!function(e, t) {
    "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).luckysheet = t()
}(this, (function() {
    "use strict";
    var commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
    function createCommonjsModule(e, t, r) {
        return e(r = {
            path: t,
            exports: {},
            require: function(e, t) {
                return commonjsRequire(e, null == t ? r.path : t)
            }
        }, r.exports),
        r.exports
    }
    function commonjsRequire() {
        throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")
    }
    var check = function(e) {
        return e && e.Math == Math && e
    }
      , global_1 = check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) || check("object" == typeof self && self) || check("object" == typeof commonjsGlobal && commonjsGlobal) || Function("return this")()
      , fails = function(e) {
        try {
            return !!e()
        } catch (e) {
            return !0
        }
    }
      , descriptors = !fails((function() {
        return 7 != Object.defineProperty({}, 1, {
            get: function() {
                return 7
            }
        })[1]
    }
    ))
      , nativePropertyIsEnumerable = {}.propertyIsEnumerable
      , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
      , NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({
        1: 2
    }, 1)
      , f = NASHORN_BUG ? function(e) {
        var t = getOwnPropertyDescriptor(this, e);
        return !!t && t.enumerable
    }
    : nativePropertyIsEnumerable
      , objectPropertyIsEnumerable = {
        f: f
    }
      , createPropertyDescriptor = function(e, t) {
        return {
            enumerable: !(1 & e),
            configurable: !(2 & e),
            writable: !(4 & e),
            value: t
        }
    }
      , toString$1 = {}.toString
      , classofRaw = function(e) {
        return toString$1.call(e).slice(8, -1)
    }
      , split = "".split
      , indexedObject = fails((function() {
        return !Object("z").propertyIsEnumerable(0)
    }
    )) ? function(e) {
        return "String" == classofRaw(e) ? split.call(e, "") : Object(e)
    }
    : Object
      , requireObjectCoercible = function(e) {
        if (null == e)
            throw TypeError("Can't call method on " + e);
        return e
    }
      , toIndexedObject = function(e) {
        return indexedObject(requireObjectCoercible(e))
    }
      , isObject = function(e) {
        return "object" == typeof e ? null !== e : "function" == typeof e
    }
      , toPrimitive = function(e, t) {
        if (!isObject(e))
            return e;
        var r, a;
        if (t && "function" == typeof (r = e.toString) && !isObject(a = r.call(e)))
            return a;
        if ("function" == typeof (r = e.valueOf) && !isObject(a = r.call(e)))
            return a;
        if (!t && "function" == typeof (r = e.toString) && !isObject(a = r.call(e)))
            return a;
        throw TypeError("Can't convert object to primitive value")
    }
      , hasOwnProperty = {}.hasOwnProperty
      , has = function(e, t) {
        return hasOwnProperty.call(e, t)
    }
      , document$1 = global_1.document
      , EXISTS = isObject(document$1) && isObject(document$1.createElement)
      , documentCreateElement = function(e) {
        return EXISTS ? document$1.createElement(e) : {}
    }
      , ie8DomDefine = !descriptors && !fails((function() {
        return 7 != Object.defineProperty(documentCreateElement("div"), "a", {
            get: function() {
                return 7
            }
        }).a
    }
    ))
      , nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
      , f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function(e, t) {
        if (e = toIndexedObject(e),
        t = toPrimitive(t, !0),
        ie8DomDefine)
            try {
                return nativeGetOwnPropertyDescriptor(e, t)
            } catch (e) {}
        if (has(e, t))
            return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(e, t), e[t])
    }
      , objectGetOwnPropertyDescriptor = {
        f: f$1
    }
      , anObject = function(e) {
        if (!isObject(e))
            throw TypeError(String(e) + " is not an object");
        return e
    }
      , nativeDefineProperty = Object.defineProperty
      , f$2 = descriptors ? nativeDefineProperty : function(e, t, r) {
        if (anObject(e),
        t = toPrimitive(t, !0),
        anObject(r),
        ie8DomDefine)
            try {
                return nativeDefineProperty(e, t, r)
            } catch (e) {}
        if ("get"in r || "set"in r)
            throw TypeError("Accessors not supported");
        return "value"in r && (e[t] = r.value),
        e
    }
      , objectDefineProperty = {
        f: f$2
    }
      , createNonEnumerableProperty = descriptors ? function(e, t, r) {
        return objectDefineProperty.f(e, t, createPropertyDescriptor(1, r))
    }
    : function(e, t, r) {
        return e[t] = r,
        e
    }
      , setGlobal = function(e, t) {
        try {
            createNonEnumerableProperty(global_1, e, t)
        } catch (r) {
            global_1[e] = t
        }
        return t
    }
      , SHARED = "__core-js_shared__"
      , store = global_1[SHARED] || setGlobal(SHARED, {})
      , sharedStore = store
      , functionToString = Function.toString;
    "function" != typeof sharedStore.inspectSource && (sharedStore.inspectSource = function(e) {
        return functionToString.call(e)
    }
    );
    var inspectSource = sharedStore.inspectSource, WeakMap = global_1.WeakMap, nativeWeakMap = "function" == typeof WeakMap && /native code/.test(inspectSource(WeakMap)), isPure = !1, shared = createCommonjsModule((function(e) {
        (e.exports = function(e, t) {
            return sharedStore[e] || (sharedStore[e] = void 0 !== t ? t : {})
        }
        )("versions", []).push({
            version: "3.6.5",
            mode: "global",
            copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
        })
    }
    )), id = 0, postfix = Math.random(), uid = function(e) {
        return "Symbol(" + String(void 0 === e ? "" : e) + ")_" + (++id + postfix).toString(36)
    }, keys = shared("keys"), sharedKey = function(e) {
        return keys[e] || (keys[e] = uid(e))
    }, hiddenKeys = {}, WeakMap$1 = global_1.WeakMap, set, get, has$1, enforce = function(e) {
        return has$1(e) ? get(e) : set(e, {})
    }, getterFor = function(e) {
        return function(t) {
            var r;
            if (!isObject(t) || (r = get(t)).type !== e)
                throw TypeError("Incompatible receiver, " + e + " required");
            return r
        }
    };
    if (nativeWeakMap) {
        var store$1 = new WeakMap$1
          , wmget = store$1.get
          , wmhas = store$1.has
          , wmset = store$1.set;
        set = function(e, t) {
            return wmset.call(store$1, e, t),
            t
        }
        ,
        get = function(e) {
            return wmget.call(store$1, e) || {}
        }
        ,
        has$1 = function(e) {
            return wmhas.call(store$1, e)
        }
    } else {
        var STATE = sharedKey("state");
        hiddenKeys[STATE] = !0,
        set = function(e, t) {
            return createNonEnumerableProperty(e, STATE, t),
            t
        }
        ,
        get = function(e) {
            return has(e, STATE) ? e[STATE] : {}
        }
        ,
        has$1 = function(e) {
            return has(e, STATE)
        }
    }
    var internalState = {
        set: set,
        get: get,
        has: has$1,
        enforce: enforce,
        getterFor: getterFor
    }
      , redefine = createCommonjsModule((function(e) {
        var t = internalState.get
          , r = internalState.enforce
          , a = String(String).split("String");
        (e.exports = function(e, t, n, o) {
            var l = !!o && !!o.unsafe
              , i = !!o && !!o.enumerable
              , s = !!o && !!o.noTargetGet;
            "function" == typeof n && ("string" != typeof t || has(n, "name") || createNonEnumerableProperty(n, "name", t),
            r(n).source = a.join("string" == typeof t ? t : "")),
            e !== global_1 ? (l ? !s && e[t] && (i = !0) : delete e[t],
            i ? e[t] = n : createNonEnumerableProperty(e, t, n)) : i ? e[t] = n : setGlobal(t, n)
        }
        )(Function.prototype, "toString", (function() {
            return "function" == typeof this && t(this).source || inspectSource(this)
        }
        ))
    }
    ))
      , path = global_1
      , aFunction = function(e) {
        return "function" == typeof e ? e : void 0
    }
      , getBuiltIn = function(e, t) {
        return arguments.length < 2 ? aFunction(path[e]) || aFunction(global_1[e]) : path[e] && path[e][t] || global_1[e] && global_1[e][t]
    }
      , ceil = Math.ceil
      , floor = Math.floor
      , toInteger = function(e) {
        return isNaN(e = +e) ? 0 : (e > 0 ? floor : ceil)(e)
    }
      , min = Math.min
      , toLength = function(e) {
        return e > 0 ? min(toInteger(e), 9007199254740991) : 0
    }
      , max = Math.max
      , min$1 = Math.min
      , toAbsoluteIndex = function(e, t) {
        var r = toInteger(e);
        return r < 0 ? max(r + t, 0) : min$1(r, t)
    }
      , createMethod = function(e) {
        return function(t, r, a) {
            var n, o = toIndexedObject(t), l = toLength(o.length), i = toAbsoluteIndex(a, l);
            if (e && r != r) {
                for (; l > i; )
                    if ((n = o[i++]) != n)
                        return !0
            } else
                for (; l > i; i++)
                    if ((e || i in o) && o[i] === r)
                        return e || i || 0;
            return !e && -1
        }
    }
      , arrayIncludes = {
        includes: createMethod(!0),
        indexOf: createMethod(!1)
    }
      , indexOf = arrayIncludes.indexOf
      , objectKeysInternal = function(e, t) {
        var r, a = toIndexedObject(e), n = 0, o = [];
        for (r in a)
            !has(hiddenKeys, r) && has(a, r) && o.push(r);
        for (; t.length > n; )
            has(a, r = t[n++]) && (~indexOf(o, r) || o.push(r));
        return o
    }
      , enumBugKeys = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
      , hiddenKeys$1 = enumBugKeys.concat("length", "prototype")
      , f$3 = Object.getOwnPropertyNames || function(e) {
        return objectKeysInternal(e, hiddenKeys$1)
    }
      , objectGetOwnPropertyNames = {
        f: f$3
    }
      , f$4 = Object.getOwnPropertySymbols
      , objectGetOwnPropertySymbols = {
        f: f$4
    }
      , ownKeys = getBuiltIn("Reflect", "ownKeys") || function(e) {
        var t = objectGetOwnPropertyNames.f(anObject(e))
          , r = objectGetOwnPropertySymbols.f;
        return r ? t.concat(r(e)) : t
    }
      , copyConstructorProperties = function(e, t) {
        for (var r = ownKeys(t), a = objectDefineProperty.f, n = objectGetOwnPropertyDescriptor.f, o = 0; o < r.length; o++) {
            var l = r[o];
            has(e, l) || a(e, l, n(t, l))
        }
    }
      , replacement = /#|\.prototype\./
      , isForced = function(e, t) {
        var r = data$1[normalize(e)];
        return r == POLYFILL || r != NATIVE && ("function" == typeof t ? fails(t) : !!t)
    }
      , normalize = isForced.normalize = function(e) {
        return String(e).replace(replacement, ".").toLowerCase()
    }
      , data$1 = isForced.data = {}
      , NATIVE = isForced.NATIVE = "N"
      , POLYFILL = isForced.POLYFILL = "P"
      , isForced_1 = isForced
      , getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f
      , _export = function(e, t) {
        var r, a, n, o, l, i = e.target, s = e.global, c = e.stat;
        if (r = s ? global_1 : c ? global_1[i] || setGlobal(i, {}) : (global_1[i] || {}).prototype)
            for (a in t) {
                if (o = t[a],
                n = e.noTargetGet ? (l = getOwnPropertyDescriptor$1(r, a)) && l.value : r[a],
                !isForced_1(s ? a : i + (c ? "." : "#") + a, e.forced) && void 0 !== n) {
                    if (typeof o == typeof n)
                        continue;
                    copyConstructorProperties(o, n)
                }
                (e.sham || n && n.sham) && createNonEnumerableProperty(o, "sham", !0),
                redefine(r, a, o, e)
            }
    }
      , arrayMethodIsStrict = function(e, t) {
        var r = [][e];
        return !!r && fails((function() {
            r.call(null, t || function() {
                throw 1
            }
            , 1)
        }
        ))
    }
      , defineProperty = Object.defineProperty
      , cache = {}
      , thrower = function(e) {
        throw e
    }
      , arrayMethodUsesToLength = function(e, t) {
        if (has(cache, e))
            return cache[e];
        t || (t = {});
        var r = [][e]
          , a = !!has(t, "ACCESSORS") && t.ACCESSORS
          , n = has(t, 0) ? t[0] : thrower
          , o = has(t, 1) ? t[1] : void 0;
        return cache[e] = !!r && !fails((function() {
            if (a && !descriptors)
                return !0;
            var e = {
                length: -1
            };
            a ? defineProperty(e, 1, {
                enumerable: !0,
                get: thrower
            }) : e[1] = 1,
            r.call(e, n, o)
        }
        ))
    }
      , $indexOf = arrayIncludes.indexOf
      , nativeIndexOf = [].indexOf
      , NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0
      , STRICT_METHOD = arrayMethodIsStrict("indexOf")
      , USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", {
        ACCESSORS: !0,
        1: 0
    });
    _export({
        target: "Array",
        proto: !0,
        forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH
    }, {
        indexOf: function(e) {
            return NEGATIVE_ZERO ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var aPossiblePrototype = function(e) {
        if (!isObject(e) && null !== e)
            throw TypeError("Can't set " + String(e) + " as a prototype");
        return e
    }, objectSetPrototypeOf = Object.setPrototypeOf || ("__proto__"in {} ? function() {
        var e, t = !1, r = {};
        try {
            (e = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(r, []),
            t = r instanceof Array
        } catch (e) {}
        return function(r, a) {
            return anObject(r),
            aPossiblePrototype(a),
            t ? e.call(r, a) : r.__proto__ = a,
            r
        }
    }() : void 0), inheritIfRequired = function(e, t, r) {
        var a, n;
        return objectSetPrototypeOf && "function" == typeof (a = t.constructor) && a !== r && isObject(n = a.prototype) && n !== r.prototype && objectSetPrototypeOf(e, n),
        e
    }, objectKeys = Object.keys || function(e) {
        return objectKeysInternal(e, enumBugKeys)
    }
    , objectDefineProperties = descriptors ? Object.defineProperties : function(e, t) {
        anObject(e);
        for (var r, a = objectKeys(t), n = a.length, o = 0; n > o; )
            objectDefineProperty.f(e, r = a[o++], t[r]);
        return e
    }
    , html = getBuiltIn("document", "documentElement"), GT = ">", LT = "<", PROTOTYPE = "prototype", SCRIPT = "script", IE_PROTO = sharedKey("IE_PROTO"), EmptyConstructor = function() {}, scriptTag = function(e) {
        return LT + SCRIPT + GT + e + LT + "/" + SCRIPT + GT
    }, NullProtoObjectViaActiveX = function(e) {
        e.write(scriptTag("")),
        e.close();
        var t = e.parentWindow.Object;
        return e = null,
        t
    }, NullProtoObjectViaIFrame = function() {
        var e, t = documentCreateElement("iframe"), r = "java" + SCRIPT + ":";
        return t.style.display = "none",
        html.appendChild(t),
        t.src = String(r),
        (e = t.contentWindow.document).open(),
        e.write(scriptTag("document.F=Object")),
        e.close(),
        e.F
    }, activeXDocument, NullProtoObject = function() {
        try {
            activeXDocument = document.domain && new ActiveXObject("htmlfile")
        } catch (e) {}
        NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
        for (var e = enumBugKeys.length; e--; )
            delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];
        return NullProtoObject()
    };
    hiddenKeys[IE_PROTO] = !0;
    var objectCreate = Object.create || function(e, t) {
        var r;
        return null !== e ? (EmptyConstructor[PROTOTYPE] = anObject(e),
        r = new EmptyConstructor,
        EmptyConstructor[PROTOTYPE] = null,
        r[IE_PROTO] = e) : r = NullProtoObject(),
        void 0 === t ? r : objectDefineProperties(r, t)
    }
      , whitespaces = "\t\n\v\f\r                　\u2028\u2029\ufeff"
      , whitespace = "[" + whitespaces + "]"
      , ltrim = RegExp("^" + whitespace + whitespace + "*")
      , rtrim = RegExp(whitespace + whitespace + "*$")
      , createMethod$1 = function(e) {
        return function(t) {
            var r = String(requireObjectCoercible(t));
            return 1 & e && (r = r.replace(ltrim, "")),
            2 & e && (r = r.replace(rtrim, "")),
            r
        }
    }
      , stringTrim = {
        start: createMethod$1(1),
        end: createMethod$1(2),
        trim: createMethod$1(3)
    }
      , getOwnPropertyNames = objectGetOwnPropertyNames.f
      , getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f
      , defineProperty$1 = objectDefineProperty.f
      , trim = stringTrim.trim
      , NUMBER = "Number"
      , NativeNumber = global_1[NUMBER]
      , NumberPrototype = NativeNumber.prototype
      , BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER
      , toNumber = function(e) {
        var t, r, a, n, o, l, i, s, c = toPrimitive(e, !1);
        if ("string" == typeof c && c.length > 2)
            if (43 === (t = (c = trim(c)).charCodeAt(0)) || 45 === t) {
                if (88 === (r = c.charCodeAt(2)) || 120 === r)
                    return NaN
            } else if (48 === t) {
                switch (c.charCodeAt(1)) {
                case 66:
                case 98:
                    a = 2,
                    n = 49;
                    break;
                case 79:
                case 111:
                    a = 8,
                    n = 55;
                    break;
                default:
                    return +c
                }
                for (l = (o = c.slice(2)).length,
                i = 0; i < l; i++)
                    if ((s = o.charCodeAt(i)) < 48 || s > n)
                        return NaN;
                return parseInt(o, a)
            }
        return +c
    };
    if (isForced_1(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"))) {
        for (var NumberWrapper = function(e) {
            var t = arguments.length < 1 ? 0 : e
              , r = this;
            return r instanceof NumberWrapper && (BROKEN_CLASSOF ? fails((function() {
                NumberPrototype.valueOf.call(r)
            }
            )) : classofRaw(r) != NUMBER) ? inheritIfRequired(new NativeNumber(toNumber(t)), r, NumberWrapper) : toNumber(t)
        }, keys$1 = descriptors ? getOwnPropertyNames(NativeNumber) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","), j = 0, key; keys$1.length > j; j++)
            has(NativeNumber, key = keys$1[j]) && !has(NumberWrapper, key) && defineProperty$1(NumberWrapper, key, getOwnPropertyDescriptor$2(NativeNumber, key));
        NumberWrapper.prototype = NumberPrototype,
        NumberPrototype.constructor = NumberWrapper,
        redefine(global_1, NUMBER, NumberWrapper)
    }
    _export({
        target: "Number",
        stat: !0
    }, {
        isNaN: function(e) {
            return e != e
        }
    });
    var thisNumberValue = function(e) {
        if ("number" != typeof e && "Number" != classofRaw(e))
            throw TypeError("Incorrect invocation");
        return +e
    }
      , stringRepeat = "".repeat || function(e) {
        var t = String(requireObjectCoercible(this))
          , r = ""
          , a = toInteger(e);
        if (a < 0 || a == 1 / 0)
            throw RangeError("Wrong number of repetitions");
        for (; a > 0; (a >>>= 1) && (t += t))
            1 & a && (r += t);
        return r
    }
      , nativeToFixed = 1..toFixed
      , floor$1 = Math.floor
      , pow = function(e, t, r) {
        return 0 === t ? r : t % 2 == 1 ? pow(e, t - 1, r * e) : pow(e * e, t / 2, r)
    }
      , log = function(e) {
        for (var t = 0, r = e; r >= 4096; )
            t += 12,
            r /= 4096;
        for (; r >= 2; )
            t += 1,
            r /= 2;
        return t
    }
      , FORCED = nativeToFixed && ("0.000" !== 8e-5.toFixed(3) || "1" !== .9.toFixed(0) || "1.25" !== 1.255.toFixed(2) || "1000000000000000128" !== (0xde0b6b3a7640080).toFixed(0)) || !fails((function() {
        nativeToFixed.call({})
    }
    ));
    _export({
        target: "Number",
        proto: !0,
        forced: FORCED
    }, {
        toFixed: function(e) {
            var t, r, a, n, o = thisNumberValue(this), l = toInteger(e), i = [0, 0, 0, 0, 0, 0], s = "", c = "0", u = function(e, t) {
                for (var r = -1, a = t; ++r < 6; )
                    a += e * i[r],
                    i[r] = a % 1e7,
                    a = floor$1(a / 1e7)
            }, h = function(e) {
                for (var t = 6, r = 0; --t >= 0; )
                    r += i[t],
                    i[t] = floor$1(r / e),
                    r = r % e * 1e7
            }, d = function() {
                for (var e = 6, t = ""; --e >= 0; )
                    if ("" !== t || 0 === e || 0 !== i[e]) {
                        var r = String(i[e]);
                        t = "" === t ? r : t + stringRepeat.call("0", 7 - r.length) + r
                    }
                return t
            };
            if (l < 0 || l > 20)
                throw RangeError("Incorrect fraction digits");
            if (o != o)
                return "NaN";
            if (o <= -1e21 || o >= 1e21)
                return String(o);
            if (o < 0 && (s = "-",
            o = -o),
            o > 1e-21)
                if (r = (t = log(o * pow(2, 69, 1)) - 69) < 0 ? o * pow(2, -t, 1) : o / pow(2, t, 1),
                r *= 4503599627370496,
                (t = 52 - t) > 0) {
                    for (u(0, r),
                    a = l; a >= 7; )
                        u(1e7, 0),
                        a -= 7;
                    for (u(pow(10, a, 1), 0),
                    a = t - 1; a >= 23; )
                        h(1 << 23),
                        a -= 23;
                    h(1 << a),
                    u(1, 1),
                    h(2),
                    c = d()
                } else
                    u(0, r),
                    u(1 << -t, 0),
                    c = d() + stringRepeat.call("0", l);
            return c = l > 0 ? s + ((n = c.length) <= l ? "0." + stringRepeat.call("0", l - n) + c : c.slice(0, n - l) + "." + c.slice(n - l)) : s + c
        }
    });
    var nativeSymbol = !!Object.getOwnPropertySymbols && !fails((function() {
        return !String(Symbol())
    }
    ))
      , useSymbolAsUid = nativeSymbol && !Symbol.sham && "symbol" == typeof Symbol.iterator
      , WellKnownSymbolsStore = shared("wks")
      , Symbol$1 = global_1.Symbol
      , createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid
      , wellKnownSymbol = function(e) {
        return has(WellKnownSymbolsStore, e) || (nativeSymbol && has(Symbol$1, e) ? WellKnownSymbolsStore[e] = Symbol$1[e] : WellKnownSymbolsStore[e] = createWellKnownSymbol("Symbol." + e)),
        WellKnownSymbolsStore[e]
    }
      , TO_STRING_TAG = wellKnownSymbol("toStringTag")
      , test = {};
    test[TO_STRING_TAG] = "z";
    var toStringTagSupport = "[object z]" === String(test)
      , TO_STRING_TAG$1 = wellKnownSymbol("toStringTag")
      , CORRECT_ARGUMENTS = "Arguments" == classofRaw(function() {
        return arguments
    }())
      , tryGet = function(e, t) {
        try {
            return e[t]
        } catch (e) {}
    }
      , classof = toStringTagSupport ? classofRaw : function(e) {
        var t, r, a;
        return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (r = tryGet(t = Object(e), TO_STRING_TAG$1)) ? r : CORRECT_ARGUMENTS ? classofRaw(t) : "Object" == (a = classofRaw(t)) && "function" == typeof t.callee ? "Arguments" : a
    }
      , objectToString = toStringTagSupport ? {}.toString : function() {
        return "[object " + classof(this) + "]"
    }
    ;
    toStringTagSupport || redefine(Object.prototype, "toString", objectToString, {
        unsafe: !0
    });
    var regexpFlags = function() {
        var e = anObject(this)
          , t = "";
        return e.global && (t += "g"),
        e.ignoreCase && (t += "i"),
        e.multiline && (t += "m"),
        e.dotAll && (t += "s"),
        e.unicode && (t += "u"),
        e.sticky && (t += "y"),
        t
    };
    function RE(e, t) {
        return RegExp(e, t)
    }
    var UNSUPPORTED_Y = fails((function() {
        var e = RE("a", "y");
        return e.lastIndex = 2,
        null != e.exec("abcd")
    }
    ))
      , BROKEN_CARET = fails((function() {
        var e = RE("^r", "gy");
        return e.lastIndex = 2,
        null != e.exec("str")
    }
    ))
      , regexpStickyHelpers = {
        UNSUPPORTED_Y: UNSUPPORTED_Y,
        BROKEN_CARET: BROKEN_CARET
    }
      , nativeExec = RegExp.prototype.exec
      , nativeReplace = String.prototype.replace
      , patchedExec = nativeExec
      , UPDATES_LAST_INDEX_WRONG = function() {
        var e = /a/
          , t = /b*/g;
        return nativeExec.call(e, "a"),
        nativeExec.call(t, "a"),
        0 !== e.lastIndex || 0 !== t.lastIndex
    }()
      , UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET
      , NPCG_INCLUDED = void 0 !== /()??/.exec("")[1]
      , PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
    PATCH && (patchedExec = function(e) {
        var t, r, a, n, o = this, l = UNSUPPORTED_Y$1 && o.sticky, i = regexpFlags.call(o), s = o.source, c = 0, u = e;
        return l && (-1 === (i = i.replace("y", "")).indexOf("g") && (i += "g"),
        u = String(e).slice(o.lastIndex),
        o.lastIndex > 0 && (!o.multiline || o.multiline && "\n" !== e[o.lastIndex - 1]) && (s = "(?: " + s + ")",
        u = " " + u,
        c++),
        r = new RegExp("^(?:" + s + ")",i)),
        NPCG_INCLUDED && (r = new RegExp("^" + s + "$(?!\\s)",i)),
        UPDATES_LAST_INDEX_WRONG && (t = o.lastIndex),
        a = nativeExec.call(l ? r : o, u),
        l ? a ? (a.input = a.input.slice(c),
        a[0] = a[0].slice(c),
        a.index = o.lastIndex,
        o.lastIndex += a[0].length) : o.lastIndex = 0 : UPDATES_LAST_INDEX_WRONG && a && (o.lastIndex = o.global ? a.index + a[0].length : t),
        NPCG_INCLUDED && a && a.length > 1 && nativeReplace.call(a[0], r, (function() {
            for (n = 1; n < arguments.length - 2; n++)
                void 0 === arguments[n] && (a[n] = void 0)
        }
        )),
        a
    }
    );
    var regexpExec = patchedExec;
    _export({
        target: "RegExp",
        proto: !0,
        forced: /./.exec !== regexpExec
    }, {
        exec: regexpExec
    });
    var TO_STRING = "toString"
      , RegExpPrototype = RegExp.prototype
      , nativeToString = RegExpPrototype[TO_STRING]
      , NOT_GENERIC = fails((function() {
        return "/a/b" != nativeToString.call({
            source: "a",
            flags: "b"
        })
    }
    ))
      , INCORRECT_NAME = nativeToString.name != TO_STRING;
    (NOT_GENERIC || INCORRECT_NAME) && redefine(RegExp.prototype, TO_STRING, (function() {
        var e = anObject(this)
          , t = String(e.source)
          , r = e.flags;
        return "/" + t + "/" + String(void 0 === r && e instanceof RegExp && !("flags"in RegExpPrototype) ? regexpFlags.call(e) : r)
    }
    ), {
        unsafe: !0
    });
    var SPECIES = wellKnownSymbol("species")
      , REPLACE_SUPPORTS_NAMED_GROUPS = !fails((function() {
        var e = /./;
        return e.exec = function() {
            var e = [];
            return e.groups = {
                a: "7"
            },
            e
        }
        ,
        "7" !== "".replace(e, "$<a>")
    }
    ))
      , REPLACE_KEEPS_$0 = "$0" === "a".replace(/./, "$0")
      , REPLACE = wellKnownSymbol("replace")
      , REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = !!/./[REPLACE] && "" === /./[REPLACE]("a", "$0")
      , SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails((function() {
        var e = /(?:)/
          , t = e.exec;
        e.exec = function() {
            return t.apply(this, arguments)
        }
        ;
        var r = "ab".split(e);
        return 2 !== r.length || "a" !== r[0] || "b" !== r[1]
    }
    ))
      , fixRegexpWellKnownSymbolLogic = function(e, t, r, a) {
        var n = wellKnownSymbol(e)
          , o = !fails((function() {
            var t = {};
            return t[n] = function() {
                return 7
            }
            ,
            7 != ""[e](t)
        }
        ))
          , l = o && !fails((function() {
            var t = !1
              , r = /a/;
            return "split" === e && ((r = {}).constructor = {},
            r.constructor[SPECIES] = function() {
                return r
            }
            ,
            r.flags = "",
            r[n] = /./[n]),
            r.exec = function() {
                return t = !0,
                null
            }
            ,
            r[n](""),
            !t
        }
        ));
        if (!o || !l || "replace" === e && (!REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE) || "split" === e && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) {
            var i = /./[n]
              , s = r(n, ""[e], (function(e, t, r, a, n) {
                return t.exec === regexpExec ? o && !n ? {
                    done: !0,
                    value: i.call(t, r, a)
                } : {
                    done: !0,
                    value: e.call(r, t, a)
                } : {
                    done: !1
                }
            }
            ), {
                REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
                REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
            })
              , c = s[0]
              , u = s[1];
            redefine(String.prototype, e, c),
            redefine(RegExp.prototype, n, 2 == t ? function(e, t) {
                return u.call(e, this, t)
            }
            : function(e) {
                return u.call(e, this)
            }
            )
        }
        a && createNonEnumerableProperty(RegExp.prototype[n], "sham", !0)
    }
      , toObject = function(e) {
        return Object(requireObjectCoercible(e))
    }
      , createMethod$2 = function(e) {
        return function(t, r) {
            var a, n, o = String(requireObjectCoercible(t)), l = toInteger(r), i = o.length;
            return l < 0 || l >= i ? e ? "" : void 0 : (a = o.charCodeAt(l)) < 55296 || a > 56319 || l + 1 === i || (n = o.charCodeAt(l + 1)) < 56320 || n > 57343 ? e ? o.charAt(l) : a : e ? o.slice(l, l + 2) : n - 56320 + (a - 55296 << 10) + 65536
        }
    }
      , stringMultibyte = {
        codeAt: createMethod$2(!1),
        charAt: createMethod$2(!0)
    }
      , charAt = stringMultibyte.charAt
      , advanceStringIndex = function(e, t, r) {
        return t + (r ? charAt(e, t).length : 1)
    }
      , regexpExecAbstract = function(e, t) {
        var r = e.exec;
        if ("function" == typeof r) {
            var a = r.call(e, t);
            if ("object" != typeof a)
                throw TypeError("RegExp exec method returned something other than an Object or null");
            return a
        }
        if ("RegExp" !== classofRaw(e))
            throw TypeError("RegExp#exec called on incompatible receiver");
        return regexpExec.call(e, t)
    }
      , max$1 = Math.max
      , min$2 = Math.min
      , floor$2 = Math.floor
      , SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g
      , SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g
      , maybeToString = function(e) {
        return void 0 === e ? e : String(e)
    };
    fixRegexpWellKnownSymbolLogic("replace", 2, (function(e, t, r, a) {
        var n = a.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
          , o = a.REPLACE_KEEPS_$0
          , l = n ? "$" : "$0";
        return [function(r, a) {
            var n = requireObjectCoercible(this)
              , o = null == r ? void 0 : r[e];
            return void 0 !== o ? o.call(r, n, a) : t.call(String(n), r, a)
        }
        , function(e, a) {
            if (!n && o || "string" == typeof a && -1 === a.indexOf(l)) {
                var s = r(t, e, this, a);
                if (s.done)
                    return s.value
            }
            var c = anObject(e)
              , u = String(this)
              , h = "function" == typeof a;
            h || (a = String(a));
            var d = c.global;
            if (d) {
                var f = c.unicode;
                c.lastIndex = 0
            }
            for (var m = []; ; ) {
                var p = regexpExecAbstract(c, u);
                if (null === p)
                    break;
                if (m.push(p),
                !d)
                    break;
                "" === String(p[0]) && (c.lastIndex = advanceStringIndex(u, toLength(c.lastIndex), f))
            }
            for (var g = "", y = 0, v = 0; v < m.length; v++) {
                p = m[v];
                for (var A = String(p[0]), b = max$1(min$2(toInteger(p.index), u.length), 0), k = [], w = 1; w < p.length; w++)
                    k.push(maybeToString(p[w]));
                var x = p.groups;
                if (h) {
                    var S = [A].concat(k, b, u);
                    void 0 !== x && S.push(x);
                    var _ = String(a.apply(void 0, S))
                } else
                    _ = i(A, u, b, k, x, a);
                b >= y && (g += u.slice(y, b) + _,
                y = b + A.length)
            }
            return g + u.slice(y)
        }
        ];
        function i(e, r, a, n, o, l) {
            var i = a + e.length
              , s = n.length
              , c = SUBSTITUTION_SYMBOLS_NO_NAMED;
            return void 0 !== o && (o = toObject(o),
            c = SUBSTITUTION_SYMBOLS),
            t.call(l, c, (function(t, l) {
                var c;
                switch (l.charAt(0)) {
                case "$":
                    return "$";
                case "&":
                    return e;
                case "`":
                    return r.slice(0, a);
                case "'":
                    return r.slice(i);
                case "<":
                    c = o[l.slice(1, -1)];
                    break;
                default:
                    var u = +l;
                    if (0 === u)
                        return t;
                    if (u > s) {
                        var h = floor$2(u / 10);
                        return 0 === h ? t : h <= s ? void 0 === n[h - 1] ? l.charAt(1) : n[h - 1] + l.charAt(1) : t
                    }
                    c = n[u - 1]
                }
                return void 0 === c ? "" : c
            }
            ))
        }
    }
    ));
    var luckysheetConfigsetting = {
        autoFormatw: !1,
        accuracy: void 0,
        total: 0,
        allowCopy: !0,
        showtoolbar: !0,
        showinfobar: !0,
        showsheetbar: !0,
        showstatisticBar: !0,
        pointEdit: !1,
        pointEditUpdate: null,
        pointEditZoom: 1,
        userInfo: null,
        userMenuItem: [],
        myFolderUrl: null,
        functionButton: null,
        showConfigWindowResize: !0,
        enableAddRow: !0,
        enableAddBackTop: !0,
        enablePage: !0,
        pageInfo: null,
        editMode: !1,
        beforeCreateDom: null,
        workbookCreateBefore: null,
        workbookCreateAfter: null,
        fireMousedown: null,
        plugins: [],
        forceCalculation: !1,
        defaultColWidth: 73,
        defaultRowHeight: 19
    }
      , Store = {
        container: null,
        luckysheetfile: null,
        defaultcolumnNum: 60,
        defaultrowNum: 84,
        fullscreenmode: !0,
        devicePixelRatio: 1,
        currentSheetIndex: 0,
        calculateSheetIndex: 0,
        flowdata: [],
        config: {},
        visibledatarow: [],
        visibledatacolumn: [],
        ch_width: 0,
        rh_height: 0,
        cellmainWidth: 0,
        cellmainHeight: 0,
        toolbarHeight: 0,
        infobarHeight: 0,
        calculatebarHeight: 0,
        rowHeaderWidth: 46,
        columnHeaderHeight: 20,
        cellMainSrollBarSize: 12,
        sheetBarHeight: 31,
        statisticBarHeight: 23,
        luckysheetTableContentHW: [0, 0],
        defaultcollen: 73,
        defaultrowlen: 19,
        jfcountfuncTimeout: null,
        jfautoscrollTimeout: null,
        luckysheet_select_status: !1,
        luckysheet_select_save: [{
            row: [0, 0],
            column: [0, 0]
        }],
        luckysheet_selection_range: [],
        luckysheet_copy_save: {},
        luckysheet_paste_iscut: !1,
        filterchage: !0,
        luckysheet_filter_save: {
            row: [],
            column: []
        },
        luckysheet_sheet_move_status: !1,
        luckysheet_sheet_move_data: [],
        luckysheet_scroll_status: !1,
        luckysheetisrefreshdetail: !0,
        luckysheetisrefreshtheme: !0,
        luckysheetcurrentisPivotTable: !1,
        luckysheet_rows_selected_status: !1,
        luckysheet_cols_selected_status: !1,
        luckysheet_rows_change_size: !1,
        luckysheet_rows_change_size_start: [],
        luckysheet_cols_change_size: !1,
        luckysheet_cols_change_size_start: [],
        luckysheet_cols_dbclick_timeout: null,
        luckysheet_cols_dbclick_times: 0,
        luckysheetCellUpdate: [],
        luckysheet_shiftpositon: null,
        iscopyself: !0,
        orderbyindex: 0,
        luckysheet_model_move_state: !1,
        luckysheet_model_xy: [0, 0],
        luckysheet_model_move_obj: null,
        luckysheet_cell_selected_move: !1,
        luckysheet_cell_selected_move_index: [],
        luckysheet_cell_selected_extend: !1,
        luckysheet_cell_selected_extend_index: [],
        luckysheet_cell_selected_extend_time: null,
        clearjfundo: !0,
        jfredo: [],
        jfundo: [],
        lang: "en",
        createChart: "",
        highlightChart: "",
        zIndex: 15,
        chartparam: {
            luckysheetCurrentChart: null,
            luckysheetCurrentChartActive: !1,
            luckysheetCurrentChartMove: null,
            luckysheetCurrentChartMoveTimeout: null,
            luckysheetCurrentChartMoveObj: null,
            luckysheetCurrentChartMoveXy: null,
            luckysheetCurrentChartMoveWinH: null,
            luckysheetCurrentChartMoveWinW: null,
            luckysheetCurrentChartResize: null,
            luckysheetCurrentChartResizeObj: null,
            luckysheetCurrentChartResizeXy: null,
            luckysheetCurrentChartResizeWinH: null,
            luckysheetCurrentChartResizeWinW: null,
            luckysheetInsertChartTosheetChange: !0,
            luckysheetCurrentChartZIndexRank: 100,
            luckysheet_chart_redo_click: !1,
            luckysheetCurrentChartMaxState: !1,
            jfrefreshchartall: "",
            changeChartCellData: "",
            renderChart: "",
            getChartJson: ""
        },
        functionList: null,
        luckysheet_function: null,
        chart_selection: {},
        currentChart: "",
        scrollRefreshSwitch: !0,
        measureTextCache: {},
        measureTextCellInfoCache: {},
        measureTextCacheTimeOut: null,
        cellOverflowMapCache: {},
        zoomRatio: 1,
        visibledatacolumn_unique: null,
        visibledatarow_unique: null,
        showGridLines: !0,
        toobarObject: {},
        inlineStringEditCache: null,
        inlineStringEditRange: null,
        fontList: [],
        defaultFontSize: 10,
        currentSheetView: "viewNormal"
    }
      , error = {
        v: "#VALUE!",
        n: "#NAME?",
        na: "#N/A",
        r: "#REF!",
        d: "#DIV/0!",
        nm: "#NUM!",
        nl: "#NULL!",
        sp: "#SPILL!"
    };
    function isRealNull(e) {
        return null == e || "" == e.toString().replace(/\s/g, "")
    }
    function isRealNum(e) {
        return null != e && "" !== e.toString().replace(/\s/g, "") && ("boolean" != typeof e && !isNaN(e))
    }
    function valueIsError(e) {
        var t = !1;
        for (var r in error)
            if (e == error[r]) {
                t = !0;
                break
            }
        return t
    }
    function hasChinaword(e) {
        return !!/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/gi.exec(e)
    }
    function isEditMode() {
        return !!luckysheetConfigsetting.editMode
    }
    function hasPartMC(e, t, r, a, n) {
        var o = !1;
        for (var l in Store.config.merge) {
            var i = e.merge[l];
            if (t < i.r) {
                if (r >= i.r && r < i.r + i.rs - 1) {
                    if (a >= i.c && a <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (n >= i.c && n <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a < i.c && n > i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                } else if (r >= i.r && r == i.r + i.rs - 1) {
                    if (a > i.c && a < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (n > i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a == i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a > i.c && n == i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                } else if (r > i.r + i.rs - 1) {
                    if (a > i.c && a <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (n >= i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a == i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a > i.c && n == i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                }
            } else if (t == i.r) {
                if (r < i.r + i.rs - 1) {
                    if (a >= i.c && a <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (n >= i.c && n <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a < i.c && n > i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                } else if (r >= i.r + i.rs - 1) {
                    if (a > i.c && a <= i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (n >= i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a == i.c && n < i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                    if (a > i.c && n == i.c + i.cs - 1) {
                        o = !0;
                        break
                    }
                }
            } else if (t <= i.r + i.rs - 1) {
                if (a >= i.c && a <= i.c + i.cs - 1) {
                    o = !0;
                    break
                }
                if (n >= i.c && n <= i.c + i.cs - 1) {
                    o = !0;
                    break
                }
                if (a < i.c && n > i.c + i.cs - 1) {
                    o = !0;
                    break
                }
            }
        }
        return o
    }
    function checkWordByteLength(e) {
        return Math.ceil(e.charCodeAt().toString(2).length / 8)
    }
    function isInteger(e) {
        return Math.floor(e) === e
    }
    function toInteger$1(e) {
        var t = {
            times: 1,
            num: 0
        };
        if (isInteger(e))
            return t.num = e,
            t;
        var r = e + ""
          , a = r.indexOf(".")
          , n = r.substr(a + 1).length
          , o = Math.pow(10, n)
          , l = parseInt(e * o + .5, 10);
        return t.times = o,
        t.num = l,
        t
    }
    function operation(e, t, r) {
        var a = toInteger$1(e)
          , n = toInteger$1(t)
          , o = a.num
          , l = n.num
          , i = a.times
          , s = n.times
          , c = i > s ? i : s;
        switch (r) {
        case "add":
            return (i === s ? o + l : i > s ? o + l * (i / s) : o * (s / i) + l) / c;
        case "subtract":
            return (i === s ? o - l : i > s ? o - l * (i / s) : o * (s / i) - l) / c;
        case "multiply":
            return o * l / (i * s);
        case "divide":
            return operation(o / l, s / i, "multiply")
        }
    }
    function fixed(e, t) {
        if (t || (t = 2),
        !isRealNum(e))
            return e;
        var r = e.toFixed(t)
          , a = r.indexOf(".")
          , n = r.substring(0, a)
          , o = r.substring(a + 1, r.length);
        if (o)
            for (var l = o.length - 1; 0 != l && ("0" == o.charAt(l) || l != o.length - 1); l--)
                o = o.substring(0, l);
        return Number(n + "." + o)
    }
    Number.prototype.add = function(e) {
        var t = parseFloat(e);
        if ("number" != typeof t || Number.isNaN(t))
            throw new Error("请输入数字或者数字字符串～");
        return operation(this, t, "add")
    }
    ,
    Number.prototype.subtract = function(e) {
        var t = parseFloat(e);
        if ("number" != typeof t || Number.isNaN(t))
            throw new Error("请输入数字或者数字字符串～");
        return operation(this, t, "subtract")
    }
    ,
    Number.prototype.multiply = function(e) {
        var t = parseFloat(e);
        if ("number" != typeof t || Number.isNaN(t))
            throw new Error("请输入数字或者数字字符串～");
        return operation(this, t, "multiply")
    }
    ,
    Number.prototype.divide = function(e) {
        var t = parseFloat(e);
        if ("number" != typeof t || Number.isNaN(t))
            throw new Error("请输入数字或者数字字符串～");
        return operation(this, t, "divide")
    }
    ,
    Number.prototype.tofixed = function(e) {
        var t = parseFloat(e);
        if ("number" != typeof t || Number.isNaN(t))
            throw new Error("请输入数字或者数字字符串～");
        return fixed(this, t)
    }
    ;
    var defaultSetting = {
        container: "luckysheet",
        column: 60,
        row: 84,
        allowCopy: !0,
        showtoolbar: !0,
        showinfobar: !0,
        showsheetbar: !0,
        showstatisticBar: !0,
        pointEdit: !1,
        pointEditUpdate: null,
        pointEditZoom: 1,
        data: [{
            name: "Sheet1",
            color: "",
            status: "1",
            order: "0",
            data: [],
            config: {},
            index: 0
        }, {
            name: "Sheet2",
            color: "",
            status: "0",
            order: "1",
            data: [],
            config: {},
            index: 1
        }, {
            name: "Sheet3",
            color: "",
            status: "0",
            order: "2",
            data: [],
            config: {},
            index: 2
        }],
        title: "Spreadsheet Online",
        userInfo: '<i style="font-size:16px;color:#ff6a00;" class="fa fa-taxi" aria-hidden="true"></i> rabbit',
        userMenuItem: [{
            url: "www.baidu.com",
            icon: '<i class="fa fa-folder" aria-hidden="true"></i>',
            name: "我的表格"
        }, {
            url: "www.baidu.com",
            icon: '<i class="fa fa-sign-out" aria-hidden="true"></i>',
            name: "退出登陆"
        }],
        myFolderUrl: "manage?tab=my_folder",
        config: {},
        fullscreenmode: !0,
        devicePixelRatio: window.devicePixelRatio,
        allowEdit: !0,
        loadUrl: "",
        loadSheetUrl: "",
        gridKey: "",
        updateUrl: "",
        updateImageUrl: "",
        allowUpdate: !1,
        functionButton: "",
        showConfigWindowResize: !0,
        enableAddRow: !0,
        enableAddBackTop: !0,
        autoFormatw: !1,
        accuracy: void 0,
        pageInfo: {
            queryExps: "",
            reportId: "",
            fields: "",
            mobile: "",
            frezon: "",
            currentPage: "",
            totalPage: 10,
            pageUrl: ""
        },
        editMode: !1,
        beforeCreateDom: null,
        fireMousedown: null,
        lang: "en",
        plugins: [],
        forceCalculation: !1,
        rowHeaderWidth: 46,
        columnHeaderHeight: 20,
        defaultColWidth: 73,
        defaultRowHeight: 19,
        defaultFontSize: 10,
        sheetFormulaBar: !0,
        showtoolbarConfig: {},
        showsheetbarConfig: {},
        showstatisticBarConfig: {},
        cellRightClickConfig: {},
        sheetRightClickConfig: {}
    }, isArray = Array.isArray || function(e) {
        return "Array" == classofRaw(e)
    }
    , createProperty = function(e, t, r) {
        var a = toPrimitive(t);
        a in e ? objectDefineProperty.f(e, a, createPropertyDescriptor(0, r)) : e[a] = r
    }, SPECIES$1 = wellKnownSymbol("species"), arraySpeciesCreate = function(e, t) {
        var r;
        return isArray(e) && ("function" != typeof (r = e.constructor) || r !== Array && !isArray(r.prototype) ? isObject(r) && null === (r = r[SPECIES$1]) && (r = void 0) : r = void 0),
        new (void 0 === r ? Array : r)(0 === t ? 0 : t)
    }, engineUserAgent = getBuiltIn("navigator", "userAgent") || "", process$1 = global_1.process, versions = process$1 && process$1.versions, v8 = versions && versions.v8, match, version;
    v8 ? (match = v8.split("."),
    version = match[0] + match[1]) : engineUserAgent && (match = engineUserAgent.match(/Edge\/(\d+)/),
    (!match || match[1] >= 74) && (match = engineUserAgent.match(/Chrome\/(\d+)/),
    match && (version = match[1])));
    var engineV8Version = version && +version
      , SPECIES$2 = wellKnownSymbol("species")
      , arrayMethodHasSpeciesSupport = function(e) {
        return engineV8Version >= 51 || !fails((function() {
            var t = [];
            return (t.constructor = {})[SPECIES$2] = function() {
                return {
                    foo: 1
                }
            }
            ,
            1 !== t[e](Boolean).foo
        }
        ))
    }
      , IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable")
      , MAX_SAFE_INTEGER = 9007199254740991
      , MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded"
      , IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails((function() {
        var e = [];
        return e[IS_CONCAT_SPREADABLE] = !1,
        e.concat()[0] !== e
    }
    ))
      , SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat")
      , isConcatSpreadable = function(e) {
        if (!isObject(e))
            return !1;
        var t = e[IS_CONCAT_SPREADABLE];
        return void 0 !== t ? !!t : isArray(e)
    }
      , FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
    _export({
        target: "Array",
        proto: !0,
        forced: FORCED$1
    }, {
        concat: function(e) {
            var t, r, a, n, o, l = toObject(this), i = arraySpeciesCreate(l, 0), s = 0;
            for (t = -1,
            a = arguments.length; t < a; t++)
                if (isConcatSpreadable(o = -1 === t ? l : arguments[t])) {
                    if (s + (n = toLength(o.length)) > MAX_SAFE_INTEGER)
                        throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
                    for (r = 0; r < n; r++,
                    s++)
                        r in o && createProperty(i, s, o[r])
                } else {
                    if (s >= MAX_SAFE_INTEGER)
                        throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
                    createProperty(i, s++, o)
                }
            return i.length = s,
            i
        }
    });
    var aFunction$1 = function(e) {
        if ("function" != typeof e)
            throw TypeError(String(e) + " is not a function");
        return e
    }
      , functionBindContext = function(e, t, r) {
        if (aFunction$1(e),
        void 0 === t)
            return e;
        switch (r) {
        case 0:
            return function() {
                return e.call(t)
            }
            ;
        case 1:
            return function(r) {
                return e.call(t, r)
            }
            ;
        case 2:
            return function(r, a) {
                return e.call(t, r, a)
            }
            ;
        case 3:
            return function(r, a, n) {
                return e.call(t, r, a, n)
            }
        }
        return function() {
            return e.apply(t, arguments)
        }
    }
      , push = [].push
      , createMethod$3 = function(e) {
        var t = 1 == e
          , r = 2 == e
          , a = 3 == e
          , n = 4 == e
          , o = 6 == e
          , l = 5 == e || o;
        return function(i, s, c, u) {
            for (var h, d, f = toObject(i), m = indexedObject(f), p = functionBindContext(s, c, 3), g = toLength(m.length), y = 0, v = u || arraySpeciesCreate, A = t ? v(i, g) : r ? v(i, 0) : void 0; g > y; y++)
                if ((l || y in m) && (d = p(h = m[y], y, f),
                e))
                    if (t)
                        A[y] = d;
                    else if (d)
                        switch (e) {
                        case 3:
                            return !0;
                        case 5:
                            return h;
                        case 6:
                            return y;
                        case 2:
                            push.call(A, h)
                        }
                    else if (n)
                        return !1;
            return o ? -1 : a || n ? n : A
        }
    }
      , arrayIteration = {
        forEach: createMethod$3(0),
        map: createMethod$3(1),
        filter: createMethod$3(2),
        some: createMethod$3(3),
        every: createMethod$3(4),
        find: createMethod$3(5),
        findIndex: createMethod$3(6)
    }
      , UNSCOPABLES = wellKnownSymbol("unscopables")
      , ArrayPrototype = Array.prototype;
    null == ArrayPrototype[UNSCOPABLES] && objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
        configurable: !0,
        value: objectCreate(null)
    });
    var addToUnscopables = function(e) {
        ArrayPrototype[UNSCOPABLES][e] = !0
    }
      , $find = arrayIteration.find
      , FIND = "find"
      , SKIPS_HOLES = !0
      , USES_TO_LENGTH$1 = arrayMethodUsesToLength(FIND);
    FIND in [] && Array(1)[FIND]((function() {
        SKIPS_HOLES = !1
    }
    )),
    _export({
        target: "Array",
        proto: !0,
        forced: SKIPS_HOLES || !USES_TO_LENGTH$1
    }, {
        find: function(e) {
            return $find(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    }),
    addToUnscopables(FIND);
    var $forEach = arrayIteration.forEach
      , STRICT_METHOD$1 = arrayMethodIsStrict("forEach")
      , USES_TO_LENGTH$2 = arrayMethodUsesToLength("forEach")
      , arrayForEach = STRICT_METHOD$1 && USES_TO_LENGTH$2 ? [].forEach : function(e) {
        return $forEach(this, e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ;
    _export({
        target: "Array",
        proto: !0,
        forced: [].forEach != arrayForEach
    }, {
        forEach: arrayForEach
    });
    var nativeJoin = [].join
      , ES3_STRINGS = indexedObject != Object
      , STRICT_METHOD$2 = arrayMethodIsStrict("join", ",");
    _export({
        target: "Array",
        proto: !0,
        forced: ES3_STRINGS || !STRICT_METHOD$2
    }, {
        join: function(e) {
            return nativeJoin.call(toIndexedObject(this), void 0 === e ? "," : e)
        }
    });
    var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice")
      , USES_TO_LENGTH$3 = arrayMethodUsesToLength("slice", {
        ACCESSORS: !0,
        0: 0,
        1: 2
    })
      , SPECIES$3 = wellKnownSymbol("species")
      , nativeSlice = [].slice
      , max$2 = Math.max;
    _export({
        target: "Array",
        proto: !0,
        forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$3
    }, {
        slice: function(e, t) {
            var r, a, n, o = toIndexedObject(this), l = toLength(o.length), i = toAbsoluteIndex(e, l), s = toAbsoluteIndex(void 0 === t ? l : t, l);
            if (isArray(o) && ("function" != typeof (r = o.constructor) || r !== Array && !isArray(r.prototype) ? isObject(r) && null === (r = r[SPECIES$3]) && (r = void 0) : r = void 0,
            r === Array || void 0 === r))
                return nativeSlice.call(o, i, s);
            for (a = new (void 0 === r ? Array : r)(max$2(s - i, 0)),
            n = 0; i < s; i++,
            n++)
                i in o && createProperty(a, n, o[i]);
            return a.length = n,
            a
        }
    }),
    fixRegexpWellKnownSymbolLogic("match", 1, (function(e, t, r) {
        return [function(t) {
            var r = requireObjectCoercible(this)
              , a = null == t ? void 0 : t[e];
            return void 0 !== a ? a.call(t, r) : new RegExp(t)[e](String(r))
        }
        , function(e) {
            var a = r(t, e, this);
            if (a.done)
                return a.value;
            var n = anObject(e)
              , o = String(this);
            if (!n.global)
                return regexpExecAbstract(n, o);
            var l = n.unicode;
            n.lastIndex = 0;
            for (var i, s = [], c = 0; null !== (i = regexpExecAbstract(n, o)); ) {
                var u = String(i[0]);
                s[c] = u,
                "" === u && (n.lastIndex = advanceStringIndex(o, toLength(n.lastIndex), l)),
                c++
            }
            return 0 === c ? null : s
        }
        ]
    }
    ));
    var MATCH = wellKnownSymbol("match")
      , isRegexp = function(e) {
        var t;
        return isObject(e) && (void 0 !== (t = e[MATCH]) ? !!t : "RegExp" == classofRaw(e))
    }
      , SPECIES$4 = wellKnownSymbol("species")
      , speciesConstructor = function(e, t) {
        var r, a = anObject(e).constructor;
        return void 0 === a || null == (r = anObject(a)[SPECIES$4]) ? t : aFunction$1(r)
    }
      , arrayPush = [].push
      , min$3 = Math.min
      , MAX_UINT32 = 4294967295
      , SUPPORTS_Y = !fails((function() {
        return !RegExp(MAX_UINT32, "y")
    }
    ));
    fixRegexpWellKnownSymbolLogic("split", 2, (function(e, t, r) {
        var a;
        return a = "c" == "abbc".split(/(b)*/)[1] || 4 != "test".split(/(?:)/, -1).length || 2 != "ab".split(/(?:ab)*/).length || 4 != ".".split(/(.?)(.?)/).length || ".".split(/()()/).length > 1 || "".split(/.?/).length ? function(e, r) {
            var a = String(requireObjectCoercible(this))
              , n = void 0 === r ? MAX_UINT32 : r >>> 0;
            if (0 === n)
                return [];
            if (void 0 === e)
                return [a];
            if (!isRegexp(e))
                return t.call(a, e, n);
            for (var o, l, i, s = [], c = (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.unicode ? "u" : "") + (e.sticky ? "y" : ""), u = 0, h = new RegExp(e.source,c + "g"); (o = regexpExec.call(h, a)) && !((l = h.lastIndex) > u && (s.push(a.slice(u, o.index)),
            o.length > 1 && o.index < a.length && arrayPush.apply(s, o.slice(1)),
            i = o[0].length,
            u = l,
            s.length >= n)); )
                h.lastIndex === o.index && h.lastIndex++;
            return u === a.length ? !i && h.test("") || s.push("") : s.push(a.slice(u)),
            s.length > n ? s.slice(0, n) : s
        }
        : "0".split(void 0, 0).length ? function(e, r) {
            return void 0 === e && 0 === r ? [] : t.call(this, e, r)
        }
        : t,
        [function(t, r) {
            var n = requireObjectCoercible(this)
              , o = null == t ? void 0 : t[e];
            return void 0 !== o ? o.call(t, n, r) : a.call(String(n), t, r)
        }
        , function(e, n) {
            var o = r(a, e, this, n, a !== t);
            if (o.done)
                return o.value;
            var l = anObject(e)
              , i = String(this)
              , s = speciesConstructor(l, RegExp)
              , c = l.unicode
              , u = (l.ignoreCase ? "i" : "") + (l.multiline ? "m" : "") + (l.unicode ? "u" : "") + (SUPPORTS_Y ? "y" : "g")
              , h = new s(SUPPORTS_Y ? l : "^(?:" + l.source + ")",u)
              , d = void 0 === n ? MAX_UINT32 : n >>> 0;
            if (0 === d)
                return [];
            if (0 === i.length)
                return null === regexpExecAbstract(h, i) ? [i] : [];
            for (var f = 0, m = 0, p = []; m < i.length; ) {
                h.lastIndex = SUPPORTS_Y ? m : 0;
                var g, y = regexpExecAbstract(h, SUPPORTS_Y ? i : i.slice(m));
                if (null === y || (g = min$3(toLength(h.lastIndex + (SUPPORTS_Y ? 0 : m)), i.length)) === f)
                    m = advanceStringIndex(i, m, c);
                else {
                    if (p.push(i.slice(f, m)),
                    p.length === d)
                        return p;
                    for (var v = 1; v <= y.length - 1; v++)
                        if (p.push(y[v]),
                        p.length === d)
                            return p;
                    m = f = g
                }
            }
            return p.push(i.slice(f)),
            p
        }
        ]
    }
    ), !SUPPORTS_Y);
    var domIterables = {
        CSSRuleList: 0,
        CSSStyleDeclaration: 0,
        CSSValueList: 0,
        ClientRectList: 0,
        DOMRectList: 0,
        DOMStringList: 0,
        DOMTokenList: 1,
        DataTransferItemList: 0,
        FileList: 0,
        HTMLAllCollection: 0,
        HTMLCollection: 0,
        HTMLFormElement: 0,
        HTMLSelectElement: 0,
        MediaList: 0,
        MimeTypeArray: 0,
        NamedNodeMap: 0,
        NodeList: 1,
        PaintRequestList: 0,
        Plugin: 0,
        PluginArray: 0,
        SVGLengthList: 0,
        SVGNumberList: 0,
        SVGPathSegList: 0,
        SVGPointList: 0,
        SVGStringList: 0,
        SVGTransformList: 0,
        SourceBufferList: 0,
        StyleSheetList: 0,
        TextTrackCueList: 0,
        TextTrackList: 0,
        TouchList: 0
    };
    for (var COLLECTION_NAME in domIterables) {
        var Collection = global_1[COLLECTION_NAME]
          , CollectionPrototype = Collection && Collection.prototype;
        if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach)
            try {
                createNonEnumerableProperty(CollectionPrototype, "forEach", arrayForEach)
            } catch (error) {
                CollectionPrototype.forEach = arrayForEach
            }
    }
    function _typeof(e) {
        return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
            return typeof e
        }
        : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        }
        )(e)
    }
    function _defineProperty(e, t, r) {
        return t in e ? Object.defineProperty(e, t, {
            value: r,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = r,
        e
    }
    function ownKeys$1(e, t) {
        var r = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var a = Object.getOwnPropertySymbols(e);
            t && (a = a.filter((function(t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            }
            ))),
            r.push.apply(r, a)
        }
        return r
    }
    function _objectSpread2(e) {
        for (var t = 1; t < arguments.length; t++) {
            var r = null != arguments[t] ? arguments[t] : {};
            t % 2 ? ownKeys$1(Object(r), !0).forEach((function(t) {
                _defineProperty(e, t, r[t])
            }
            )) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys$1(Object(r)).forEach((function(t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
            }
            ))
        }
        return e
    }
    function _unsupportedIterableToArray(e, t) {
        if (e) {
            if ("string" == typeof e)
                return _arrayLikeToArray(e, t);
            var r = Object.prototype.toString.call(e).slice(8, -1);
            return "Object" === r && e.constructor && (r = e.constructor.name),
            "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray(e, t) : void 0
        }
    }
    function _arrayLikeToArray(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, a = new Array(t); r < t; r++)
            a[r] = e[r];
        return a
    }
    function _createForOfIteratorHelper(e, t) {
        var r;
        if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) {
            if (Array.isArray(e) || (r = _unsupportedIterableToArray(e)) || t && e && "number" == typeof e.length) {
                r && (e = r);
                var a = 0
                  , n = function() {};
                return {
                    s: n,
                    n: function() {
                        return a >= e.length ? {
                            done: !0
                        } : {
                            done: !1,
                            value: e[a++]
                        }
                    },
                    e: function(e) {
                        throw e
                    },
                    f: n
                }
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
        }
        var o, l = !0, i = !1;
        return {
            s: function() {
                r = e[Symbol.iterator]()
            },
            n: function() {
                var e = r.next();
                return l = e.done,
                e
            },
            e: function(e) {
                i = !0,
                o = e
            },
            f: function() {
                try {
                    l || null == r.return || r.return()
                } finally {
                    if (i)
                        throw o
                }
            }
        }
    }
    var $filter = arrayIteration.filter
      , HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport("filter")
      , USES_TO_LENGTH$4 = arrayMethodUsesToLength("filter");
    _export({
        target: "Array",
        proto: !0,
        forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$4
    }, {
        filter: function(e) {
            return $filter(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var test$1 = []
      , nativeSort = test$1.sort
      , FAILS_ON_UNDEFINED = fails((function() {
        test$1.sort(void 0)
    }
    ))
      , FAILS_ON_NULL = fails((function() {
        test$1.sort(null)
    }
    ))
      , STRICT_METHOD$3 = arrayMethodIsStrict("sort")
      , FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$3;
    _export({
        target: "Array",
        proto: !0,
        forced: FORCED$2
    }, {
        sort: function(e) {
            return void 0 === e ? nativeSort.call(toObject(this)) : nativeSort.call(toObject(this), aFunction$1(e))
        }
    });
    var nativeAssign = Object.assign
      , defineProperty$2 = Object.defineProperty
      , objectAssign = !nativeAssign || fails((function() {
        if (descriptors && 1 !== nativeAssign({
            b: 1
        }, nativeAssign(defineProperty$2({}, "a", {
            enumerable: !0,
            get: function() {
                defineProperty$2(this, "b", {
                    value: 3,
                    enumerable: !1
                })
            }
        }), {
            b: 2
        })).b)
            return !0;
        var e = {}
          , t = {}
          , r = Symbol();
        return e[r] = 7,
        "abcdefghijklmnopqrst".split("").forEach((function(e) {
            t[e] = e
        }
        )),
        7 != nativeAssign({}, e)[r] || "abcdefghijklmnopqrst" != objectKeys(nativeAssign({}, t)).join("")
    }
    )) ? function(e, t) {
        for (var r = toObject(e), a = arguments.length, n = 1, o = objectGetOwnPropertySymbols.f, l = objectPropertyIsEnumerable.f; a > n; )
            for (var i, s = indexedObject(arguments[n++]), c = o ? objectKeys(s).concat(o(s)) : objectKeys(s), u = c.length, h = 0; u > h; )
                i = c[h++],
                descriptors && !l.call(s, i) || (r[i] = s[i]);
        return r
    }
    : nativeAssign;
    _export({
        target: "Object",
        stat: !0,
        forced: Object.assign !== objectAssign
    }, {
        assign: objectAssign
    });
    var quot = /"/g
      , createHtml = function(e, t, r, a) {
        var n = String(requireObjectCoercible(e))
          , o = "<" + t;
        return "" !== r && (o += " " + r + '="' + String(a).replace(quot, "&quot;") + '"'),
        o + ">" + n + "</" + t + ">"
    }
      , stringHtmlForced = function(e) {
        return fails((function() {
            var t = ""[e]('"');
            return t !== t.toLowerCase() || t.split('"').length > 3
        }
        ))
    };
    _export({
        target: "String",
        proto: !0,
        forced: stringHtmlForced("bold")
    }, {
        bold: function() {
            return createHtml(this, "b", "", "")
        }
    }),
    _export({
        target: "String",
        proto: !0,
        forced: stringHtmlForced("link")
    }, {
        link: function(e) {
            return createHtml(this, "a", "href", e)
        }
    });
    var en = {
        functionlist: [{
            n: "SUMIF",
            t: 0,
            d: "Returns a conditional sum across a range.",
            a: "A conditional sum across a range.",
            m: [2, 3],
            p: [{
                name: "range",
                detail: "The range which is tested against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sum_range",
                detail: "The range to be summed, if different from `range`.",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TAN",
            t: 0,
            d: "Returns the tangent of an angle provided in radians.",
            a: "Tangent of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the tangent of, in radians.",
                example: "45*PI()/180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TANH",
            t: 0,
            d: "Returns the hyperbolic tangent of any real number.",
            a: "Hyperbolic tangent of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic tangent of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CEILING",
            t: 0,
            d: "Rounds a number up to the nearest integer multiple of specified significance `factor`.",
            a: "Rounds number up to nearest multiple of a factor.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round up to the nearest integer multiple of `factor`.",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN",
            t: 0,
            d: "Returns the inverse tangent of a value, in radians.",
            a: "Inverse tangent of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse tangent.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ASINH",
            t: 0,
            d: "Returns the inverse hyperbolic sine of a number.",
            a: "Inverse hyperbolic sine of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic sine.",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ABS",
            t: 0,
            d: "Returns the absolute value of a number.",
            a: "Absolute value of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number of which to return the absolute value.",
                example: "-2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOS",
            t: 0,
            d: "Returns the inverse cosine of a value, in radians.",
            a: "Inverse cosine of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse cosine. Must be between `-1` and `1`, inclusive.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOSH",
            t: 0,
            d: "Returns the inverse hyperbolic cosine of a number.",
            a: "Inverse hyperbolic cosine of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic cosine. Must be greater than or equal to `1`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTINOMIAL",
            t: 0,
            d: "Returns the factorial of the sum of values divided by the product of the values' factorials.",
            a: "Multinomial distribution function.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "ATANH",
            t: 0,
            d: "Returns the inverse hyperbolic tangent of a number.",
            a: "Inverse hyperbolic tangent of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic tangent. Must be between -1 and 1, exclusive.",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN2",
            t: 0,
            d: "Returns the angle between the x-axis and a line segment from the origin (0,0) to specified coordinate pair (`x`,`y`), in radians.",
            a: "Arctangent of a value.",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The x coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "y",
                detail: "The y coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTBLANK",
            t: 1,
            d: "Returns the number of empty values in a list of values and ranges.",
            a: "Number of empty values.",
            m: [1, 1],
            p: [{
                name: "value1",
                detail: "The first value or range in which to count the number of blanks.",
                example: "A2:C100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "COSH",
            t: 0,
            d: "Returns the hyperbolic cosine of any real number.",
            a: "Hyperbolic cosine of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic cosine of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INT",
            t: 0,
            d: "Rounds a number down to the nearest integer that is less than or equal to it.",
            a: "Rounds number down to nearest integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round down to the nearest integer.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISEVEN",
            t: 0,
            d: "Checks whether the provided value is even.",
            a: "Whether the provided value is even.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as even.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISODD",
            t: 0,
            d: "Checks whether the provided value is odd.",
            a: "Whether the provided value is odd.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as odd.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LCM",
            t: 0,
            d: "Returns the least common multiple of one or more integers.",
            a: "Least common multiple of one or more integers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range whose factors to consider in a calculation to find the least common multiple.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges whose factors to consider to find the least common multiple.",
                example: "3",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LN",
            t: 0,
            d: "Returns the logarithm of a number, base e (Euler's number).",
            a: "The logarithm of a number, base e (euler's number).",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm, base e.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG",
            t: 0,
            d: "Returns the logarithm of a number with respect to a base.",
            a: "The logarithm of a number with respect to a base.",
            m: [1, 2],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm.",
                example: "128",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "base",
                detail: "The base to use for calculation of the logarithm.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG10",
            t: 0,
            d: "Returns the logarithm of a number, base 10.",
            a: "The logarithm of a number, base 10.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm, base 10.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MOD",
            t: 0,
            d: "Returns the result of the modulo operator, the remainder after a division operation.",
            a: "Modulo (remainder) operator.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided to find the remainder.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MROUND",
            t: 0,
            d: "Rounds one number to the nearest integer multiple of another.",
            a: "Rounds a number to the nearest integer multiple.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The number to round to the nearest integer multiple of another.",
                example: "21",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ODD",
            t: 0,
            d: "Rounds a number up to the nearest odd integer.",
            a: "Rounds a number up to the nearest odd integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round to the next greatest odd number.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMSQ",
            t: 0,
            d: "Returns the sum of the squares of a series of numbers and/or cells.",
            a: "Sum of squares.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first number or range whose squares to add together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional numbers or ranges whose squares to add to the square(s) of `value1`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMBIN",
            t: 0,
            d: "Returns the number of ways to choose some number of objects from a pool of a given size of objects.",
            a: "Number of combinations from a set of objects.",
            m: [2, 2],
            p: [{
                name: "n",
                detail: "The size of the pool of objects to choose from.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "The number of objects to choose.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUM",
            t: 0,
            d: "Returns the sum of a series of numbers and/or cells.",
            a: "Sum of a series of numbers and/or cells.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first number or range to add together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional numbers or ranges to add to `value1`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SUBTOTAL",
            t: 0,
            d: "Returns a subtotal for a vertical range of cells using a specified aggregation function.",
            a: "Subtotal for a range using a specific function.",
            m: [2, 256],
            p: [{
                name: "function_code",
                detail: "The function to use in subtotal aggregation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "range1",
                detail: "The first range over which to calculate a subtotal.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "range2",
                detail: "Additional ranges over which to calculate subtotals.",
                example: "B2:B8",
                require: "o",
                repeat: "y",
                type: "range"
            }]
        }, {
            n: "ASIN",
            t: 0,
            d: "Returns the inverse sine of a value, in radians.",
            a: "Inverse sine of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse sine. Must be between `-1` and `1`, inclusive.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTIF",
            t: 1,
            d: "Returns a conditional count across a range.",
            a: "A conditional count across a range.",
            m: [2, 2],
            p: [{
                name: "range",
                detail: "The range that is tested against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RADIANS",
            t: 0,
            d: "Converts an angle value in degrees to radians.",
            a: "Converts an angle value in degrees to radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to convert from degrees to radians.",
                example: "180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RAND",
            t: 0,
            d: "Returns a random number between 0 inclusive and 1 exclusive.",
            a: "A random number between 0 inclusive and 1 exclusive.",
            m: [0, 0],
            p: []
        }, {
            n: "COUNTUNIQUE",
            t: 0,
            d: "Counts the number of unique values in a list of specified values and ranges.",
            a: "Counts number of unique values in a range.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider for uniqueness.",
                example: "A1:C100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider for uniqueness.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DEGREES",
            t: 0,
            d: "Converts an angle value in radians to degrees.",
            a: "Converts an angle value in radians to degrees.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to convert from radians to degrees.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ERFC",
            t: 9,
            d: "Returns the complementary Gauss error function of a value.",
            a: "Complementary gauss error function of a value.",
            m: [1, 1],
            p: [{
                name: "z",
                detail: "The number for which to calculate the complementary Gauss error function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EVEN",
            t: 0,
            d: "Rounds a number up to the nearest even integer.",
            a: "Rounds a number up to the nearest even integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round to the next greatest even number.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EXP",
            t: 0,
            d: "Returns Euler's number, e (~2.718) raised to a power.",
            a: "Euler's number, e (~2.718) raised to a power.",
            m: [1, 1],
            p: [{
                name: "exponent",
                detail: "The exponent to raise e to.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACT",
            t: 0,
            d: "Returns the factorial of a number.",
            a: "Factorial of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number or reference to a number whose factorial will be calculated and returned.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACTDOUBLE",
            t: 0,
            d: 'Returns the "double factorial" of a number.',
            a: '"double factorial" of a number.',
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number or reference to a number whose double factorial will be calculated and returned.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PI",
            t: 0,
            d: "Returns the value of Pi to 14 decimal places.",
            a: "The number pi.",
            m: [0, 0],
            p: []
        }, {
            n: "FLOOR",
            t: 0,
            d: "Rounds a number down to the nearest integer multiple of specified significance `factor`.",
            a: "Rounds number down to nearest multiple of a factor.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round down to the nearest integer multiple of `factor`.",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GCD",
            t: 0,
            d: "Returns the greatest common divisor of one or more integers.",
            a: "Greatest common divisor of one or more integers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range whose factors to consider in a calculation to find the greatest common divisor.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges whose factors to consider to find the greatest common divisor.",
                example: "96",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANDBETWEEN",
            t: 0,
            d: "Returns a uniformly random integer between two values, inclusive.",
            a: "Random integer between two values, inclusive.",
            m: [2, 2],
            p: [{
                name: "low",
                detail: "The low end of the random range.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "high",
                detail: "The high end of the random range.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUND",
            t: 0,
            d: "Rounds a number to a certain number of decimal places according to standard rules.",
            a: "Rounds a number according to standard rules.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDDOWN",
            t: 0,
            d: "Rounds a number to a certain number of decimal places, always rounding down to the next valid increment.",
            a: "Rounds down a number.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places, always rounding down.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDUP",
            t: 0,
            d: "Rounds a number to a certain number of decimal places, always rounding up to the next valid increment.",
            a: "Rounds up a number.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places, always rounding up.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SERIESSUM",
            t: 0,
            d: "Given parameters `x`, `n`, `m`, and `a`, returns the power series sum a",
            a: "Sum of a power series.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the power series. Varies depending on the type of approximation, may be angle, exponent, or some other value.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "The initial power to which to raise `x` in the power series.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "m",
                detail: "The additive increment by which to increase `x`.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "a",
                detail: "The array or range containing the coefficients of the power series.",
                example: "{FACT(0)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIGN",
            t: 0,
            d: "Given an input number, returns `-1` if it is negative, `1` if positive, and `0` if it is zero.",
            a: "Sign of a provided number (+/-/0).",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value whose sign will be evaluated.",
                example: "-42",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIN",
            t: 0,
            d: "Returns the sine of an angle provided in radians.",
            a: "Sine of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the sine of, in radians.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SINH",
            t: 0,
            d: "Returns the hyperbolic sine of any real number.",
            a: "Hyperbolic sine of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic sine of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRT",
            t: 0,
            d: "Returns the positive square root of a positive number.",
            a: "Positive square root of a positive number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number for which to calculate the positive square root.",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRTPI",
            t: 0,
            d: "Returns the positive square root of the product of Pi and the given positive number.",
            a: "Square root of the product of pi and number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number which will be multiplied by Pi and have the product's square root returned",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GAMMALN",
            t: 1,
            d: "Returns the logarithm of a specified Gamma function, base e (Euler's number).",
            a: "Logarithm of gamma function.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The input to the Gamma function. The natural logarithm of Gamma(`value`) will be returned.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COS",
            t: 0,
            d: "Returns the cosine of an angle provided in radians.",
            a: "Cosine of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the cosine of, in radians.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRUNC",
            t: 0,
            d: "Truncates a number to a certain number of significant digits by omitting less significant digits.",
            a: "Truncates a number.",
            m: [1, 2],
            p: [{
                name: "value",
                detail: "The value to be truncated.",
                example: "3.141592654",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of significant digits to the right of the decimal point to retain.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUOTIENT",
            t: 0,
            d: "Returns one number divided by another.",
            a: "One number divided by another.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POWER",
            t: 0,
            d: "Returns a number raised to a power.",
            a: "A number raised to a power.",
            m: [2, 2],
            p: [{
                name: "base",
                detail: "The number to raise to the `exponent` power.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "exponent",
                detail: "The exponent to raise `base` to.",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMIFS",
            t: 0,
            d: "Returns the sum of a range depending on multiple criteria.",
            a: "Sums a range depending on multiple criteria.",
            m: [3, 257],
            p: [{
                name: "sum_range",
                detail: "The range to sum.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criteria_range1",
                detail: "The range to check against criterion1.",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to criteria_range1.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " C1:C10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTIFS",
            t: 1,
            d: "Returns the count of a range depending on multiple criteria.",
            a: "Count values depending on multiple criteria.",
            m: [2, 256],
            p: [{
                name: "criteria_range1",
                detail: "The range to check against `criterion1`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to `criteria_range1`.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " B1:B10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PRODUCT",
            t: 0,
            d: "Returns the result of multiplying a series of numbers together.",
            a: "Result of multiplying a series of numbers together.",
            m: [1, 255],
            p: [{
                name: "factor1",
                detail: "The first number or range to calculate for the product.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor2",
                detail: "More numbers or ranges to calculate for the product.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HARMEAN",
            t: 1,
            d: "Calculates the harmonic mean of a dataset.",
            a: "The harmonic mean of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HYPGEOMDIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of successes in a certain number of tries given a population of a certain size containing a certain number of successes, without replacement of draws.",
            a: "Hypergeometric distribution probability.",
            m: [5, 5],
            p: [{
                name: "num_successes",
                detail: "The desired number of successes.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_draws",
                detail: "The number of permitted draws.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "successes_in_pop",
                detail: "The total number of successes in the population.",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pop_size",
                detail: "The total size of the population",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf cumulative is TRUE(), HYPGEOM.DIST returns the cumulative distribution function;\n\nif FALSE(), it returns the probability density function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INTERCEPT",
            t: 1,
            d: "Calculates the y-value at which the line resulting from linear regression of a dataset will intersect the y-axis (x=0).",
            a: "Y-intercept of line derived via linear regression.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "KURT",
            t: 1,
            d: 'Calculates the kurtosis of a dataset, which describes the shape, and in particular the "peakedness" of that dataset.',
            a: "Kurtosis of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LARGE",
            t: 1,
            d: "Returns the nth largest element from a data set, where n is user-defined.",
            a: "Nth largest element from a data set.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "The rank from largest to smallest of the element to return.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVA",
            t: 1,
            d: "Calculates the standard deviation based on a sample, setting text to the value `0`.",
            a: "Standard deviation of sample (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVP",
            t: 1,
            d: "Calculates the standard deviation based on an entire population.",
            a: "Standard deviation of an entire population.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "GEOMEAN",
            t: 1,
            d: "Calculates the geometric mean of a dataset.",
            a: "The geometric mean of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANK_EQ",
            t: 1,
            d: "Returns the rank of a specified value in a dataset. If there is more than one entry of the same value in the dataset, the top rank of the entries will be returned.",
            a: "Top rank of a specified value in a dataset.",
            m: [2, 3],
            p: [{
                name: "value",
                detail: "The value whose rank will be determined.",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "is_ascending",
                detail: "Whether to consider the values in `data` in descending or ascending order. If omitted, the default is descending (FALSE).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANK_AVG",
            t: 1,
            d: "Returns the rank of a specified value in a dataset. If there is more than one entry of the same value in the dataset, the average rank of the entries will be returned.",
            a: "Average rank of a specified value in a dataset.",
            m: [2, 3],
            p: [{
                name: "value",
                detail: "The value whose rank will be determined.",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "is_ascending",
                detail: "Whether to consider the values in `data` in descending or ascending order. If omitted, the default is descending (FALSE).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERCENTRANK_EXC",
            t: 1,
            d: "Returns the percentage rank (percentile) from 0 to 1 exclusive of a specified value in a dataset.",
            a: "Percentage rank (percentile) from 0 to 1 exclusive.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value",
                detail: "The value whose percentage rank will be determined.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant figures to use in the calculation. Default is 3.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTRANK_INC",
            t: 1,
            d: "Returns the percentage rank (percentile) from 0 to 1 inclusive of a specified value in a dataset.",
            a: "Percentage rank (percentile) from 0 to 1 inclusive.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value",
                detail: "The value whose percentage rank will be determined.",
                example: " A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant figures to use in the calculation. Default is 3.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FORECAST",
            t: 1,
            d: "Calculates the expected y-value for a specified x based on a linear regression of a dataset.",
            a: "Expected y-value based of linear regression.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The value on the x-axis to forecast.",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHERINV",
            t: 1,
            d: "Returns the inverse Fisher transformation of a specified value.",
            a: "Inverse fisher transformation of a specified value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse Fisher transformation.",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHER",
            t: 1,
            d: "Returns the Fisher transformation of a specified value.",
            a: "Fisher transformation of a specified value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the Fisher transformation.",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MODE_SNGL",
            t: 1,
            d: "Returns the most commonly occurring value in a dataset.",
            a: "Most commonly occurring value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating mode.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating mode.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "WEIBULL_DIST",
            t: 1,
            d: "Returns the value of the Weibull distribution function (or Weibull cumulative distribution function) for a specified shape and scale.",
            a: "Weibull distribution function.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the Weibull distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "shape",
                detail: "The shape parameter of the Weibull distribution function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "scale",
                detail: "The scale parameter of the Weibull distribution function.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the cumulative distribution function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COUNT",
            t: 1,
            d: "Returns the number of numeric values in a dataset.",
            a: "The number of numeric values in dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when counting.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when counting.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTA",
            t: 1,
            d: "Returns the number of values in a dataset.",
            a: "The number of values in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when counting.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when counting.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVEDEV",
            t: 1,
            d: "Calculates the average of the magnitudes of deviations of data from a dataset's mean.",
            a: "Average magnitude of deviations from mean.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "AVERAGE",
            t: 1,
            d: "Returns the numerical average value in a dataset, ignoring text.",
            a: "Numerical average value in a dataset, ignoring text.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the average value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the average value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEA",
            t: 1,
            d: "Returns the numerical average value in a dataset.",
            a: "Numerical average value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the average value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the average value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_DIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of successes (or a maximum number of successes) in a certain number of tries given a population of a certain size containing a certain number of successes, with replacement of draws.",
            a: "Binomial distribution probability.",
            m: [4, 4],
            p: [{
                name: "num_successes",
                detail: "The number of successes for which to calculate the probability in `num_trials` trials.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_trials",
                detail: "The number of independent trials.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the binomial cumulative distribution.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_INV",
            t: 1,
            d: "Calculates the smallest value for which the cumulative binomial distribution is greater than or equal to a specified criteria.",
            a: "Inverse cumulative binomial distribution function.",
            m: [3, 3],
            p: [{
                name: "num_trials",
                detail: "The number of independent trials.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "target_prob",
                detail: "The desired threshold probability.",
                example: "0.8",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONFIDENCE_NORM",
            t: 1,
            d: "Calculates the width of half the confidence interval for a normal distribution.",
            a: "Confidence interval for a normal distribution.",
            m: [3, 3],
            p: [{
                name: "alpha",
                detail: "One minus the desired confidence level. E.g. `0.1` for `0.9`, or 90%, confidence.",
                example: "0.05",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation of the population.",
                example: "1.6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pop_size",
                detail: "The size of the population.",
                example: "250",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CORREL",
            t: 1,
            d: "Calculates r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Pearson Product-Moment Correlation Coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_P",
            t: 1,
            d: "Calculates the covariance of a dataset.",
            a: "The covariance of a dataset.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_S",
            t: 1,
            d: "Calculates the sample covariance of a dataset.",
            a: "The sample covariance of a dataset.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEVSQ",
            t: 1,
            d: "Calculates the sum of squares of deviations based on a sample.",
            a: "The sum of squares of deviations based on a sample.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "EXPON_DIST",
            t: 1,
            d: "Returns the value of the exponential distribution function with a specified lambda at a specified value.",
            a: "Exponential distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the exponential distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "lambda",
                detail: "The lambda to specify the exponential distribution function.",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the exponential cumulative distribution.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIF",
            t: 1,
            d: "Returns the average of a range depending on criteria.",
            a: "Average of values depending on criteria.",
            m: [2, 3],
            p: [{
                name: "criteria_range",
                detail: "The range to check against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `criteria_range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "average_range",
                detail: "The range to average. If not included, `criteria_range` is used for the average instead.",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIFS",
            t: 1,
            d: "Returns the average of a range depending on multiple criteria.",
            a: "Average of values depending on multiple criteria.",
            m: [2, 255],
            p: [{
                name: "average_range",
                detail: "The range to average.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range1",
                detail: "The range to check against `criterion1`.",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to `criteria_range1`.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " C1:C10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERMUT",
            t: 1,
            d: "Returns the number of ways to choose some number of objects from a pool of a given size of objects, considering order.",
            a: "Number of permutations from a number of objects.",
            m: [2, 2],
            p: [{
                name: "n",
                detail: "The size of the pool of objects to choose from.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "The number of objects to choose.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRIMMEAN",
            t: 1,
            d: "Calculates the mean of a dataset excluding some proportion of data from the high and low ends of the dataset.",
            a: "Mean of a dataset excluding high/low ends.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "exclude_proportion",
                detail: "The proportion of the dataset to exclude, from the extremities of the set.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_EXC",
            t: 1,
            d: "Returns the value at a given percentile of a dataset exclusive of 0 and 1.",
            a: "Value at a given percentile of a dataset exclusive of 0 and 1.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "percentile",
                detail: "The percentile, exclusive of 0 and 1, whose value within 'data' will be calculated and returned.",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_INC",
            t: 1,
            d: "Returns the value at a given percentile of a dataset.",
            a: "Value at a given percentile of a dataset.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "percentile",
                detail: "The percentile whose value within `data` will be calculated and returned.`",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PEARSON",
            t: 1,
            d: "Calculates r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Pearson Product-Moment Correlation Coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_INV",
            t: 1,
            d: "Returns the value of the inverse standard normal distribution function for a specified value.",
            a: "Inverse standard normal distribution function.",
            m: [1, 1],
            p: [{
                name: "x",
                detail: "The input to the inverse standard normal distribution function.",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_DIST",
            t: 1,
            d: "Returns the value of the standard normal cumulative distribution function for a specified value.",
            a: "Standard normal cumulative distribution function.",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the standard normal cumulative distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NORM_INV",
            t: 1,
            d: "Returns the value of the inverse normal distribution function for a specified value, mean, and standard deviation.",
            a: "Inverse normal distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the inverse normal distribution function.",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the normal distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the normal distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_DIST",
            t: 1,
            d: "Returns the value of the normal distribution function (or normal cumulative distribution function) for a specified value, mean, and standard deviation.",
            a: "Normal distribution function.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the normal distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the normal distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the normal distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the normal cumulative distribution function rather than the distribution function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NEGBINOM_DIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of failures before a certain number of successes given a probability of success in independent trials.",
            a: "Negative binomial distribution probability.",
            m: [4, 4],
            p: [{
                name: "num_failures",
                detail: "The number of failures to model.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_successes",
                detail: "The number of successes to model.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINA",
            t: 1,
            d: "Returns the minimum numeric value in a dataset.",
            a: "Minimum numeric value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the minimum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the minimum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MIN",
            t: 1,
            d: "Returns the minimum value in a numeric dataset.",
            a: "Minimum value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the minimum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the minimum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MEDIAN",
            t: 1,
            d: "Returns the median value in a numeric dataset.",
            a: "Median value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the median value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the median value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAXA",
            t: 1,
            d: "Returns the maximum numeric value in a dataset.",
            a: "Maximum numeric value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the maximum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the maximum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAX",
            t: 1,
            d: "Returns the maximum value in a numeric dataset.",
            a: "Maximum value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the maximum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the maximum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_INV",
            t: 1,
            d: "Returns the value of the inverse log-normal cumulative distribution with given mean and standard deviation at a specified value.",
            a: "Inverse log-normal cumulative distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the inverse log-normal cumulative distribution function.",
                example: "0.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the inverse log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the inverse log-normal cumulative distribution function.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_DIST",
            t: 1,
            d: "Returns the value of the log-normal cumulative distribution with given mean and standard deviation at a specified value.",
            a: "Log-normal cumulative distribution probability.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the log-normal cumulative distribution function.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "Z_TEST",
            t: 1,
            d: "Returns the one-tailed p-value of a Z-test with standard distribution.",
            a: "One-tailed p-value of a z-test.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "value",
                detail: "The test statistic to use in the Z-test.",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation to assume for the Z-test. If this is not provided, the standard deviation of the data will be used.",
                example: "3",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PROB",
            t: 1,
            d: "Given a set of values and corresponding probabilities, calculates the probability that a value chosen at random falls between two limits.",
            a: "Probability values lie in a range.",
            m: [3, 4],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A3:A6",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "probabilities",
                detail: "Array or range containing probabilities corresponding to `data`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "low_limit",
                detail: "The lower bound on the value range for which to calculate the probability.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "high_limit",
                detail: "The upper bound on the value range for which to calculate the probability.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_EXC",
            t: 1,
            d: "Returns a value nearest to a specified quartile of a dataset exclusive of 0 and 4.",
            a: "Value nearest to a specific quartile of a dataset exclusive of 0 and 4.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quartile_number",
                detail: "Which quartile to return.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_INC",
            t: 1,
            d: "Returns a value nearest to a specified quartile of a dataset.",
            a: "Value nearest to a specific quartile of a dataset.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quartile_number",
                detail: "Which quartile value to return.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POISSON_DIST",
            t: 1,
            d: "Returns the value of the Poisson distribution function (or Poisson cumulative distribution function) for a specified value and mean.",
            a: "Poisson distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the Poisson distribution function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the Poisson distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the Poisson cumulative distribution function rather than the distribution function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RSQ",
            t: 1,
            d: "Calculates the square of r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Square of the correlation coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST",
            t: 1,
            d: "Calculates the left tail probability for a Student's t-distribution with a given input (x).",
            a: "The left-tailed Student's t-distribution",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T_DIST_2T",
            t: 1,
            d: "Calculates the probability for two tailed Student's t-distribution with a given input (x).",
            a: "The two tailed Student's t-distribution",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST_RT",
            t: 1,
            d: "Calculates the right tail probability for a Student's t-distribution with a given input (x).",
            a: "The right-tailed Student's t-distribution",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV",
            t: 1,
            d: "Calculates the negative inverse of the one-tailed TDIST function.",
            a: "T.INV",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "The probability associated with the two-tailed t-distribution.",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV_2T",
            t: 1,
            d: "Calculates the inverse of the two-tailed TDIST function.",
            a: "T.INV.2T",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "The probability associated with the two-tailed t-distribution.",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_TEST",
            t: 1,
            d: "t-test. Returns the probability associated with Student's t-test. Determines whether two samples are likely to have come from the same two underlying populations that have the same mean.",
            a: "Returns the probability associated with t-test.",
            m: [4, 4],
            p: [{
                name: "range1",
                detail: "The first sample of data or group of cells to consider for the t-test.",
                example: "A1:A4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "range2",
                detail: "The second sample of data or group of cells to consider for the t-test.",
                example: "B1:B4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "tails",
                detail: "Specifies the number of distribution tails.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "Specifies the type of t-test.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "F_DIST",
            t: 1,
            d: "Calculates the left-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.",
            a: "F probability distribution (left-tailed).",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the F probability distribution function. The value at which to evaluate the function.",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "The numerator of the number of degrees of freedom.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "The denominator of the number of degrees of freedom.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Logical value that determines the form of the function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "F_DIST_RT",
            t: 1,
            d: "Calculates the right-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.",
            a: "F probability distribution.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the F probability distribution function. The value at which to evaluate the function.",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "The numerator of the number of degrees of freedom.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "The denominator of the number of degrees of freedom.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_P",
            t: 1,
            d: "Calculates the variance based on an entire population.",
            a: "Variance of entire population.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_S",
            t: 1,
            d: "Calculates the variance based on a sample.",
            a: "Variance.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARA",
            t: 1,
            d: "Calculates the variance based on a sample, setting text to the value `0`.",
            a: "Variance of sample (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARPA",
            t: 1,
            d: "Calculates the variance based on an entire population, setting text to the value `0`.",
            a: "Variance of entire population (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STEYX",
            t: 1,
            d: "Calculates the standard error of the predicted y-value for each x in the regression of a dataset.",
            a: "Standard error of predicted y-values in regression.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STANDARDIZE",
            t: 1,
            d: "Calculates the normalized equivalent of a random variable given mean and standard deviation of the distribution.",
            a: "Normalized equivalent of a random variable.",
            m: [3, 3],
            p: [{
                name: "value",
                detail: "The value of the random variable to normalize.",
                example: "96",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean of the distribution.",
                example: "80",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation of the distribution.",
                example: "6.7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SMALL",
            t: 1,
            d: "Returns the nth smallest element from a data set, where n is user-defined.",
            a: "Nth smallest element in a data set.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "n",
                detail: "The rank from smallest to largest of the element to return.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLOPE",
            t: 1,
            d: "Calculates the slope of the line resulting from linear regression of a dataset.",
            a: "Slope of line from linear regression of data.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SKEW",
            t: 1,
            d: "Calculates the skewness of a dataset, which describes the symmetry of that dataset about the mean.",
            a: "Skewness of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SKEW_P",
            t: 1,
            d: "Calculates the skewness of a dataset, which describes the symmetry of that dataset about the mean. This assumes the dataset is for the population.",
            a: "Skewness of a population's dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "VLOOKUP",
            t: 2,
            d: "Vertical lookup. Searches down the first column of a range for a key and returns the value of a specified cell in the row found.",
            a: "Vertical lookup.",
            m: [3, 4],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The range to consider for the search. The first column in the range is searched for the key specified in `search_key`.",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "index",
                detail: "The column index of the value to be returned, where the first column in `range` is numbered 1.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_sorted",
                detail: "Indicates whether the column to be searched (the first column of the specified range) is sorted, in which case the closest match for `search_key` will be returned.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HLOOKUP",
            t: 2,
            d: "Horizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.",
            a: "Horizontal lookup",
            m: [3, 4],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The range to consider for the search. The first row in the range is searched for the key specified in `search_key`.",
                example: "A2:Z6",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "index",
                detail: "The row index of the value to be returned, where the first row in `range` is numbered 1.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_sorted",
                detail: "Indicates whether the row to be searched (the first row of the specified range) is sorted.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOOKUP",
            t: 2,
            d: "Looks through a sorted row or column for a key and returns the value of the cell in a result range located in the same position as the search row or column.",
            a: "Look up a value.",
            m: [2, 3],
            p: [{
                name: "search_key",
                detail: 'The value to search for in the row or column. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "search_range|search_result_array",
                detail: "One method of using this function is to provide a single sorted row or column `search_range` to look through for the `search_key` with a second argument `result_range`. The other way is to combine these two arguments into one `search_result_array` where the first row or column is searched and a value is returned from the last row or column in the array. If `search_key` is not found, a non-exact match may be returned.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "result_range",
                detail: "The range from which to return a result. The value returned corresponds to the location where `search_key` is found in `search_range`. This range must be only a single row or column and should not be used if using the `search_result_array` method.",
                example: "B1:B100",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADDRESS",
            t: 2,
            d: "Returns a cell reference as a string.",
            a: "Cell reference as a string.",
            m: [2, 5],
            p: [{
                name: "row",
                detail: "The row number of the cell reference",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column",
                detail: "The column number (not name) of the cell reference. `A` is column number `1`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "absolute_relative_mode",
                detail: "An indicator of whether the reference is row/column absolute. `1` is row and column absolute (e.g. $A$1), `2` is row absolute and column relative (e.g. A$1), `3` is row relative and column absolute (e.g. $A1), and `4` is row and column relative (e.g. A1).",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "use_a1_notation",
                detail: "A boolean indicating whether to use `A1` style notation (TRUE) or `R1C1` style notation (FALSE).",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sheet",
                detail: "Text indicating the name of the sheet into which the address points.",
                example: '"Sheet2"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INDIRECT",
            t: 2,
            d: "Returns a cell reference specified by a string.",
            a: "A cell reference specified by a string.",
            m: [1, 2],
            p: [{
                name: "cell_reference_as_string",
                detail: "A cell reference, written as a string with surrounding quotation marks.",
                example: '"Sheet2!"&B10',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "is_A1_notation",
                detail: "Indicates if the cell reference is in A1 notation (TRUE) or R1C1 notation (FALSE).",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROW",
            t: 2,
            d: "Returns the row number of a specified cell.",
            a: "Row number of a specified cell.",
            m: [0, 1],
            p: [{
                name: "cell_reference",
                detail: "The cell whose row number will be returned.",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROWS",
            t: 2,
            d: "Returns the number of rows in a specified array or range.",
            a: "Number of rows in a specified array or range.",
            m: [1, 1],
            p: [{
                name: "range",
                detail: "The range whose row count will be returned.",
                example: "A9:A62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COLUMN",
            t: 2,
            d: "Returns the column number of a specified cell, with `A=1`.",
            a: "Column number of a specified cell.",
            m: [0, 1],
            p: [{
                name: "cell_reference",
                detail: "The cell whose column number will be returned. Column `A` corresponds to `1`.",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNS",
            t: 2,
            d: "Returns the number of columns in a specified array or range.",
            a: "Number of columns in a specified array or range.",
            m: [1, 1],
            p: [{
                name: "range",
                detail: "The range whose column count will be returned.",
                example: "A9:W62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OFFSET",
            t: 2,
            d: "Returns a range reference shifted a specified number of rows and columns from a starting cell reference.",
            a: "A range reference offset relative to a cell.",
            m: [3, 5],
            p: [{
                name: "cell_reference",
                detail: "The starting point from which to count the offset rows and columns.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "offset_rows",
                detail: "The number of rows to offset by.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "offset_columns",
                detail: "The number of columns to offset by.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "height",
                detail: "The height of the range to return starting at the offset target.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "width",
                detail: "The width of the range to return starting at the offset target.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MATCH",
            t: 2,
            d: "Returns the relative position of an item in a range that matches a specified value.",
            a: "Position of item in range that matches value.",
            m: [2, 3],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: '"Sunday"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The one-dimensional array to be searched.",
                example: "A2:A9",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "search_type",
                detail: "The search method. `1` (default) finds the largest value less than or equal to `search_key` when `range` is sorted in ascending order. `0` finds the exact value when `range` is unsorted. `-1` finds the smallest value greater than or equal to `search_key` when `range` is sorted in descending order.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INDEX",
            t: 2,
            d: "Returns the content of a cell, specified by row and column offset.",
            a: "Content of cell specified by row and column offset.",
            m: [2, 3],
            p: [{
                name: "reference",
                detail: "The array of cells to be offset into.",
                example: "A1:C20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "row",
                detail: "The number of offset rows.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column",
                detail: "The number of offset columns.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GETPIVOTDATA",
            t: 2,
            d: "Extracts an aggregated value from a pivot table that corresponds to the specified row and column headings.",
            a: "Extracts an aggregated value from a pivot table that corresponds to the specified row and column headings.",
            m: [2, 254],
            p: [{
                name: "value_name",
                detail: "The name of the value in the pivot table for which you want to get data.",
                example: '"SUM of number of units"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "any_pivot_table_cell",
                detail: "Any reference to a cell in the desired pivot table (top corner recommended).",
                example: "'Pivot table'!A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "original_column",
                detail: "The name of the column in the original data set (not the pivot table).",
                example: '"division"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }, {
                name: "pivot_item",
                detail: "The name of the row or column shown in the pivot table corresponding to *original_column* that you want to retrieve.",
                example: '"east"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CHOOSE",
            t: 2,
            d: "Returns an element from a list of choices based on index.",
            a: "An element from a list of choices based on index.",
            m: [2, 255],
            p: [{
                name: "index",
                detail: "Which choice (of the up to 30 provided) to return.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "choice1",
                detail: "A potential value to return. Required. May be a reference to a cell or an individual value.",
                example: '"A"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "choice2",
                detail: "Additional values among which to choose.",
                example: '"B"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "HYPERLINK",
            t: 2,
            d: "Creates a hyperlink inside a cell.",
            a: "Creates a hyperlink inside a cell.",
            p: [{
                name: "url",
                detail: "The full URL of the link location enclosed in quotation marks, or a reference to a cell containing such a URL.",
                example: '"http://www.luckysheet.com/"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "link_label",
                detail: "The text to display in the cell as the link, enclosed in quotation marks, or a reference to a cell containing such a label.",
                example: '"luckysheet"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TIME",
            t: 6,
            d: "Converts a provided hour, minute, and second into a time.",
            a: "Converts hour/minute/second into a time.",
            m: [3, 3],
            p: [{
                name: "hour",
                detail: "The hour component of the time.",
                example: "11",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "minute",
                detail: "The minute component of the time.",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "second",
                detail: "The second component of the time.",
                example: "59",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TIMEVALUE",
            t: 6,
            d: "Returns the fraction of a 24-hour day the time represents.",
            a: "Converts a time string into its serial number representation.",
            m: [1, 1],
            p: [{
                name: "time_string",
                detail: "The string that holds the time representation.",
                example: '"2:15 PM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EOMONTH",
            t: 6,
            d: "Returns a date on the last day of a month that falls a specified number of months before or after another date.",
            a: "Last day of a month before or after a date.",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "The date from which to calculate the result.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "The number of months before (negative) or after (positive) 'start_date' to consider.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EDATE",
            t: 6,
            d: "Returns a date a specified number of months before or after another date.",
            a: "Date a number of months before/after another date.",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "The date from which to calculate the result.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "The number of months before (negative) or after (positive) 'start_date' to calculate.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SECOND",
            t: 6,
            d: "Returns the second component of a specific time, in numeric format.",
            a: "Second component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the second component",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINUTE",
            t: 6,
            d: "Returns the minute component of a specific time, in numeric format.",
            a: "Minute component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the minute component.",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HOUR",
            t: 6,
            d: "Returns the hour component of a specific time, in numeric format.",
            a: "Hour component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the hour component.",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOW",
            t: 6,
            d: "Returns the current date and time as a date value.",
            a: "Current date and time as a date value.",
            m: [0, 0],
            p: []
        }, {
            n: "NETWORKDAYS",
            t: 6,
            d: "Returns the number of net working days between two provided days.",
            a: "Net working days between two provided days.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date of the period from which to calculate the number of net working days.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date of the period from which to calculate the number of net working days.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the date serial numbers to consider holidays.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NETWORKDAYS_INTL",
            t: 6,
            d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
            a: "Net working days between two dates (specifying weekends).",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "The start date of the period from which to calculate the number of net working days.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date of the period from which to calculate the number of net working days.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "weekend",
                detail: "A number or string representing which days of the week are considered weekends.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider as holidays.",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISOWEEKNUM",
            t: 6,
            d: "Returns a number representing the ISO week of the year where the provided date falls.",
            a: "ISO week number of the year.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date for which to determine the ISO week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WEEKNUM",
            t: 6,
            d: "Returns a number representing the week of the year where the provided date falls.",
            a: "Week number of the year.",
            m: [1, 2],
            p: [{
                name: "date",
                detail: "The date for which to determine the week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "type",
                detail: "A number representing the day that a week starts on. Sunday = 1.",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "WEEKDAY",
            t: 6,
            d: "Returns a number representing the day of the week of the date provided.",
            a: "Day of the week of the date provided (as number).",
            m: [1, 2],
            p: [{
                name: "date",
                detail: "The date for which to determine the day of the week. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "type",
                detail: "A number indicating which numbering system to use to represent weekdays. By default, counts starting with Sunday = 1.",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DAY",
            t: 6,
            d: "Returns the day of the month that a specific date falls on, in numeric format.",
            a: "Day of the month that a specific date falls on.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the day.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS",
            t: 6,
            d: "Returns the number of days between two dates.",
            a: "Number of days between two dates.",
            m: [2, 2],
            p: [{
                name: "end_date",
                detail: "The end of the date range.",
                example: "2011-3-15",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_date",
                detail: "The start of the date range.",
                example: "2011-2-1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS360",
            t: 6,
            d: "Returns the difference between two days based on the 360 day year used in some financial interest calculations.",
            a: "Days between two dates on a 360-day year.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "method",
                detail: "An indicator of what day count method to use.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATE",
            t: 6,
            d: "Converts a provided year, month, and day into a date.",
            a: "Converts year/month/day into a date.",
            m: [3, 3],
            p: [{
                name: "year",
                detail: "The year component of the date.",
                example: "1969",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "The month component of the date.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day",
                detail: "The day component of the date.",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATEVALUE",
            t: 6,
            d: "Converts a provided date string in a known format to a date value.",
            a: "Converts a date string to a date value.",
            m: [1, 1],
            p: [{
                name: "date_string",
                detail: "The string representing the date.",
                example: '"1969-7-20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATEDIF",
            t: 6,
            d: "Calculates the number of days, months, or years between two dates.",
            a: "Date Difference.",
            m: [3, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "unit",
                detail: 'A string abbreviation for unit of time. For example, "M" for month. Accepted values are "Y","M","D","MD","YM","YD".',
                example: "16)",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY",
            t: 6,
            d: "Calculates the date after a number of working days from a specified start date.",
            a: "Number of working days from start date.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The date from which to begin counting.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_days",
                detail: "The number of working days to advance from `start_date`. If negative, counts backwards.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider holidays.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY_INTL",
            t: 6,
            d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
            a: "Date after a number of workdays (specifying weekends).",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "The date from which to begin counting.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_days",
                detail: "The number of working days to advance from `start_date`. If negative, counts backwards.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "weekend",
                detail: "A number or string representing which days of the week are considered weekends.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider holidays.",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEAR",
            t: 6,
            d: "Returns the year specified by a given date.",
            a: "Year specified by a given date.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the year.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEARFRAC",
            t: 6,
            d: "Returns the number of years, including fractional years, between two dates using a specified day count convention.",
            a: "Exact number of years between two dates.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TODAY",
            t: 6,
            d: "Returns the current date as a date value.",
            a: "Current date as a date value.",
            m: [0, 0],
            p: []
        }, {
            n: "MONTH",
            t: 6,
            d: "Returns the month of the year a specific date falls in, in numeric format.",
            a: "Month of the year a specific date falls in.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the month.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EFFECT",
            t: 8,
            d: "Calculates the annual effective interest rate given the nominal rate and number of compounding periods per year.",
            a: "Annual effective interest rate.",
            m: [2, 2],
            p: [{
                name: "nominal_rate",
                detail: "The nominal interest rate per year.",
                example: "0.99",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "periods_per_year",
                detail: "The number of compounding periods per year.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLAR",
            t: 12,
            d: "Formats a number into the currency specific to your spreadsheet locale.",
            a: "Formats a number as currency specific to your spreadsheet locale.",
            m: [1, 2],
            p: [{
                name: "number",
                detail: "The value to be formatted.",
                example: "1.2351",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_places",
                detail: "The number of decimal places to display.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARDE",
            t: 8,
            d: "Converts a price quotation given as a decimal fraction into a decimal value.",
            a: "Converts a decimal fraction to decimal value.",
            m: [2, 2],
            p: [{
                name: "fractional_price",
                detail: "The price quotation given using fractional decimal conventions.",
                example: "100.10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "unit",
                detail: "The units of the fraction, e.g. `8` for 1/8ths or `32` for 1/32nds.",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARFR",
            t: 8,
            d: "Converts a price quotation given as a decimal value into a decimal fraction.",
            a: "Converts a decimal value to decimal fraction.",
            m: [2, 2],
            p: [{
                name: "decimal_price",
                detail: "The price quotation given as a decimal value.",
                example: "100.125",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "unit",
                detail: "The units of the desired fraction, e.g. `8` for 1/8ths or `32` for 1/32nds.",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DB",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the arithmetic declining balance method.",
            a: "Depreciation via declining balance method.",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "The number of months in the first year of depreciation.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DDB",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the double-declining balance method.",
            a: "Depreciation via double-declining balance method.",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The factor by which depreciation decreases.",
                example: "2.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RATE",
            t: 8,
            d: "Calculates the interest rate of an annuity investment based on constant-amount periodic payments and the assumption of a constant interest rate.",
            a: "Interest rate of an annuity investment.",
            m: [3, 6],
            p: [{
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_per_period",
                detail: "The amount per period to be paid.",
                example: "-100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the interest rate will be.",
                example: "0.1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CUMPRINC",
            t: 8,
            d: "Calculates the cumulative principal paid over a range of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Cumulative principal paid over a set of periods.",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "first_period",
                detail: "The number of the payment period to begin the cumulative calculation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "last_period",
                detail: "The number of the payment period to end the cumulative calculation.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNUM",
            t: 8,
            d: "Calculates the number of coupons, or interest payments, between the settlement date and the maturity date of the investment.",
            a: "Number of coupons between settlement and maturity.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "02",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SYD",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the sum of years digits method.",
            a: "Depreciation via sum of years digits method.",
            m: [4, 4],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLEQ",
            t: 8,
            d: "Calculates the equivalent annualized rate of return of a US Treasury Bill based on discount rate.",
            a: "Equivalent rate of return for a Treasury bill.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the bill at time of purchase.",
                example: "2)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLYIELD",
            t: 8,
            d: "Calculates the yield of a US Treasury Bill based on price.",
            a: "The yield of a us treasury bill based on price.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLPRICE",
            t: 8,
            d: "Calculates the price of a US Treasury Bill based on discount rate.",
            a: "Price of US treasury bill.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the bill at time of purchase.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PV",
            t: 8,
            d: "Calculates the present value of an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Present value of an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount per period to be paid.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "D2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACCRINT",
            t: 8,
            d: "Calculates the accrued interest of a security that has periodic payments.",
            a: "Accrued interest of security with periodic payments.",
            m: [6, 8],
            p: [{
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "first_payment",
                detail: "The first date interest will be paid.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "calc_method",
                detail: "[Optional-defaults to TRUE()] - A logical value that specifies the method used to calculate the total accrued interest when the settlement date is later than the first interest accrual date. \n\nIf the value is TRUE, the total accrued interest from the issue date to the settlement date is returned. \n\nIf the value is FALSE, return the accrued interest from the first interest accrual date to the settlement date.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ACCRINTM",
            t: 8,
            d: "Calculates the accrued interest of a security that pays interest at maturity.",
            a: "Accrued interest of security paying at maturity.",
            m: [4, 5],
            p: [{
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity date of the security.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "1000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYBS",
            t: 8,
            d: "Calculates the number of days from the first coupon, or interest payment, until settlement.",
            a: "Number of days from first coupon to settlement.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYS",
            t: 8,
            d: "Calculates the number of days in the coupon, or interest payment, period that contains the specified settlement date.",
            a: "Days in coupon period containing settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYSNC",
            t: 8,
            d: "Calculates the number of days from the settlement date until the next coupon, or interest payment.",
            a: "Days from settlement until next coupon.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNCD",
            t: 8,
            d: "Calculates next coupon, or interest payment, date after the settlement date.",
            a: "Next coupon date after the settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPPCD",
            t: 8,
            d: "Calculates last coupon, or interest payment, date before the settlement date.",
            a: "Last coupon date before settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FV",
            t: 8,
            d: "Calculates the future value of an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Future value of an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount per period to be paid.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FVSCHEDULE",
            t: 8,
            d: "Calculates the future value of some principal based on a specified series of potentially varying interest rates.",
            a: "Future value of principal from series of rates.",
            m: [2, 2],
            p: [{
                name: "principal",
                detail: "The amount of initial capital or value to compound against.",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "rate_schedule",
                detail: "A series of interest rates to compound against the `principal`.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "YIELD",
            t: 8,
            d: "Calculates the annual yield of a security paying periodic interest, such as a US Treasury Bond, based on price.",
            a: "Annual yield of a security paying periodic interest.",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "YIELDDISC",
            t: 8,
            d: "Calculates the annual yield of a discount (non-interest-bearing) security, based on price.",
            a: "Annual yield of a discount security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NOMINAL",
            t: 8,
            d: "Calculates the annual nominal interest rate given the effective rate and number of compounding periods per year.",
            a: "Annual nominal interest rate.",
            m: [2, 2],
            p: [{
                name: "effective_rate",
                detail: "The effective interest rate per year.",
                example: "0.85",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "periods_per_year",
                detail: "The number of compounding periods per year.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "XIRR",
            t: 8,
            d: "Calculates the internal rate of return of an investment based on a specified series of potentially irregularly spaced cash flows.",
            a: "Internal rate of return given non-periodic cashflows.",
            m: [2, 3],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "cashflow_dates",
                detail: "An array or range with dates corresponding to the cash flows in `cashflow_amounts`.",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the internal rate of return will be.",
                example: "250",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MIRR",
            t: 8,
            d: "Calculates the modified internal rate of return on an investment based on a series of periodic cash flows and the difference between the interest rate paid on financing versus the return received on reinvested income.",
            a: "Modified internal rate of return.",
            m: [3, 3],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "financing_rate",
                detail: "The interest rate paid on funds invested.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "reinvestment_return_rate",
                detail: "The return (as a percentage) earned on reinvestment of income received from the investment.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IRR",
            t: 8,
            d: "Calculates the internal rate of return on an investment based on a series of periodic cash flows.",
            a: "Internal rate of return given periodic cashflows.",
            m: [1, 2],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the internal rate of return will be.",
                example: "200",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPV",
            t: 8,
            d: "Calculates the net present value of an investment based on a series of periodic cash flows and a discount rate.",
            a: "The net present value of an investment based on a series of periodic cash flows and a discount rate.",
            m: [2, 255],
            p: [{
                name: "discount",
                detail: "The discount rate of the investment over one period.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cashflow1",
                detail: "The first future cash flow.",
                example: "200",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "cashflow2",
                detail: "Additional future cash flows.",
                example: "250",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "XNPV",
            t: 8,
            d: "Calculates the net present value of an investment based on a specified series of potentially irregularly spaced cash flows and a discount rate.",
            a: "Net present value given non-periodic cashflows.",
            m: [3, 3],
            p: [{
                name: "discount",
                detail: "The discount rate of the investment over one period.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cashflow_amounts",
                detail: "A range of cells containing the income or payments associated with the investment.",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "cashflow_dates",
                detail: "A range of cells with dates corresponding to the cash flows in `cashflow_amounts`.",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CUMIPMT",
            t: 8,
            d: "Calculates the cumulative interest over a range of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Cumulative interest paid over a set of periods.",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "first_period",
                detail: "The number of the payment period to begin the cumulative calculation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "last_period",
                detail: "The number of the payment period to end the cumulative calculation.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PMT",
            t: 8,
            d: "Calculates the periodic payment for an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Periodic payment for an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: " 100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "D2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IPMT",
            t: 8,
            d: "Calculates the payment on interest for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Payment on interest for an investment.",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The amortization period, in terms of number of periods.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "80000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "E2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PPMT",
            t: 8,
            d: "Calculates the payment on the principal of an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Payment on the principal of an investment.",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The amortization period, in terms of number of periods.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "3*12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INTRATE",
            t: 8,
            d: "Calculates the effective interest rate generated when an investment is purchased at one price and sold at another with no interest or dividends generated by the investment itself.",
            a: "Calculates effective interest rate.",
            m: [4, 5],
            p: [{
                name: "buy_date",
                detail: "The date of purchase of the investment.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sell_date",
                detail: "The date of sale of the investment.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "buy_price",
                detail: "The price at which the investment was purchased.",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sell_price",
                detail: "The price at which the investment was sold.",
                example: "101200",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICE",
            t: 8,
            d: "Calculates the price of a security paying periodic interest, such as a US Treasury Bond, based on expected yield.",
            a: "Price of a security paying periodic interest.",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.065",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEDISC",
            t: 8,
            d: "Calculates the price of a discount (non-interest-bearing) security, based on expected yield.",
            a: "Price of a discount security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the security at time of purchase.",
                example: "0.0525",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEMAT",
            t: 8,
            d: "Calculates the price of a security paying interest at maturity, based on expected yield.",
            a: "Price of security paying interest at maturity.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RECEIVED",
            t: 8,
            d: "Calculates the amount received at maturity for an investment in fixed-income securities purchased on a given date.",
            a: "Amount received at maturity for a security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "investment",
                detail: "The amount invested (irrespective of face value of each security).",
                example: "10000000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "discount",
                detail: "The discount rate of the security invested in.",
                example: "0.0575",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DISC",
            t: 8,
            d: "Calculates the discount rate of a security based on price.",
            a: "The discount rate of a security based on price.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "97.975",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPER",
            t: 8,
            d: "Calculates the number of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Number of payment periods for an investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount of each payment made.",
                example: "500",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "40000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLN",
            t: 8,
            d: "Calculates the depreciation of an asset for one period using the straight-line method.",
            a: "Depreciation of asset using the straight-line method.",
            m: [3, 3],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "300000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "75000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DURATION",
            t: 8,
            d: "Calculates the number of compounding periods required for an investment of a specified present value appreciating at a given rate to reach a target value.",
            a: "Number of periods for an investment to reach a value.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MDURATION",
            t: 8,
            d: "Calculates the modified Macaulay duration of a security paying periodic interest, such as a US Treasury Bond, based on expected yield.",
            a: "Modified Macaulay duration.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2DEC",
            t: 9,
            d: "Converts a signed binary number to decimal format.",
            a: "Converts a signed binary number to decimal format.",
            m: [1, 1],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to decimal, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIN2HEX",
            t: 9,
            d: "Converts a signed binary number to signed hexadecimal format.",
            a: "Converts a binary number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to signed hexademical, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2OCT",
            t: 9,
            d: "Converts a signed binary number to signed octal format.",
            a: "Converts a binary number to octal.",
            m: [1, 2],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to signed octal, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2BIN",
            t: 9,
            d: "Converts a decimal number to signed binary format.",
            a: "Converts a decimal number to signed binary format.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed binary, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2HEX",
            t: 9,
            d: "Converts a decimal number to signed hexadecimal format.",
            a: "Converts a decimal number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed hexadecimal, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2OCT",
            t: 9,
            d: "Converts a decimal number to signed octal format.",
            a: "Converts a decimal number to signed octal format.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed octal, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2BIN",
            t: 9,
            d: "Converts a signed hexadecimal number to signed binary format.",
            a: "Converts a hexadecimal number to binary.",
            m: [1, 2],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to signed binary, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2DEC",
            t: 9,
            d: "Converts a signed hexadecimal number to decimal format.",
            a: "Converts a hexadecimal number to decimal.",
            m: [1, 1],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to decimal, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HEX2OCT",
            t: 9,
            d: "Converts a signed hexadecimal number to signed octal format.",
            a: "Converts a hexadecimal number to octal.",
            m: [1, 2],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to signed octal, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2BIN",
            t: 9,
            d: "Converts a signed octal number to signed binary format.",
            a: "Converts an octal number to binary.",
            m: [1, 2],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to signed binary, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2DEC",
            t: 9,
            d: "Converts a signed octal number to decimal format.",
            a: "Converts a signed octal number to decimal format.",
            m: [1, 1],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to decimal, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OCT2HEX",
            t: 9,
            d: "Converts a signed octal number to signed hexadecimal format.",
            a: "Converts an octal number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to signed hexadecimal, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COMPLEX",
            t: 9,
            d: "Creates a complex number given real and imaginary coefficients.",
            a: "Creates a complex number.",
            m: [2, 3],
            p: [{
                name: "real_part",
                detail: "The real coefficient.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "imaginary_part",
                detail: "The imaginary coefficient.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "suffix",
                detail: "The suffix for the imaginary coefficient, can only be 'i' or 'j'. If omitted, 'i' will be used.",
                example: '"j"',
                require: "o",
                repeat: "n",
                type: "rangestring"
            }]
        }, {
            n: "IMREAL",
            t: 9,
            d: "Returns the real coefficient of a complex number.",
            a: "The real coefficient of a complex number.",
            m: [1, 1],
            p: [{
                name: "complex_number",
                detail: "The complex number, in the a+bi or a+bj format.",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMAGINARY",
            t: 9,
            d: "Returns the imaginary coefficient of a complex number.",
            a: "The imaginary coefficient of a complex number.",
            m: [1, 1],
            p: [{
                name: "complex_number",
                detail: "The complex number, in the a+bi or a+bj format.",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMCONJUGATE",
            t: 9,
            d: "Returns the complex conjugate of a number.",
            a: "The complex conjugate of a number.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The complex number to calculate the conjugate for.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMABS",
            t: 9,
            d: "Returns absolute value (or modulus) of a complex number.",
            a: "The absolute value of a complex number.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The complex number to calculate the absolute value of.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DELTA",
            t: 9,
            d: "Compare two numeric values, returning 1 if they're equal.",
            a: "Compare two numeric values.",
            m: [1, 2],
            p: [{
                name: "number1",
                detail: "The first number to compare.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number2",
                detail: "The second number to compare.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IMSUM",
            t: 9,
            d: "Returns the sum of a series of complex numbers.",
            a: "Sum of a series of complex numbers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first complex number or range to add together.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional complex numbers or ranges to add to `value1`.",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMSUB",
            t: 9,
            d: "Returns the difference between two complex numbers.",
            a: "The difference between two complex numbers.",
            m: [2, 2],
            p: [{
                name: "first_number",
                detail: "The complex number to subtract second_number from.",
                example: '"6+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "second_number",
                detail: "The complex number to subtract from first_number.",
                example: '"2+3i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMPRODUCT",
            t: 9,
            d: "Returns the result of multiplying a series of complex numbers together.",
            a: "Result of multiplying a series of complex numbers together.",
            m: [1, 255],
            p: [{
                name: "factor1",
                detail: "The first number or range to calculate for the product.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "factor2",
                detail: "Additional complex numbers or ranges to calculate for the product.",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMDIV",
            t: 9,
            d: "Returns one complex number divided by another.",
            a: "One complex number divided by another.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The complex number to be divided.",
                example: '"11+16i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "divisor",
                detail: "The complex number to divide by.",
                example: '"3+2i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOT",
            t: 10,
            d: "Returns the opposite of a logical value - `NOT(TRUE)` returns `FALSE`; `NOT(FALSE)` returns `TRUE`.",
            a: "Returns opposite of provided logical value.",
            m: [1, 1],
            p: [{
                name: "logical_expression",
                detail: "An expression or reference to a cell holding an expression that represents some logical value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRUE",
            t: 10,
            d: "Returns the logical value `TRUE`.",
            a: "Logical value `true`.",
            m: [0, 0],
            p: []
        }, {
            n: "FALSE",
            t: 10,
            d: "Returns the logical value `FALSE`.",
            a: "Logical value `false`.",
            m: [0, 0],
            p: []
        }, {
            n: "AND",
            t: 10,
            d: "Returns true if all of the provided arguments are logically true, and false if any of the provided arguments are logically false.",
            a: "Logical `and` operator.",
            m: [1, 255],
            p: [{
                name: "logical_expression1",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`, or an expression that can be coerced to a logical value.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "logical_expression2",
                detail: "More expressions that represent logical values.",
                example: 'A3 = "bar"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IFERROR",
            t: 10,
            d: "Returns the first argument if it is not an error value, otherwise returns the second argument if present, or a blank if the second argument is absent.",
            a: "Value if it is not an error, otherwise 2nd argument.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to return if `value` itself is not an error.",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_error",
                detail: "The value the function returns if `value` is an error.",
                example: '"Error in cell A1"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IF",
            t: 10,
            d: "Returns one value if a logical expression is `TRUE` and another if it is `FALSE`.",
            a: "Returns value depending on logical expression.",
            m: [2, 3],
            p: [{
                name: "logical_expression",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_true",
                detail: "The value the function returns if `logical_expression` is `TRUE`.",
                example: '"A2 is foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_false",
                detail: "The value the function returns if `logical_expression` is `FALSE`.",
                example: '"A2 was false"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OR",
            t: 10,
            d: "Returns true if any of the provided arguments are logically true, and false if all of the provided arguments are logically false.",
            a: "Logical `or` operator.",
            m: [1, 255],
            p: [{
                name: "logical_expression1",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`, or an expression that can be coerced to a logical value.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "logical_expression2",
                detail: "More expressions that evaluate to logical values.",
                example: ' A3 = "bar"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NE",
            t: 11,
            d: "Returns `TRUE` if two specified values are not equal and `FALSE` otherwise. Equivalent to the `!=` operator.",
            a: "Not equal.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to test against `value1` for inequality.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EQ",
            t: 11,
            d: "Returns `TRUE` if two specified values are equal and `FALSE` otherwise. Equivalent to the `==` operator.",
            a: "Equal.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to test against `value1` for equality.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GT",
            t: 11,
            d: "Returns `TRUE` if the first argument is strictly greater than the second, and `FALSE` otherwise. Equivalent to the `>` operator.",
            a: "Strictly greater than.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being greater than `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GTE",
            t: 11,
            d: "Returns `TRUE` if the first argument is greater than or equal to the second, and `FALSE` otherwise. Equivalent to the `>=` operator.",
            a: "Greater than or equal to.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being greater than or equal to `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LT",
            t: 11,
            d: "Returns `TRUE` if the first argument is strictly less than the second, and `FALSE` otherwise. Equivalent to the `<` operator.",
            a: "Less than.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being less than `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LTE",
            t: 11,
            d: "Returns `TRUE` if the first argument is less than or equal to the second, and `FALSE` otherwise. Equivalent to the `<=` operator.",
            a: "Less than or equal to.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being less than or equal to `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADD",
            t: 11,
            d: "Returns the sum of two numbers. Equivalent to the `+` operator.",
            a: "Sum of two numbers",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first addend.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "The second addend.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINUS",
            t: 11,
            d: "Returns the difference of two numbers. Equivalent to the `-` operator.",
            a: "Difference of two numbers",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The minuend, or number to be subtracted from.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "The subtrahend, or number to subtract from `value1`.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTIPLY",
            t: 11,
            d: "Returns the product of two numbers. Equivalent to the `*` operator.",
            a: "Product of two numbers",
            m: [2, 2],
            p: [{
                name: "factor1",
                detail: "The first multiplicand.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor2",
                detail: "The second multiplicand.",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DIVIDE",
            t: 11,
            d: "Returns one number divided by another. Equivalent to the `/` operator.",
            a: "One number divided by another",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCAT",
            t: 11,
            d: "Returns the concatenation of two values. Equivalent to the `&` operator.",
            a: "Concatenation of two values",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to which `value2` will be appended.",
                example: '"de"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to append to `value1`.",
                example: '"mystify"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNARY_PERCENT",
            t: 11,
            d: "Returns a value interpreted as a percentage; that is, `UNARY_PERCENT(100)` equals `1`.",
            a: "Value interpreted as a percentage.",
            m: [1, 1],
            p: [{
                name: "percentage",
                detail: "The value to interpret as a percentage.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCATENATE",
            t: 12,
            d: "Appends strings to one another.",
            a: "Appends strings to one another.",
            m: [1, 255],
            p: [{
                name: "string1",
                detail: "The initial string.",
                example: '"Super"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "string2",
                detail: "More strings to append in sequence.",
                example: '"calla"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CODE",
            t: 12,
            d: "Returns the numeric Unicode map value of the first character in the string provided.",
            a: "Numeric unicode map value of character.",
            m: [1, 1],
            p: [{
                name: "string",
                detail: "The string whose first character's Unicode map value will be returned.",
                example: '"a"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CHAR",
            t: 12,
            d: "Convert a number into a character according to the current Unicode table.",
            a: "Gets character associated with number.",
            m: [1, 1],
            p: [{
                name: "table_number",
                detail: "The number of the character to look up from the current Unicode table in decimal format.",
                example: "97",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ARABIC",
            t: 12,
            d: "Computes the value of a Roman numeral.",
            a: "Computes the value of a roman numeral.",
            m: [1, 1],
            p: [{
                name: "roman_numeral",
                detail: "The Roman numeral to format, whose value must be between 1 and 3999, inclusive.",
                example: '"XIV"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROMAN",
            t: 12,
            d: "Formats a number in Roman numerals.",
            a: "Formats a number in Roman numerals.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The number to format, between 1 and 3999, inclusive.",
                example: "499",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "REGEXEXTRACT",
            t: 12,
            d: "Extracts matching substrings according to a regular expression.",
            a: "Extracts matching substrings with regular expression.",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "The input text.",
                example: '"Needle in a haystack"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The first part of `text` that matches this expression will be returned.",
                example: '".e{2}dle"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXMATCH",
            t: 12,
            d: "Whether a piece of text matches a regular expression.",
            a: "Whether a piece of text matches regular expression.",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "The text to be tested against the regular expression.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The regular expression to test the text against.",
                example: '"S.r"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXREPLACE",
            t: 12,
            d: "Replaces part of a text string with a different text string using regular expressions.",
            a: "Replaces text with regular expressions.",
            m: [3, 3],
            p: [{
                name: "text",
                detail: "The text, a part of which will be replaced.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The regular expression.  All matching instances in `text` will be replaced.",
                example: '"S.*d"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "replacement",
                detail: "The text which will be inserted into the original text.",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T",
            t: 12,
            d: "Returns string arguments as text, or the empty string if the value is not text.",
            a: "String arguments as text.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument to be converted to text.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIXED",
            t: 12,
            d: "Formats a number with a fixed number of decimal places.",
            a: "Formats number with fixed number of decimal places.",
            m: [1, 3],
            p: [{
                name: "number",
                detail: "The number to format.",
                example: "3.141592653",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_places",
                detail: "The number of decimal places to display in the result.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "suppress_separator",
                detail: "Whether or not to suppress the thousands separator used in some locales (e.g. `1,000` becomes `1000`). Separators will be present if this value is 0 or omitted, and absent otherwise.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIND",
            t: 12,
            d: "Returns the position at which a string is first found within text where the capitalization of letters matters. Returns `#VALUE!` if the string is not found.",
            a: "First position of string found in text, case-sensitive.",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "14",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FINDB",
            t: 12,
            d: "Returns the position at which a string is first found within text counting each double-character as 2.",
            a: "Position at which a string is first found within text (binary).",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"new"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: '"new year"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "JOIN",
            t: 12,
            d: "Concatenates the elements of one or more one-dimensional arrays using a specified delimiter.",
            a: "Concatenates elements of arrays with delimiter.",
            m: [2, 255],
            p: [{
                name: "delimiter",
                detail: "The character or string to place between each concatenated value.",
                example: '" and-a "',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_or_array1",
                detail: "The value or values to be appended using `delimiter`.",
                example: "{1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_or_array2",
                detail: "More values to be appended using `delimiter`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LEFT",
            t: 12,
            d: "Returns a substring from the beginning of a specified string.",
            a: "Substring from beginning of specified string.",
            m: [1, 2],
            p: [{
                name: "string",
                detail: "The string from which the left portion will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_characters",
                detail: "The number of characters to return from the left side of `string`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RIGHT",
            t: 12,
            d: "Returns a substring from the end of a specified string.",
            a: "A substring from the end of a specified string.",
            m: [1, 2],
            p: [{
                name: "string",
                detail: "The string from which the right portion will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_characters",
                detail: "The number of characters to return from the right side of `string`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MID",
            t: 12,
            d: "Returns a segment of a string.",
            a: "A segment of a string.",
            m: [3, 3],
            p: [{
                name: "string",
                detail: "The string to extract a segment from.",
                example: '"get this"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The index from the left of `string` from which to begin extracting. The first character in `string` has the index 1.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "extract_length",
                detail: "The length of the segment to extract.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LEN",
            t: 12,
            d: "Returns the length of a string.",
            a: "Length of a string.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string whose length will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LENB",
            t: 12,
            d: "Returns the length of a string in bytes.",
            a: "Length of a string in bytes.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string whose length will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOWER",
            t: 12,
            d: "Converts a specified string to lowercase.",
            a: "Converts a specified string to lowercase.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string to convert to lowercase.",
                example: '"LOREM IPSUM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UPPER",
            t: 12,
            d: "Converts a specified string to uppercase.",
            a: "Converts a specified string to uppercase.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string to convert to uppercase.",
                example: '"lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EXACT",
            t: 12,
            d: "Tests whether two strings are identical.",
            a: "Tests whether two strings are identical.",
            m: [2, 2],
            p: [{
                name: "string1",
                detail: "The first string to compare",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "string2",
                detail: "The second string to compare",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPLACE",
            t: 12,
            d: "Replaces part of a text string with a different text string.",
            a: "Replaces part of a text string with different text.",
            m: [4, 4],
            p: [{
                name: "text",
                detail: "The text, a part of which will be replaced.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "position",
                detail: "The position where the replacement will begin (starting from 1).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "length",
                detail: "The number of characters in the text to be replaced.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_text",
                detail: "The text which will be inserted into the original text.",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPT",
            t: 12,
            d: "Returns specified text repeated a number of times.",
            a: "Specified text repeated a number of times.",
            m: [2, 2],
            p: [{
                name: "text_to_repeat",
                detail: "The character or string to repeat.",
                example: '"ha"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_repetitions",
                detail: "The number of times `text_to_repeat` should appear in the value returned.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEARCH",
            t: 12,
            d: "Returns the position at which a string is first found within text and ignores capitalization of letters. Returns `#VALUE!` if the string is not found.",
            a: "First position of string found in text, ignoring case.",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUBSTITUTE",
            t: 12,
            d: "Replaces existing text with new text in a string.",
            a: "Replaces existing text with new text in a string.",
            m: [3, 4],
            p: [{
                name: "text_to_search",
                detail: "The text within which to search and replace.",
                example: '"search for it"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "search_for",
                detail: "The string to search for within `text_to_search`.",
                example: '"search for"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "replace_with",
                detail: "The string that will replace `search_for`.",
                example: '"Google"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "occurrence_number",
                detail: "The instance of `search_for` within `text_to_search` to replace with `replace_with`. By default, all occurrences of `search_for` are replaced; however, if `occurrence_number` is specified, only the indicated instance of `search_for` is replaced.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CLEAN",
            t: 12,
            d: "Returns the text with the non-printable ASCII characters removed.",
            a: "Removes non-printable characters from a piece of text.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The text whose non-printable characters are to be removed.",
                example: '"AF"&CHAR(31)',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TEXT",
            t: 12,
            d: "Converts a number into text according to a specified format.",
            a: "Formats a number into text.",
            m: [2, 2],
            p: [{
                name: "number",
                detail: "The number, date, or time to format.",
                example: "1.23",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "format",
                detail: "The pattern by which to format the number, enclosed in quotation marks.",
                example: '"$0.00"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRIM",
            t: 12,
            d: "Removes leading, trailing, and repeated spaces in text.",
            a: "Removes space characters.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The text or reference to a cell containing text to be trimmed.",
                example: '" lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "VALUE",
            t: 12,
            d: "Converts a string in any of the date, time or number formats that Google Sheets understands into a number.",
            a: "Converts a date/time/number string into a number.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string containing the value to be converted.",
                example: '"123"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROPER",
            t: 12,
            d: "Capitalizes each word in a specified string.",
            a: "Capitalizes each word in a specified string.",
            m: [1, 1],
            p: [{
                name: "text_to_capitalize",
                detail: "The text which will be returned with the first letter of each word in uppercase and all other letters in lowercase.",
                example: '"united states"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CONVERT",
            t: 13,
            d: "Converts a numeric value to a different unit of measure.",
            a: "Unit conversion for numbers.",
            m: [3, 3],
            p: [{
                name: "value",
                detail: "The numeric value in `start_unit` to convert to `end_unit`.",
                example: "5.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start_unit",
                detail: "The starting unit, the unit currently assigned to `value`.",
                example: '"g"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_unit",
                detail: "The unit of measure into which to convert the argument, `value`.",
                example: '"kg"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "SUMX2MY2",
            t: 14,
            d: "Calculates the sum of the differences of the squares of values in two arrays.",
            a: "Sum of the differences of squares.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values whose squares will be reduced by the squares of corresponding entries in `array_y` and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values whose squares will be subtracted from the squares of corresponding entries in `array_x` and added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMX2PY2",
            t: 14,
            d: "Calculates the sum of the sums of the squares of values in two arrays.",
            a: "Sum of the sums of squares.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values whose squares will be added to the squares of corresponding entries in `array_y` and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values whose squares will be added to the squares of corresponding entries in `array_x` and added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMXMY2",
            t: 14,
            d: "Calculates the sum of the squares of differences of values in two arrays.",
            a: "Sum of the squares of differences.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values that will be reduced by corresponding entries in `array_y`, squared, and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values that will be subtracted from corresponding entries in `array_x`, the result squared, and all such results added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRANSPOSE",
            t: 14,
            d: "Transposes the rows and columns of an array or range of cells.",
            a: "Transposes the rows and columns of an array.",
            m: [1, 1],
            p: [{
                name: "array_or_range",
                detail: "The array or range whose rows and columns will be swapped.",
                example: "{1,2}",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TREND",
            t: 14,
            d: "Given partial data about a linear trend, fits an ideal linear trend using the least squares method and/or predicts further values.",
            a: "Fits points to linear trend derived via least-squares.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal linear trend.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_data_x",
                detail: "The data points to return the `y` values for on the ideal curve fit.",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general linear form of `y = m*x+b` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `0` and only calculates the `m` values if `FALSE`, i.e. forces the curve fit to pass through the origin.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FREQUENCY",
            t: 14,
            d: "Calculates the frequency distribution of a one-column array into specified classes.",
            a: "The frequency distribution of array.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the values to be counted.",
                example: "A2:A40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "classes",
                detail: "The array or range containing the set of classes.",
                example: "B2:B5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GROWTH",
            t: 14,
            d: "Given partial data about an exponential growth trend, fits an ideal exponential growth trend and/or predicts further values.",
            a: "Fits points to exponential growth trend.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal exponential growth curve.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_data_x",
                detail: "The data points to return the `y` values for on the ideal curve fit.",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general exponential form of `y = b*m^x` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `1` and only calculates the `m` values if `FALSE`.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINEST",
            t: 14,
            d: "Given partial data about a linear trend, calculates various parameters about the ideal linear trend using the least-squares method.",
            a: "Best-fit linear trend via least-squares.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal linear trend.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "calculate_b",
                detail: "Given a linear form of `y = m*x+b`, calculates the y-intercept (`b`) if `TRUE`. Otherwise, forces `b` to be `0` and only calculates the `m` values if `FALSE`, i.e. forces the curve fit to pass through the origin.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "verbose",
                detail: "A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept (default).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOGEST",
            t: 14,
            d: "Given partial data about an exponential growth curve, calculates various parameters about the best fit ideal exponential growth curve.",
            a: "Best-fit exponential growth curve.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal exponential growth curve.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general exponential form of `y = b*m^x` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `1` and only calculates the `m` values if `FALSE`.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "verbose",
                detail: "A flag specifying whether to return additional regression statistics or only the calculated coefficient and exponents.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MDETERM",
            t: 14,
            d: "Returns the matrix determinant of a square matrix specified as an array or range.",
            a: "Matrix determinant of a square matrix.",
            m: [1, 1],
            p: [{
                name: "square_matrix",
                detail: "An array or range with an equal number of rows and columns representing a matrix whose determinant will be calculated.",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINVERSE",
            t: 14,
            d: "Returns the multiplicative inverse of a square matrix specified as an array or range.",
            a: "Multiplicative inverse of square matrix.",
            m: [1, 1],
            p: [{
                name: "square_matrix",
                detail: "An array or range with an equal number of rows and columns representing a matrix whose multiplicative inverse will be calculated.",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MMULT",
            t: 14,
            d: "Calculates the matrix product of two matrices specified as arrays or ranges.",
            a: "The matrix product of two matrices.",
            m: [2, 2],
            p: [{
                name: "matrix1",
                detail: "The first matrix in the matrix multiplication operation, represented as an array or range.",
                example: "A1:B3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "matrix2",
                detail: "The second matrix in the matrix multiplication operation, represented as an array or range.",
                example: "C1:F2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMPRODUCT",
            t: 14,
            d: "Calculates the sum of the products of corresponding entries in two equal-sized arrays or ranges.",
            a: "Sum of products of elements in two arrays.",
            m: [1, 255],
            p: [{
                name: "array1",
                detail: "The first array or range whose entries will be multiplied with corresponding entries in the second such array or range.",
                example: "A2:C5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array2",
                detail: "The second array or range whose entries will be multiplied with corresponding entries in the first such array or range.",
                example: "D2:F5",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "ISFORMULA",
            t: 15,
            d: "Checks whether a value is a formula.",
            a: "Whether a value is a formula.",
            m: [1, 1],
            p: [{
                name: "cell",
                detail: "The cell to be verified as containing a formula.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CELL",
            t: 15,
            d: "Returns the requested information about the specified cell.",
            a: "Gets information about a cell.",
            m: [2, 2],
            p: [{
                name: "info_type",
                detail: "The type of information requested (see article for available types)",
                example: '"type"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "reference",
                detail: "The reference to the cell.",
                example: "C2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "NA",
            t: 15,
            d: 'Returns the "value not available" error, `#N/A`.',
            a: "The `#N/A` error.",
            m: [0, 0],
            p: []
        }, {
            n: "ERROR_TYPE",
            t: 15,
            d: "Returns a number corresponding to the error value in a different cell.",
            a: "Error value of cell (as number).",
            m: [1, 1],
            p: [{
                name: "reference",
                detail: "The cell to find the error number for although you can also provide the error value directly.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISBLANK",
            t: 15,
            d: "Checks whether the referenced cell is empty.",
            a: "Whether the referenced cell is empty.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Reference to the cell that will be checked for emptiness.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISERR",
            t: 15,
            d: "Checks whether a value is an error other than `#N/A`.",
            a: "Whether a value is an error other than `#n/a`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as an error type other than `#N/A`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISERROR",
            t: 15,
            d: "Checks whether a value is an error.",
            a: "Whether a value is an error.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as an error type.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISLOGICAL",
            t: 15,
            d: "Checks whether a value is `TRUE` or `FALSE`.",
            a: "Whether a value is `true` or `false`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a logical `TRUE` or `FALSE`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNA",
            t: 15,
            d: "Checks whether a value is the error `#N/A`.",
            a: "Whether a value is the error `#n/a`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be compared with the error value `#N/A`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNONTEXT",
            t: 15,
            d: "Checks whether a value is non-textual.",
            a: "Whether a value is non-textual.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be checked.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNUMBER",
            t: 15,
            d: "Checks whether a value is a number.",
            a: "Whether a value is a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a number.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISREF",
            t: 15,
            d: "Checks whether a value is a valid cell reference.",
            a: "Whether a value is a valid cell reference.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a cell reference.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISTEXT",
            t: 15,
            d: "Checks whether a value is text.",
            a: "Whether a value is text.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as text.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TYPE",
            t: 15,
            d: "Returns a number associated with the type of data passed into the function.",
            a: "Get the type of a value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value whose type is to be determined.",
                example: "C4",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "N",
            t: 15,
            d: "Returns the argument provided as a number. Text is converted to 0 and errors are returned as-is.",
            a: "Argument provided as a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument to be converted to a number.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DATE",
            t: 16,
            d: "Converts a provided number to a date.",
            a: "Converts a provided number to a date.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a date.",
                example: "25405",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PURE_NUMBER",
            t: 16,
            d: "Converts a provided date/time, percentage, currency or other formatted numeric value to a pure number without formatting.",
            a: "Converts any numeric value to a pure number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a pure number.",
                example: "50%",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_TEXT",
            t: 16,
            d: "Converts a provided numeric value to a text value.",
            a: "Converts a provided numeric value to a text value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to text.",
                example: "24",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DOLLARS",
            t: 16,
            d: "Converts a provided number to a dollar value.",
            a: "Converts a provided number to a dollar value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a dollar value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PERCENT",
            t: 16,
            d: "Converts a provided number to a percentage.",
            a: "Converts a provided number to a percentage.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a percentage.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DGET",
            t: 17,
            d: "Returns a single value from a database table-like array or range using a SQL-like query.",
            a: "Single value from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMAX",
            t: 17,
            d: "Returns the maximum value selected from a database table-like array or range using a SQL-like query.",
            a: "Maximum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMIN",
            t: 17,
            d: "Returns the minimum value selected from a database table-like array or range using a SQL-like query.",
            a: "Minimum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DAVERAGE",
            t: 17,
            d: "Returns the average of a set of values selected from a database table-like array or range using a SQL-like query.",
            a: "Average of a set of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNT",
            t: 17,
            d: "Counts numeric values selected from a database table-like array or range using a SQL-like query.",
            a: "Counts values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNTA",
            t: 17,
            d: "Counts values, including text, selected from a database table-like array or range using a SQL-like query.",
            a: "Counts values and text from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DPRODUCT",
            t: 17,
            d: "Returns the product of values selected from a database table-like array or range using a SQL-like query.",
            a: "Product of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEV",
            t: 17,
            d: "Returns the standard deviation of a population sample selected from a database table-like array or range using a SQL-like query.",
            a: "Standard deviation of population sample from table.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEVP",
            t: 17,
            d: "Returns the standard deviation of an entire population selected from a database table-like array or range using a SQL-like query.",
            a: "Standard deviation of entire population from table.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSUM",
            t: 17,
            d: "Returns the sum of values selected from a database table-like array or range using a SQL-like query.",
            a: "Sum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVAR",
            t: 17,
            d: "Returns the variance of a population sample selected from a database table-like array or range using a SQL-like query.",
            a: "Variance of population sample from table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVARP",
            t: 17,
            d: "Returns the variance of an entire population selected from a database table-like array or range using a SQL-like query.",
            a: "Variance of a population from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "AGE_BY_IDCARD",
            t: "3",
            d: "Calculate the age based on the Chinese ID number. Support 15 or 18",
            a: "Get age based on ID number.",
            m: [1, 2],
            p: [{
                name: "ID number",
                example: "A1",
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Deadline",
                example: '"2017-10-01"',
                detail: "The deadline or range of age calculation. The default is the current day.",
                require: "o",
                repeat: "n",
                type: "rangedatetime"
            }]
        }, {
            n: "SEX_BY_IDCARD",
            t: "3",
            d: "Calculate gender based on Chinese ID number. Support 15 or 18",
            a: "Get gender based on ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIRTHDAY_BY_IDCARD",
            t: "3",
            d: "Calculate the birthday based on the Chinese ID number. Support 15 or 18",
            a: "Get the birthday based on the ID number.",
            m: [1, 2],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Birthday format",
                example: "0",
                detail: "Date type, default:0:[1900/01/01], 1:[1900-01-01], 2:[1900年1月1日]",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROVINCE_BY_IDCARD",
            t: "3",
            d: "Calculate the province of birthplace based on the Chinese ID number. Support 15 or 18",
            a: "Get the province of birthplace based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CITY_BY_IDCARD",
            t: "3",
            d: "Calculate the city of birthplace based on the Chinese ID number. Support 15 or 18",
            a: "Get the city of birthplace based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "STAR_BY_IDCARD",
            t: "3",
            d: "Calculate the constellation based on the Chinese ID number. Support 15 or 18",
            a: "Get the constellation based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ANIMAL_BY_IDCARD",
            t: "3",
            d: "Calculate the zodiac (rat, ox, tiger, rabbit...) based on the Chinese ID number. Support 15 or 18",
            a: "Get the zodiac according to the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISIDCARD",
            t: "3",
            d: "Verify that the format of the ID card is correct. Support 15 or 18",
            a: "Verify the correctness of the ID card format.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DM_TEXT_CUTWORD",
            t: "4",
            d: "Text segmentation. Split a series of words into a series of individual words",
            a: "Chinese text segmentation.",
            m: [1, 2],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Word segmentation mode",
                example: "0",
                detail: "The default is 0[precision mode], 1[full mode], 2[search engine mode].",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TFIDF",
            t: "4",
            d: "Use tf-idf algorithm for keyword extraction. Identify keywords from a series of text",
            a: "tf-idf keyword recognition.",
            m: [1, 3],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Number of keywords",
                example: "20",
                detail: "The number of keywords returned by the algorithm, the default is 20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Corpus",
                example: "1",
                detail: "Select a corpus in a specific field, the default is 0[General], 1[Finance], 2[Medical]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TEXTRANK",
            t: "4",
            d: "Use TextRank algorithm to extract keywords. Identify keywords from a series of text",
            a: "TextRank keyword recognition.",
            m: [1, 3],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Number of keywords",
                example: "20",
                detail: "The number of keywords returned by the algorithm, the default is 20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Corpus",
                example: "1",
                detail: "Select a corpus in a specific field, the default is 0[General], 1[Finance], 2[Medical]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_CLOSE",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock closing price of A shares.",
            a: "Returns the closing price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_OPEN",
            t: "5",
            d: "According to the stock code and date, return the opening price of stock.",
            a: "Return the opening price of a shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MAX",
            t: "5",
            d: "According to the stock code and date, return the highest price of stock.",
            a: "Return the highest price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MIN",
            t: "5",
            d: "According to the stock code and date, return the lowest price of stock.",
            a: "Returns the lowest price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_VOLUMN",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock trading volume of A shares.",
            a: "Returns the corresponding stock trading volume of A shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_AMOUNT",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock turnover of A shares.",
            a: "Returns the corresponding stock turnover of A shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISDATE",
            t: "6",
            d: "Returns whether a value is a date.",
            a: "Whether a value is a date.",
            m: [1, 1],
            p: [{
                name: "value",
                example: '"1990-01-01"',
                detail: "The value to be verified as a date.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINESPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell to describe the continuous trend of data",
            a: "Generate sparklines line chart",
            m: [1, 8],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line thickness",
                example: "1",
                detail: "Line thickness of the line graph, the default is 1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line",
                example: "avg",
                detail: "A horizontal line, which can be min, max, avg, median, range or custom value, default 0 none",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line color",
                example: "#000",
                detail: "Color setting of auxiliary line, same as line color configuration, default #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Maximum mark",
                example: "#fc5c5c",
                detail: "Identifies the maximum value of the line graph, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Minimum mark",
                example: "#fc5c5c",
                detail: "Identify the minimum value of the line graph, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Mark size",
                example: "1.5",
                detail: "The maximum and minimum mark size settings, the default is 1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AREASPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell area chart, generally used to describe the continuous cumulative value trend of the data",
            a: "Generate sparklines area chart",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Fill color",
                example: "#CCF3F4",
                detail: "Form an area chart, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line thickness",
                example: "1",
                detail: "Line thickness of the line graph, the default is 1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line",
                example: "avg",
                detail: "A horizontal line, which can be min, max, avg, median, range or custom value, default 0 none",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line color",
                example: "#000",
                detail: "Color setting of auxiliary line, same as line color configuration, default #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the vertical histogram of cells, generally used to describe the size of discrete data",
            a: "Generate sparklines vertical histogram",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the bar chart, used to standardize the length of the bar chart, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKCOLUMNSPLINES",
            t: "3",
            d: "Generate sparklines, a cumulative vertical histogram embedded in a cell, generally used to describe the numerical size of multiple dimensions of discrete data",
            a: "Generate sparklines cumulative vertical histogram",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Stack by column",
                example: "1",
                detail: "If you need to stack by row, set this item to false or 0, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the cumulative bar, used to regulate the length of the bar, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can individually set the bar color of each dimension, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BARSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the size of discrete data",
            a: "Generate sparklines horizontal bar graph",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the bar chart, used to standardize the length of the bar chart, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKBARSPLINES",
            t: "3",
            d: "Generate sparklines, a cumulative horizontal bar graph embedded in a cell, which is generally used to describe the numerical size of multiple dimensions of discrete data",
            a: "Generate sparklines cumulative horizontal bar graph",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Stack by column",
                example: "1",
                detail: "If you need to stack by row, set this item to false or 0, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the cumulative bar, used to regulate the length of the bar, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can individually set the bar color of each dimension, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "DISCRETESPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the trend of discrete data",
            a: "Generate sparklines discrete graph",
            m: [1, 4],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Segmentation threshold",
                example: "1",
                detail: "Discrete graph column color distinction, for example: if the value is 0, blue is greater than 0, red is less than 0, and the default is 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Above threshold color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Below threshold color",
                example: "#fc5c5c",
                detail: "The color setting of the bar below the threshold, the same as the color above the threshold, default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRISTATESPLINES",
            t: "3",
            d: "Generate sparklines, a three-state graph embedded in the cell, which is generally used to describe the trend of three situations, such as winning, losing, or drawing.",
            a: "Generate sparklines three-state graph",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Zero value bar color",
                example: "#999",
                detail: "Zero value bar color setting, representing 0 value color, the same color configuration of the bar, default #999",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PIESPLINES",
            t: "3",
            d: "Generate sparklines pie chart embedded in the cell, generally used to describe the proportion of data",
            a: "Generate sparklines pie chart",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Rotation angle",
                example: "0",
                detail: "The rotation angle of the pie chart, the default is 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "border",
                example: "0",
                detail: "Pie chart border size, default is none 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Border color",
                example: "#000",
                detail: "The border color of the pie chart, the default is #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color of the slice can be set in the palette, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BOXSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell box plot, generally used to describe the statistical distribution of the data set",
            a: "Generate sparklines box plot",
            m: [1, 4],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Outlier ratio",
                example: "1.5",
                detail: "The threshold range of outliers, if it is 0 or false, it will not be displayed, the default is 1.5 times",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Target value",
                example: "10",
                detail: "The target value setting on the box plot, the default is false and does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Point size",
                example: "1.5",
                detail: "The radius of the target point and outlier is set, the default is 1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BULLETSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the task achievement rate",
            a: "Generating sparklines bullets",
            m: [2, 3],
            p: [{
                name: "Target",
                example: "10",
                detail: "The numerical value can be calculated effectively for the achieved target value, such as A1, 100, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "achieved",
                example: "8",
                detail: "Only when the value is completed can the value be calculated effectively, such as A1, 100, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Contrast",
                example: "12",
                detail: "Comparative values, such as excess, minimum, and bottom line for awards, can be effectively calculated, such as A1, 100, etc. You can set up to 9 comparison values",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMPOSESPLINES",
            t: "3",
            d: "Support multiple types of pictures in the same cell, each parameter represents a sparklines diagram",
            a: "Combine sparklines graphs into one cell",
            m: [1, 1],
            p: [{
                name: "config",
                example: "PIESPLINES(A1:A20)",
                detail: "Sparklines chart settings, such as A1:A20, a completed pie chart, line chart settings, etc.",
                require: "m",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SORT",
            t: "14",
            d: "Sorts the rows of a given array or range by the values in one or more columns.",
            a: "Sorts rows of range by specified column.",
            m: [1, 4],
            p: [{
                name: "range",
                detail: "The data to be sorted.",
                example: "A2:A17",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_column",
                detail: "The index of the column in `range` or a range outside of `range` containing the values by which to sort.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_ascending",
                detail: "`TRUE` or `FALSE` indicating whether to sort `sort_column` in ascending order. `FALSE` sorts in descending order.",
                example: "-1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_column2",
                detail: "Additional columns.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FILTER",
            t: "14",
            d: "Returns a filtered version of the source range, returning only rows or columns which meet the specified conditions.",
            a: "Filters a range based off provided conditions.",
            m: [2, 3],
            p: [{
                name: "range",
                detail: "The data to be filtered.",
                example: "A5:D20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "condition1",
                detail: "A column or row containing true or false values corresponding to the first column or row of `range`, or an array formula evaluating to true or false.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "condition2",
                detail: "Additional rows or columns containing boolean values `TRUE` or `FALSE` indicating whether the corresponding row or column in `range` should pass through `FILTER`. Can also contain array formula expressions which evaluate to such rows or columns. All conditions must be of the same type (row or column). Mixing row conditions and column conditions is not permitted.",
                example: '""',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNIQUE",
            t: "14",
            d: "Returns unique rows in the provided source range, discarding duplicates. Rows are returned in the order in which they first appear in the source range.",
            a: "Unique rows in the provided source range.",
            m: [1, 3],
            p: [{
                name: "range",
                detail: "The data to filter by unique entries.",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "by_col",
                detail: "[Option] - Logical value, indicating how to compare; by row = FALSE() or omitted; by column = TRUE().",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "occurs_once",
                detail: "[Option] - Logical value, only one occurrence in the unique value is returned = TRUE(); including all unique values = FALSE() or omitted.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANDARRAY",
            t: "14",
            d: "Returns a grid of random numbers between 0 inclusive and 1 exclusive. The grid size will match the provided rows and columns arguments. If neither rows nor columns are provided, then the grid will be size 1 x 1.",
            a: "Returns a grid of random numbers.",
            m: [0, 2],
            p: [{
                name: "rows",
                detail: "The number of rows to populate with a random number.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "columns",
                detail: "The number of columns to populate with a random number.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEQUENCE",
            t: "14",
            d: "Returns a grid of sequential numbers starting at a specified start value and  increasing by a specified step size. By default, the sequence starts at and  increases by 1.",
            a: "Returns a grid of sequential numbers.",
            m: [1, 4],
            p: [{
                name: "rows",
                detail: "The number of rows in the function's resulting grid.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "columns",
                detail: "The number of columns in the function's resulting grid. If omitted, the result grid will have 1 column.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start",
                detail: "The number, at which to start the sequence. If omitted, the sequence will start at 1.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "step",
                detail: "The amount each value in the sequence will differ by. If omitted, each value will differ by 1.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }],
        toolbar: {
            undo: "Undo",
            redo: "Redo",
            paintFormat: "Paint format",
            currencyFormat: "Format as currency",
            percentageFormat: "Format as percent",
            numberDecrease: "Decrease decimal places",
            numberIncrease: "Increase decimal places",
            moreFormats: "More formats",
            font: "Font",
            fontSize: "Font size",
            bold: "Bold (Ctrl+B)",
            italic: "Italic (Ctrl+I)",
            strikethrough: "Strikethrough (Alt+Shift+5)",
            textColor: "Text color",
            chooseColor: "choose color",
            resetColor: "Reset",
            customColor: "CUSTOM",
            alternatingColors: "Alternating colors",
            confirmColor: "OK",
            cancelColor: "Cancel",
            collapse: "Collapse",
            fillColor: "Fill color",
            border: "Border",
            borderStyle: "Border style",
            mergeCell: "Merge cells",
            chooseMergeType: "Choose merge type",
            horizontalAlign: "Horizontal align",
            verticalAlign: "Vertical align",
            alignment: "Alignment",
            textWrap: "Text wrap",
            textWrapMode: "Text wrap mode",
            textRotate: "Text rotate",
            textRotateMode: "Text rotate mode",
            freezeTopRow: "Freeze top row",
            sortAndFilter: "Sort and filter",
            findAndReplace: "Find and replace",
            sum: "SUM",
            autoSum: "Auto SUM",
            moreFunction: "More functions",
            conditionalFormat: "Conditional format",
            postil: "Comment",
            pivotTable: "Pivot Table",
            chart: "Chart",
            screenshot: "Screenshot",
            splitColumn: "Split text",
            insertImage: "Insert image",
            insertLink: "Insert link",
            dataVerification: "Data verification",
            protection: "Protect the sheet",
            clearText: "Clear color",
            noColorSelectedText: "No color is selected",
            toolMore: "More",
            toolLess: "Less",
            toolClose: "Close",
            toolMoreTip: "More features",
            moreOptions: "More options",
            cellFormat: "Cell format config",
            print: "Print"
        },
        alternatingColors: {
            applyRange: "Apply to range",
            selectRange: "Select a data range",
            header: "Header",
            footer: "Footer",
            errorInfo: "Cannot perform this operation on multiple selection areas, please select a single area and try again",
            textTitle: "Format style",
            custom: "CUSTOM",
            close: "close",
            selectionTextColor: "Click to select text color",
            selectionCellColor: "Click to select cell color",
            removeColor: "Remove alternating colors",
            colorShow: "color",
            currentColor: "Current",
            tipSelectRange: "Please select the range of alternating colors",
            errorNoRange: "No range is selected",
            errorExistColors: "Alternating colors already exist and cannot be edited"
        },
        button: {
            confirm: "OK",
            cancel: "Cancel",
            close: "Close",
            update: "Update",
            delete: "Delete",
            insert: "Insert"
        },
        paint: {
            start: "Paint format start",
            end: "ESC",
            tipSelectRange: "Please select the range to be copied",
            tipNotMulti: "Cannot perform this operation on multiple selection ranges"
        },
        format: {
            moreCurrency: "More currency formats",
            moreDateTime: "More date and time formats",
            moreNumber: "More number formats",
            titleCurrency: "Currency formats",
            decimalPlaces: "Decimal places",
            titleDateTime: "Date and time formats",
            titleNumber: "Number formats"
        },
        info: {
            detailExport: "<i class='fa fa-download' aria-hidden='true'></i> Download",
            detailSaveAs: " Save As",
            close: "<i class='fa fa-window-close' aria-hidden='true'></i> Close",
            detailSave: " Save",
            row: "",
            column: "",
            loading: "Loading",
            copy: "Copy",
            return: "Exit",
            rename: "Rename",
            tips: "WorkBook rename",
            noName: "Untitled spreadsheet",
            wait: "waiting for update",
            add: "Add",
            addLast: "more rows at bottom",
            backTop: "Back to the top",
            pageInfo: "Total ${total}，${totalPage} page，current ${currentPage}",
            nextPage: "Next",
            tipInputNumber: "Please enter the number",
            tipInputNumberLimit: "The increase range is limited to 1-100",
            tipRowHeightLimit: "Row height must be between 0 ~ 545",
            tipColumnWidthLimit: "The column width must be between 0 ~ 2038",
            pageInfoFull: "Total ${total}，${totalPage} page，All data displayed"
        },
        currencyDetail: {
            RMB: "RMB",
            USdollar: "US dollar",
            EUR: "EUR",
            GBP: "GBP",
            HK: "HK",
            JPY: "JPY",
            AlbanianLek: "Albanian Lek",
            AlgerianDinar: "Algerian Dinar",
            Afghani: "Afghani",
            ArgentinePeso: "Argentine Peso",
            UnitedArabEmiratesDirham: "United Arab Emirates Dirham",
            ArubanFlorin: "Aruban Florin",
            OmaniRial: "Omani Rial",
            Azerbaijanimanat: "Azerbaijani manat",
            EgyptianPound: "Egyptian Pound",
            EthiopianBirr: "Ethiopian Birr",
            AngolaKwanza: "Angola Kwanza",
            AustralianDollar: "Australian Dollar",
            Patacas: "Patacas",
            BarbadosDollar: "Barbados Dollar",
            PapuaNewGuineaKina: "Papua New Guinea Kina",
            BahamianDollar: "Bahamian Dollar",
            PakistanRupee: "Pakistan Rupee",
            ParaguayanGuarani: "Paraguayan Guarani",
            BahrainiDinar: "Bahraini Dinar",
            PanamanianBalboa: "Panamanian Balboa",
            Brazilianreal: "Brazilian real",
            Belarusianruble: "Belarusian ruble",
            BermudianDollar: "Bermudian Dollar",
            BulgarianLev: "Bulgarian Lev",
            IcelandKrona: "Iceland Krona",
            BosniaHerzegovinaConvertibleMark: "Bosnia-Herzegovina Convertible Mark",
            PolishZloty: "Polish Zloty",
            Boliviano: "Boliviano",
            BelizeDollar: "Belize Dollar",
            BotswanaPula: "Botswana Pula",
            NotDannuzhamu: "Not Dannuzhamu",
            BurundiFranc: "Burundi Franc",
            NorthKoreanWon: "North Korean Won",
            DanishKrone: "Danish Krone",
            EastCaribbeanDollar: "East Caribbean Dollar",
            DominicaPeso: "Dominica Peso",
            RussianRuble: "Russian Ruble",
            EritreanNakfa: "Eritrean Nakfa",
            CFAfranc: "CFA franc",
            PhilippinePeso: "Philippine Peso",
            FijiDollar: "Fiji Dollar",
            CapeVerdeEscudo: "Cape Verde Escudo",
            FalklandIslandsPound: "Falkland Islands Pound",
            GambianDalasi: "Gambian Dalasi",
            Congolesefranc: "Congolese franc",
            ColombianPeso: "Colombian Peso",
            CostaRicanColon: "Costa Rican Colon",
            CubanPeso: "Cuban Peso",
            Cubanconvertiblepeso: "Cuban convertible peso",
            GuyanaDollar: "Guyana Dollar",
            KazakhstanTenge: "Kazakhstan Tenge",
            Haitiangourde: "Haitian gourde",
            won: "won",
            NetherlandsAntillesGuilder: "Netherlands Antilles Guilder",
            Honduraslempiras: "Honduras lempiras",
            DjiboutiFranc: "Djibouti Franc",
            KyrgyzstanSom: "Kyrgyzstan Som",
            GuineaFranc: "Guinea Franc",
            CanadianDollar: "Canadian Dollar",
            GhanaianCedi: "Ghanaian Cedi",
            Cambodianriel: "Cambodian riel",
            CzechKoruna: "Czech Koruna",
            ZimbabweDollar: "Zimbabwe Dollar",
            QatariRiyal: "Qatari Riyal",
            CaymanIslandsDollar: "Cayman Islands Dollar",
            Comorianfranc: "Comorian franc",
            KuwaitiDinar: "Kuwaiti Dinar",
            CroatianKuna: "Croatian Kuna",
            KenyanShilling: "Kenyan Shilling",
            LesothoLoti: "Lesotho Loti",
            LaoKip: "Lao Kip",
            LebanesePound: "Lebanese Pound",
            Lithuanianlitas: "Lithuanian litas",
            LibyanDinar: "Libyan Dinar",
            LiberianDollar: "Liberian Dollar",
            RwandaFranc: "Rwanda Franc",
            RomanianLeu: "Romanian Leu",
            MalagasyAriary: "Malagasy Ariary",
            MaldivianRufiyaa: "Maldivian Rufiyaa",
            MalawiKwacha: "Malawi Kwacha",
            MalaysianRinggit: "Malaysian Ringgit",
            MacedoniawearingDinar: "Macedonia wearing Dinar",
            MauritiusRupee: "Mauritius Rupee",
            MauritanianOuguiya: "Mauritanian Ouguiya",
            MongolianTugrik: "Mongolian Tugrik",
            BangladeshiTaka: "Bangladeshi Taka",
            PeruvianNuevoSol: "Peruvian Nuevo Sol",
            MyanmarKyat: "Myanmar Kyat",
            MoldovanLeu: "Moldovan Leu",
            MoroccanDirham: "Moroccan Dirham",
            MozambiqueMetical: "Mozambique Metical",
            MexicanPeso: "Mexican Peso",
            NamibianDollar: "Namibian Dollar",
            SouthAfricanRand: "South African Rand",
            SouthSudanesePound: "South Sudanese Pound",
            NicaraguaCordoba: "Nicaragua Cordoba",
            NepaleseRupee: "Nepalese Rupee",
            NigerianNaira: "Nigerian Naira",
            NorwegianKrone: "Norwegian Krone",
            GeorgianLari: "Georgian Lari",
            RMBOffshore: "RMB (Offshore)",
            SwedishKrona: "Swedish Krona",
            SwissFranc: "Swiss Franc",
            SerbianDinar: "Serbian Dinar",
            SierraLeone: "Sierra Leone",
            SeychellesRupee: "Seychelles Rupee",
            SaudiRiyal: "Saudi Riyal",
            SaoTomeDobra: "Sao Tome Dobra",
            SaintHelenapound: "Saint Helena pound",
            SriLankaRupee: "Sri Lanka Rupee",
            SwazilandLilangeni: "Swaziland Lilangeni",
            SudanesePound: "Sudanese Pound",
            Surinamesedollar: "Surinamese dollar",
            SolomonIslandsDollar: "Solomon Islands Dollar",
            SomaliShilling: "Somali Shilling",
            TajikistanSomoni: "Tajikistan Somoni",
            PacificFranc: "Pacific Franc",
            ThaiBaht: "Thai Baht",
            TanzanianShilling: "Tanzanian Shilling",
            TonganPaanga: "Tongan Pa'anga",
            TrinidadandTobagoDollar: "Trinidad and Tobago Dollar",
            TunisianDinar: "Tunisian Dinar",
            TurkishLira: "Turkish Lira",
            VanuatuVatu: "Vanuatu Vatu",
            GuatemalanQuetzal: "Guatemalan Quetzal",
            CommissionBolivar: "Commission Bolivar",
            BruneiDollar: "Brunei Dollar",
            UgandanShilling: "Ugandan Shilling",
            UkrainianHryvnia: "Ukrainian Hryvnia",
            UruguayanPeso: "Uruguayan Peso",
            Uzbekistansom: "Uzbekistan som",
            WesternSamoaTala: "Western Samoa Tala",
            SingaporeDollar: "Singapore Dollar",
            NT: "NT",
            NewZealandDollar: "New Zealand Dollar",
            HungarianForint: "Hungarian Forint",
            SyrianPound: "Syrian Pound",
            JamaicanDollar: "Jamaican Dollar",
            ArmenianDram: "Armenian Dram",
            YemeniRial: "Yemeni Rial",
            IraqiDinar: "Iraqi Dinar",
            IranianRial: "Iranian Rial",
            NewIsraeliShekel: "New Israeli Shekel",
            IndianRupee: "Indian Rupee",
            IndonesianRupiah: "Indonesian Rupiah",
            JordanianDinar: "Jordanian Dinar",
            VND: "VND",
            ZambianKwacha: "Zambian Kwacha",
            GibraltarPound: "Gibraltar Pound",
            ChileanPeso: "Chilean Peso",
            CFAFrancBEAC: "CFA Franc BEAC"
        },
        defaultFmt: [{
            text: "Automatic",
            value: "General",
            example: ""
        }, {
            text: "Plain text",
            value: "@",
            example: ""
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "Number",
            value: "##0.00",
            example: "1000.12"
        }, {
            text: "Percent",
            value: "#0.00%",
            example: "12.21%"
        }, {
            text: "Scientific",
            value: "0.00E+00",
            example: "1.01E+5"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "Accounting",
            value: "¥(0.00)",
            example: "¥(1200.09)"
        }, {
            text: "Currency",
            value: "¥0.00",
            example: "¥1200.09"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "Date",
            value: "yyyy-MM-dd",
            example: "2017-11-29"
        }, {
            text: "Time",
            value: "hh:mm AM/PM",
            example: "3:00 PM"
        }, {
            text: "Time 24H",
            value: "hh:mm",
            example: "15:00"
        }, {
            text: "Date time",
            value: "yyyy-MM-dd hh:mm AM/PM",
            example: "2017-11-29 3:00 PM"
        }, {
            text: "Date time 24 H",
            value: "yyyy-MM-dd hh:mm",
            example: "2017-11-29 15:00"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "Custom formats",
            value: "fmtOtherSelf",
            example: "more"
        }],
        dateFmtList: [{
            name: "1930-08-05",
            value: "yyyy-MM-dd"
        }, {
            name: "1930/8/5",
            value: "yyyy/MM/dd"
        }, {
            name: "08-05",
            value: "MM-dd"
        }, {
            name: "8-5",
            value: "M-d"
        }, {
            name: "13:30:30",
            value: "h:mm:ss"
        }, {
            name: "13:30",
            value: "h:mm"
        }, {
            name: "PM 01:30",
            value: "AM/PM hh:mm"
        }, {
            name: "PM 1:30",
            value: "AM/PM h:mm"
        }, {
            name: "PM 1:30:30",
            value: "AM/PM h:mm:ss"
        }, {
            name: "08-05 PM 01:30",
            value: "MM-dd AM/PM hh:mm"
        }],
        fontFamily: {
            MicrosoftYaHei: "YaHei"
        },
        fontarray: ["Times New Roman", "Arial", "Tahoma", "Verdana"],
        fontjson: {
            "times new roman": 0,
            arial: 1,
            tahoma: 2,
            verdana: 3
        },
        border: {
            borderTop: "borderTop",
            borderBottom: "borderBottom",
            borderLeft: "borderLeft",
            borderRight: "borderRight",
            borderNone: "borderNone",
            borderAll: "borderAll",
            borderOutside: "borderOutside",
            borderInside: "borderInside",
            borderHorizontal: "borderHorizontal",
            borderVertical: "borderVertical",
            borderColor: "borderColor",
            borderSize: "borderSize"
        },
        merge: {
            mergeAll: "Merge all",
            mergeV: "Vertically",
            mergeH: "Horizontally",
            mergeCancel: "Unmerge",
            overlappingError: "Cannot merge overlapping areas",
            partiallyError: "Cannot perform this operation on partially merged cells"
        },
        align: {
            left: "left",
            center: "center",
            right: "right",
            top: "Top",
            middle: "Middle",
            bottom: "Bottom"
        },
        textWrap: {
            overflow: "Overflow",
            wrap: "Wrap",
            clip: "Clip"
        },
        rotation: {
            none: "None",
            angleup: "Tilt Up",
            angledown: "Tilt Down",
            vertical: "Stack Vertically",
            rotationUp: "Rotate Up",
            rotationDown: "Rotate Down"
        },
        freezen: {
            default: "Freeze",
            freezenRow: "First Row",
            freezenColumn: "First Column",
            freezenRC: "Both",
            freezenRowRange: "Freezen row range",
            freezenColumnRange: "Freezen column range",
            freezenRCRange: "Freezen both range",
            freezenCancel: "Cancel",
            noSeletionError: "No Range to be selected"
        },
        sort: {
            asc: "Ascending ",
            desc: "Descending ",
            custom: "Custom sort",
            hasTitle: "Data has a header row",
            sortBy: "Sort by",
            addOthers: "Add another sort column",
            close: "close",
            confirm: "sort",
            columnOperation: "Column",
            secondaryTitle: "then by",
            sortTitle: "Sort range",
            sortRangeTitle: "Sort range from",
            sortRangeTitleTo: "to",
            noRangeError: "Cannot perform this operation on multiple selection areas, please select a single range and try again",
            mergeError: "There are merged cells in the selection, this operation cannot be performed!"
        },
        filter: {
            filter: "create filter",
            sortByAsc: "Sort A-Z",
            sortByDesc: "Sort Z-A",
            filterByColor: "Filter by color",
            filterByCondition: "Filter by condition",
            filterByValues: "Filter by values",
            filiterInputNone: "None",
            filiterInputTip: "Enter filter value",
            filiterRangeStartTip: "Value for formula",
            filiterRangeEndTip: "Value for formula",
            filterValueByAllBtn: "Check all",
            filterValueByClearBtn: "Clear",
            filterValueByInverseBtn: "Inverse",
            filterValueByTip: "filter By Values",
            filterConform: "Confirm",
            filterCancel: "Cancel",
            clearFilter: "Clear filter",
            conditionNone: "None",
            conditionCellIsNull: "Is empty",
            conditionCellNotNull: "Is not empty",
            conditionCellTextContain: "Text contains",
            conditionCellTextNotContain: "Text does not contain",
            conditionCellTextStart: "Text starts with",
            conditionCellTextEnd: "Text ends with",
            conditionCellTextEqual: "Text is exactly",
            conditionCellDateEqual: "Date is",
            conditionCellDateBefore: "Date is before",
            conditionCellDateAfter: "Date is after",
            conditionCellGreater: "Greater than",
            conditionCellGreaterEqual: "Greater than or equal to",
            conditionCellLess: "Less than",
            conditionCellLessEqual: "Less than or equal to",
            conditionCellEqual: "Is equal to",
            conditionCellNotEqual: "Is not equal to",
            conditionCellBetween: "Is between",
            conditionCellNotBetween: "Is not between",
            filiterMoreDataTip: "Big amount of data! please wait",
            filiterMonthText: "Month",
            filiterYearText: "Year",
            filiterByColorTip: "Filter by cell color",
            filiterByTextColorTip: "Filter by font color",
            filterContainerOneColorTip: "This column contains only one color",
            filterDateFormatTip: "Date format",
            valueBlank: "(Null)",
            mergeError: "There are merged cells in the filter selection, this operation cannot be performed!"
        },
        rightclick: {
            copy: "Copy",
            copyAs: "Copy as",
            paste: "Paste",
            insert: "Insert",
            delete: "Delete",
            deleteCell: "Delete cell",
            deleteSelected: "Delete selected ",
            hide: "Hide",
            hideSelected: "Hide selected ",
            showHide: "Show hidden ",
            to: "Towards",
            left: "Left",
            right: "Right",
            top: "Top",
            bottom: "Bottom",
            moveLeft: "Move left",
            moveUp: "Move up",
            add: "Add",
            row: "Row",
            column: "Column",
            width: "Width",
            height: "Height",
            number: "Number",
            confirm: "Confirm",
            orderAZ: "A-Z order",
            orderZA: "Z-A order",
            clearContent: "Clear content",
            matrix: "Matrix operation",
            sortSelection: "Sort",
            filterSelection: "Filter",
            chartGeneration: "Create chart",
            firstLineTitle: "first line title",
            untitled: "untitled",
            array1: "One-dimensional array",
            array2: "Two-dimensional array",
            array3: "Multidimensional Arrays",
            diagonal: "Diagonal",
            antiDiagonal: "Anti-diagonal",
            diagonalOffset: "Diagonal offset",
            offset: "Offset",
            boolean: "Boolean",
            flip: "Flip",
            upAndDown: "Up and down",
            leftAndRight: "Left and right",
            clockwise: "Clockwise",
            counterclockwise: "Counterclockwise",
            transpose: "Transpose",
            matrixCalculation: "Matrix calculation",
            plus: "Plus",
            minus: "Minus",
            multiply: "Multiply",
            divided: "Divided",
            power: "Power",
            root: "Root",
            log: "Log",
            delete0: "Delete 0 values at both ends",
            removeDuplicate: "Remove duplicate values",
            byRow: "By row",
            byCol: "By column",
            generateNewMatrix: "Generate new matrix"
        },
        comment: {
            insert: "Insert",
            edit: "Edit",
            delete: "Delete",
            showOne: "Show/Hide",
            showAll: "Show/Hide All"
        },
        screenshot: {
            screenshotTipNoSelection: "Please select the scope of the screenshot",
            screenshotTipTitle: "Warning！",
            screenshotTipHasMerge: "This operation cannot be performed on merged cells",
            screenshotTipHasMulti: "This operation cannot be performed on multiple selection regions",
            screenshotTipSuccess: "Successful",
            screenshotImageName: "Screenshot",
            downLoadClose: "Close",
            downLoadCopy: "Copy to clipboard",
            downLoadBtn: "Download",
            browserNotTip: "not supported by IE browser!",
            rightclickTip: 'Please right-click "copy" on the picture',
            successTip: 'Successfully (if pasting fails, please right-click on the image to "copy image")'
        },
        splitText: {
            splitDelimiters: "Delimiters",
            splitOther: "Other",
            splitContinueSymbol: "Consecutive separators are treated as a single",
            splitDataPreview: "Preview",
            splitTextTitle: "Split text",
            splitConfirmToExe: "There is already data here, do you want to replace it?",
            tipNoMulti: "Cannot perform this operation on multiple selection areas, please select a single area and try again",
            tipNoMultiColumn: "Only one column of data can be converted at a time. The selected area can have multiple rows but not multiple columns. Please try again after selecting a single column range"
        },
        imageText: {
            imageSetting: "Image setting",
            close: "Close",
            conventional: "Conventional",
            moveCell1: "Move and resize cells",
            moveCell2: "Move and do not resize the cell",
            moveCell3: "Do not move and resize the cell",
            fixedPos: "Fixed position",
            border: "Border",
            width: "Width",
            radius: "Radius",
            style: "Style",
            solid: "Solid",
            dashed: "Dashed",
            dotted: "Dotted",
            double: "Double",
            color: "Color"
        },
        punctuation: {
            tab: "Tab",
            semicolon: "semicolon",
            comma: "comma",
            space: "space"
        },
        findAndReplace: {
            find: "Find",
            replace: "Replace",
            goto: "Go to",
            location: "Location",
            formula: "Formula",
            date: "Date",
            number: "Number",
            string: "String",
            error: "Error",
            condition: "Condition",
            rowSpan: "Row span",
            columnSpan: "Column span",
            locationExample: "Location",
            lessTwoRowTip: "Please select at least two rows",
            lessTwoColumnTip: "Please select at least two columns",
            findTextbox: "Find Content",
            replaceTextbox: "Replace Content",
            regexTextbox: "Regular Expression",
            wholeTextbox: "Whole word",
            distinguishTextbox: "Case sensitive",
            allReplaceBtn: "Replace All",
            replaceBtn: "Replace",
            allFindBtn: "Find All",
            findBtn: "Find next",
            noFindTip: "The content was not found",
            modeTip: "This operation is not available in this mode",
            searchTargetSheet: "Sheet",
            searchTargetCell: "Cell",
            searchTargetValue: "Value",
            searchInputTip: "Please enter the search content",
            noReplceTip: "There is nothing to replace",
            noMatchTip: "No match found",
            successTip: "${xlength} items found",
            locationConstant: "Constant",
            locationFormula: "Formula",
            locationDate: "Date",
            locationDigital: "Number",
            locationString: "String",
            locationBool: "Logical",
            locationError: "Error",
            locationNull: "Null",
            locationCondition: "Conditional format",
            locationRowSpan: "Row span",
            locationColumnSpan: "Column span",
            locationTiplessTwoRow: "Please select at least two rows",
            locationTiplessTwoColumn: "Please select at least two columns",
            locationTipNotFindCell: "Cell not found"
        },
        sheetconfig: {
            delete: "Delete",
            copy: "Copy",
            rename: "Rename",
            changeColor: "Change color",
            hide: "Hide",
            unhide: "Unhide",
            moveLeft: "Move left",
            moveRight: "Move right",
            resetColor: "Reset color",
            cancelText: "Cancel",
            chooseText: "Confirm color",
            tipNameRepeat: "The name of the tab page cannot be repeated! Please revise",
            noMoreSheet: "The workbook contains at least one visual worksheet. To delete the selected worksheet, please insert a new worksheet or show a hidden worksheet.",
            confirmDelete: "Are you sure to delete",
            redoDelete: "Can be undo by Ctrl+Z",
            noHide: "Can't hide, at least keep one sheet tag",
            chartEditNoOpt: "This operation is not allowed in chart editing mode!",
            sheetNameSpecCharError: "The name cannot contain:[ ] :  ? * / ' \""
        },
        conditionformat: {
            conditionformat_greaterThan: "Conditionformat-GreaterThan",
            conditionformat_greaterThan_title: "Format cells greater than",
            conditionformat_lessThan: "Conditionformat-LessThan",
            conditionformat_lessThan_title: "Format cells smaller than",
            conditionformat_betweenness: "Conditionformat-Betweenness",
            conditionformat_betweenness_title: "Format cells with values between",
            conditionformat_equal: "Conditionformat-Equal",
            conditionformat_equal_title: "Format cells equal to",
            conditionformat_textContains: "Conditionformat-TextContains",
            conditionformat_textContains_title: "Format cells containing the following text",
            conditionformat_occurrenceDate: "Conditionformat-OccurrenceDate",
            conditionformat_occurrenceDate_title: "Format cells containing the following dates",
            conditionformat_duplicateValue: "Conditionformat-DuplicateValue",
            conditionformat_duplicateValue_title: "Format cells containing the following types of values",
            conditionformat_top10: "Conditionformat-Top10",
            conditionformat_top10_percent: "Conditionformat-Top10%",
            conditionformat_top10_title: "Format the cells with the highest value",
            conditionformat_last10: "Conditionformat-Last10",
            conditionformat_last10_percent: "Conditionformat-Last10%",
            conditionformat_last10_title: "Format the cells with the smallest value",
            conditionformat_AboveAverage: "Conditionformat-AboveAverage",
            conditionformat_AboveAverage_title: "Format cells above average",
            conditionformat_SubAverage: "Conditionformat-SubAverage",
            conditionformat_SubAverage_title: "Format cells below average",
            rule: "Rule",
            newRule: "New rule",
            editRule: "Edit rule",
            deleteRule: "Delete rule",
            deleteCellRule: "Delete cell rule",
            deleteSheetRule: "Delete sheet rule",
            manageRules: "Management rules",
            showRules: "Show its formatting rules",
            highlightCellRules: "Highlight cell rules",
            itemSelectionRules: "Item selection rules",
            conditionformatManageRules: "Conditional Formatting Rule Manager",
            format: "Format",
            setFormat: "Set format",
            setAs: "Set as",
            setAsByArea: "For the selected area, set to",
            applyRange: "Apply range",
            selectRange: "Select application range",
            selectRange_percent: "Percentage of selected range",
            selectRange_average: "Average value of selected range",
            selectRange_value: "Value in the selected range",
            pleaseSelectRange: "Please select application range",
            selectDataRange: "Select data range",
            selectCell: "select cell",
            pleaseSelectCell: "Please select cell",
            pleaseSelectADate: "Please select a date",
            pleaseEnterInteger: "Please enter an integer between 1 and 1000",
            onlySingleCell: "Only a single cell can be referenced",
            conditionValueCanOnly: "The condition value can only be a number or a single cell",
            ruleTypeItem1: "Format all cells based on their respective values",
            ruleTypeItem2: "Only format cells that contain",
            ruleTypeItem2_title: "Only for cells that meet the following conditions",
            ruleTypeItem3: "Format only the top or bottom numbers",
            ruleTypeItem3_title: "Is the value in the following ranking",
            ruleTypeItem4: "Format only values above or below the average",
            ruleTypeItem4_title: "Is a value that satisfies the following conditions",
            ruleTypeItem5: "Format only unique or repeated values",
            textColor: "Text color",
            cellColor: "Cell color",
            confirm: "Confirm",
            confirmColor: "Confirm color",
            cancel: "Cancel",
            close: "Close",
            clearColorSelect: "Clear color select",
            sheet: "Sheet",
            currentSheet: "Current Sheet",
            dataBar: "data bar",
            dataBarColor: "data bar color",
            gradientDataBar_1: "Blue-white gradient data bar",
            gradientDataBar_2: "Green-white gradient data bar",
            gradientDataBar_3: "Red-white gradient data bar",
            gradientDataBar_4: "Orange-white gradient stripes",
            gradientDataBar_5: "Light blue-white gradient stripes",
            gradientDataBar_6: "Purple-white gradient data bar",
            solidColorDataBar_1: "Blue data bar",
            solidColorDataBar_2: "Green data bar",
            solidColorDataBar_3: "Red data bar",
            solidColorDataBar_4: "Orange data bar",
            solidColorDataBar_5: "Light blue data bar",
            solidColorDataBar_6: "Purple data bar",
            colorGradation: "color gradation",
            colorGradation_1: "Green-yellow-red color gradation",
            colorGradation_2: "Red-yellow-green color gradation",
            colorGradation_3: "Green-white-red color gradation",
            colorGradation_4: "Red-white-green color gradation",
            colorGradation_5: "Blue-white-red color gradation",
            colorGradation_6: "Red-white-blue color gradation",
            colorGradation_7: "White-red color gradation",
            colorGradation_8: "Red-white color gradation",
            colorGradation_9: "Green-white color gradation",
            colorGradation_10: "White-green color gradation",
            colorGradation_11: "Green-yellow color gradation",
            colorGradation_12: "Yellow-green color gradation",
            icons: "icons",
            pleaseSelectIcon: "Please click to select a group of icons:",
            cellValue: "Cell value",
            specificText: "Specific text",
            occurrence: "Date",
            greaterThan: "Greater than",
            lessThan: "Less than",
            between: "Between",
            equal: "Equal",
            in: "In",
            between2: "",
            contain: "Contain",
            textContains: "Text contains",
            duplicateValue: "Duplicate value",
            uniqueValue: "Unique value",
            top: "Top",
            top10: "Top 10",
            top10_percent: "Top 10%",
            last: "Last",
            last10: "Last 10",
            last10_percent: "Last 10%",
            oneself: "",
            above: "Above",
            aboveAverage: "Above average",
            below: "Below",
            belowAverage: "Below average",
            all: "All",
            yesterday: "YTD",
            today: "Today",
            tomorrow: "Tomorrow",
            lastWeek: "Last week",
            thisWeek: "This week",
            lastMonth: "Last month",
            thisMonth: "This month",
            lastYear: "Last year",
            thisYear: "This year",
            last7days: "Last 7 days",
            last30days: "Last 30 days",
            next7days: "Next 7 days",
            next30days: "Next 30 days",
            next60days: "Next 60 days",
            chooseRuleType: "Choose rule type",
            editRuleDescription: "Edit rule description",
            newFormatRule: "New format rule",
            editFormatRule: "Edit format rule",
            formatStyle: "Style",
            fillType: "Fill",
            color: "Color",
            twocolor: "Two-color",
            tricolor: "Tricolor",
            multicolor: "Multi color",
            grayColor: "Gray color",
            gradient: "Gradient",
            solid: "Solid",
            maxValue: "Max value",
            medianValue: "Median value",
            minValue: "Min value",
            direction: "Direction",
            threeWayArrow: "Three-way arrow",
            fourWayArrow: "Four-way arrow",
            fiveWayArrow: "Five-way arrow",
            threeTriangles: "Three triangles",
            shape: "Shape",
            threeColorTrafficLight: "Three-color traffic light",
            fourColorTrafficLight: "Four-color traffic light",
            threeSigns: "Three signs",
            greenRedBlackGradient: "Green-red-black gradient",
            rimless: "Rimless",
            bordered: "Bordered",
            mark: "Mark",
            threeSymbols: "Three symbols",
            tricolorFlag: "Tricolor flag",
            circled: "Circled",
            noCircle: "No circle",
            grade: "Grade",
            grade4: "4 Grade",
            grade5: "5 Grade",
            threeStars: "3 Stars",
            fiveQuadrantDiagram: "Five-quadrant diagram",
            fiveBoxes: "5 Boxes"
        },
        insertLink: {
            linkText: "Text",
            linkType: "Link type",
            external: "External link",
            internal: "Internal link",
            linkAddress: "Link address",
            linkSheet: "Worksheet",
            linkCell: "Cell reference",
            linkTooltip: "Tooltip",
            placeholder1: "Please enter the web link address",
            placeholder2: "Please enter the cell to be quoted, example A1",
            placeholder3: "Please enter the prompt content",
            tooltipInfo1: "Please enter a valid link",
            tooltipInfo2: "Please enter the correct cell reference"
        },
        dataVerification: {
            cellRange: "Cell range",
            selectCellRange: "Click to select a cell range",
            selectCellRange2: "Please select a range of cells",
            verificationCondition: "Verification condition",
            dropdown: "drop-down list",
            checkbox: "Checkbox",
            number: "Number",
            number_integer: "Number-integer",
            number_decimal: "Number-decimal",
            text_content: "Text-content",
            text_length: "Text-length",
            date: "Date",
            validity: "Effectiveness",
            placeholder1: "Please enter the options, separated by commas, such as 1,2,3,4,5",
            placeholder2: "Please enter content",
            placeholder3: "Numeric value, such as 10",
            placeholder4: "Please enter the specified text",
            placeholder5: "Please enter the prompt displayed when the cell is selected",
            selected: "Selected",
            notSelected: "Not selected",
            between: "Between",
            notBetween: "Not between",
            equal: "Equal",
            notEqualTo: "Not equal to",
            moreThanThe: "More than the",
            lessThan: "Less than",
            greaterOrEqualTo: "Greater or equal to",
            lessThanOrEqualTo: "Less than or equal to",
            include: "Include",
            exclude: "Exclude",
            earlierThan: "Earlier than",
            noEarlierThan: "No earlier than",
            laterThan: "Later than",
            noLaterThan: "No later than",
            identificationNumber: "Identification number",
            phoneNumber: "Phone number",
            remote: "Automatic remote acquisition option",
            prohibitInput: "Prohibit input when input data is invalid",
            hintShow: "Show prompt when the cell is selected",
            deleteVerification: "Delete verification",
            tooltipInfo1: "The drop-down list option cannot be empty",
            tooltipInfo2: "Checkbox content cannot be empty",
            tooltipInfo3: "The value entered is not a numeric type",
            tooltipInfo4: "The value 2 cannot be less than the value 1",
            tooltipInfo5: "The text content cannot be empty",
            tooltipInfo6: "The value entered is not a date type",
            tooltipInfo7: "Date 2 cannot be less than date 1"
        },
        formula: {
            sum: "Sum",
            average: "Average",
            count: "Count",
            max: "Max",
            min: "Min",
            ifGenerate: "If formula generator",
            find: "Learn more",
            tipNotBelongToIf: "This cell function does not belong to the if formula!",
            tipSelectCell: "Please select the cell to insert the function",
            ifGenCompareValueTitle: "Comparison value",
            ifGenSelectCellTitle: "Click to select cell",
            ifGenRangeTitle: "Range",
            ifGenRangeTo: "to",
            ifGenRangeEvaluate: "Range evaluate",
            ifGenSelectRangeTitle: "Click to select range",
            ifGenCutWay: "Partition way",
            ifGenCutSame: "Same Partition value",
            ifGenCutNpiece: "Partition by N",
            ifGenCutCustom: "Custom",
            ifGenCutConfirm: "Confirm",
            ifGenTipSelectCell: "Select cells",
            ifGenTipSelectCellPlace: "Please select cells",
            ifGenTipSelectRange: "Select range",
            ifGenTipSelectRangePlace: "Please select range",
            ifGenTipNotNullValue: "The comparison value cannot be empty!",
            ifGenTipLableTitile: "Label",
            ifGenTipRangeNotforNull: "The range cannot be empty!",
            ifGenTipCutValueNotforNull: "The partition value cannot be empty!",
            ifGenTipNotGenCondition: "No conditions are available for generation!"
        },
        formulaMore: {
            valueTitle: "Value",
            tipSelectDataRange: "Select data range",
            tipDataRangeTile: "Data range",
            findFunctionTitle: "Search function",
            tipInputFunctionName: "Function name or brief description of function",
            Array: "Array",
            Database: "Database",
            Date: "Date",
            Engineering: "Engineering",
            Filter: "Filter",
            Financial: "Financial",
            luckysheet: "Luckysheet",
            other: "Other",
            Logical: "Logical",
            Lookup: "Lookup",
            Math: "Math",
            Operator: "Operator",
            Parser: "Parser",
            Statistical: "Statistical",
            Text: "Text",
            dataMining: "Data Mining",
            selectFunctionTitle: "Select a function",
            calculationResult: "Result",
            tipSuccessText: "Success",
            tipParamErrorText: "Parameter type error",
            helpClose: "Close",
            helpCollapse: "Collapse",
            helpExample: "Example",
            helpAbstract: "Abstract",
            execfunctionError: "Error in the formula",
            execfunctionSelfError: "The formula cannot refer to its own cell",
            execfunctionSelfErrorResult: "The formula cannot refer to its own cell, which will lead to inaccurate calculation results",
            allowRepeatText: "Repeat",
            allowOptionText: "Option",
            selectCategory: "Or select a category"
        },
        drag: {
            noMerge: "Cannot perform this operation on merged cells",
            affectPivot: "This change cannot be made to the selected cell because it will affect the pivot table!",
            noMulti: "Cannot perform this operation on multiple selection areas, please select a single area",
            noPaste: "Unable to paste this content here, please select a cell in the paste area and try to paste again",
            noPartMerge: "Cannot perform this operation on partially merged cells",
            inputCorrect: "Please enter the correct value",
            notLessOne: "The number of rows and columns cannot be less than 1",
            offsetColumnLessZero: "The offset column cannot be negative!",
            pasteMustKeybordAlert: "在表格中进行复制粘贴: Ctrl + C 进行复制, Ctrl + V 进行粘贴, Ctrl + X 进行剪切",
            pasteMustKeybordAlertHTMLTitle: "在表格中进行复制粘贴",
            pasteMustKeybordAlertHTML: "<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切"
        },
        pivotTable: {
            title: "Pivot Table",
            closePannel: "Close",
            editRange: "Range",
            tipPivotFieldSelected: "Select the fields",
            tipClearSelectedField: "Clear all fields",
            btnClearSelectedField: "Clear",
            btnFilter: "Filter",
            titleRow: "Row",
            titleColumn: "Column",
            titleValue: "Value",
            tipShowColumn: "Statistics fields are displayed as columns",
            tipShowRow: "Statistics fields are displayed as rows",
            titleSelectionDataRange: "Select range",
            titleDataRange: "Data range",
            valueSum: "SUM",
            valueStatisticsSUM: "Sum",
            valueStatisticsCOUNT: "Count",
            valueStatisticsCOUNTA: "Count A",
            valueStatisticsCOUNTUNIQUE: "Count Unique",
            valueStatisticsAVERAGE: "Average",
            valueStatisticsMAX: "Max",
            valueStatisticsMIN: "Min",
            valueStatisticsMEDIAN: "Median",
            valueStatisticsPRODUCT: "Product",
            valueStatisticsSTDEV: "Stdev",
            valueStatisticsSTDEVP: "Stdevp",
            valueStatisticslet: "Var",
            valueStatisticsVARP: "VarP",
            errorNotAllowEdit: "This operation is prohibited in non-editing mode!",
            errorNotAllowMulti: "Cannot perform this operation on multiple selection areas, please select a single range and try again",
            errorSelectRange: "Please select the range of the new pivot table",
            errorIsDamage: "The source data of this pivot table is corrupted!",
            errorNotAllowPivotData: "Cannot select pivot table as source data!",
            errorSelectionRange: "Selection failed, wrong input range!",
            errorIncreaseRange: "Please expand the selected range!",
            titleAddColumn: "Add column to pivot table",
            titleMoveColumn: "Move the column to the white box below",
            titleClearColumnFilter: "Clear the filter for this column",
            titleFilterColumn: "Filter",
            titleSort: "Sort",
            titleNoSort: "No sort",
            titleSortAsc: "ASC",
            titleSortDesc: "DESC",
            titleSortBy: "Sort by",
            titleShowSum: "Show total",
            titleStasticTrue: "Yes",
            titleStasticFalse: "No"
        },
        dropCell: {
            copyCell: "Copy",
            sequence: "Sequence",
            onlyFormat: "Only format",
            noFormat: "Not format",
            day: "Day",
            workDay: "Work Day",
            month: "Month",
            year: "Year",
            chineseNumber: "Chinese numbers"
        },
        imageCtrl: {
            borderTile: "Image border color",
            borderCur: "Color"
        },
        protection: {
            protectiontTitle: "Protection",
            enterPassword: "Enter a password (optional)",
            enterHintTitle: "Prompt when editing is prohibited (optional)",
            enterHint: "The cell or chart you are trying to change is in a protected worksheet. If you want to change it, please unprotect the worksheet. You may need to enter a password",
            swichProtectionTip: "Protect the sheet and contents of locked cells",
            authorityTitle: "Allow users of this sheet to:",
            selectLockedCells: "Select locked cells",
            selectunLockedCells: "Select unlocked cells",
            formatCells: "Format cells",
            formatColumns: "Format columns",
            formatRows: "Format rows",
            insertColumns: "Insert columns",
            insertRows: "Insert rows",
            insertHyperlinks: "Insert hyperlinks",
            deleteColumns: "Delete columns",
            deleteRows: "Delete rows",
            sort: "Sort",
            filter: "Filter",
            usePivotTablereports: "Use Pivot Table reports",
            editObjects: "Edit objects",
            editScenarios: "Edit scenarios",
            allowRangeTitle: "Allow users of range to:",
            allowRangeAdd: "New...",
            allowRangeAddTitle: "Title",
            allowRangeAddSqrf: "Reference",
            selectCellRange: "Click to select a cell range",
            selectCellRangeHolder: "Cell range",
            allowRangeAddTitlePassword: "Password",
            allowRangeAddTitleHint: "Prompt",
            allowRangeAddTitleHintTitle: "Prompt when a password is set (optional)",
            allowRangeAddtitleDefault: "Input range name",
            rangeItemDblclick: "Double click to edit",
            rangeItemHasPassword: "Has password",
            rangeItemErrorTitleNull: "Title is null",
            rangeItemErrorRangeNull: "Reference is null",
            rangeItemErrorRange: "Reference is error",
            validationTitle: "Password validation",
            validationTips: "Need to enter a password to unlock the protection of the worksheet",
            validationInputHint: "Enter a password",
            checkPasswordNullalert: "Password is required!",
            checkPasswordWrongalert: "Incorrect password, please try again!",
            checkPasswordSucceedalert: "Unlock Succeed!",
            defaultRangeHintText: "The cell is being password protected.",
            defaultSheetHintText: "The cell or chart is in a protected worksheet. To make changes, please unprotect the worksheet. You may need to enter a password"
        },
        cellFormat: {
            cellFormatTitle: "Format cells",
            protection: "Protection",
            locked: "Locked",
            hidden: "Hidden",
            protectionTips: "To lock cells or hide formulas, protect the worksheet. On the toolbar, Click Protect Sheet Button",
            tipsPart: "Partial checked",
            tipsAll: "All checked",
            selectionIsNullAlert: "Selection is required!",
            sheetDataIsNullAlert: "error, Data is none!"
        },
        print: {
            normalBtn: "Normal",
            layoutBtn: "Page Layout",
            pageBtn: "Page break preview",
            menuItemPrint: "Print (Ctrl+P)",
            menuItemAreas: "Print areas",
            menuItemRows: "Print title rows",
            menuItemColumns: "Print title columns"
        }
    }, _filter, zh = {
        functionlist: [{
            n: "SUMIF",
            t: 0,
            d: "对范围中符合指定条件的值求和。",
            a: "对范围中符合指定条件的值求和。",
            m: [2, 3],
            p: [{
                name: "范围",
                detail: "要根据条件进行检测的范围。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "条件",
                detail: "要应用于范围的模式或测试条件。\n\n如果范围包含的是要检测的文本，则条件必须为字符串。条件可以包含通配符，包括用于匹配单个字符的?或用于匹配零个或连续多个字符的*。要匹配问号星号本身，请在该字符前面加上波浪号(~)前缀（即~?和~*）。字符串条件必须用引号括起来。函数会检查范围中的每个单元格与条件是否相等或匹配（如果使用了通配符）。\n\n如果范围包含的是要检测的数字，则条件可以是字符串也可以是数字。如果给定的条件是一个数字，则检查范围中的每个单元格是否等于条件。另外，条件也可能是包含数字的字符串（也将对其进行相等检测），或者带有以下前缀的数字：=（检查是否相等）、>（检查范围单元格的值是否大于条件值）或<（检查范围单元格的值是否小于条件值）",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "求和范围",
                detail: "要求和的范围（如果与范围不同）。",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TAN",
            t: 0,
            d: "返回已知角度的正切值。",
            a: "返回已知角度的正切值。",
            m: [1, 1],
            p: [{
                name: "角度",
                detail: "要求其正切值的角度，以弧度表示。",
                example: "45*PI()/180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TANH",
            t: 0,
            d: "返回给定实数的双曲正切值。",
            a: "返回给定实数的双曲正切值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其双曲正切值的实数。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CEILING",
            t: 0,
            d: "将数值向上取整为最接近的指定因数的倍数。",
            a: "将数值向上取整为最接近的指定因数的倍数。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "要向上舍入的数值。",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "因数",
                detail: "要将值舍入到此数的整数倍。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN",
            t: 0,
            d: "返回数值的反正切值，以弧度表示。",
            a: "返回数值的反正切值",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反正切值的数值。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ASINH",
            t: 0,
            d: "返回数值的反双曲正弦值。",
            a: "返回数值的反双曲正弦值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反双曲正弦值的数值。",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ABS",
            t: 0,
            d: "返回数值的绝对值。",
            a: "返回数值的绝对值。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要返回其绝对值的数。",
                example: "-2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOS",
            t: 0,
            d: "返回数值的反余弦值，以弧度表示。",
            a: "返回数值的反余弦值",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反余弦值的数值。必须介于-1和1之间，包括两端值。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOSH",
            t: 0,
            d: "返回数值的反双曲余弦值。",
            a: "返回数值的反双曲余弦值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反双曲余弦值的数值。必须大于等于1。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTINOMIAL",
            t: 0,
            d: "返回参数和的阶乘除以各参数阶乘的乘积后得到的值。",
            a: "返回参数和的阶乘除以各参数阶乘的乘积后得到的值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "用于计算的第一项数值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2",
                detail: "用于计算的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "ATANH",
            t: 0,
            d: "返回数值的反双曲正切值。",
            a: "返回数值的反双曲正切值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反双曲正切值的数值。必须介于-1和1之间（不包括-1和1）。",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN2",
            t: 0,
            d: "以弧度为单位返回 x 轴与从原点 (0,0) 到指定坐标点 (`x`,`y`) 之间连线的夹角。",
            a: "以弧度为单位返回 x 轴与从原点 (0,0) 到指定坐标点 (`x`,`y`) 之间连线的夹角。",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "要计算其与x轴夹角大小的线段的终点x坐标。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "y",
                detail: "要计算其与x轴夹角大小的线段的终点y坐标。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTBLANK",
            t: 1,
            d: "返回给定范围内的空单元格数。",
            a: "返回给定范围内的空单元格数。",
            m: [1, 1],
            p: [{
                name: "范围",
                detail: "要统计空白单元格数量的范围。",
                example: "A2:C100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "COSH",
            t: 0,
            d: "返回给定实数的双曲余弦值。",
            a: "返回给定实数的双曲余弦值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其双曲余弦值的实数值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INT",
            t: 0,
            d: "将数值向下取整为小于或等于该数的最接近的整数。",
            a: "将数值向下取整为小于或等于该数的最接近的整数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要向下取整为最接近的整数的数值。",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISEVEN",
            t: 0,
            d: "检查所提供的数值是否为偶数。",
            a: "检查所提供的数值是否为偶数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要验证其是否为偶数的数值。\n\n如果值为偶数或指向包含偶数的单元格的引用，ISEVEN将返回TRUE，否则返回FALSE。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISODD",
            t: 0,
            d: "检查所提供的数值是否为奇数。",
            a: "检查所提供的数值是否为奇数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要验证其是否为奇数的数值。\n\n如果值为奇数或指向包含奇数的单元格，ISODD将返回TRUE，否则返回FALSE。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LCM",
            t: 0,
            d: "返回一个或多个整数的最小公倍数。",
            a: "返回一个或多个整数的最小公倍数。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "要在求最小公倍数数的计算中检查其因数的第一项数值或范围。",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2",
                detail: "[可选] - 在求最小公倍数时要考虑其因数的其他数值或范围。",
                example: "3",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LN",
            t: 0,
            d: "返回数值以 e（欧拉数）为底的对数。",
            a: "返回数值以 e（欧拉数）为底的对数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要以 e 为底数计算其对数的值。\n\n值必须为正数。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG",
            t: 0,
            d: "根据指定底数返回数字的对数。",
            a: "根据指定底数返回数字的对数。",
            m: [1, 2],
            p: [{
                name: "值",
                detail: "想要计算其对数的正实数。",
                example: "128",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "底数",
                detail: "[可选] - 对数的底数。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG10",
            t: 0,
            d: "返回数值以10为底的对数。",
            a: "返回数值以10为底的对数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其以10为底的对数的数值。\n\n值必须为正值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MOD",
            t: 0,
            d: "返回两数相除的余数, 结果的符号与除数相同。",
            a: "返回两数相除的余数。",
            m: [2, 2],
            p: [{
                name: "被除数",
                detail: "要将其相除以得到余数的数值。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "除数",
                detail: "用于除其他数的数值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MROUND",
            t: 0,
            d: "将数值取整为另一整数最接近的整数倍。",
            a: "将数值取整为另一整数最接近的整数倍。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "要取整为另一整数最接近的整数倍的数值。",
                example: "21",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "因数",
                detail: "值将取此因数的整数倍。",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ODD",
            t: 0,
            d: "将数值向上取整为最接近的奇整数。",
            a: "将数值向上取整为最接近的奇整数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要向上取整的数值，取整值为大于此值的最接近的奇数。\n\n如果值为负数，则将其取整为绝对值大于该值的相邻负奇数。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMSQ",
            t: 0,
            d: "返回一组数值和/或单元格的平方总和。",
            a: "返回一组数值和/或单元格的平方总和。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "要将其平方相加的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 要将其平方与值1的平方相加的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMBIN",
            t: 0,
            d: "给定集合中的对象总数和要选择的对象数量，返回共有多少种不同选择方式。",
            a: "给定集合中的对象总数和要选择的对象数量",
            m: [2, 2],
            p: [{
                name: "n",
                detail: "要从中进行选择的对象集合的大小。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "要选择的对象数量。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUM",
            t: 0,
            d: "返回一组数值和/或单元格的总和。",
            a: "返回一组数值和/或单元格的总和。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "要相加的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2",
                detail: "[可选] - 要相加的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SUBTOTAL",
            t: 0,
            d: "使用指定的汇总函数，返回一系列纵向单元格的分类汇总。",
            a: "使用指定的汇总函数",
            m: [2, 256],
            p: [{
                name: "函数代码",
                detail: "用于计算分类汇总的函数。\n\n1代表AVERAGE\n\n2代表COUNT\n\n3代表COUNTA\n\n4代表MAX\n\n5代表MIN\n\n6代表PRODUCT\n\n7代表STDEV\n\n8代表STDEVP\n\n9代表SUM\n\n10代表VAR\n\n11代表VARP\n\n通过在这些2位代码前附加10（对于1位代码）或1（对于2位代码），可以将隐藏值忽略。例如，102代表忽略隐藏单元格的COUNT，而110则代表忽略隐藏值的VAR。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "范围1",
                detail: "要计算分类汇总的第一个范围。",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "范围2",
                detail: "[可选] - 要计算分类汇总的其他范围。",
                example: "B2:B8",
                require: "o",
                repeat: "y",
                type: "range"
            }]
        }, {
            n: "ASIN",
            t: 0,
            d: "返回数值的反正弦值，以弧度表示。",
            a: "返回数值的反正弦值",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其反正弦值的数值。必须介于-1和1之间，包括两端值。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTIF",
            t: 1,
            d: "返回范围内满足某个条件的单元格的数量。",
            a: "返回范围内满足某个条件的单元格的数量。",
            m: [2, 2],
            p: [{
                name: "范围",
                detail: "要根据条件进行检测的范围。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "条件",
                detail: "要应用于范围的模式或测试条件。\n\n如果范围包含的是要检测的文本，则条件必须为字符串。条件可以包含通配符，包括用于匹配单个字符的?或用于匹配零个或连续多个字符的*。要匹配问号星号本身，请在该字符前面加上波浪号(~)前缀（即~?和~*）。字符串条件必须用引号括起来。函数会检查范围中的每个单元格与条件是否相等或匹配（如果使用了通配符）。\n\n如果范围包含的是要检测的数字，则条件可以是字符串也可以是数字。如果给定的条件是一个数字，则检查范围中的每个单元格是否等于条件。另外，条件也可能是包含数字的字符串（也将对其进行相等检测），或者带有以下前缀的数字：=、>、>=、<或<=，这些条件将分别用于检查范围中的单元格是否等于、大于、大于等于、小于、小于等于条件值。",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RADIANS",
            t: 0,
            d: "将以度表示的角度值转换为弧度。",
            a: "将以度表示的角度值转换为弧度。",
            m: [1, 1],
            p: [{
                name: "角度",
                detail: "要从度转换为弧度的角度。",
                example: "180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RAND",
            t: 0,
            d: "返回一个介于0和1之间（包括0但不包括1）的随机数。",
            a: "返回一个介于0和1之间（包括0但不包括1）的随机数。",
            m: [0, 0],
            p: []
        }, {
            n: "COUNTUNIQUE",
            t: 0,
            d: "计算一列指定值和范围中不重复数值的个数。",
            a: "计算一列指定值和范围中不重复数值的个数。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "要检查其是否唯一的第一个值或范围。",
                example: "A1:C100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2",
                detail: "[可选] - 要检查是否唯一的其他值或范围。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DEGREES",
            t: 0,
            d: "将以弧度表示的角度值转换为度。",
            a: "将以弧度表示的角度值转换为度。",
            m: [1, 1],
            p: [{
                name: "角度",
                detail: "要从弧度转换为度的角度。",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ERFC",
            t: 9,
            d: "返回数值的互补高斯误差函数。",
            a: "返回数值的互补高斯误差函数。",
            m: [1, 1],
            p: [{
                name: "z",
                detail: "要为其计算互补高斯误差函数的数值。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EVEN",
            t: 0,
            d: "将数值向上取整为最接近的偶整数。",
            a: "将数值向上取整为最接近的偶整数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要向上取整的数值，取整值为大于此值的最接近的偶数。\n\n如果值为负数，则将其取整为绝对值大于该值的相邻负偶数。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EXP",
            t: 0,
            d: "返回欧拉数 e (~2.718) 的指定次幂。",
            a: "返回欧拉数 e (~2.718) 的指定次幂。",
            m: [1, 1],
            p: [{
                name: "指数",
                detail: "指定e的自乘幂次值。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACT",
            t: 0,
            d: "返回数值的阶乘。",
            a: "返回数值的阶乘。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算并返回其阶乘的数字或对数字（所在单元格）的引用。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACTDOUBLE",
            t: 0,
            d: "返回数值的“双阶乘”。",
            a: "返回数值的“双阶乘”。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算并返回其双阶乘的数字或对数字（所在单元格）的引用。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PI",
            t: 0,
            d: "返回带有14位小数的 PI 值。",
            a: "返回带有14位小数的 PI 值。",
            m: [0, 0],
            p: []
        }, {
            n: "FLOOR",
            t: 0,
            d: "将数值向下取整为指定因数的最接近的整数倍。",
            a: "将数值向下取整为指定因数的最接近的整数倍。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "要向下舍入为因数的最接近整数倍的数值。",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "因数",
                detail: "要将值舍入到此数的整数倍。\n\n因数不得为0。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GCD",
            t: 0,
            d: "返回一个或多个整数的最大公约数。",
            a: "返回一个或多个整数的最大公约数。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "要在查找最大公约数的计算中检查其因数的第一项数值或范围。",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2",
                detail: "[可选] - 在求最大公约数时要考虑其因数的其他数值或范围。",
                example: "96",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANDBETWEEN",
            t: 0,
            d: "返回介于两个整数之间（包括这两个整数）的随机数。",
            a: "返回介于两个整数之间（包括这两个整数）的随机数。",
            m: [2, 2],
            p: [{
                name: "下界",
                detail: "随机值范围的下界。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "上界",
                detail: "随机值范围的上界。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUND",
            t: 0,
            d: "将数字四舍五入到指定的位数。",
            a: "将数字四舍五入到指定的位数。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "要四舍五入的数字。",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "位数",
                detail: "要进行四舍五入运算的位数。\n\n位数可以取负值，在这种情况下会将值的小数点左侧部分舍入到指定的位数。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDDOWN",
            t: 0,
            d: "朝着零的方向将数字进行向下舍入。",
            a: "朝着零的方向将数字进行向下舍入。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "需要向下舍入的任意实数。",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "位数",
                detail: "要通过舍入达到的小数位数。\n\n位数可以取负值，在这种情况下会将值的小数点左侧部分舍入到指定的位数。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDUP",
            t: 0,
            d: "朝着远离 0（零）的方向将数字进行向上舍入。",
            a: "朝着远离 0（零）的方向将数字进行向上舍入。",
            m: [2, 2],
            p: [{
                name: "值",
                detail: "要将其舍入为位数位数字的值，始终向上舍入。",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "位数",
                detail: "要通过舍入达到的小数位数。\n\n位数可以取负值，在这种情况下会将值的小数点左侧部分舍入到指定的位数。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SERIESSUM",
            t: 0,
            d: "给定参数 x、n、m 和 a，返回幂级数的和 a1xn + a2x(n+m) + ... + aix(n+(i-1)m)，其中 i 为范围 a 中的项数。",
            a: "给定参数 x、n、m 和 a",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "幂级数的输入值。随相应的近似类型而变，有可能为角度、指数或其他一些值。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "在幂级数中x的初始自乘幂次。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "m",
                detail: "x的幂次中的附加增量。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "a",
                detail: "包含幂级数系数的数组或范围。",
                example: "{FACT(0)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIGN",
            t: 0,
            d: "给定输入数值，如果为负返回-1；如果为正返回1；如果为零则返回0。",
            a: "给定输入数值",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要返回其符号的数值。",
                example: "-42",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIN",
            t: 0,
            d: "给定角度（以弧度表示），返回其正弦值。",
            a: "给定角度（以弧度表示）",
            m: [1, 1],
            p: [{
                name: "角度",
                detail: "要返回其正弦值的角度，以弧度表示。",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SINH",
            t: 0,
            d: "返回给定实数的双曲正弦值。",
            a: "返回给定实数的双曲正弦值。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其双曲正弦值的实数值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRT",
            t: 0,
            d: "返回一个正数的正平方根。",
            a: "返回一个正数的正平方根。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要计算其正平方根的数值。\n\n值必须为正数；如果为负，SQRT 将返回 #NUM! 错误。",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRTPI",
            t: 0,
            d: "返回 PI 与给定正数乘积的正平方根。",
            a: "返回 PI 与给定正数乘积的正平方根。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "要将其与 PI 相乘并返回该乘积的平方根的数值\n\n值必须为正数；如果为负数，SQRTPI 将返回 #NUM! 错误。",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GAMMALN",
            t: 1,
            d: "返回指定伽玛函数的以 e（欧拉数）为底的对数。",
            a: "返回指定伽玛函数的以 e（欧拉数）为底的对数。",
            m: [1, 1],
            p: [{
                name: "值",
                detail: "伽玛函数的输入值。返回的将是伽玛 (值) 的自然对数。\n\n值必须为正数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COS",
            t: 0,
            d: "返回给定角度的余弦值（角度以弧度表示）。",
            a: "返回给定角度的余弦值（角度以弧度表示）。",
            m: [1, 1],
            p: [{
                name: "角度",
                detail: "要取其余弦值的角度，以弧度表示。",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRUNC",
            t: 0,
            d: "截除指定有效位之外的部分，取数据的指定有效位。",
            a: "截除指定有效位之外的部分",
            m: [1, 2],
            p: [{
                name: "值",
                detail: "要截取的数据。",
                example: "3.141592654",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "位数",
                detail: "[可选 - 默认值为0] - 小数点右侧要保留的有效位数。\n\n如果位数大于值中的有效位数，则将“值”原样返回。\n\n位数可以取负值，在这种情况下会将小数点左侧指定位数的值更改为零。小数点右侧的所有位数都会被舍弃。如果值的所有位都被更改为零，则TRUNC会返回0。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUOTIENT",
            t: 0,
            d: "返回以一个数除以另一个数所得的结果，不包含余数。",
            a: "返回以一个数除以另一个数所得的结果",
            m: [2, 2],
            p: [{
                name: "被除数",
                detail: "要被除的数值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "除数",
                detail: "用于除其他数的数值。\n\n除数不得为0。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POWER",
            t: 0,
            d: "返回数值的指定次幂。",
            a: "返回数值的指定次幂。",
            m: [2, 2],
            p: [{
                name: "底数",
                detail: "要计算其指数次幂的数值。\n\n如果底数为负，则指数必须为整数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "指数",
                detail: "指定底数的自乘幂次值。",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMIFS",
            t: 0,
            d: "根据多项条件返回范围之和。",
            a: "根据多项条件返回范围之和。",
            m: [3, 257],
            p: [{
                name: "求和范围",
                detail: "要对其求和的范围。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "条件范围1",
                detail: "要在哪个范围内检查条件1。",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "条件1",
                detail: "要应用于条件范围1的模式或测试条件。",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "条件范围2, 条件2...",
                detail: "[ 可选 ] - 要检查的其他范围和条件。",
                example: " C1:C10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTIFS",
            t: 1,
            d: "根据多项条件返回范围中的单元格数量。",
            a: "根据多项条件返回范围中的单元格数量。",
            m: [2, 256],
            p: [{
                name: "条件范围1",
                detail: "要在哪个范围内检查条件1。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "条件1",
                detail: "要应用于条件范围1的模式或测试条件。",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "条件范围2, 条件2...",
                detail: "[ 可选 ] - 要检查的其他范围和条件，可重复。",
                example: " B1:B10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PRODUCT",
            t: 0,
            d: "返回将一组数相乘所得的结果。",
            a: "返回将一组数相乘所得的结果。",
            m: [1, 255],
            p: [{
                name: "乘数1",
                detail: "用于计算乘积的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "乘数2 ... 乘数30",
                detail: "[可选] - 要相乘的其他数值。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HARMEAN",
            t: 1,
            d: "计算数据集的调和平均值。",
            a: "计算数据集的调和平均值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HYPGEOMDIST",
            t: 1,
            d: "返回超几何分布。 如果已知样本量、总体成功次数和总体大小，则 HYPGEOM.DIST 返回样本取得已知成功次数的概率。",
            a: "返回超几何分布。",
            m: [5, 5],
            p: [{
                name: "Sample_s",
                detail: "样本中成功的次数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Number_sample",
                detail: "样本量。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Population_s",
                detail: "总体中成功的次数。",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Number_pop",
                detail: "总体大小。",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "决定函数形式的逻辑值。\n\n如果 cumulative 为 TRUE()，则 HYPGEOM.DIST 返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INTERCEPT",
            t: 1,
            d: "计算数据集的线性回归方程直线与 Y 轴的相交点 (x=0) 的 y 值。",
            a: "计算数据集的线性回归方程直线与 Y 轴的相交点 (x=0) 的 y 值。",
            m: [2, 2],
            p: [{
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "KURT",
            t: 1,
            d: "计算数据集的峭度，该指标指示数据集（分布）的形态，尤其是该形态的陡峭程度。",
            a: "计算数据集的峭度",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "数据集中的第一个值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LARGE",
            t: 1,
            d: "返回数据集中第 n 个最大元素，n 由用户指定。",
            a: "返回数据集中第 n 个最大元素",
            m: [2, 2],
            p: [{
                name: "数据",
                detail: "包含相关数据集的数组或范围。",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "要返回的元素的排行位置（从大到小顺序）。\n\n例如，将n设为4将使LARGE返回数据中排名第4的最大元素。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVA",
            t: 1,
            d: "基于样本计算标准偏差，将文本取值为0。",
            a: "基于样本计算标准偏差",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2,…",
                detail: "[可选] - 样本中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVP",
            t: 1,
            d: "基于样本总体计算标准偏差。",
            a: "基于样本总体计算标准偏差。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "数据集中的第一个值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "GEOMEAN",
            t: 1,
            d: "计算数据集的几何平均值。",
            a: "计算数据集的几何平均值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANK_EQ",
            t: 1,
            d: "返回指定值在数据集中的排名。如果相同的值在数据集中存在多项，则返回其中的最高排名。",
            a: "返回指定值在数据集中的排名。如果相同的值在数据集中存在多项，则返回其中的最高排名。",
            m: [2, 3],
            p: [{
                name: "number",
                detail: "要确定其排名的值。",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "ref",
                detail: "包含相关数据集的数组或范围。",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "order",
                detail: "[可选 - 默认为按降序 (FALSE()) ] - 要按升序还是按降序考虑“data”中的值。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANK_AVG",
            t: 1,
            d: "返回指定值在数据集中的排名。如果相同的值在数据集中存在多项，则返回这些项排名的平均值。",
            a: "返回指定值在数据集中的排名。如果相同的值在数据集中存在多项，则返回这些项排名的平均值。",
            m: [2, 3],
            p: [{
                name: "number",
                detail: "要确定其排名的值。",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "ref",
                detail: "包含相关数据集的数组或范围。",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "order",
                detail: "[可选 - 默认为按降序 (FALSE()) ] - 要按升序还是按降序考虑“data”中的值。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERCENTRANK_EXC",
            t: 1,
            d: "以百分数形式返回指定值在给定数据集中的百分比排名（介于0和1之间，不包括两端值）。",
            a: "以百分数形式返回指定值在给定数据集中的百分比排名（介于0和1之间，不包括两端值）。",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "包含相关数据集的数组或范围。",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "x",
                detail: "要确定其百分比排位的值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significance",
                detail: "[可选 - 默认值为 3] - 要在计算中使用的有效位数。",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTRANK_INC",
            t: 1,
            d: "以百分比形式返回指定值在给定数据集中的百分比排名（介于0和1之间，包括两端值）。",
            a: "以百分比形式返回指定值在给定数据集中的百分比排名（介于0和1之间，包括两端值）。",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "包含相关数据集的数组或范围。",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "x",
                detail: "要确定其百分比排位的值。",
                example: " A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significance",
                detail: "[可选 - 默认值为 3] - 要在计算中使用的有效位数。",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FORECAST",
            t: 1,
            d: "基于数据集的线性回归，计算指定 x 的预期 y 值。",
            a: "基于数据集的线性回归",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "x轴上用于预测的值。",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHERINV",
            t: 1,
            d: "返回指定数值的 Fisher 逆变换。",
            a: "返回指定数值的 Fisher 逆变换。",
            m: [1, 1],
            p: [{
                name: "y",
                detail: "要计算其Fisher逆变换的数值。",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHER",
            t: 1,
            d: "返回指定数值的 Fisher 变换。",
            a: "返回指定数值的 Fisher 变换。",
            m: [1, 1],
            p: [{
                name: "x",
                detail: "要计算其Fisher变换的数值。",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MODE_SNGL",
            t: 1,
            d: "返回数据集中出现次数最多的值。",
            a: "返回数据集中出现次数最多的值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算模式时要检查的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计算模式时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "WEIBULL_DIST",
            t: 1,
            d: "给定形状和尺度，返回韦伯分布函数（或韦伯累积分布函数）的值。",
            a: "给定形状和尺度",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "WEIBULL 分布函数的输入值。",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "alpha",
                detail: "Weibull 分布函数的形状参数。\n\nalpha 值必须大于 0。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "beta",
                detail: "Weibull 分布函数的尺度参数。\n\nbeta 值必须大于 0。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "TRUE() 表示使用累积分布函数，FALSE() 则表示使用概率密度函数。",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COUNT",
            t: 1,
            d: "返回数据集中数值的个数。",
            a: "返回数据集中数值的个数。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计数时要检查的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计数时要检查的其他值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTA",
            t: 1,
            d: "返回数据集中值的数量。",
            a: "返回数据集中值的数量。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计数时要检查的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计数时要检查的其他值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVEDEV",
            t: 1,
            d: "计算数据与数据集均值之间的偏差大小的平均值。",
            a: "计算数据与数据集均值之间的偏差大小的平均值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 样本中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "AVERAGE",
            t: 1,
            d: "返回数据集的算术平均值，对文本忽略不计。",
            a: "返回数据集的算术平均值",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算平均值时用到的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计算平均值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEA",
            t: 1,
            d: "返回数据集的算术平均值。",
            a: "返回数据集的算术平均值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算平均值时用到的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计算平均值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_DIST",
            t: 1,
            d: "返回一元二项式分布的概率。",
            a: "返回一元二项式分布的概率。",
            m: [4, 4],
            p: [{
                name: "number_s",
                detail: "试验的成功次数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "trials",
                detail: "独立检验的次数。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "probability_s",
                detail: "任一给定检验的成功概率。",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "是否使用二项式累积分布。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_INV",
            t: 1,
            d: "计算累积二项式分布大于或等于指定条件的最小值。",
            a: "计算累积二项式分布大于或等于指定条件的最小值。",
            m: [3, 3],
            p: [{
                name: "trials",
                detail: "贝努利试验次数。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "probability_s",
                detail: "任一次给定检验的成功概率。",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "alpha",
                detail: "期望的临界概率。",
                example: "0.8",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONFIDENCE_NORM",
            t: 1,
            d: "计算正态分布的置信区间的一半宽度。",
            a: "计算正态分布的置信区间的一半宽度。",
            m: [3, 3],
            p: [{
                name: "alpha",
                detail: "用来计算置信水平的显著性水平。\n\n置信水平等于 100*(1 - alpha)%，亦即，如果 alpha 为 0.05，则置信水平为 95%。",
                example: "0.05",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "数据区域的总体标准偏差。",
                example: "1.6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "size",
                detail: "样本总量的大小。",
                example: "250",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CORREL",
            t: 1,
            d: "计算给定数据集的皮尔逊积矩相关系数 r。",
            a: "计算给定数据集的皮尔逊积矩相关系数 r。",
            m: [2, 2],
            p: [{
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_P",
            t: 1,
            d: "计算数据集的总体协方差。",
            a: "计算数据集的总体协方差。",
            m: [2, 2],
            p: [{
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_S",
            t: 1,
            d: "计算数据集的样本协方差。",
            a: "计算数据集的样本协方差。",
            m: [2, 2],
            p: [{
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEVSQ",
            t: 1,
            d: "基于样本计算其偏差的平方和。",
            a: "基于样本计算其偏差的平方和。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 样本中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "EXPON_DIST",
            t: 1,
            d: "返回带有指定 Lambda 和指定值的指数分布函数的值。",
            a: "返回带有指定 Lambda 和指定值的指数分布函数的值。",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "指数分布函数的输入值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "lambda",
                detail: "用于指定指数分布函数的 lambda 值。",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "是否使用指数累积分布。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIF",
            t: 1,
            d: "根据条件返回范围的平均值。",
            a: "根据条件返回范围的平均值。",
            m: [2, 3],
            p: [{
                name: "criteria_range",
                detail: "要对其检查 criterion 的范围。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion",
                detail: '要应用于 criteria_range 的模式或测试条件。\n\n等于："文本" 或 1 或 "=文本" 或 "=1"\n\n大于：">1"\n\n大于等于：">=1"\n\n小于："<1"\n\n小于等于："<=1"\n\n不等于："<>1"或"<>文本"',
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "average_range",
                detail: "[可选] - 要计算平均值的范围。如果未提供此参数，则改用 criteria_range 来计算平均值。",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIFS",
            t: 1,
            d: "根据多项条件返回范围的平均值。",
            a: "根据多项条件返回范围的平均值。",
            m: [2, 255],
            p: [{
                name: "average_range",
                detail: "要计算平均值的范围。",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range1",
                detail: "要对其检查 criterion1 的范围。",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion1",
                detail: "要应用于 criteria_range1 的模式或测试条件。",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2, criterion2, ...",
                detail: "[可选] - 要检查的其他范围和条件。",
                example: " C1:C10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERMUT",
            t: 1,
            d: "返回可从数字对象中选择的给定数目对象的排列数。",
            a: "返回可从数字对象中选择的给定数目对象的排列数。",
            m: [2, 2],
            p: [{
                name: "number",
                detail: "表示对象个数的整数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_chosen",
                detail: "表示每个排列中对象个数的整数。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRIMMEAN",
            t: 1,
            d: "在排除数据集高低两端的部分数据之后计算所得的均值。",
            a: "在排除数据集高低两端的部分数据之后计算所得的均值。",
            m: [2, 2],
            p: [{
                name: "数据",
                detail: "包含相关数据集的数组或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "排除比例",
                detail: "要从数据集的极值部分排除的数据占数据集的比例。\n\n排除比例必须大于等于0且小于1。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_EXC",
            t: 1,
            d: "返回数组的 K 百分点值，K 介于 0 到 1 之间，不含 0 与 1。",
            a: "返回数组的 K 百分点值，K 介于 0 到 1 之间，不含 0 与 1。",
            m: [2, 2],
            p: [{
                name: "array",
                detail: "定义相对位置的数组或数据区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "0 到 1 之间的百分点值，不包含 0 和 1。",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_INC",
            t: 1,
            d: "返回数组的 K 百分点值，K 介于 0 到 1 之间，包含 0 与 1。",
            a: "返回数组的 K 百分点值，K 介于 0 到 1 之间，包含 0 与 1。",
            m: [2, 2],
            p: [{
                name: "array",
                detail: "定义相对位置的数组或数据区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "0 到 1 之间的百分点值，包含 0 和 1。",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PEARSON",
            t: 1,
            d: "返回皮尔生(Pearson)乘积矩相关系数 r。",
            a: "返回皮尔生(Pearson)乘积矩相关系数 r。",
            m: [2, 2],
            p: [{
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_INV",
            t: 1,
            d: "返回标准正态累积分布函数的反函数值。 该分布的平均值为 0，标准偏差为 1。",
            a: "返回标准正态累积分布函数的反函数值。 该分布的平均值为 0，标准偏差为 1。",
            m: [1, 1],
            p: [{
                name: "probability",
                detail: "对应于正态分布的概率。",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_DIST",
            t: 1,
            d: "返回标准正态分布函数（该分布的平均值为 0，标准偏差为 1）。",
            a: "返回标准正态分布函数（该分布的平均值为 0，标准偏差为 1）。",
            m: [2, 2],
            p: [{
                name: "z",
                detail: "需要计算其分布的数值。",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "决定函数形式的逻辑值。\n\n如果为 TRUE()，则返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NORM_INV",
            t: 1,
            d: "返回指定平均值和标准偏差的正态累积分布函数的反函数值。",
            a: "返回指定平均值和标准偏差的正态累积分布函数的反函数值。",
            m: [3, 3],
            p: [{
                name: "probability",
                detail: "对应于正态分布的概率。",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "分布的算术平均值。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "分布的标准偏差。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_DIST",
            t: 1,
            d: "返回指定平均值和标准偏差的正态分布函数。",
            a: "返回指定平均值和标准偏差的正态分布函数。",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "需要计算其分布的数值。",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "分布的算术平均值。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "分布的标准偏差。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "决定函数形式的逻辑值。\n\n如果为 TRUE()，则返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NEGBINOM_DIST",
            t: 1,
            d: "返回负二项式分布。",
            a: "返回负二项式分布。",
            m: [4, 4],
            p: [{
                name: "number_f",
                detail: "要模拟的失败次数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_s",
                detail: "要模拟的成功次数。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "probability_s",
                detail: "任一次给定检验的成功概率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "决定函数形式的逻辑值。\n\n如果为 TRUE()，则返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINA",
            t: 1,
            d: "返回数据集中的最小数值。",
            a: "返回数据集中的最小数值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算最小值时所用的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2",
                detail: "[可选] - 在计算最小值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MIN",
            t: 1,
            d: "返回数值数据集中的最小值。",
            a: "返回数值数据集中的最小值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算最小值时所用的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2",
                detail: "[可选] - 在计算最小值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MEDIAN",
            t: 1,
            d: "返回数值数据集中的中值。",
            a: "返回数值数据集中的中值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算中值时所用的第一个数值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2",
                detail: "[可选] - 在计算中值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAXA",
            t: 1,
            d: "返回数据集中的最大数值。",
            a: "返回数据集中的最大数值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算最大值时所用的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 在计算最大值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAX",
            t: 1,
            d: "返回数值数据集中的最大值。",
            a: "返回数值数据集中的最大值。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "计算最大值时所用的第一个值或范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2",
                detail: "[可选] - 在计算最大值时要考虑的其他数值或范围。",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_INV",
            t: 1,
            d: "返回 x 的对数累积分布函数的反函数值。",
            a: "返回 x 的对数累积分布函数的反函数值。",
            m: [3, 3],
            p: [{
                name: "probability",
                detail: "与对数分布相关的概率，介于 0 与 1 之间（不含 0 与 1）。",
                example: "0.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "ln(x) 的平均值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "ln(x) 的标准偏差，正数。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_DIST",
            t: 1,
            d: "返回 x 的对数分布函数。",
            a: "返回 x 的对数分布函数。",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "用来计算函数的值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "ln(x) 的平均值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "ln(x) 的标准偏差，正数。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "决定函数形式的逻辑值。\n\n如果为 TRUE()，则返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "Z_TEST",
            t: 1,
            d: "返回 z 检验的单尾 P 值。",
            a: "返回 z 检验的单尾 P 值。",
            m: [2, 3],
            p: [{
                name: "array",
                detail: "用来检验 x 的数组或数据区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "x",
                detail: "要测试的值。",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sigma",
                detail: "[可选] - 总体（已知）标准偏差。 如果省略，则使用样本标准偏差。",
                example: "3",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PROB",
            t: 1,
            d: "返回区域中的数值落在指定区间内的概率。",
            a: "返回区域中的数值落在指定区间内的概率。",
            m: [3, 4],
            p: [{
                name: "x_range",
                detail: "具有各自相应概率值的 x 数值区域。",
                example: "A3:A6",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "prob_range",
                detail: "与 x_range 中的值相关联的一组概率值。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "lower_limit",
                detail: "要计算其概率的数值下界。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "upper_limit",
                detail: "[可选 - 默认值为下界] - 要计算其概率的可选数值上界。\n\n如果省略上界，PROB则计算随机选取相应值的次数恰好等于下界的概率。",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_EXC",
            t: 1,
            d: "基于 0 到 1 之间（不包括 0 和 1）的百分点值返回数据集的四分位数。",
            a: "基于 0 到 1 之间（不包括 0 和 1）的百分点值返回数据集的四分位数。",
            m: [2, 2],
            p: [{
                name: "array",
                detail: "要求得四分位数值的数组或数字型单元格区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quart",
                detail: "要返回第几个四分位值。\n\n1返回数据中最靠近第一个四分位值的值（25%标记）。\n\n2返回数据中最接近中值的值（50%标记）。\n\n3返回数据中最接近第三个四分位值的值（75%标记）。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_INC",
            t: 1,
            d: "根据 0 到 1 之间的百分点值（包含 0 和 1）返回数据集的四分位数。",
            a: "根据 0 到 1 之间的百分点值（包含 0 和 1）返回数据集的四分位数。",
            m: [2, 2],
            p: [{
                name: "array",
                detail: "要求得四分位数值的数组或数字型单元格区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quart",
                detail: "要返回第几个四分位值。\n\n0返回数据中的最小值（0%标记）。\n\n1返回数据中最靠近第一个四分位值的值（25%标记）。\n\n2返回数据中最接近中值的值（50%标记）。\n\n3返回数据中最接近第三个四分位值的值（75%标记）。\n\n4返回数据中的最大值（100%标记）。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POISSON_DIST",
            t: 1,
            d: "返回泊松分布。",
            a: "返回泊松分布。",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "事件数。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "期望值。非负数",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "一逻辑值，确定所返回的概率分布的形式。\n\n如果为 TRUE()，则返回发生的随机事件数在零（含零）和 x（含 x）之间的累积泊松概率；\n\n如果为 FALSE()，则返回发生的事件数正好是 x 的泊松概率密度函数。",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RSQ",
            t: 1,
            d: "返回皮尔生(Pearson)乘积矩相关系数 r 的平方。",
            a: "返回皮尔生(Pearson)乘积矩相关系数 r 的平方。",
            m: [2, 2],
            p: [{
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST",
            t: 1,
            d: "返回学生的左尾 t 分布。",
            a: "返回学生的左尾 t 分布。",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "T-分布函数的输入。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "自由度数值。",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "tails",
                detail: "决定函数形式的逻辑值。\n\n如果 cumulative 为 TRUE()，则 HYPGEOM.DIST 返回累积分布函数；\n\n如果为 FALSE()，则返回概率密度函数。",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T_DIST_2T",
            t: 1,
            d: "返回学生的双尾 t 分布。",
            a: "返回学生的双尾 t 分布。",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "T-分布函数的输入。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "自由度数值。",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST_RT",
            t: 1,
            d: "返回学生的右尾 t 分布。",
            a: "返回学生的右尾 t 分布。",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "T-分布函数的输入。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "自由度数值。",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV",
            t: 1,
            d: "返回学生的 t 分布的左尾反函数。",
            a: "返回学生的 t 分布的左尾反函数。",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "与学生的 t 分布相关的概率。\n\n必须大于 0 且小于 1。",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "deg_freedom",
                detail: "自由度数值。\n\n如果所提供的参数不是整数，将截取其整数部分。\n\n必须大于等于 1。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV_2T",
            t: 1,
            d: "返回学生 t 分布的双尾反函数。",
            a: "返回学生 t 分布的双尾反函数。",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "与学生的 t 分布相关的概率。\n\n必须大于 0 且小于1。",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "deg_freedom",
                detail: "自由度数值。\n\n如果所提供的参数不是整数，将截取其整数部分。\n\n必须大于等于 1。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_TEST",
            t: 1,
            d: "返回与t-检验相关的概率。用于判断两个样本是否可能是出自平均值相同的两个样本总体。",
            a: "返回与t-检验相关的概率。用于判断两个样本是否可能是出自平均值相同的两个样本总体。",
            m: [4, 4],
            p: [{
                name: "array1",
                detail: "将用于 t 检验的第一个数据样本或第一组单元格。",
                example: "A1:A4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array2",
                detail: "将用于 t 检验的第二个数据样本或第二组单元格。",
                example: "B1:B4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "tails",
                detail: "指定分布的尾数。\n\n如果为 1：使用单尾分布。\n\n如果为 2：使用双尾分布。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "指定 t 检验的类型。\n\n如果为 1：执行配对检验。\n\n如果为 2：执行双样本等方差（同方差）检验。\n\n如果为3：执行双样本不等方差（异方差）检验。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "F_DIST",
            t: 1,
            d: "给定输入值 x，计算两个数据集的左尾 F 概率分布（差异程度）。此分布也称为 Fisher-Snedecor 分布或 Snedecor F 分布。",
            a: "给定输入值 x",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "用来计算函数的值。",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "分子自由度。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "分母自由度。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "用于确定函数形式的逻辑值。默认值为 FALSE。\n\n如果为 TRUE()：F.DIST 将返回累积分布函数值。\n\n如果为 FALSE()：F.DIST 将返回概率密度函数值。",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "F_DIST_RT",
            t: 1,
            d: "给定输入x，计算两个数据集的右尾F概率分布（差异程度）。 此分布也称为Fisher-Snedecor分布或Snedecor F分布。",
            a: "给定输入x",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "用来计算函数的值。",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "分子自由度。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "分母自由度。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_P",
            t: 1,
            d: "基于样本总体计算方差。",
            a: "基于样本总体计算方差。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "数据集中的第一个值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, …",
                detail: "[可选] - 数据集中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_S",
            t: 1,
            d: "基于样本计算方差。",
            a: "基于样本计算方差。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, …",
                detail: "[可选] - 样本中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARA",
            t: 1,
            d: "基于样本计算方差，将文本取值为0。",
            a: "基于样本计算方差",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2, ...",
                detail: "[可选] - 样本中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARPA",
            t: 1,
            d: "基于样本总体计算方差，将文本取值为0。",
            a: "基于样本总体计算方差",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "样本中的第一项值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他数值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STEYX",
            t: 1,
            d: "返回通过线性回归法预测每个 x 的 y 值时所产生的标准误差。",
            a: "返回通过线性回归法预测每个 x 的 y 值时所产生的标准误差。",
            m: [2, 2],
            p: [{
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STANDARDIZE",
            t: 1,
            d: "给定分布的均值和标准偏差，计算一个随机变量正态化的相应值。",
            a: "给定分布的均值和标准偏差，计算一个随机变量正态化的相应值。",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "要正态化的随机变量值。",
                example: "96",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "分布的均值。",
                example: "80",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_dev",
                detail: "分布的标准偏差。",
                example: "6.7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SMALL",
            t: 1,
            d: "返回数据集中的第 k 个最小值。",
            a: "返回数据集中的第 k 个最小值。",
            m: [2, 2],
            p: [{
                name: "array",
                detail: "需要找到第 k 个最小值的数组或数值数据区域。",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "k",
                detail: "要返回的数据在数组或数据区域里的位置（从小到大）。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLOPE",
            t: 1,
            d: "计算通过数据集的线性回归得到的直线的斜率。",
            a: "计算通过数据集的线性回归得到的直线的斜率。",
            m: [2, 2],
            p: [{
                name: "数据_y",
                detail: "代表因变量数据数组或矩阵的范围。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "数据_x",
                detail: "代表自变量数据数组或矩阵的范围。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SKEW",
            t: 1,
            d: "返回分布的偏斜度。 偏斜度表明分布相对于平均值的不对称程度。 正偏斜度表明分布的不对称尾部趋向于更多正值。 负偏斜度表明分布的不对称尾部趋向于更多负值。",
            a: "返回分布的偏斜度。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "数据集中的第一个值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SKEW_P",
            t: 1,
            d: "返回基于样本总体的分布不对称度：表明分布相对于平均值的不对称程度。",
            a: "返回基于样本总体的分布不对称度：表明分布相对于平均值的不对称程度。",
            m: [1, 255],
            p: [{
                name: "值1",
                detail: "数据集中的第一个值或范围。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "值2, ...",
                detail: "[可选] - 数据集中包含的其他值或范围。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "VLOOKUP",
            t: 2,
            d: "纵向查找。在范围的第一列中自上而下搜索某个键值，并返回所找到的行中指定单元格的值。",
            a: "纵向查找。在范围的第一列中自上而下搜索某个键值",
            m: [3, 4],
            p: [{
                name: "搜索键值",
                detail: '要搜索的值，如 42、"Cats" 或 I24。',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "范围",
                detail: "要进行搜索的范围。VLOOKUP 将在该范围的第一列中搜索搜索键值中指定的键值。",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "索引",
                detail: "要返回的值的列索引，范围中的第一列编号为 1。\n\n如果索引不是介于 1 和范围中的列数之间，将返回 #VALUE! 。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "已排序",
                detail: "[默认值为 TRUE() ] - 指示要搜索的列（指定范围的第一列）是否已排序。大多数情况下，建议设为 FALSE()。\n\n建议将已排序设为 FALSE。如果设为 FALSE，将返回完全匹配项。如果存在多个匹配值，将返回找到的第一个值对应的单元格的内容，如果找不到匹配值，则返回 #N/A。\n\n如果将已排序设为 TRUE 或省略，将返回（小于或等于搜索键值的）最接近的匹配项。如果搜索的列中所有的值均大于搜索键值，则返回 #N/A。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HLOOKUP",
            t: 2,
            d: "横向查找。在范围的第一行中搜索某个键值，并返回所找到的列中指定单元格的值。",
            a: "横向查找。在范围的第一行中搜索某个键值",
            m: [3, 4],
            p: [{
                name: "搜索键值",
                detail: '要搜索的值。例如，42、"Cats"或I24。',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "范围",
                detail: "要进行搜索的范围。将在该范围的第一行中搜索在搜索键值中指定的键值。",
                example: "A2:Z6",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "索引",
                detail: "要返回的值的行索引，范围中的第一行编号为1。\n\n如果索引不是介于1和范围中的行数之间，将返回#VALUE!。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "已排序",
                detail: "[可选 - 默认值为TRUE()] - 指示要搜索的行（指定范围的第一行）是否已排序。\n\n如果将已排序设为TRUE或省略，将返回最接近的匹配值（小于或等于搜索键值）。如果在搜索的行中所有的值均大于搜索键值，则返回#N/A。\n\n如果将已排序设为TRUE或将其省略，而范围的首行并非处于已排序状态，则返回值可能会是错误的。\n\n如果将已排序设为FALSE，则仅返回完全匹配。如果存在多个匹配值，将返回与找到的第一个值对应的单元格的内容，如果找不到匹配值则返回#N/A。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOOKUP",
            t: 2,
            d: "在行或列中查找相应键，并将相应单元格的值返回到与搜索行或列所在位置相同的结果范围中。",
            a: "在行或列中查找相应键",
            m: [2, 3],
            p: [{
                name: "搜索键值",
                detail: '要在行或列中搜索的值。例如，42、"Cats" 或 I24。',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "搜索范围 | 搜索结果数组",
                detail: "使用 LOOKUP 的一种方法是给定单行或单列形式的搜索范围进行搜索查找，这种方式要用到另一个参数结果范围。另一种方式是将这两个参数合并为一个搜索结果数组，其中第一行或第一列用于搜索，并将返回值放在该数组的最后一行或最后一列中。",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "结果范围",
                detail: "[ 可选 ] - 用于存放返回结果的范围。返回值对应于在搜索范围中找到搜索键值的位置。此范围必须仅为单行或单列，而如果您使用的是搜索结果数组方式，则不应提供此参数。",
                example: "B1:B100",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADDRESS",
            t: 2,
            d: "返回字符串形式的单元格引用。",
            a: "返回字符串形式的单元格引用。",
            m: [2, 5],
            p: [{
                name: "row_num",
                detail: "一个数值，指定要在单元格引用中使用的行号。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column_num",
                detail: "一个数值，指定要在单元格引用中使用的列号（而非名称）。A列的编号为1。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "abs_num",
                detail: "[可选 - 默认值为1] - 一个数值，指定要返回的引用类型。\n\n1 表示行列均采用绝对值（例如$A$1）；\n\n2 表示采用绝对行号，相对列标（例如A$1）；\n\n3 表示采用相对行号，绝对列标（例如$A1）；\n\n4 表示行列均采用相对值（例如A1）。",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "A1",
                detail: "[可选 - 默认值为TRUE()] - 一个布尔值，指示采用A1标记形式(TRUE)还是R1C1标记形式(FALSE)。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sheet_text",
                detail: "[可选 - 默认缺省] - 用于指定地址所指向的工作表名称。",
                example: '"Sheet2"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INDIRECT",
            t: 2,
            d: "返回以字符串指定的单元格引用。",
            a: "返回以字符串指定的单元格引用。",
            m: [1, 2],
            p: [{
                name: "ref_text",
                detail: "以带引号的字符串形式提供的单元格引用。",
                example: '"Sheet2!"&B10',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "A1",
                detail: "[可选 - 默认值为TRUE()] - 一个布尔值，指示采用A1标记形式(TRUE)还是R1C1标记形式(FALSE)。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROW",
            t: 2,
            d: "返回指定单元格的行号",
            a: "返回指定单元格的行号",
            m: [0, 1],
            p: [{
                name: "reference",
                detail: "[可选 - 默认为此公式所在的单元格] - 要返回其行号的单元格。\n\n如果单元格引用指向的范围其宽度大于一个单元格，而此公式不是用作数组公式的，这时会仅返回单元格引用中首行的编号值。",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROWS",
            t: 2,
            d: "返回指定数组或范围中的行数。",
            a: "返回指定数组或范围中的行数。",
            m: [1, 1],
            p: [{
                name: "array",
                detail: "要返回其行数的范围。",
                example: "A9:A62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COLUMN",
            t: 2,
            d: "按照 `A=1` 的规则返回指定单元格的列号。",
            a: "按照 `A=1` 的规则返回指定单元格的列号。",
            m: [0, 1],
            p: [{
                name: "reference",
                detail: "[可选 - 默认为包含此公式的单元格] - 要返回其列号的单元格。A列对应的编号为1。\n\n如果单元格引用是宽度超过一个单元格的范围，而此公式不是作为数组公式来使用的，因此将返回单元格引用中的第一列的位置。",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNS",
            t: 2,
            d: "返回指定数组或范围中的列数。",
            a: "返回指定数组或范围中的列数。",
            m: [1, 1],
            p: [{
                name: "array",
                detail: "要返回其列数的范围。",
                example: "A9:W62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OFFSET",
            t: 2,
            d: "给定某范围的起始单元格引用以及该范围涵盖的行列数量，返回该范围的引用。",
            a: "给定某范围的起始单元格引用以及该范围涵盖的行列数量，返回该范围的引用。",
            m: [3, 5],
            p: [{
                name: "reference",
                detail: "用于计算行列偏移量的起点。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "rows",
                detail: "要偏移的行数。\n\n行偏移量必须是整数，但也可以是负数。如果提供的参数带有小数，小数部分将被截去。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cols",
                detail: "要偏移的列数。\n\n列偏移量必须是整数，但也可以是负数。如果提供的参数带有小数，小数部分将被截去。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "height",
                detail: "[可选] - 要从偏移目标开始返回的范围的高度。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "width",
                detail: "[可选] - 要从偏移目标开始返回的范围的宽度。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MATCH",
            t: 2,
            d: "在单元格中搜索指定项，然后返回该项在单元格区域中的相对位置。",
            a: "在单元格中搜索指定项，然后返回该项在单元格区域中的相对位置。",
            m: [2, 3],
            p: [{
                name: "lookup_value",
                detail: "要在 lookup_array 中匹配的值。",
                example: '"Sunday"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "lookup_array",
                detail: "要搜索的单元格区域。\n\n如果所用的范围的高度和宽度均大于1，MATCH将返回#N/A!。",
                example: "A2:A9",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "match_type",
                detail: "[可选 - 默认值为1] - 要采用的搜索方式。\n\n1为默认类型，此时MATCH会假设范围已按升序排序，并返回小于等于搜索键值的最大值。\n\n0表示完全匹配，在范围未排序的情况下需要使用此方式。\n\n-1让MATCH假设范围是按降序排序的，并返回大于等于搜索键值的最小值。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INDEX",
            t: 2,
            d: "返回表格或中的元素值，此元素由行号和列号的索引值给定。",
            a: "返回表格或中的元素值，此元素由行号和列号的索引值给定。",
            m: [2, 3],
            p: [{
                name: "array",
                detail: "单元格区域或数组常量。",
                example: "A1:C20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "row_num",
                detail: "选择数组中的某行，函数从该行返回数值。",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column_num",
                detail: "选择数组中的某列，函数从该列返回数值。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GETPIVOTDATA",
            t: 2,
            d: "从与指定行和列标题对应的数据透视表中提取汇总值。",
            a: "从与指定行和列标题对应的数据透视表中提取汇总值。",
            m: [2, 254],
            p: [{
                name: "data_field",
                detail: "您想从数据透视表中获取其数据的值名称。\n值名称必须括在引号中或是指向包含相关文本的任何单元格的引用。\n如果有多个值字段，则必须使用数据透视表中显示的确切名称（如“销售总额”）。",
                example: '"SUM of number of units"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "pivot_table",
                detail: "目标数据透视表中的任何单元格的引用（推荐位于顶角的单元格）。",
                example: "'Pivot table'!A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "field1",
                detail: "[可选] - 源数据集（不是数据透视表）中列的名称。",
                example: '"division"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }, {
                name: "item1",
                detail: "[可选] - 数据透视表中显示的与您要检索的字段名称 1 相对应的行或列的名称。",
                example: '"east"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CHOOSE",
            t: 2,
            d: "基于索引返回选项列表中的元素。",
            a: "基于索引返回选项列表中的元素。",
            m: [2, 255],
            p: [{
                name: "index_num",
                detail: "指定要返回哪一项。\n\n如果索引为零、负值或大于提供的选择数量，将返回#VALUE!错误。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value1",
                detail: "一项可能的返回值。必须提供。可以是单元格引用或单独的值。",
                example: '"A"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "[可选] - 其他可以选择的值。选择",
                example: '"B"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "HYPERLINK",
            t: 2,
            d: "在单元格内创建一个超链接。",
            a: "在单元格内创建一个超链接。",
            p: [{
                name: "网址",
                detail: "以引号括住的链接位置的完整网址，或对包含这种网址的单元格的引用。\n\n仅允许某些链接类型。其中包括：http://、https://、mailto:、aim:、ftp://、gopher://、telnet://和news://，明确禁用使用其他协议。如果指定的是其他协议，将会在单元格中显示链接标签，但该标签不会以链接形式呈现。\n\n如果未指定协议，则假设使用http://，并将其作为网址的前缀。",
                example: '"http://www.google.com/"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "链接标签",
                detail: '[可选 - 默认为网址] - 要在单元格中作为链接显示的文本（用引号括起来的），或者指向包含这种标签的单元格的引用。\n\n如果链接标签是指向某个空单元格的引用，如果网址有效，就将其作为链接显示，否则作为纯文本显示。\n\n如果链接标签为空字符串常量("")，所在单元格显示的内容将为空白，但通过点击该单元格或转入该单元格仍然可以访问链接。',
                example: '"Google"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TIME",
            t: 6,
            d: "将给定的小时、分钟和秒转换为时间。",
            a: "将给定的小时、分钟和秒转换为时间。",
            m: [3, 3],
            p: [{
                name: "小时",
                detail: "0（零）到 32767 之间的数字，代表小时。\n\n任何大于 23 的值都会除以 24，余数将作为小时值。",
                example: "11",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "分钟",
                detail: "0（零）到 32767 之间的数字，代表分钟。\n\n任何大于 59 的值将转换为小时和分钟。",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "秒",
                detail: "0（零）到 32767 之间的数字，代表秒。\n\n任何大于 59 的值将转换为小时、分钟和秒。",
                example: "59",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TIMEVALUE",
            t: 6,
            d: "按一天24小时返回该时间的分数表示。",
            a: "按一天24小时返回该时间的分数表示。",
            m: [1, 1],
            p: [{
                name: "time_text",
                detail: "用于表示时间的字符串。",
                example: '"2:15 PM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EOMONTH",
            t: 6,
            d: "返回某个月份最后一天的序列号，该月份在另一个日期之前或之后的数个月（月数由参数指定）。",
            a: "返回某个月份最后一天的序列号",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "用于计算结果的参照日期。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "用于计算的起始日期之前（负）或之后（正）的月数。返回的是计算所得月份的最后那天。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EDATE",
            t: 6,
            d: "返回表示某个日期的序列号，该日期在另一个日期的数月之前/之后。",
            a: "返回表示某个日期的序列号",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "用于计算结果的参照日期。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "用于计算的起始日期之前（负）或之后（正）的月数。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SECOND",
            t: 6,
            d: "返回时间值的秒数。 秒数是 0（零）到 59 范围内的整数。",
            a: "返回时间值的秒数。 秒数是 0（零）到 59 范围内的整数。",
            m: [1, 1],
            p: [{
                name: "时间",
                detail: "用于计算秒钟部分的时间。必须为以下值之一：指向包含日期/时间值的单元格的引用、返回日期/时间的函数或者数字。",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINUTE",
            t: 6,
            d: "以数字格式返回特定时间的分钟部分。",
            a: "以数字格式返回特定时间的分钟部分。",
            m: [1, 1],
            p: [{
                name: "时间",
                detail: "用于计算分钟部分的时间。必须为以下值之一：指向包含日期/时间值的单元格的引用、返回日期/时间的函数或者数字。",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HOUR",
            t: 6,
            d: "以数字格式返回特定时间的小时部分。",
            a: "以数字格式返回特定时间的小时部分。",
            m: [1, 1],
            p: [{
                name: "时间",
                detail: "用于计算小时部分的时间。必须为以下值之一：指向包含日期/时间值的单元格的引用、返回日期/时间的函数或者数字。",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOW",
            t: 6,
            d: "以日期值格式返回当前日期和时间。",
            a: "以日期值格式返回当前日期和时间。",
            m: [0, 0],
            p: []
        }, {
            n: "NETWORKDAYS",
            t: 6,
            d: "返回所提供的两个日期之间的净工作日天数。",
            a: "返回所提供的两个日期之间的净工作日天数。",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "用于计算净工作日天数的时间段开始日期。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "用于计算净工作日天数的时间段结束日期。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "[可选] - 一个范围或数组常量，其中包含作为节假日的日期序号。\n\n在节假日数组中提供的值必须是日期序号值（例如由N所返回的值）或日期值（例如由DATE、DATEVALUE或TO_DATE返回的值）。由范围指定的值应该是标准的日期值或日期序数值。",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NETWORKDAYS_INTL",
            t: 6,
            d: "返回给定的两个日期之间的净工作日天数（排除指定的周末和节假日）。",
            a: "返回给定的两个日期之间的净工作日天数（排除指定的周末和节假日）。",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "用于计算净工作日天数的时间段开始日期。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "用于计算净工作日天数的时间段结束日期。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "weekend",
                detail: "[可选 - 默认值为1] - 用于表示哪些天为周末的数字或字符串。\n字符串方式：可以使用由0和1组成的字符串来指定周末，串中的第一个数字字符代表周一，最后一个则代表周日。零表示这一天是工作日，1表示这一天为周末。例如，“0000011”表示将周六和周日作为周末。\n数字方式：这种方式不使用上述字符串形式，而是使用一个数字。1 =周六/周日为周末，2 =周日/周一为周末，依此类推则7 =周五/周六。11 =周日为唯一周末，12 =周一为唯一周末，依此类推则17 =周六为唯一周末。",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "[ 可选 ] - 这是一个范围或数组常量，其中包含作为节假日的日期。\n在节假日数组内提供的值必须为日期序数值（例如N的返回值）或日期值（例如DATE、DATEVALUE或TO_DATE的返回值）。由范围指定的值应该是标准的日期值或日期序数值。",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISOWEEKNUM",
            t: 6,
            d: "返回给定日期在全年中的 ISO 周数。",
            a: "返回给定日期在全年中的 ISO 周数。",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "用于日期和时间计算的日期-时间代码。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WEEKNUM",
            t: 6,
            d: "返回特定日期的周数。",
            a: "返回特定日期的周数。",
            m: [1, 2],
            p: [{
                name: "serial_number",
                detail: "要确定其位于第几周的日期，必须是对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "return_type",
                detail: "[可选 - 默认值为 1 ] - 代表一周起始日的数字，系统也使用该数字来确定一年的第一周（1=周日，2=周一）。",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "WEEKDAY",
            t: 6,
            d: "返回一个数字，对应于给定日期所在的星期几。",
            a: "返回一个数字，对应于给定日期所在的星期几。",
            m: [1, 2],
            p: [{
                name: "serial_number",
                detail: "要为其确定星期几的日期。必须是对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "return_type",
                detail: "[可选 - 默认值为 1] - 以数字指示使用哪种编号顺序来表示星期几。默认情况下，按星期日 (= 1) 开始计算。\n\n如果类型为 1，则星期值将从星期日开始算起，并且星期日的值为 1，因此星期六的值就是 7。\n\n如果类型为 2，则星期值将从星期一开始算起，并且星期一的值为 1，因此星期日的值就是 7。\n\n如果类型为 3，则星期值将从星期一算起，并且星期一的值为 0，因此星期日的值就是 6。",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DAY",
            t: 6,
            d: "以数字格式返回特定日期所在的当月几号。",
            a: "以数字格式返回特定日期所在的当月几号。",
            m: [1, 1],
            p: [{
                name: "serial_number",
                detail: "要从中提取具体几号的日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS",
            t: 6,
            d: "返回两个日期之间的天数。",
            a: "返回两个日期之间的天数。",
            m: [2, 2],
            p: [{
                name: "end_date",
                detail: "计算中要使用的结束日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "2011-3-15",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_date",
                detail: "计算中要使用的开始日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "2011-2-1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS360",
            t: 6,
            d: "按照每年360天，返回两个日期之间的差（用于计算利息）。",
            a: "按照每年360天，返回两个日期之间的差（用于计算利息）。",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "计算中要使用的开始日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "计算中要使用的结束日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "method",
                detail: "[可选 - 默认为FALSE()] - 指示要使用哪种天数计算方法。\n\nFALSE - 采用美国 (NASD) 方法时，如果起始日期为某月的最后一天，为便于计算，会将起始日期的当月几号更改为30。此外，如果结束日期是所在月份的最后一天，而且起始日期在其所在月的30号之前，则将结束日期更改为结束日期之后那个月的第一天，否则将结束日期更改为该月的30号。\n\nTRUE - 采用欧洲方法时，会将所有日期在31号的起始日期或结束日期更改为当月的30号。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATE",
            t: 6,
            d: "将提供的年、月、日转换为日期。",
            a: "将提供的年、月、日转换为日期。",
            m: [3, 3],
            p: [{
                name: "year",
                detail: "日期的年份部分，包含一到四位数字。\n\n介于 0（零）到 1899 之间，会将该值与 1900 相加来计算年份；\n\n介于 1900 到 9999 之间，将使用该数值作为年份；\n\n小于 0 或大于等于 10000，返回 错误值 #NUM!。",
                example: "1969",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "日期的月份部分，一个正整数或负整数。\n\n如果 month 大于 12，则 month 会将该月份数与指定年中的第一个月相加。\n\n如果 month 小于 1，month 则从指定年份的一月份开始递减该月份数，然后再加上 1 个月。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day",
                detail: "日期的日部分，一个正整数或负整数。\n\n如果 day 大于月中指定的天数，则 day 会将天数与该月中的第一天相加。\n\n如果 day 小于 1，则 day 从指定月份的第一天开始递减该天数，然后再加上 1 天。",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATEVALUE",
            t: 6,
            d: "将提供的日期字符串转换为日期的序列号。",
            a: "将提供的日期字符串转换为日期的序列号。",
            m: [1, 1],
            p: [{
                name: "date_text",
                detail: "表示日期的字符串。",
                example: '"1969-7-20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATEDIF",
            t: 6,
            d: "计算两个日期之间的天数、月数或年数。",
            a: "计算两个日期之间的天数、月数或年数。",
            m: [3, 3],
            p: [{
                name: "起始日期",
                detail: "计算中要使用的开始日期。必须是对包含DATE值的单元格的引用、返回DATE类型的函数或数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "结束日期",
                detail: "计算中要使用的结束日期。必须是对包含DATE值的单元格的引用、返回DATE类型的函数或数字。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "单位",
                detail: '时间单位的缩写文字。例如 "M" 代表月。有效值包括："Y"、"M"、"D"、"MD"、"YM" 和 "YD"。\n\n"Y"：返回起始日期和结束日期之间的整年数。\n\n"M"：返回起始日期和结束日期之间的整月数。\n\n"D"：返回起始日期和结束日期之间的天数。\n\n"MD"：返回起始日期和结束日期之间的天数（不计整月数）。\n\n"YM"：返回起始日期和结束日期之间的整月数（不计整年数）。\n\n"YD"：返回起始日期和结束日期之间的天数（假设起始日期和结束日期的间隔不超过一年）。',
                example: "16)",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY",
            t: 6,
            d: "指定工作日天数，计算结束日期。",
            a: "指定工作日天数，计算结束日期。",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "计算的开始日期。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "days",
                detail: "start_date 之前或之后不含周末及节假日的天数。\n\n为正值将生成未来日期；\n\n为负值生成过去日期。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "holidays",
                detail: "[可选] - 一个范围或数组常量，其中包含作为节假日的日期序号。\n\n在节假日数组中提供的值必须是日期序号值（例如由N所返回的值）或日期值（例如由DATE、DATEVALUE或TO_DATE返回的值）。由范围指定的值应该是标准的日期值或日期序数值。",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY_INTL",
            t: 6,
            d: "返回指定的若干个工作日之前或之后的日期的序列号（使用自定义周末参数）。 ",
            a: "返回指定的若干个工作日之前或之后的日期的序列号（使用自定义周末参数）。 ",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "开始日期（将被截尾取整）。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "days",
                detail: "start_date 之前或之后的工作日的天数。\n\n正值表示未来日期；\n\n负值表示过去日期；\n\n零值表示开始日期。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "weekend",
                detail: "[可选 - 默认值为1] - 用于表示哪些天为周末的数字或字符串。\n字符串方式：可以使用由0和1组成的字符串来指定周末，串中的第一个数字字符代表周一，最后一个则代表周日。零表示这一天是工作日，1表示这一天为周末。例如，“0000011”表示将周六和周日作为周末。\n数字方式：这种方式不使用上述字符串形式，而是使用一个数字。1 =周六/周日为周末，2 =周日/周一为周末，依此类推则7 =周五/周六。11 =周日为唯一周末，12 =周一为唯一周末，依此类推则17 =周六为唯一周末。",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "[ 可选 ] - 这是一个范围或数组常量，其中包含作为节假日的日期。\n在节假日数组内提供的值必须为日期序数值（例如N的返回值）或日期值（例如DATE、DATEVALUE或TO_DATE的返回值）。由范围指定的值应该是标准的日期值或日期序数值。",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEAR",
            t: 6,
            d: "返回对应于某个日期的年份。 Year 作为 1900 - 9999 之间的整数返回。",
            a: "返回对应于某个日期的年份。 Year 作为 1900 - 9999 之间的整数返回。",
            m: [1, 1],
            p: [{
                name: "serial_number",
                detail: "用于计算年份的日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEARFRAC",
            t: 6,
            d: "返回 start_date 和 end_date 之间的天数占全年天数的百分比。",
            a: "返回 start_date 和 end_date 之间的天数占全年天数的百分比。",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "计算中要使用的开始日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "计算中要使用的结束日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 要使用的日计数基准类型。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TODAY",
            t: 6,
            d: "以日期值格式返回当前日期。",
            a: "以日期值格式返回当前日期。",
            m: [0, 0],
            p: []
        }, {
            n: "MONTH",
            t: 6,
            d: "返回日期（以序列数表示）中的月份。 月份是介于 1（一月）到 12（十二月）之间的整数。",
            a: "返回日期（以序列数表示）中的月份。 月份是介于 1（一月）到 12（十二月）之间的整数。",
            m: [1, 1],
            p: [{
                name: "serial_number",
                detail: "要从中提取月份的日期。必须是以下一种：对包含日期的单元格的引用、返回日期类型的函数或者数字。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EFFECT",
            t: 8,
            d: "根据名义利率及每年的复利计息期数来计算实际年利率。",
            a: "根据名义利率及每年的复利计息期数来计算实际年利率。",
            m: [2, 2],
            p: [{
                name: "nominal_rate",
                detail: "每年的名义利率。",
                example: "0.99",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "npery",
                detail: "每年的复利计算期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLAR",
            t: 12,
            d: "将数字格式设置为与语言区域相对应的货币格式。",
            a: "将数字格式设置为与语言区域相对应的货币格式。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: "要设置格式的值。",
                example: "1.2351",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "decimals",
                detail: "[可选 - 默认值为 2] - 要显示的小数位数。\n\n如果这是负数，则将数字四舍五入到小数点左侧。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARDE",
            t: 8,
            d: "将以整数部分和分数部分转换为以小数部分表示的金额数字",
            a: "将以整数部分和分数部分转换为以小数部分表示的金额数字",
            m: [2, 2],
            p: [{
                name: "fractional_dollar",
                detail: "以整数部份和分数部分表示的数字，用小数点隔开。",
                example: "100.10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fraction",
                detail: "用作分数中的分母的整数。",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARFR",
            t: 8,
            d: "将小数转换为分数表示的金额数字。",
            a: "将小数转换为分数表示的金额数字。",
            m: [2, 2],
            p: [{
                name: "decimal_dollar",
                detail: "小数。",
                example: "100.125",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fraction",
                detail: "用作分数中的分母的整数。",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DB",
            t: 8,
            d: "使用固定余额递减法，返回指定期间内某项固定资产的折旧值。",
            a: "使用固定余额递减法，返回指定期间内某项固定资产的折旧值。",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "资产原值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "折旧末尾时的值（有时也称为资产残值）。",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "资产的折旧期数（有时也称作资产的使用寿命）。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "在使用期限内要计算折旧的折旧期。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "[可选 - 默认值为12] - 折旧第一年中的月数。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DDB",
            t: 8,
            d: "用双倍余额递减法，返回指定期间内某项固定资产的折旧值。",
            a: "用双倍余额递减法，返回指定期间内某项固定资产的折旧值。",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "资产原值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "折旧末尾时的值（有时也称为资产残值）。",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "资产的折旧期数（有时也称作资产的使用寿命）。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "在使用期限内要计算折旧的折旧期。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "[可选 - 默认值为2] - 折旧的递减系数。",
                example: "2.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RATE",
            t: 8,
            d: "返回年金每期的利率。",
            a: "返回年金每期的利率。",
            m: [3, 6],
            p: [{
                name: "nper",
                detail: "年金的付款总期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pmt",
                detail: "每期的付款金额，在年金周期内不能更改。",
                example: "-100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值即一系列未来付款当前值的总和。",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选 - 默认值为0] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "guess",
                detail: "[可选 - 默认值为0.1] - 预期利率。",
                example: "0.1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CUMPRINC",
            t: 8,
            d: "基于等额分期付款和固定利率，计算投资在多个付款期内的累计本金偿还额。",
            a: "基于等额分期付款和固定利率，计算投资在多个付款期内的累计本金偿还额。",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "利率。",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "总付款期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "年金的现值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start_period",
                detail: "开始累计计算的付款期序号。\n\n首期必须大于等于1。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_period",
                detail: "结束累计计算的付款期序号。\n\n末期必须大于首期。",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNUM",
            t: 8,
            d: "返回在结算日和到期日之间的付息次数，向上舍入到最近的整数。",
            a: "返回在结算日和到期日之间的付息次数，向上舍入到最近的整数。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。到期日是有价证券有效期截止时的日期。",
                example: "02",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SYD",
            t: 8,
            d: "返回在指定期间内资产按年限总和折旧法计算的折旧。",
            a: "返回在指定期间内资产按年限总和折旧法计算的折旧。",
            m: [4, 4],
            p: [{
                name: "cost",
                detail: "资产原值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "折旧末尾时的值（有时也称为资产残值）。",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "资产的折旧期数（有时也称作资产的使用寿命）。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "在使用期限内要计算折旧的折旧期。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLEQ",
            t: 8,
            d: "基于贴现率计算美国政府短期债券的等效年化收益率。",
            a: "基于贴现率计算美国政府短期债券的等效年化收益率。",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "债券的结算日期，此日期为债券发行后交付给买家的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "债券的到期或结束日期，届时可将其以面值或票面价值赎回。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "债券购买时的贴现率。",
                example: "2)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLYIELD",
            t: 8,
            d: "基于价格计算美国政府短期债券的收益率。",
            a: "基于价格计算美国政府短期债券的收益率。",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "债券的结算日期，此日期为债券发行后交付给买家的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "债券的到期或结束日期，届时可将其以面值或票面价值赎回。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "pr",
                detail: "债券的购买价格。",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLPRICE",
            t: 8,
            d: "基于贴现率计算美国政府短期债券的价格。",
            a: "基于贴现率计算美国政府短期债券的价格。",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "债券的结算日期，此日期为债券发行后交付给买家的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "债券的到期或结束日期，届时可将其以面值或票面价值赎回。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "债券购买时的贴现率。",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PV",
            t: 8,
            d: "基于等额分期付款和固定利率，计算年金投资的现值。",
            a: "基于等额分期付款和固定利率，计算年金投资的现值。",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "各期利率。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "年金的付款总期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pmt",
                detail: "每期的付款金额，在年金周期内不能更改。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "D2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACCRINT",
            t: 8,
            d: "返回定期付息证券的应计利息。",
            a: "返回定期付息证券的应计利息。",
            m: [6, 8],
            p: [{
                name: "issue",
                detail: "有价证券的发行日。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "first_interest",
                detail: "有价证券的首次计息日。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "有价证券的年息票利率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "par",
                detail: "证券的票面值。",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示““欧洲30/360”方法” - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "calc_method",
                detail: "[可选 - 默认为TRUE()] - 一个逻辑值，指定当结算日期晚于首次计息日期时用于计算总应计利息的方法。\n\n如果值为 TRUE，则返回从发行日到结算日的总应计利息。\n\n如果值为 FALSE，则返回从首次计息日到结算日的应计利息。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ACCRINTM",
            t: 8,
            d: "返回在到期日支付利息的有价证券的应计利息。",
            a: "返回在到期日支付利息的有价证券的应计利息。",
            m: [4, 5],
            p: [{
                name: "issue",
                detail: "有价证券的发行日。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "settlement",
                detail: "有价证券的到期日。",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "有价证券的年息票利率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "par",
                detail: "证券的票面值。",
                example: "1000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYBS",
            t: 8,
            d: "返回从付息期开始到结算日的天数。",
            a: "返回从付息期开始到结算日的天数。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYS",
            t: 8,
            d: "返回结算日所在的付息期的天数。",
            a: "返回结算日所在的付息期的天数。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYSNC",
            t: 8,
            d: "返回从结算日到下一票息支付日之间的天数。",
            a: "返回从结算日到下一票息支付日之间的天数。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNCD",
            t: 8,
            d: "计算结算日之后的下一票息或利息派发日期。",
            a: "计算结算日之后的下一票息或利息派发日期。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPPCD",
            t: 8,
            d: "计算结算日之前的最后一个票息或利息支付日。",
            a: "计算结算日之前的最后一个票息或利息支付日。",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FV",
            t: 8,
            d: "基于等额分期付款和固定利率，计算年金投资的未来价值。",
            a: "基于等额分期付款和固定利率，计算年金投资的未来价值。",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "各期利率。",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "年金的付款总期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pmt",
                detail: "各期所应支付的金额，在整个年金期间保持不变。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "[可选 - 默认值为 0 ] - 现值，或一系列未来付款的当前值的累积和。",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为 0 ] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FVSCHEDULE",
            t: 8,
            d: "返回应用一系列复利率计算的初始本金的未来值。",
            a: "返回应用一系列复利率计算的初始本金的未来值。",
            m: [2, 2],
            p: [{
                name: "principal",
                detail: "现值。",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "schedule",
                detail: "用于计算本金复利的一组利率。\n\n利率表必须是范围或数组，其中包含要用于计算复利的一组利率。这些利率值应该以十进制小数形式表示，或者使用UNARY_PERCENT以百分比形式表示，即表示为0.09或UNARY_PERCENT(9)，而不要表示为9。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "YIELD",
            t: 8,
            d: "返回定期支付利息的债券的收益率。",
            a: "返回定期支付利息的债券的收益率。",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "有价证券的年息票利率。",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pr",
                detail: "有价证券的价格。",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "有价证券的清偿价值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "YIELDDISC",
            t: 8,
            d: "基于价格计算折价发行的（不带息）债券的年收益率。",
            a: "基于价格计算折价发行的（不带息）债券的年收益率。",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "pr",
                detail: "有价证券的价格。",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "有价证券的清偿价值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NOMINAL",
            t: 8,
            d: "基于给定的实际利率和年复利期数，返回名义年利率。",
            a: "基于给定的实际利率和年复利期数，返回名义年利率。",
            m: [2, 2],
            p: [{
                name: "effect_rate",
                detail: "每年的实际利率。",
                example: "0.85",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "npery",
                detail: "每年的复利期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "XIRR",
            t: 8,
            d: "返回一组不一定定期发生的现金流的内部收益率。",
            a: "返回一组不一定定期发生的现金流的内部收益率。",
            m: [2, 3],
            p: [{
                name: "values",
                detail: "其中含有投资相关收益或支出的数组或范围。\n\n现金流数额中必须至少包含一项负的和一项正的现金流金额才能计算回报率。",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "dates",
                detail: "与现金流数额参数中的现金流对应的日期数组或范围。",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "guess",
                detail: "[可选 - 默认值为0.1] - 对内部回报率的估算值。",
                example: "250",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MIRR",
            t: 8,
            d: "返回一系列定期现金流的修改后内部收益率。",
            a: "返回一系列定期现金流的修改后内部收益率。",
            m: [3, 3],
            p: [{
                name: "values",
                detail: "其中含有投资相关收益或支出的数组或范围。\n\n现金流数额中必须至少包含一项负的和一项正的现金流金额才能计算回报率。",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "finance_rate",
                detail: "现金流中使用的资金支付的利率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "reinvest_rate",
                detail: "将现金流再投资的收益率。",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IRR",
            t: 8,
            d: "返回由值中的数字表示的一系列现金流的内部收益率。 ",
            a: "返回由值中的数字表示的一系列现金流的内部收益率。 ",
            m: [1, 2],
            p: [{
                name: "values",
                detail: "其中含有投资相关收益或支出的数组或范围。\n\n现金流数额中必须至少包含一项负的和一项正的现金流金额才能计算回报率。",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "guess",
                detail: "[可选 - 默认为 0.1] - 内部收益率的估值。",
                example: "200",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPV",
            t: 8,
            d: "使用贴现率和一系列未来支出（负值）和收益（正值）来计算一项投资的净现值。",
            a: "使用贴现率和一系列未来支出（负值）和收益（正值）来计算一项投资的净现值。",
            m: [2, 255],
            p: [{
                name: "rate",
                detail: "某一期间的贴现率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value1",
                detail: "第一笔支出（负值）和收益（正值）。",
                example: "200",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2, ...",
                detail: "[可选] - 其他支出（负值）和收益（正值）。",
                example: "250",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "XNPV",
            t: 8,
            d: "返回一组现金流的净现值，这些现金流不一定定期发生。",
            a: "返回一组现金流的净现值，这些现金流不一定定期发生。",
            m: [3, 3],
            p: [{
                name: "rate",
                detail: "应用于现金流的贴现率。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "values",
                detail: "与 dates 中的支付时间相对应的一系列现金流。",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "dates",
                detail: "与现金流支付相对应的支付日期表。",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CUMIPMT",
            t: 8,
            d: "基于等额分期付款和固定利率，计算投资在一系列付款期内的累计利息。",
            a: "基于等额分期付款和固定利率，计算投资在一系列付款期内的累计利息。",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "利息率。",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "总付款期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start_period",
                detail: "开始累计计算的付款期序号。\n\n首期必须大于等于1。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_period",
                detail: "结束累计计算的付款期序号。\n\n末期必须大于首期。",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PMT",
            t: 8,
            d: "用于根据固定付款额和固定利率计算贷款的付款额。",
            a: "用于根据固定付款额和固定利率计算贷款的付款额。",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "贷款利率。",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "该项贷款的付款总数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值，或一系列未来付款额现在所值的总额，也叫本金。",
                example: " 100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选 - 默认值为 0] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "D2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为 0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IPMT",
            t: 8,
            d: "基于固定利率及等额分期付款方式，返回给定期数内对投资的利息偿还额。",
            a: "基于固定利率及等额分期付款方式，返回给定期数内对投资的利息偿还额。",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "各期利率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "per",
                detail: "用于计算其利息数额的期数，必须在 1 到 nper 之间。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "年金的付款总期数。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值，或一系列未来付款的当前值的累积和。",
                example: "80000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选 - 默认值为 0] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "E2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为 0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PPMT",
            t: 8,
            d: "返回根据定期固定付款和固定利率而定的投资在已知期间内的本金偿付额。",
            a: "返回根据定期固定付款和固定利率而定的投资在已知期间内的本金偿付额。",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "各期利率。",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "per",
                detail: "指定期数，该值必须在 1 到 nper 范围内。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "nper",
                detail: "年金的付款总期数。",
                example: "3*12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值即一系列未来付款当前值的总和。",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选 - 默认值为 0] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为 0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INTRATE",
            t: 8,
            d: "返回完全投资型证券的利率。",
            a: "返回完全投资型证券的利率。",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "investment",
                detail: "有价证券的投资额。",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "有价证券到期时的兑换值。",
                example: "101200",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICE",
            t: 8,
            d: "返回定期付息的面值 ￥100 的有价证券的价格。",
            a: "返回定期付息的面值 ￥100 的有价证券的价格。",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "有价证券的年息票利率。",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yld",
                detail: "有价证券的年收益率。",
                example: "0.065",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "面值 ￥100 的有价证券的清偿价值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEDISC",
            t: 8,
            d: "返回折价发行的面值 ￥100 的有价证券的价格。",
            a: "返回折价发行的面值 ￥100 的有价证券的价格。",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "有价证券的贴现率。",
                example: "0.0525",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "面值 ￥100 的有价证券的清偿价值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEMAT",
            t: 8,
            d: "返回到期付息的面值 ￥100 的有价证券的价格。",
            a: "返回到期付息的面值 ￥100 的有价证券的价格。",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "issue",
                detail: "有价证券的发行日。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "有价证券在发行日的利率。",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yld",
                detail: "有价证券的年收益率。",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RECEIVED",
            t: 8,
            d: "返回一次性付息的有价证券到期收回的金额。",
            a: "返回一次性付息的有价证券到期收回的金额。",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "investment",
                detail: "有价证券的投资额。",
                example: "10000000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "discount",
                detail: "有价证券的贴现率。",
                example: "0.0575",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DISC",
            t: 8,
            d: "返回有价证券的贴现率。",
            a: "返回有价证券的贴现率。",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "pr",
                detail: "有价证券的价格（按面值为 ￥100 计算）。",
                example: "97.975",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "面值 ￥100 的有价证券的清偿价值。",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPER",
            t: 8,
            d: "基于固定利率及等额分期付款方式，返回某项投资的总期数。",
            a: "基于固定利率及等额分期付款方式，返回某项投资的总期数。",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "各期利率。",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pmt",
                detail: "各期所应支付的金额，在整个年金期间保持不变。",
                example: "500",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pv",
                detail: "现值，或一系列未来付款的当前值的累积和。",
                example: "40000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "fv",
                detail: "[可选 - 默认值为0] - 未来值，或在最后一次付款后希望得到的现金余额。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "[可选 - 默认值为0] - 指定各期的付款时间是在期初还是期末。\n\n0 表示期末；\n\n1 表示期初。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLN",
            t: 8,
            d: "返回一个期间内的资产的直线折旧。",
            a: "返回一个期间内的资产的直线折旧。",
            m: [3, 3],
            p: [{
                name: "cost",
                detail: "资产原值。",
                example: "300000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "折旧末尾时的值（有时也称为资产残值）。",
                example: "75000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "资产的折旧期数（有时也称作资产的使用寿命）。",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DURATION",
            t: 8,
            d: "返回假设面值 ￥100 的定期付息有价证券的修正期限。",
            a: "返回假设面值 ￥100 的定期付息有价证券的修正期限。",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "coupon",
                detail: "有价证券的年息票利率。",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yld",
                detail: "有价证券的年收益率。",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MDURATION",
            t: 8,
            d: "返回假设面值 ￥100 的有价证券的 Macauley 修正期限。",
            a: "返回假设面值 ￥100 的有价证券的 Macauley 修正期限。",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "有价证券的结算日。 有价证券结算日是在发行日之后，有价证券卖给购买者的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "有价证券的到期日。 到期日是有价证券有效期截止时的日期。",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "coupon",
                detail: "有价证券的年息票利率。",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yld",
                detail: "有价证券的年收益率。",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "年付息次数。\n\n如果按年支付，frequency = 1；\n\n按半年期支付，frequency = 2；\n\n按季支付，frequency = 4。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "basis",
                detail: "[可选 - 默认为0] - 指示要使用哪种天数计算方法。\n\n0表示“美国(NASD) 30/360”方法 - 此方法按照美国全国证券交易商协会标准，假设每月30天、每年360天，并对所输入的月末日期进行具体调整。\n\n1表示“实际/实际”方法 - 此方法计算基于指定日期之间的实际天数和所涉及的年份中的实际天数进行计算。此方法用于美国长期债券，也是在非财经用途方面使用最多的方法。\n\n2表示“实际/360”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为360天。\n\n3表示“实际/365”方法 - 此方法基于指定日期之间的实际天数进行计算，但假定每年为365天。\n\n4表示“欧洲30/360”方法 - 类似于0，此方法基于每月30天、每年360天进行计算，但按照欧洲金融惯例对月末日期进行调整。",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2DEC",
            t: 9,
            d: "将二进制数转换为十进制数。",
            a: "将二进制数转换为十进制数。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: '要转换为十进制数的带符号的10位二进制数值（以字符串形式提供）。\n\n带符号的二进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n对于此函数，最大的正数输入值为0111111111，最小的负数输入值为1000000000。\n\n如果所提供的带符号的二进制数是有效的二进制数，会自动将其转换为相应的字符串输入。例如，BIN2DEC(100)和BIN2DEC("100")得出的结果相同，均为4。',
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIN2HEX",
            t: 9,
            d: "将二进制数转换为十六进制数。",
            a: "将二进制数转换为十六进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的十六进制数的带符号的10位二进制数值（以字符串形式提供）。\n\n带符号的二进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n对于此函数，最大的正数输入值为0111111111，最小的负数输入值为1000000000。\n\n如果所提供的带符号的二进制数是有效的二进制数，会自动将其转换为相应的字符串输入。例如，BIN2HEX(11111)和BIN2HEX("11111")得出 的结果相同，均为1F。',
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: '[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。例如，BIN2HEX("11111",8)所得的结果值为0000001F。\n\n如果带符号的二进制数的最高位为1，则忽略此值；即当提供的带符号的二进制数大于等于1000000000时忽略此值。',
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2OCT",
            t: 9,
            d: "将二进制数转换为八进制数。",
            a: "将二进制数转换为八进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的八进制数的带符号的10位二进制数值（以字符串形式提供）。\n\n带符号的二进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n对于此函数，最大的正数输入值为0111111111，最小的负数输入值为1000000000。\n\n如果所提供的带符号的二进制数是有效的二进制数，会自动将其转换为相应的字符串输入。例如，BIN2OCT(11111)和BIN2OCT("11111")得出的结果相同，均为37。',
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: '[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。例如，BIN2OCT("11111")得到的结果值为00000037。\n\n如果带符号的二进制数的最高位为1，则忽略此值；即当提供的带符号的二进制数大于等于1000000000时忽略此值。',
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2BIN",
            t: 9,
            d: "将十进制数转换为二进制数。",
            a: "将十进制数转换为二进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的二进制数的十进制数值（以字符串形式提供）。\n\n对于此函数，最大的正数输入值为511，最小的负数输入值为-512。\n\n如果所提供的十进制数是有效的十进制数，会自动将其转换为相应的字符串输入。例如，DEC2BIN(199)和DEC2BIN("199")得出的结果相同，均为11000111。',
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果十进制数为负数，则忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2HEX",
            t: 9,
            d: "将十进制数转换为十六进制数。",
            a: "将十进制数转换为十六进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的十六进制数的十进制数值（以字符串形式提供）。\n\n此函数可接受的最大正数值为549755813887，最小负数值为-549755814888。\n\n如果所提供的十进制数是有效的十进制数，会自动将其转换为相应的字符串输入。例如，DEC2HEX(100)和DEC2HEX("100")得出的结果相同，均为64。',
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果十进制数为负数，则忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2OCT",
            t: 9,
            d: "将十进制数转换为八进制数。",
            a: "将十进制数转换为八进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的八进制数的十进制数值（以字符串形式提供）。\n\n此函数可接受的最大正数值为536870911，最小负数值为-53687092。\n\n如果所提供的十进制数是有效的十进制数，会自动将其转换为相应的字符串输入。例如，DEC2OCT(199)和DEC2OCT("199")得出的结果相同，均为307。',
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果十进制数为负数，则忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2BIN",
            t: 9,
            d: "将十六进制数转换为二进制数。",
            a: "将十六进制数转换为二进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的二进制数的带符号的40位十六进制数值（以字符串形式提供）。\n\n带符号的十六进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为1FF，最小负数值为FFFFFFFE00。\n\n如果所提供的带符号的十六进制数是有效的十六进制数，函数会自动将其转换为相应的字符串输入。例如，HEX2BIN(199)和HEX2BIN("199")得出的结果相同，均为110011001。',
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果带符号的十六进制数的最高位为1，则忽略此值；即当提供的带符号的十六进制数大于等于8000000000时忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2DEC",
            t: 9,
            d: "将十六进制数转换为十进制数。",
            a: "将十六进制数转换为十进制数。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: '要转换为十进制数的带符号的40位十六进制数值（以字符串形式提供）。\n\n带符号的十六进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为7fffffffff，最小负数值为8000000000。\n\n如果所提供的带符号的十六进制数是有效的十六进制数，函数会自动将其转换为相应的字符串输入。例如，HEX2DEC(199)和HEX2DEC("199")得出的结果相同，均为409。',
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HEX2OCT",
            t: 9,
            d: "将十六进制数转换为八进制数。",
            a: "将十六进制数转换为八进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的八进制数的带符号的40位十六进制数值（以字符串形式提供）。\n\n带符号的十六进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为1FFFFFFF，最小负数值为FFE0000000。\n\n如果所提供的带符号的十六进制数是有效的十六进制数，函数会自动将其转换为相应的字符串输入。例如，HEX2OCT(199)和HEX2OCT("199")得出的结果相同，均为631。',
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果带符号的十六进制数的最高位为1，则忽略此值；即当给定的带符号的十六进制数大于等于8000000000时忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2BIN",
            t: 9,
            d: "将八进制数转换为二进制数。",
            a: "将八进制数转换为二进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的二进制数的带符号的30位八进制数值（以字符串形式提供）。\n\n带符号的八进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为777，最小负数值为7777777000。\n\n如果所提供的带符号的八进制数是有效的八进制数，函数会自动将其转换为相应的字符串输入。例如，OCT2BIN(177)和OCT2BIN("177")得出的结果相同，均为1111111。',
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果带符号的八进制数的最高位为1，则忽略此值；即当给定的带符号的八进制数大于等于4000000000时忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2DEC",
            t: 9,
            d: "将八进制数转换为十进制数。",
            a: "将八进制数转换为十进制数。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: '要转换为十进制数的带符号的30位八进制数值（以字符串形式提供）。\n\n带符号的ba进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为3777777777，最小负数值为4000000000。\n\n如果所提供的带符号的八进制数是有效的八进制数，函数会自动将其转换为相应的字符串输入。例如，OCT2DEC(177)和OCT2DEC("177")得出的结果相同，均为127。',
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OCT2HEX",
            t: 9,
            d: "将八进制数转换为十六进制数。",
            a: "将八进制数转换为十六进制数。",
            m: [1, 2],
            p: [{
                name: "number",
                detail: '要转换为带符号的十六进制数的带符号的30位八进制数值（以字符串形式提供）。\n\n带符号的ba进制数的最高位是符号位；也就是说，负数是以二的补码形式表示的。\n\n此函数可接受的最大正数值为3777777777，最小负数值为4000000000。\n\n如果所提供的带符号的八进制数是有效的八进制数，函数会自动将其转换为相应的字符串输入。例如，OCT2HEX(177)和OCT2HEX("177")得出的结果相同，均为7F。',
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "places",
                detail: "[ 可选 ] - 结果中要确保的有效位数。\n\n如果设置的有效位数大于结果中的有效位数，则在结果的左侧填充0，使总有效位数达到有效位数。\n\n如果带符号的八进制数的最高位为1，则忽略此值；即当给定的带符号的八进制数大于等于4000000000时忽略此值。",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COMPLEX",
            t: 9,
            d: "将实系数及虚系数转换为 x+yi 或 x+yj 形式的复数。",
            a: "将实系数及虚系数转换为 x+yi 或 x+yj 形式的复数。",
            m: [2, 3],
            p: [{
                name: "real_num",
                detail: "复数的实系数。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "i_num",
                detail: "复数的虚系数。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "suffix",
                detail: '[可选 - 默认为 "i"] - 复数中虚系数的后缀。',
                example: '"j"',
                require: "o",
                repeat: "n",
                type: "rangestring"
            }]
        }, {
            n: "IMREAL",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的复数的实系数。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的复数的实系数。",
            m: [1, 1],
            p: [{
                name: "inumber",
                detail: "需要计算其实系数的复数。",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMAGINARY",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的复数的虚系数。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的复数的虚系数。",
            m: [1, 1],
            p: [{
                name: "inumber",
                detail: "需要计算其虚系数的复数。",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMCONJUGATE",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的复数的共轭复数。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的复数的共轭复数。",
            m: [1, 1],
            p: [{
                name: "inumber",
                detail: "需要计算其共轭数的复数。",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMABS",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的复数的绝对值（模）。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的复数的绝对值（模）。",
            m: [1, 1],
            p: [{
                name: "inumber",
                detail: "要计算其绝对值的复数。",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DELTA",
            t: 9,
            d: "检验两个值是否相等。 如果 number1=number2，则返回 1；否则返回 0。",
            a: "检验两个值是否相等。 如果 number1=number2，则返回 1；否则返回 0。",
            m: [1, 2],
            p: [{
                name: "number1",
                detail: "第一个数字。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number2",
                detail: "[可选 - 默认为 0] - 第二个数字。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IMSUM",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的 1 至 255 个复数的和。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的 1 至 255 个复数的和。",
            m: [1, 255],
            p: [{
                name: "inumber1",
                detail: "要相加的第一个复数",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "inumber2, …",
                detail: "[可选] - 要与值1 相加的其他复数",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMSUB",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的两个复数的差。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的两个复数的差。",
            m: [2, 2],
            p: [{
                name: "inumber1",
                detail: "从（复）数中减去 inumber2。",
                example: '"6+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "inumber2",
                detail: "从 inumber1 中减（复）数。",
                example: '"2+3i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMPRODUCT",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的 1 至 255 个复数的乘积。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的 1 至 255 个复数的乘积。",
            m: [1, 255],
            p: [{
                name: "inumber1",
                detail: "用于计算乘积的第一个复数",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "inumber2, …",
                detail: "[可选] - 要相乘的其他复数。",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMDIV",
            t: 9,
            d: "返回以 x+yi 或 x+yj 文本格式表示的两个复数的商。",
            a: "返回以 x+yi 或 x+yj 文本格式表示的两个复数的商。",
            m: [2, 2],
            p: [{
                name: "inumber1",
                detail: "复数分子或被除数。",
                example: '"11+16i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "inumber2",
                detail: "复数分母或除数。",
                example: '"3+2i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOT",
            t: 10,
            d: "返回某个逻辑值的相反值 - “NOT(TRUE())”将返回 FALSE；“NOT(FALSE())”将返回 TRUE。",
            a: "返回某个逻辑值的相反值 - “NOT(TRUE())”将返回 FALSE；“NOT(FALSE())”将返回 TRUE。",
            m: [1, 1],
            p: [{
                name: "logical",
                detail: "计算结果为 TRUE 或 FALSE 的任何值或表达式。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRUE",
            t: 10,
            d: "返回逻辑值 TRUE。",
            a: "返回逻辑值 TRUE。",
            m: [0, 0],
            p: []
        }, {
            n: "FALSE",
            t: 10,
            d: "返回逻辑值 FALSE。",
            a: "返回逻辑值 FALSE。",
            m: [0, 0],
            p: []
        }, {
            n: "AND",
            t: 10,
            d: "所有参数的计算结果为 TRUE 时，返回 TRUE；只要有一个参数的计算结果为 FALSE，即返回 FALSE。",
            a: "所有参数的计算结果为 TRUE 时，返回 TRUE；只要有一个参数的计算结果为 FALSE，即返回 FALSE。",
            m: [1, 255],
            p: [{
                name: "logical1",
                detail: "要测试的第一个条件，其计算结果可以为 TRUE 或 FALSE。",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "logical2,...",
                detail: "[可选] - 要测试的其他条件，其计算结果可以为 TRUE 或 FALSE，最多可包含 255 个条件。",
                example: 'A3 = "bar"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IFERROR",
            t: 10,
            d: "如果第一个参数不是错误值，就返回第一个参数；否则，返回第二个参数。",
            a: "如果第一个参数不是错误值",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "检查是否存在错误的参数。",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_error",
                detail: "公式的计算结果错误时返回的值。 计算以下错误类型：#N/A、#VALUE!、#REF!、#DIV/0!、#NUM!、#NAME? 或 #NULL!。",
                example: '"Error in cell A1"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IF",
            t: 10,
            d: "当逻辑表达式的值为 TRUE 时返回一个值，而当其为 FALSE 时返回另一个值。",
            a: "当逻辑表达式的值为 TRUE 时返回一个值，而当其为 FALSE 时返回另一个值。",
            m: [2, 3],
            p: [{
                name: "logical_test",
                detail: "一个表达式或对包含表达式的单元格的引用，该表达式代表某种逻辑值（即TRUE或FALSE）。",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_true",
                detail: "当逻辑表达式为TRUE时的返回值。",
                example: '"A2 is foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_false",
                detail: "[可选 - 默认为空白] - 当逻辑表达式等于FALSE时的函数返回值。",
                example: '"A2 was false"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OR",
            t: 10,
            d: "只要有一个参数的计算结果为 TRUE 时，返回 TRUE；所有参数的计算结果为 FALSE，即返回 FALSE。",
            a: "只要有一个参数的计算结果为 TRUE 时，返回 TRUE；所有参数的计算结果为 FALSE，即返回 FALSE。",
            m: [1, 255],
            p: [{
                name: "logical1",
                detail: "要测试的第一个条件，其计算结果可以为 TRUE 或 FALSE。",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "逻辑表达式2",
                detail: "[可选] - 其他表达式或对包含表达式的单元格的引用，这些表达式代表某种逻辑值（即TRUE或FALSE）或者可以强制转换为逻辑值。",
                example: ' A3 = "bar"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NE",
            t: 11,
            d: "如果指定的值不相等，则返回“TRUE”；否则返回“FALSE”。相当于“<>”运算符。",
            a: "如果指定的值不相等，则返回“TRUE”；否则返回“FALSE”。相当于“<>”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "第一个值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "要检查是否与 value1 不相等的值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EQ",
            t: 11,
            d: "如果指定的值相等，则返回“TRUE”；否则返回“FALSE”。相当于“=”运算符。",
            a: "如果指定的值相等，则返回“TRUE”；否则返回“FALSE”。相当于“=”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "第一个值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "要检查是否与 value1 相等的值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GT",
            t: 11,
            d: "如果第一个参数严格大于第二个，则返回 TRUE；否则返回 FALSE。相当于“>”运算符。",
            a: "如果第一个参数严格大于第二个，则返回 TRUE；否则返回 FALSE。相当于“>”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "要测试其是否大于 value2 的值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "第二个值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GTE",
            t: 11,
            d: "如果第一个参数大于或等于第二个，则返回 TRUE；否则返回 FALSE。相当于“>=”运算符。",
            a: "如果第一个参数大于或等于第二个，则返回 TRUE；否则返回 FALSE。相当于“>=”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "要测试其是否大于等于 value2 的值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "第二个值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LT",
            t: 11,
            d: "如果第一个参数严格小于第二个，则返回 TRUE；否则返回 FALSE。相当于“<”运算符。",
            a: "如果第一个参数严格小于第二个，则返回 TRUE；否则返回 FALSE。相当于“<”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "要测试其是否小于 value2 的值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "第二个值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LTE",
            t: 11,
            d: "如果第一个参数小于或等于第二个，则返回 TRUE；否则返回 FALSE。相当于“<=”运算符。",
            a: "如果第一个参数小于或等于第二个，则返回 TRUE；否则返回 FALSE。相当于“<=”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "要测试其是否小于等于 value2 的值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "第二个值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADD",
            t: 11,
            d: "返回两个数值之和。相当于 `+` 运算符。",
            a: "返回两个数值之和。相当于 `+` 运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "第一个加数。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "第二个加数。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINUS",
            t: 11,
            d: "返回两个数值之差。相当于“-”运算符。",
            a: "返回两个数值之差。相当于“-”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "被减数，即要对其计减的数值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "减数，即要从 value1 中减除的数值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTIPLY",
            t: 11,
            d: "返回两个数的乘积。相当于“*”运算符。",
            a: "返回两个数的乘积。相当于“*”运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "第一个乘数。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "第二个乘数。",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DIVIDE",
            t: 11,
            d: "返回两个参数相除所得的结果。相当于 `/` 运算符。",
            a: "返回两个参数相除所得的结果。相当于 `/` 运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "要被除的数值。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "用于除其他数的数值。\n\n除数不得为0。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCAT",
            t: 11,
            d: "返回两个值的串联。相当于 `&` 运算符。",
            a: "返回两个值的串联。相当于 `&` 运算符。",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "value2 将附于其后的值。",
                example: '"de"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "要附于 value1 之后的值。",
                example: '"mystify"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNARY_PERCENT",
            t: 11,
            d: "返回按百分比解释的数值。例如，“UNARY_PERCENT(100)”等于1。",
            a: "返回按百分比解释的数值。例如，“UNARY_PERCENT(100)”等于1。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "要作为百分比解释的数值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCATENATE",
            t: 12,
            d: "将两个或多个文本字符串联接为一个字符串。",
            a: "将两个或多个文本字符串联接为一个字符串。",
            m: [1, 255],
            p: [{
                name: "text1",
                detail: "初始字符串。",
                example: '"Super"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text2 ...",
                detail: "[可选] - 要按顺序连接在一起的其他字符串。",
                example: '"calla"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CODE",
            t: 12,
            d: "返回所提供的字符串中首字符的 Unicode 映射值。",
            a: "返回所提供的字符串中首字符的 Unicode 映射值。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要返回其首字符的Unicode映射值的字符串。",
                example: '"a"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CHAR",
            t: 12,
            d: "按照当前 Unicode 编码表，将数字转换为对应的字符。",
            a: "按照当前 Unicode 编码表，将数字转换为对应的字符。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "介于 1 到 255 之间的数字。",
                example: "97",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ARABIC",
            t: 12,
            d: "将罗马数字转换为阿拉伯数字。",
            a: "将罗马数字转换为阿拉伯数字。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要转换格式的罗马数字",
                example: '"XIV"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROMAN",
            t: 12,
            d: "将数字格式设置为罗马数字形式。",
            a: "将数字格式设置为罗马数字形式。",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "要设置格式的数字，介于1到3999之间（包括这两个数字）。",
                example: "499",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "REGEXEXTRACT",
            t: 12,
            d: "按照正则表达式提取匹配的子串。",
            a: "按照正则表达式提取匹配的子串。",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "输入文本。",
                example: '"Needle in a haystack"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "此函数将返回文本中符合此表达式的第一个子串。",
                example: '".e{2}dle"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXMATCH",
            t: 12,
            d: "判断一段文本是否与正则表达式相匹配。",
            a: "判断一段文本是否与正则表达式相匹配。",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "要用正则表达式测试的文本。",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "用来测试文本的正则表达式。",
                example: '"S.r"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXREPLACE",
            t: 12,
            d: "使用正则表达式将文本字符串中的一部分替换为其他文本字符串。",
            a: "使用正则表达式将文本字符串中的一部分替换为其他文本字符串。",
            m: [3, 3],
            p: [{
                name: "text",
                detail: "要对其局部进行替换操作的文本。",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "正则表达式。 text 中所有匹配的实例都将被替换。",
                example: '"S.*d"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "replacement",
                detail: "要插入到原有文本中的文本。",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T",
            t: 12,
            d: "返回文本格式的字符串参数。",
            a: "返回文本格式的字符串参数。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为文本的参数。\n\n如果值为文本，T将返回值本身。\n\n如果值为指向包含文本的单元格的引用，T将返回值中的内容。\n\n如果值为错误值或包含错误值的单元格，T将返回该错误值。\n\n对于所有其他情况，T将返回空串。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIXED",
            t: 12,
            d: "以固定的小数位数设置数字的格式。",
            a: "以固定的小数位数设置数字的格式。",
            m: [1, 3],
            p: [{
                name: "number",
                detail: "要进行舍入并转换为文本的数字。",
                example: "3.141592653",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "decimals",
                detail: "[可选 - 默认值为2] - 结果中要显示的小数位数。\n\n如果数值的有效位数小于小数位数，将以零填充。如果数值的有效位数大于小数位数，则将其舍入到所需的小数位数而不是将其截断。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "no_commas",
                detail: "[可选 - 默认值为FALSE()] - 一个逻辑值，如果为 TRUE()，则会禁止 FIXED 在返回的文本中包含逗号。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIND",
            t: 12,
            d: "返回字符串在文本中首次出现的位置（区分大小写）。",
            a: "返回字符串在文本中首次出现的位置（区分大小写）。",
            m: [2, 3],
            p: [{
                name: "find_text",
                detail: "要在要搜索的文本中查找的字符串。",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "within_text",
                detail: "要在其中搜索搜索字符串的首次出现位置的文本。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_num",
                detail: "[可选 - 默认值为1] - 要在要搜索的文本中开始搜索的字符位置。",
                example: "14",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FINDB",
            t: 12,
            d: "返回某个字符串在文本中首次出现的位置（每个双字节字符占两个位置）。",
            a: "返回某个字符串在文本中首次出现的位置（每个双字节字符占两个位置）。",
            m: [2, 3],
            p: [{
                name: "find_text",
                detail: "要在要搜索的文本中查找的字符串。",
                example: '"新"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "within_text",
                detail: "要在其中搜索搜索字符串的首次出现位置的文本。",
                example: '"农历新年"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_num",
                detail: "[可选 - 默认值为 1] - 要在要搜索的文本中开始搜索的字符位置。",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "JOIN",
            t: 12,
            d: "将一个或多个使用指定定界符的一维数组的元素连接到一起。",
            a: "将一个或多个使用指定定界符的一维数组的元素连接到一起。",
            m: [2, 255],
            p: [{
                name: "separator",
                detail: "置于相互连接的值之间的字符或字符串。\n\n定界符可以为空，例如JOIN(,{1,2,3})。",
                example: '" and-a "',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "array1",
                detail: "要使用定界符连接的一个或多个值。",
                example: "{1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "array2, ...",
                detail: "[可选] - 要使用定界符连接的其他值或数组。",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LEFT",
            t: 12,
            d: "从文本字符串的第一个字符开始返回指定个数的字符。",
            a: "从文本字符串的第一个字符开始返回指定个数的字符。",
            m: [1, 2],
            p: [{
                name: "text",
                detail: "包含要提取的字符的文本字符串。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_chars",
                detail: "[可选 - 默认值为1] - 指定要由 LEFT 提取的字符的数量。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RIGHT",
            t: 12,
            d: "根据所指定的字符数返回文本字符串中最后一个或多个字符。",
            a: "根据所指定的字符数返回文本字符串中最后一个或多个字符。",
            m: [1, 2],
            p: [{
                name: "text",
                detail: "包含要提取的字符的文本字符串。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_chars",
                detail: "[可选 - 默认值为1] - 指定要由 RIGHT 提取的字符的数量。",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MID",
            t: 12,
            d: "返回文本字符串中从指定位置开始的特定数目的字符。",
            a: "返回文本字符串中从指定位置开始的特定数目的字符。",
            m: [3, 3],
            p: [{
                name: "text",
                detail: "包含要提取的字符的文本字符串。",
                example: '"get this"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_num",
                detail: "要从字符串中开始提取的位置。字符串中第一个字符的索引为1。",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_chars",
                detail: "指定要由 MID 提取的字符的数量。\n\n如果提取的字符数尚不足提取长度个字符时就到达了字符串尾部，则MID返回从开始位置到字符串尾部的字符。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LEN",
            t: 12,
            d: "返回给定字符串的长度。",
            a: "返回给定字符串的长度。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要返回其长度的字符串。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LENB",
            t: 12,
            d: "返回文本中所包含的字符数。与双字节字符集(DBCS)一起使用。",
            a: "返回文本中所包含的字符数。与双字节字符集(DBCS)一起使用。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要返回其字节数的字符串。（一个汉字为两个字节数）",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOWER",
            t: 12,
            d: "将指定字符串中的字母转换为小写。",
            a: "将指定字符串中的字母转换为小写。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要转换为小写的字符串。",
                example: '"LOREM IPSUM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UPPER",
            t: 12,
            d: "将指定字符串中的字母转换为大写。",
            a: "将指定字符串中的字母转换为大写。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要转换为大写的字符串。",
                example: '"lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EXACT",
            t: 12,
            d: "比较两个字符串是否相同。",
            a: "比较两个字符串是否相同。",
            m: [2, 2],
            p: [{
                name: "text1",
                detail: "要比较的第一个字符串。",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text2",
                detail: "要比较的第二个字符串。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPLACE",
            t: 12,
            d: "将文本字符串的一部分替换为其他文本字符串。",
            a: "将文本字符串的一部分替换为其他文本字符串。",
            m: [4, 4],
            p: [{
                name: "old_text",
                detail: "要对其局部进行替换操作的文本。",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_num",
                detail: "开始进行替换操作的位置（文本开头位置为 1）。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_chars",
                detail: "要在文本中替换的字符个数。",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_text",
                detail: "要插入到原有文本中的文本。",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPT",
            t: 12,
            d: "返回指定文本的多次重复。",
            a: "返回指定文本的多次重复。",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "要重复的字符或字符串。",
                example: '"ha"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_times",
                detail: "要重复的文本要在返回值中出现的次数。\n\n最大重复次数为100。即使重复次数大于100，REPT也仅将相应文本重复100次。",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEARCH",
            t: 12,
            d: "返回字符串在文本中首次出现的位置（不区分大小写）。",
            a: "返回字符串在文本中首次出现的位置（不区分大小写）。",
            m: [2, 3],
            p: [{
                name: "find_text",
                detail: "要在要搜索的文本中查找的字符串。",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "within_text",
                detail: "要在其中搜索搜索字符串的首次出现位置的文本。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_num",
                detail: "[ 可选 - 默认值为1 ] - 要在要搜索的文本中开始搜索的字符位置。",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUBSTITUTE",
            t: 12,
            d: "在文本字符串中用 new_text 替换 old_text。",
            a: "在文本字符串中用 new_text 替换 old_text。",
            m: [3, 4],
            p: [{
                name: "text",
                detail: "需要替换其中字符的文本，或对含有文本（需要替换其中字符）的单元格的引用。",
                example: '"search for it"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "old_text",
                detail: "需要替换的文本。",
                example: '"search for"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "new_text",
                detail: "用于替换 old_text 的文本。",
                example: '"Google"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "instance_num",
                detail: "[ 可选 ] - 指定要用 new_text 替换 old_text 的事件。 如果指定了 instance_num，则只有满足要求的 old_text 被替换。 否则，文本中出现的所有 old_text 都会更改为 new_text。",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CLEAN",
            t: 12,
            d: "移除文本中的不可打印 ASCII 字符后将其返回。",
            a: "移除文本中的不可打印 ASCII 字符后将其返回。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要移除其中不可打印字符的文本。",
                example: '"AF"&CHAR(31)',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TEXT",
            t: 12,
            d: "按照指定格式将数字转换为文本。",
            a: "按照指定格式将数字转换为文本。",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "要设置格式的数字、日期或时间。",
                example: "1.23",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "format_text",
                detail: '以括号括起来的模式串，将按该模式设置数字的格式。\n\n0表示在数值位数少于格式指定的位数时必定以零填充。例如，TEXT(12.3,"000.00")将返回012.30。当数值的小数位数超过模式指定的小数位数时，四舍五入为指定的小数位数。例如，TEXT(12.305,"00.00")将返回12.31。\n\n#类似于0，但并不是在小数点的两侧都以零填充。例如，TEXT(12.3,"###.##")将返回12.3。',
                example: '"$0.00"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRIM",
            t: 12,
            d: "删除指定字符串前后的空格。",
            a: "删除指定字符串前后的空格。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要修剪的字符串或指向包含该字符串的单元格的引用。",
                example: '" lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "VALUE",
            t: 12,
            d: "将可识别的任何日期、时间或数字格式的字符串转换为数字。",
            a: "将可识别的任何日期、时间或数字格式的字符串转换为数字。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "包含要转换的值的字符串。",
                example: '"123"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROPER",
            t: 12,
            d: "将指定字符串中每个单词的首字母转为大写。",
            a: "将指定字符串中每个单词的首字母转为大写。",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "要转换的文本，其中每个单词的首字母都将转为大写，所有其他字母则转为小写。",
                example: '"united states"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CONVERT",
            t: 13,
            d: "将数字从一种度量系统转换为另一种度量系统。",
            a: "将数字从一种度量系统转换为另一种度量系统。",
            m: [3, 3],
            p: [{
                name: "number",
                detail: "是以 from_unit 为单位的需要进行转换的数值。",
                example: "5.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "from_unit",
                detail: "是数值的单位。",
                example: '"g"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "to_unit",
                detail: "是结果的单位。",
                example: '"kg"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "SUMX2MY2",
            t: 14,
            d: "返回两数组中对应数值的平方差之和。",
            a: "返回两数组中对应数值的平方差之和。",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "第一个数组或数值区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "第二个数组或数值区域。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMX2PY2",
            t: 14,
            d: "返回两数组中对应数值的平方和之和。",
            a: "返回两数组中对应数值的平方和之和。",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "第一个数组或数值区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "第二个数组或数值区域。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMXMY2",
            t: 14,
            d: "返回两数组中对应数值之差的平方和。",
            a: "返回两数组中对应数值之差的平方和。",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "第一个数组或数值区域。",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "第二个数组或数值区域。",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRANSPOSE",
            t: 14,
            d: "将数组或单元格范围的行列转置。",
            a: "将数组或单元格范围的行列转置。",
            m: [1, 1],
            p: [{
                name: "array",
                detail: "要将其行列互换的数组或范围。",
                example: "{1,2}",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TREND",
            t: 14,
            d: "返回线性趋势值。",
            a: "返回线性趋势值。",
            m: [1, 4],
            p: [{
                name: "known_y",
                detail: "关系表达式 y = mx + b 中已知的 y 值集合。\n\n如果 known_y 为二维数组或范围，则 known_x 的维数必须与之相同，或者省略此参数。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_x",
                detail: "[可选 - 默认该数组为{1,2,3,...},其大小与 known_y 相同] - 关系表达式 y = mx + b 中已知的可选 x 值集合。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_x",
                detail: "[可选 - 默认与 known_x 相同] -  需要函数 TREND 返回对应 y 值的新 x 值。",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "const",
                detail: "[可选 - 默认值为TRUE()] - 一个逻辑值，用于指定是否将常量 b 强制设为 0。\n\nTRUE() 表示 b 将按正常计算；\n\nFALSE() 表示 b 将被设为 0（零），m 将被调整以使 y = mx。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FREQUENCY",
            t: 14,
            d: "计算数值在某个区域内的出现频率，然后返回一个垂直数组。",
            a: "计算数值在某个区域内的出现频率，然后返回一个垂直数组。",
            m: [2, 2],
            p: [{
                name: "data_array",
                detail: "要对其频率进行计数的一组数值或对这组数值的引用。",
                example: "A2:A40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "bins_array",
                detail: "要将 data_array 中的值插入到的间隔数组或对间隔的引用。\n\n为清晰起见，应将类别排序，但如果未排序，FREQUENCY会在内部对这些指定的值进行排序并返回正确结果。",
                example: "B2:B5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GROWTH",
            t: 14,
            d: "使用现有数据计算预测的指数等比。",
            a: "使用现有数据计算预测的指数等比。",
            m: [1, 4],
            p: [{
                name: "known_y",
                detail: "关系表达式 y = b*m^x 中已知的 y 值集合。\n\n如果已知数据_y为二维数组或范围，则已知数据_x的维数必须与之相同，或者省略此参数。\n\n如果已知数据_y为一维数组或范围，已知数据_x则可代表二维数组或范围中的多个自变量。也就是说，如果已知数据_y为单行，则将已知数据_x中的每行解释为各自独立的值，类似情况也适用于已知数据_y为单列的情况。",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_x",
                detail: "[可选 - 默认该数组为{1,2,3,...},其大小与 known_y 相同] - 关系表达式 y = b*m^x 中已知的可选 x 值集合。\n\n如果已知数据_y为一维数组或范围，已知数据_x则可代表二维数组或范围中的多个自变量。也就是说，如果已知数据_y为单行，则将已知数据_x中的每行解释为各自独立的值，类似情况也适用于已知数据_y为单列的情况。",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_x",
                detail: "[可选 - 默认与 known_x 相同] - 需要函数 GROWTH 返回对应 y 值的新 x 值。",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "const",
                detail: "[可选 - 默认值为TRUE()] -一个逻辑值，用于指定是否将常量 b 强制设为 1。\n\nTRUE() 表示 b 将按正常计算；\n\nFALSE() 表示 b 将被设为 1，m 将被调整以使 y = m^x。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINEST",
            t: 14,
            d: "可通过使用最小二乘法计算与现有数据最佳拟合的直线，来计算某直线的统计值，然后返回描述此直线的数组。",
            a: "可通过使用最小二乘法计算与现有数据最佳拟合的直线，来计算某直线的统计值，然后返回描述此直线的数组。",
            m: [1, 4],
            p: [{
                name: "known_y",
                detail: "关系表达式 y = mx + b 中已知的 y 值集合。\n\n如果 known_y 为二维数组或范围，则 known_x 的维数必须与之相同，或者省略此参数。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_x",
                detail: "[可选 - 默认该数组为{1,2,3,...},其大小与 known_y 相同] - 关系表达式 y = mx + b 中已知的可选 x 值集合。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "const",
                detail: "[可选 - 默认值为TRUE()] - 一个逻辑值，用于指定是否将常量 b 强制设为 0。\n\nTRUE() 表示 b 将按正常计算；\n\nFALSE() 表示 b 将被设为 0（零），m 将被调整以使 y = mx。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "stats",
                detail: "[可选 - 默认值为FALSE()] - 一个逻辑值，用于指定是否返回附加回归统计值。\n\n如果详细为TRUE，除了对应于每个自变量的一组线性系数和y截距之外，LINEST还返回以下信息：\n\n每项系数和截距的标准误差、\n\n限定系数（介于0和1之间，1表示完全相关）、\n\n因变量值的标准误差、\n\nF统计或F观测值，指示所观测到的因变量和自变量变量之间的关系是随机的还是线性的、\n\n自由度，用于在参照表中查找F统计值以估算可信度、\n\n回归平方和，以及\n\n残差平方和。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOGEST",
            t: 14,
            d: "在回归分析中，计算最符合数据的指数回归拟合曲线，并返回描述该曲线的数值数组。",
            a: "在回归分析中，计算最符合数据的指数回归拟合曲线，并返回描述该曲线的数值数组。",
            m: [1, 4],
            p: [{
                name: "known_y",
                detail: "关系表达式 y = mx + b 中已知的 y 值集合。\n\n如果 known_y 为二维数组或范围，则 known_x 的维数必须与之相同，或者省略此参数。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_x",
                detail: "[可选 - 默认该数组为{1,2,3,...},其大小与 known_y 相同] - 关系表达式 y = mx + b 中已知的可选 x 值集合。\n\n如果 known_y 为一维数组或范围，known_x 则可代表二维数组或范围中的多个自变量。也就是说，如果 known_y 为单行，则将 known_x 中的每行解释为各自独立的值，类似情况也适用于 known_y 为单列的情况。",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "const",
                detail: "[可选 - 默认值为TRUE()] - 一个逻辑值，用于指定是否将常量 b 强制设为 0。\n\nTRUE() 表示 b 将按正常计算；\n\nFALSE() 表示 b 将被设为 0（零），m 将被调整以使 y = mx。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "stats",
                detail: "[可选 - 默认值为FALSE()] - 一个逻辑值，用于指定是否返回附加回归统计值。\n\n如果详细为TRUE，则除了为每个自变量和系数 b 返回一组指数值之外，LOGEST 还将返回以下数据：\n\n每项指数和系数的标准误差、\n\n限定系数（介于 0 和 1 之间，1 表示完全相关）、\n\n因变量值的标准误差、\n\nF 统计或 F 观测值，指示所观测到的因变量和自变量之间的关系是随机的还是指数的、\n\n自由度 - 用于在参照表中查找 F 统计值以估算可信度、\n\n回归平方和，以及\n\n残差平方和。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MDETERM",
            t: 14,
            d: "返回一个数组的矩阵行列式的值。",
            a: "返回一个数组的矩阵行列式的值。",
            m: [1, 1],
            p: [{
                name: "array",
                detail: "行数和列数相等的数值数组。",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINVERSE",
            t: 14,
            d: "返回数组中存储的矩阵的逆矩阵。",
            a: "返回数组中存储的矩阵的逆矩阵。",
            m: [1, 1],
            p: [{
                name: "array",
                detail: "行数和列数相等的数值数组。",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MMULT",
            t: 14,
            d: "返回两个数组的矩阵乘积。结果矩阵的行数与 array1 的行数相同，矩阵的列数与 array2 的列数相同。",
            a: "返回两个数组的矩阵乘积。结果矩阵的行数与 array1 的行数相同，矩阵的列数与 array2 的列数相同。",
            m: [2, 2],
            p: [{
                name: "array1",
                detail: "要进行矩阵乘法运算的第一个矩阵数组。\n\narray1 列数必须与 array2 的行数相同",
                example: "A1:B3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array2",
                detail: "要进行矩阵乘法运算的第二个矩阵数组。\n\narray2 的行数必须与 array1 列数相同",
                example: "C1:F2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMPRODUCT",
            t: 14,
            d: "在给定的几组数组中，将数组间对应的元素相乘，并返回乘积之和。",
            a: "在给定的几组数组中，将数组间对应的元素相乘，并返回乘积之和。",
            m: [1, 255],
            p: [{
                name: "array1",
                detail: "其相应元素需要进行相乘并求和的第一个数组参数。",
                example: "A2:C5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array2",
                detail: "[可选] - 其相应元素需要进行相乘并求和的其它数组参数。",
                example: "D2:F5",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "ISFORMULA",
            t: 15,
            d: "检查公式是否位于引用的单元格中。",
            a: "检查公式是否位于引用的单元格中。",
            m: [1, 1],
            p: [{
                name: "cell",
                detail: "要检查是否存在公式的单元格。\n\n如果 cell 为包含公式的单元格，则 ISFORMULA 将返回 TRUE。如果 cell 为相应单元格范围，则当该范围内的首个单元格包含公式时，系统会返回 TRUE。如果是任何其他值，系统都将返回 FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CELL",
            t: 15,
            d: "返回有关单元格的格式、位置或内容的信息。",
            a: "返回有关单元格的格式、位置或内容的信息。",
            m: [2, 2],
            p: [{
                name: "info_type",
                detail: "一个文本值，指定要返回的单元格信息的类型。",
                example: '"type"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "reference",
                detail: "需要其相关信息的单元格。",
                example: "C2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "NA",
            t: 15,
            d: "返回错误值 #N/A。",
            a: "返回错误值 #N/A。",
            m: [0, 0],
            p: []
        }, {
            n: "ERROR_TYPE",
            t: 15,
            d: "返回与其他单元格中的错误值相对应的数字。",
            a: "返回与其他单元格中的错误值相对应的数字。",
            m: [1, 1],
            p: [{
                name: "error_val",
                detail: "用于查找错误号的单元格，虽然您也可以直接提供错误值。",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISBLANK",
            t: 15,
            d: "检查所引用的单元格是否为空。",
            a: "检查所引用的单元格是否为空。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "对要检查其是否为空的单元格的引用。\n\n如果是空单元格，则 TRUE；否则返回 FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISERR",
            t: 15,
            d: "检查某个值是否为 #N/A 以外的错误值。",
            a: "检查某个值是否为 #N/A 以外的错误值。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其是否为#N/A以外的错误类型的值。\n\n如果值是除#N/A之外的任何错误（包括#DIV/0!、#NAME?、#NULL!、#NUM!、#VALUE!和#REF!），ISERR将返回TRUE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISERROR",
            t: 15,
            d: "检查某个值是否为错误值。",
            a: "检查某个值是否为错误值。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其是否为错误类型的值。\n\n只要值是某种错误值（包括#DIV/0!、#N/A、#NAME?、#NULL!、#NUM!、#VALUE!和#REF!），ISERROR就会返回TRUE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISLOGICAL",
            t: 15,
            d: "检查某个值是 TRUE 还是 FALSE。",
            a: "检查某个值是 TRUE 还是 FALSE。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其为逻辑TRUE还是逻辑FALSE的值。\n\n*如果值为TRUE或FALSE，或为指向值为TRUE或FALSE的单元格的引用，ISLOGICAL将返回TRUE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNA",
            t: 15,
            d: "检查某个值是否为错误值 #N/A。",
            a: "检查某个值是否为错误值 #N/A。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要与错误值#N/A进行比较的值。\n\n*如果值为#N/A或指向包含#N/A的单元格的引用，则ISNA将返回TRUE，否则返回FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNONTEXT",
            t: 15,
            d: "检查某个值是否为非文本。",
            a: "检查某个值是否为非文本。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要检查的文本。\n\n*如果参数为文本值或指向包含文本的单元格的引用，ISNONTEXT将返回FALSE，否则返回TRUE。\n\n当值为指向空单元格的引用时，ISNONTEXT会返回TRUE。\n\n当值为空字符串时，ISNONTEXT将返回FALSE，因为空串被视作文本。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNUMBER",
            t: 15,
            d: "检查某个值是否为数字。",
            a: "检查某个值是否为数字。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其是否为数字的值。\n\n*如果参数为数字或指向内容为数字值的单元格的引用，ISNUMBER将返回TRUE，否则返回FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISREF",
            t: 15,
            d: "检查某个值是否为有效的单元格引用。",
            a: "检查某个值是否为有效的单元格引用。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其是否为单元格引用的值。\n\n*如果参数是有效的单元格引用，ISREF将返回TRUE，否则返回FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISTEXT",
            t: 15,
            d: "检查某个值是否为文本。",
            a: "检查某个值是否为文本。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要验证其是否为文本的值。\n\n如果参数为文本值或指向包含文本值的单元格的引用，ISTEXT将返回TRUE，否则返回FALSE。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TYPE",
            t: 15,
            d: "返回数值的类型。",
            a: "返回数值的类型。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要确定其类型的数据。\n\n数字 返回 1;\n\n文本 返回 2;\n\n逻辑值 返回 4;\n\n错误值 返回 16;\n\n数组 返回 64;",
                example: "C4",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "N",
            t: 15,
            d: "返回转化为数值后的值。",
            a: "返回转化为数值后的值。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为数字的参数。\n\n如果值为数字，则返回该数字。\n\n如果值为日期，则返回该日期的序列号。\n\n如果值为TRUE，则返回1。\n\n如果值为FALSE，则返回0。\n\n如果值为错误值，则返回错误值。\n\n如果值为其他值，则返回0。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DATE",
            t: 16,
            d: "将指定的数字转换为日期。",
            a: "将指定的数字转换为日期。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为日期的参数或其单元格引用。\n\n如果值为数字或指向内容为数值的单元格的引用，TO_DATE会将值转换为相应的日期并返回，值代表从十二月30日到对应的日期之间的天数，\n\n负值表示对应的日期在十二月30日之前，而小数值则代表一天中从午夜算起的时间。\n如果值不是数字或指向内容为数值的单元格的引用，则TO_DATE将在不做任何修改的情况下返回值。",
                example: "25405",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PURE_NUMBER",
            t: 16,
            d: "将给定的日期/时间、百分比、货币金额或其他格式的数值转换为不带格式的纯数字。",
            a: "将给定的日期/时间、百分比、货币金额或其他格式的数值转换为不带格式的纯数字。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为纯数字的参数或其单元格引用。\n\n如果值为数字或指向包含数值的单元格的引用，TO_PURE_NUMBER将以不带任何格式与解释的形式返回值。\n\n如果值不是数字或指向内容为数值的单元格的引用，则TO_PERCENT将在不做任何修改的情况下返回值。",
                example: "50%",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_TEXT",
            t: 16,
            d: "将给定的数字值转换为文本格式。",
            a: "将给定的数字值转换为文本格式。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为文本的参数或其单元格引用。\n\n如果值为数字或指向包含数值的单元格的引用，TO_TEXT将返回字符串形式的值，并保持现有格式。即原为货币的仍为货币，原为十进制数的仍为十进制数，原为百分比的仍为百分比，原为日期的仍为日期。\n\n如果值不是数字或指向内容为数值的单元格的引用，则TO_TEXT将在不做任何修改的情况下返回值。",
                example: "24",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DOLLARS",
            t: 16,
            d: "将指定的数字转换为美元金额。",
            a: "将指定的数字转换为美元金额。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为美元金额的参数或其单元格引用。\n\n如果值不是数字或指向内容为数值的单元格的引用，则 TO_DOLLARS 将在不做任何修改的情况下返回值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PERCENT",
            t: 16,
            d: "将指定的数字转换为百分比。",
            a: "将指定的数字转换为百分比。",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "要转换为百分比的参数或其单元格引用。\n\n如果值为数字或指向包含数值的单元格的引用，TO_PERCENT会以1 = 100%为标准，将值转换为百分比。\n\n如果值不是数字或指向内容为数值的单元格的引用，则TO_PERCENT将在不做任何修改的情况下返回值。",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DGET",
            t: 17,
            d: "使用 SQL 式查询，从列表或数据库的列中提取符合指定条件的单个值。",
            a: "使用 SQL 式查询，从列表或数据库的列中提取符合指定条件的单个值。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMAX",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的最大数字。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的最大数字。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMIN",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的最小数字。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的最小数字。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DAVERAGE",
            t: 17,
            d: "使用 SQL 式查询，对列表或数据库中满足指定条件的记录字段（列）中的数值求平均值。",
            a: "使用 SQL 式查询，对列表或数据库中满足指定条件的记录字段（列）中的数值求平均值。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNT",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中包含数字的单元格的个数。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中包含数字的单元格的个数。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNTA",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的非空单元格的个数。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的非空单元格的个数。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DPRODUCT",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的数值的乘积。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的数值的乘积。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEV",
            t: 17,
            d: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为一个样本估算出的总体标准偏差。",
            a: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为一个样本估算出的总体标准偏差。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEVP",
            t: 17,
            d: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为样本总体计算出的总体标准偏差。",
            a: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为样本总体计算出的总体标准偏差。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSUM",
            t: 17,
            d: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的数字之和。",
            a: "使用 SQL 式查询，返回列表或数据库中满足指定条件的记录字段（列）中的数字之和。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVAR",
            t: 17,
            d: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为一个样本估算出的总体方差。",
            a: "使用 SQL 式查询，返回利用列表或数据库中满足指定条件的记录字段（列）中的数字作为一个样本估算出的总体方差。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVARP",
            t: 17,
            d: "使用 SQL 式查询，通过使用列表或数据库中满足指定条件的记录字段（列）中的数字计算样本总体的样本总体方差。",
            a: "使用 SQL 式查询，通过使用列表或数据库中满足指定条件的记录字段（列）中的数字计算样本总体的样本总体方差。",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "构成列表或数据库的单元格区域，列表的第一行包含每一列的标签。",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "指定 database 中的哪一列包含要提取和用于计算的值。\n\nfield 可以是与 database 第一行中某个列标题对应的文本标签，也可以是指定相关列的数字索引，第一列的索引值为 1。",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "包含所指定条件的单元格区域。计算之前将使用这些条件来过滤 database 中的值。",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "AGE_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出年龄。支持15为或18位身份证",
            a: "根据身份证号得到年龄。",
            m: [1, 2],
            p: [{
                name: "身份证号",
                example: "A1",
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "截止日期",
                example: '"2017-10-01"',
                detail: "年龄计算的截止日期或范围，默认为当日。",
                require: "o",
                repeat: "n",
                type: "rangedatetime"
            }]
        }, {
            n: "SEX_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出性别。支持15为或18位身份证",
            a: "根据身份证号得到性别。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIRTHDAY_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出生日。支持15为或18位身份证",
            a: "根据身份证号得到生日。",
            m: [1, 2],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "生日格式",
                example: "0",
                detail: "日期类型,默认0:[1900/01/01], 1:[1900-01-01], 2:[1900年1月1日]",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROVINCE_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出籍贯的省份。支持15为或18位身份证",
            a: "根据身份证号得到籍贯的省份。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CITY_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出籍贯的城市。支持15为或18位身份证",
            a: "根据身份证号得到籍贯的城市。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "STAR_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出星座。支持15为或18位身份证",
            a: "根据身份证号得到星座。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ANIMAL_BY_IDCARD",
            t: "3",
            d: "根据中国身份证号计算出生肖（鼠、牛、虎、兔...）。支持15为或18位身份证",
            a: "根据身份证号得到生肖。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISIDCARD",
            t: "3",
            d: "验证身份证的格式是否正确。支持15为或18位身份证",
            a: "验证身份证格式正确性。",
            m: [1, 1],
            p: [{
                name: "身份证号",
                example: '"31033519900101XXXX"',
                detail: "15位或者18位的身份证号或范围。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DM_TEXT_CUTWORD",
            t: "4",
            d: "文本分词。把一连串文字拆分为一系列单独词语",
            a: "中文文本分词。",
            m: [1, 2],
            p: [{
                name: "文本",
                example: '"我来到北京清华大学"',
                detail: "任意需要分词的文本。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "分词模式",
                example: "0",
                detail: "默认为0[精确模式], 1[全模式], 2[搜索引擎模式]。",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TFIDF",
            t: "4",
            d: "采用tf-idf算法进行关键词提取。从一连串文字中识别关键词",
            a: "tf-idf关键词识别。",
            m: [1, 3],
            p: [{
                name: "文本",
                example: '"我来到北京清华大学"',
                detail: "任意需要分词的文本。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "关键词个数",
                example: "20",
                detail: "算法返回的关键词个数，默认20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "语料库",
                example: "1",
                detail: "选择特定领域的语料库，默认0[通用], 1[金融], 2[医疗]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TEXTRANK",
            t: "4",
            d: "采用TextRank算法进行关键词提取。从一连串文字中识别关键词",
            a: "TextRank关键词识别。",
            m: [1, 3],
            p: [{
                name: "文本",
                example: '"我来到北京清华大学"',
                detail: "任意需要分词的文本。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "关键词个数",
                example: "20",
                detail: "算法返回的关键词个数，默认20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "语料库",
                example: "1",
                detail: "选择特定领域的语料库，默认0[通用], 1[金融], 2[医疗]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_CLOSE",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票收盘价。",
            a: "返回A股对应股票收盘价。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_OPEN",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票开盘价。",
            a: "返回A股对应股票开盘价。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MAX",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票最高价。",
            a: "返回A股对应股票最高价。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MIN",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票最低价。",
            a: "返回A股对应股票最低价。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_VOLUMN",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票成交量。",
            a: "返回A股对应股票成交量。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_AMOUNT",
            t: "5",
            d: "根据股票代码和日期，返回A股对应股票成交额。",
            a: "返回A股对应股票成交额。",
            m: [1, 3],
            p: [{
                name: "股票代码",
                example: '"000001"',
                detail: "6位股票代码，必填项。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "日期",
                example: "2015-01-08",
                detail: "股票的交易日，默认为最新交易日",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "复权除权",
                example: "0",
                detail: "选择股票的除权复权类型，默认0[前复权], 1[原始价格], 2[后复权]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISDATE",
            t: "6",
            d: "验证日期的格式是否正确。支持多种日期格式",
            a: "验证日期格式正确性。",
            m: [1, 1],
            p: [{
                name: "日期",
                example: '"1990-01-01"',
                detail: "日期值，例如1990/01/01, 1990年1月1日等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINESPLINES",
            t: "3",
            d: "生成嵌入在单元格内的折线图sparklines，用于描述数据的连续走势",
            a: "生成单元格折线图",
            m: [1, 8],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "线条颜色",
                example: "#2ec7c9",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "线条粗细",
                example: "1",
                detail: "折线图线段粗细，默认为1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "辅助线",
                example: "avg",
                detail: "一条横线，可以是min、max、avg、median、范围或自定义数值，默认0无",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "辅助线颜色",
                example: "#000",
                detail: "辅助线的颜色设置，同线条颜色配置，默认#000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最大值标识",
                example: "#fc5c5c",
                detail: "标识线图最大值，同线条颜色配置，默认0不显示",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最小值标识",
                example: "#fc5c5c",
                detail: "标识线图最小值，同线条颜色配置，默认0不显示",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "标识大小",
                example: "1.5",
                detail: "最大值和最小值的标识大小设置，默认为1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AREASPLINES",
            t: "3",
            d: "生成嵌入在单元格内的面积图sparklines，一般用于描述数据的连续累积值走势",
            a: "生成单元格面积图",
            m: [1, 5],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "线条颜色",
                example: "#2ec7c9",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "填充颜色",
                example: "#CCF3F4",
                detail: "形成面积图，同线条颜色配置，默认0不显示",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "线条粗细",
                example: "1",
                detail: "折线图线段粗细，默认为1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "辅助线",
                example: "avg",
                detail: "一条横线，可以是min、max、avg、median、范围或自定义数值，默认0无",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "辅助线颜色",
                example: "#000",
                detail: "辅助线的颜色设置，同线条颜色配置，默认#000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的垂直柱状图sparklines，一般用于描述离散数据之间的大小情况",
            a: "生成单元格垂直柱状图",
            m: [1, 6],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条间隔",
                example: "1",
                detail: "柱条之间的间隔距离，默认为1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条颜色",
                example: "#fc5c5c",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "负向柱条颜色",
                example: "#97b552",
                detail: "负向柱条颜色设置，代表负值的颜色，同柱条颜色配置，默认#97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最大值",
                example: "100",
                detail: "柱图最大值，用于规范柱图长度，默认为自动计算false、auto、null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "色板",
                example: "#97b552",
                detail: "调色板可以单独设置每个柱条的颜色，可设置多个，支持两种格式：1颜色例如#000，代表第一个柱的颜色是黑色；2数值范围:颜色，例如-2:#000表示数值为-2的柱为黑色，0:5:#000表示数值0-5的柱为黑色，默认为空",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKCOLUMNSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的累积垂直柱状图sparklines，一般用于描述离散数据多个维度的数值大小",
            a: "生成单元格累积垂直柱状图",
            m: [1, 5],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "按列堆积",
                example: "1",
                detail: "如果需要按行堆积则本项设为false或0，默认为是1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条间隔",
                example: "1",
                detail: "柱条之间的间隔距离，默认为1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最大值",
                example: "100",
                detail: "累积柱图最大值，用于规范柱图长度，默认为自动计算false、auto、null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "累积色板",
                example: "#97b552",
                detail: "调色板可以单独设置每个维度的柱条颜色，可设置为A1:A10等范围，默认为#2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BARSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的横向条形图sparklines，一般用于描述离散数据之间的大小情况",
            a: "生成单元格横向条形图",
            m: [1, 6],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条间隔",
                example: "1",
                detail: "柱条之间的间隔距离，默认为1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条颜色",
                example: "#fc5c5c",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "负向柱条颜色",
                example: "#97b552",
                detail: "负向柱条颜色设置，代表负值的颜色，同柱条颜色配置，默认#97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最大值",
                example: "100",
                detail: "柱图最大值，用于规范柱图长度，默认为自动计算false、auto、null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "色板",
                example: "#97b552",
                detail: "调色板可以单独设置每个柱条的颜色，可设置多个，支持两种格式：1颜色例如#000，代表第一个柱的颜色是黑色；2数值范围:颜色，例如-2:#000表示数值为-2的柱为黑色，0:5:#000表示数值0-5的柱为黑色，默认为空",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKBARSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的累积横向条形图sparklines，一般用于描述离散数据多个维度的数值大小",
            a: "生成单元格累积横向条形图",
            m: [1, 5],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "按列堆积",
                example: "1",
                detail: "如果需要按行堆积则本项设为false或0，默认为是1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条间隔",
                example: "1",
                detail: "柱条之间的间隔距离，默认为1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "最大值",
                example: "100",
                detail: "累积柱图最大值，用于规范柱图长度，默认为自动计算false、auto、null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "累积色板",
                example: "#97b552",
                detail: "调色板可以单独设置每个维度的柱条颜色，可设置为A1:A10等范围，默认为#2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "DISCRETESPLINES",
            t: "3",
            d: "生成嵌入在单元格内的离散图sparklines，一般用于描述离散数据走势",
            a: "生成单元格离散图",
            m: [1, 4],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "分割阈值",
                example: "1",
                detail: "离散图柱形颜色的区分，例如：该值为0，则大于0为蓝色，小于0为红色，默认为0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "阈值以上颜色",
                example: "#2ec7c9",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "阈值以下颜色",
                example: "#fc5c5c",
                detail: "阈值以下柱条颜色设置，同阈值以上颜色，默认#fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRISTATESPLINES",
            t: "3",
            d: "生成嵌入在单元格内的三态图sparklines，一般用于描述三种态势的走势例如胜负平",
            a: "生成单元格三态图",
            m: [1, 6],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条间隔",
                example: "1",
                detail: "柱条之间的间隔距离，默认为1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "柱条颜色",
                example: "#fc5c5c",
                detail: "线图的线条颜色，可以是否个范围A1、色表索引数值或者具体颜色值，设置为0或false则不显示，支持regx、rgb、rgba等。默认#fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "负向柱条颜色",
                example: "#97b552",
                detail: "负向柱条颜色设置，代表负值的颜色，同柱条颜色配置，默认#97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "零值柱条颜色",
                example: "#999",
                detail: "零值柱条颜色设置，代表0值颜色，同柱条颜色配置，默认#999",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "色板",
                example: "#97b552",
                detail: "调色板可以单独设置每个柱条的颜色，可设置多个，支持两种格式：1颜色例如#000，代表第一个柱的颜色是黑色；2数值范围:颜色，例如-2:#000表示数值为-2的柱为黑色，0-5:#000表示数值0-5的柱为黑色，默认为空",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PIESPLINES",
            t: "3",
            d: "生成嵌入在单元格内的饼图sparklines，一般用于描述数据占比",
            a: "生成单元格饼图",
            m: [1, 5],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "旋转角度",
                example: "0",
                detail: "饼图的旋转角度，默认为0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "饼图边框",
                example: "0",
                detail: "饼图边框大小，默认为无0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "边框颜色",
                example: "#000",
                detail: "饼图边框颜色，默认为#000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "饼图色板",
                example: "#97b552",
                detail: "调色板可以设置切片的颜色，可设置为A1:A10等范围，默认为#2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BOXSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的箱线图sparklines，一般用于描述数据集的统计分布",
            a: "生成单元格箱线图",
            m: [1, 4],
            p: [{
                name: "数据范围",
                example: "A1:A20",
                detail: "数据范围，数值才能被有效计算，例如A1:A20， {1,2,3,4,5}等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "离群点比例",
                example: "1.5",
                detail: "离群点的阈值范围，如果为0或false则不显示，默认为1.5倍",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "目标点值",
                example: "10",
                detail: "箱线图上的目标值设置，默认为false不显示",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "数据点大小",
                example: "1.5",
                detail: "目标点和离群点的半径大小设置，默认为1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BULLETSPLINES",
            t: "3",
            d: "生成嵌入在单元格内的子弹图sparklines，一般用于描述任务达成率",
            a: "生成单元格子弹图",
            m: [2, 3],
            p: [{
                name: "目标",
                example: "10",
                detail: "达成的目标值，数值才能被有效计算，例如A1， 100等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "实际完成",
                example: "8",
                detail: "目前完成值，数值才能被有效计算，例如A1， 100等。",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "对比值",
                example: "12",
                detail: "对比值，例如超额、最低、获奖底线等，数值才能被有效计算，例如A1， 100等。可以设置最多9个对比值",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMPOSESPLINES",
            t: "3",
            d: "支持多个类型的图画在同一个单元格,每个参数代表一个sparklines图",
            a: "组合sparklines图到一个单元格",
            m: [1, 1],
            p: [{
                name: "图设置",
                example: "PIESPLINES(A1:A20)",
                detail: "sparklines图设置，例如A1:A20， 一个完成的饼图、线图设置等。",
                require: "m",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SORT",
            t: "14",
            d: "返回数组中元素的排序数组。返回的数组与提供的数组参数形状相同。",
            a: "返回数组中元素的排序数组。返回的数组与提供的数组参数形状相同。",
            m: [1, 4],
            p: [{
                name: "array",
                detail: "要排序的范围或数组。",
                example: "A2:A17",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_index",
                detail: "[可选] - 表示要排序的行或列的数字。（默认row1/col1）",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_order",
                detail: "[可选] - 表示所需排序顺序的数字；1表示升序（默认），-1表示降序。",
                example: "-1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "by_col",
                detail: "[可选] - 表示所需排序方向的逻辑值；按行排序为FALSE()（默认），按列排序为TRUE()。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FILTER",
            t: "14",
            d: "基于一个布尔（真/假）数组过滤一个数组。",
            a: "基于一个布尔（真/假）数组过滤一个数组。",
            m: [2, 3],
            p: [{
                name: "array",
                detail: "要筛选的数组或范围。",
                example: "A5:D20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "include",
                detail: "布尔数组，其高度或宽度与数组相同",
                example: "1",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "if_empty",
                detail: "[可选] - 如果包含数组中的所有值都为空(filter不返回任何值)，则返回的值。",
                example: '""',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNIQUE",
            t: "14",
            d: "返回列表或区域中的唯一值的列表。",
            a: "返回列表或区域中的唯一值的列表。",
            m: [1, 3],
            p: [{
                name: "array",
                detail: "从其返回唯一值的数组或区域。",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "by_col",
                detail: "[可选] - 逻辑值，指示如何比较；按行 = FALSE() 或省略；按列 = TRUE()。",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "occurs_once",
                detail: "[可选] - 逻辑值，仅返回唯一值中出现一次 = TRUE()；包括所有唯一值 = FALSE() 或省略。",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANDARRAY",
            t: "14",
            d: "返回 0 到 1 之间的随机数字数组。",
            a: "返回 0 到 1 之间的随机数字数组。",
            m: [0, 2],
            p: [{
                name: "rows",
                detail: "[可选] - 要返回的行数。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cols",
                detail: "[可选] - 要返回的列数。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEQUENCE",
            t: "14",
            d: "生成数字序列的列表。",
            a: "生成数字序列的列表。",
            m: [1, 4],
            p: [{
                name: "rows",
                detail: "要返回的行数。",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cols",
                detail: "[可选] - 要返回的列数。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start",
                detail: "[可选] - 序列中的第一个数字。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "step",
                detail: "[可选] - 序列中每个序列值的增量。",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }],
        toolbar: {
            undo: "撤销",
            redo: "重做",
            paintFormat: "格式刷",
            currencyFormat: "货币格式",
            percentageFormat: "百分比格式",
            numberDecrease: "减少小数位数",
            numberIncrease: "增加小数位数",
            moreFormats: "更多格式",
            font: "字体",
            fontSize: "字号大小",
            bold: "粗体 (Ctrl+B)",
            italic: "斜体 (Ctrl+I)",
            strikethrough: "删除线 (Alt+Shift+5)",
            textColor: "文本颜色",
            chooseColor: "颜色选择",
            resetColor: "重置颜色",
            customColor: "自定义",
            alternatingColors: "交替颜色",
            confirmColor: "确定颜色",
            cancelColor: "取消",
            collapse: "收起",
            fillColor: "单元格颜色",
            border: "边框",
            borderStyle: "边框类型",
            mergeCell: "合并单元格",
            chooseMergeType: "选择合并类型",
            horizontalAlign: "水平对齐",
            verticalAlign: "垂直对齐",
            alignment: "对齐方式",
            textWrap: "文本换行",
            textWrapMode: "换行方式",
            textRotate: "文本旋转",
            textRotateMode: "旋转方式",
            freezeTopRow: "冻结首行",
            sortAndFilter: "排序和筛选",
            findAndReplace: "查找替换",
            sum: "求和",
            autoSum: "自动求和",
            moreFunction: "更多函数",
            conditionalFormat: "条件格式",
            postil: "批注",
            pivotTable: "数据透视表",
            chart: "图表",
            screenshot: "截图",
            splitColumn: "分列",
            insertImage: "插入图片",
            insertLink: "插入链接",
            dataVerification: "数据验证",
            protection: "保护工作表内容",
            clearText: "清除颜色选择",
            noColorSelectedText: "没有颜色被选择",
            toolMore: "更多",
            toolLess: "少于",
            toolClose: "收起",
            toolMoreTip: "更多功能",
            moreOptions: "更多选项",
            cellFormat: "设置单元格格式",
            print: "打印"
        },
        alternatingColors: {
            applyRange: "应用范围",
            selectRange: "选择应用范围",
            header: "页眉",
            footer: "页脚",
            errorInfo: "不能对多重选择区域执行此操作，请选择单个区域，然后再试",
            textTitle: "格式样式",
            custom: "自定义",
            close: "关闭",
            selectionTextColor: "选择文本颜色",
            selectionCellColor: "选择单元格颜色",
            removeColor: "移除交替颜色",
            colorShow: "颜色",
            currentColor: "当前颜色",
            tipSelectRange: "请选择交替颜色应用范围",
            errorNoRange: "您选择的应用范围不是选区！",
            errorExistColors: "您选择的应用范围已存在交替颜色且不属于你要编辑的应用范围！"
        },
        button: {
            confirm: "确定",
            cancel: "取消",
            close: "关闭",
            update: "Update",
            delete: "Delete",
            insert: "新建"
        },
        paint: {
            start: "格式刷开启",
            end: "ESC键退出",
            tipSelectRange: "请选择需要复制格式的区域",
            tipNotMulti: "无法对多重选择区域执行此操作"
        },
        format: {
            moreCurrency: "更多货币格式",
            moreDateTime: "更多日期与时间格式",
            moreNumber: "更多数字格式",
            titleCurrency: "货币格式",
            decimalPlaces: "小数位数",
            titleDateTime: "日期与时间格式",
            titleNumber: "数字格式"
        },
        info: {
            detailExport: "新打开",
            detailSaveAs: "Save As",
            detailSave: "已恢复本地缓存",
            row: "行",
            column: "列",
            loading: "渲染中",
            copy: "副本",
            return: "返回",
            rename: "重命名",
            tips: "表格重命名",
            noName: "无标题的电子表格",
            wait: "待更新",
            add: "添加",
            addLast: "在底部添加",
            backTop: "回到顶部",
            pageInfo: "共${total}条，${totalPage}页，当前已显示${currentPage}页",
            nextPage: "下一页",
            tipInputNumber: "请输入数字",
            tipInputNumberLimit: "增加范围限制在1-100",
            tipRowHeightLimit: "行高必须在0 ~ 545之间",
            tipColumnWidthLimit: "列宽必须在0 ~ 2038之间",
            pageInfoFull: "共${total}条，${totalPage}页，已显示全部数据"
        },
        currencyDetail: {
            RMB: "人民币",
            USdollar: "美元",
            EUR: "欧元",
            GBP: "英镑",
            HK: "港元",
            JPY: "日元",
            AlbanianLek: "阿尔巴尼亚列克",
            AlgerianDinar: "阿尔及利亚第纳尔",
            Afghani: "阿富汗尼",
            ArgentinePeso: "阿根廷比索",
            UnitedArabEmiratesDirham: "阿拉伯联合酋长国迪拉姆",
            ArubanFlorin: "阿鲁巴弗罗林",
            OmaniRial: "阿曼里亚尔",
            Azerbaijanimanat: "阿塞拜疆马纳特",
            EgyptianPound: "埃及镑",
            EthiopianBirr: "埃塞俄比亚比尔",
            AngolaKwanza: "安哥拉宽扎",
            AustralianDollar: "澳大利亚元",
            Patacas: "澳门元",
            BarbadosDollar: "巴巴多斯元",
            PapuaNewGuineaKina: "巴布亚新几内亚基那",
            BahamianDollar: "巴哈马元",
            PakistanRupee: "巴基斯坦卢比",
            ParaguayanGuarani: "巴拉圭瓜拉尼",
            BahrainiDinar: "巴林第纳尔",
            PanamanianBalboa: "巴拿马巴波亚",
            Brazilianreal: "巴西里亚伊",
            Belarusianruble: "白俄罗斯卢布",
            BermudianDollar: "百慕大元",
            BulgarianLev: "保加利亚列弗",
            IcelandKrona: "冰岛克朗",
            BosniaHerzegovinaConvertibleMark: "波黑可兑换马克",
            PolishZloty: "波兰兹罗提",
            Boliviano: "玻利维亚诺",
            BelizeDollar: "伯利兹元",
            BotswanaPula: "博茨瓦纳普拉",
            NotDannuzhamu: "不丹努扎姆",
            BurundiFranc: "布隆迪法郎",
            NorthKoreanWon: "朝鲜圆",
            DanishKrone: "丹麦克朗",
            EastCaribbeanDollar: "东加勒比元",
            DominicaPeso: "多米尼加比索",
            RussianRuble: "俄国卢布",
            EritreanNakfa: "厄立特里亚纳克法",
            CFAfranc: "非洲金融共同体法郎",
            PhilippinePeso: "菲律宾比索",
            FijiDollar: "斐济元",
            CapeVerdeEscudo: "佛得角埃斯库多",
            FalklandIslandsPound: "福克兰群岛镑",
            GambianDalasi: "冈比亚达拉西",
            Congolesefranc: "刚果法郎",
            ColombianPeso: "哥伦比亚比索",
            CostaRicanColon: "哥斯达黎加科朗",
            CubanPeso: "古巴比索",
            Cubanconvertiblepeso: "古巴可兑换比索",
            GuyanaDollar: "圭亚那元",
            KazakhstanTenge: "哈萨克斯坦坚戈",
            Haitiangourde: "海地古德",
            won: "韩元",
            NetherlandsAntillesGuilder: "荷属安的列斯盾",
            Honduraslempiras: "洪都拉斯拉伦皮拉",
            DjiboutiFranc: "吉布提法郎",
            KyrgyzstanSom: "吉尔吉斯斯坦索姆",
            GuineaFranc: "几内亚法郎",
            CanadianDollar: "加拿大元",
            GhanaianCedi: "加纳塞地",
            Cambodianriel: "柬埔寨瑞尔",
            CzechKoruna: "捷克克朗",
            ZimbabweDollar: "津巴布韦元",
            QatariRiyal: "卡塔尔里亚尔",
            CaymanIslandsDollar: "开曼群岛元",
            Comorianfranc: "科摩罗法郎",
            KuwaitiDinar: "科威特第纳尔",
            CroatianKuna: "克罗地亚库纳",
            KenyanShilling: "肯尼亚先令",
            LesothoLoti: "莱索托洛蒂",
            LaoKip: "老挝基普",
            LebanesePound: "黎巴嫩镑",
            Lithuanianlitas: "立陶宛立特",
            LibyanDinar: "利比亚第纳尔",
            LiberianDollar: "利比亚元",
            RwandaFranc: "卢旺达法郎",
            RomanianLeu: "罗马尼亚列伊",
            MalagasyAriary: "马达加斯加阿里亚里",
            MaldivianRufiyaa: "马尔代夫拉菲亚",
            MalawiKwacha: "马拉维克瓦查",
            MalaysianRinggit: "马来西亚林吉特",
            MacedoniawearingDinar: "马其顿戴第纳尔",
            MauritiusRupee: "毛里求斯卢比",
            MauritanianOuguiya: "毛里塔尼亚乌吉亚",
            MongolianTugrik: "蒙古图格里克",
            BangladeshiTaka: "孟加拉塔卡",
            PeruvianNuevoSol: "秘鲁新索尔",
            MyanmarKyat: "缅甸开亚特",
            MoldovanLeu: "摩尔多瓦列伊",
            MoroccanDirham: "摩洛哥迪拉姆",
            MozambiqueMetical: "莫桑比克梅蒂卡尔",
            MexicanPeso: "墨西哥比索",
            NamibianDollar: "纳米比亚元",
            SouthAfricanRand: "南非兰特",
            SouthSudanesePound: "南苏丹镑",
            NicaraguaCordoba: "尼加拉瓜科多巴",
            NepaleseRupee: "尼泊尔卢比",
            NigerianNaira: "尼日利亚奈拉",
            NorwegianKrone: "挪威克朗",
            GeorgianLari: "乔治亚拉瑞",
            RMBOffshore: "人民币（离岸）",
            SwedishKrona: "瑞典克朗",
            SwissFranc: "瑞士法郎",
            SerbianDinar: "塞尔维亚第纳尔",
            SierraLeone: "塞拉利昂利昂",
            SeychellesRupee: "塞舌尔卢比",
            SaudiRiyal: "沙特里亚尔",
            SaoTomeDobra: "圣多美多布拉",
            SaintHelenapound: "圣赫勒拿群岛磅",
            SriLankaRupee: "斯里兰卡卢比",
            SwazilandLilangeni: "斯威士兰里兰吉尼",
            SudanesePound: "苏丹镑",
            Surinamesedollar: "苏里南元",
            SolomonIslandsDollar: "所罗门群岛元",
            SomaliShilling: "索马里先令",
            TajikistanSomoni: "塔吉克斯坦索莫尼",
            PacificFranc: "太平洋法郎",
            ThaiBaht: "泰国铢",
            TanzanianShilling: "坦桑尼亚先令",
            TonganPaanga: "汤加潘加",
            TrinidadandTobagoDollar: "特立尼达和多巴哥元",
            TunisianDinar: "突尼斯第纳尔",
            TurkishLira: "土耳其里拉",
            VanuatuVatu: "瓦努阿图瓦图",
            GuatemalanQuetzal: "危地马拉格查尔",
            CommissionBolivar: "委内瑞拉博利瓦",
            BruneiDollar: "文莱元",
            UgandanShilling: "乌干达先令",
            UkrainianHryvnia: "乌克兰格里夫尼亚",
            UruguayanPeso: "乌拉圭比索",
            Uzbekistansom: "乌兹别克斯坦苏姆",
            WesternSamoaTala: "西萨摩亚塔拉",
            SingaporeDollar: "新加坡元",
            NT: "新台币",
            NewZealandDollar: "新西兰元",
            HungarianForint: "匈牙利福林",
            SyrianPound: "叙利亚镑",
            JamaicanDollar: "牙买加元",
            ArmenianDram: "亚美尼亚德拉姆",
            YemeniRial: "也门里亚尔",
            IraqiDinar: "伊拉克第纳尔",
            IranianRial: "伊朗里亚尔",
            NewIsraeliShekel: "以色列新谢克尔",
            IndianRupee: "印度卢比",
            IndonesianRupiah: "印度尼西亚卢比",
            JordanianDinar: "约旦第纳尔",
            VND: "越南盾",
            ZambianKwacha: "赞比亚克瓦查",
            GibraltarPound: "直布罗陀镑",
            ChileanPeso: "智利比索",
            CFAFrancBEAC: "中非金融合作法郎"
        },
        defaultFmt: [{
            text: "自动",
            value: "General",
            example: ""
        }, {
            text: "纯文本",
            value: "@",
            example: ""
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "数字",
            value: "##0.00",
            example: "1000.12"
        }, {
            text: "百分比",
            value: "#0.00%",
            example: "12.21%"
        }, {
            text: "科学计数",
            value: "0.00E+00",
            example: "1.01E+5"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "会计",
            value: "¥(0.00)",
            example: "¥(1200.09)"
        }, {
            text: "万元",
            value: "w",
            example: "1亿2000万2500"
        }, {
            text: "货币",
            value: "¥0.00",
            example: "¥1200.09"
        }, {
            text: "万元2位小数",
            value: "w0.00",
            example: "2万2500.55"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "日期",
            value: "yyyy-MM-dd",
            example: "2017-11-29"
        }, {
            text: "时间",
            value: "hh:mm AM/PM",
            example: "3:00 PM"
        }, {
            text: "时间24H",
            value: "hh:mm",
            example: "15:00"
        }, {
            text: "日期时间",
            value: "yyyy-MM-dd hh:mm AM/PM",
            example: "2017-11-29 3:00 PM"
        }, {
            text: "日期时间24H",
            value: "yyyy-MM-dd hh:mm",
            example: "2017-11-29 15:00"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "自定义格式",
            value: "fmtOtherSelf",
            example: "more"
        }],
        dateFmtList: [{
            name: "1930-08-05",
            value: "yyyy-MM-dd"
        }, {
            name: "1930/8/5",
            value: "yyyy/MM/dd"
        }, {
            name: "1930年8月5日",
            value: 'yyyy"年"M"月"d"日"'
        }, {
            name: "08-05",
            value: "MM-dd"
        }, {
            name: "8-5",
            value: "M-d"
        }, {
            name: "8月5日",
            value: 'M"月"d"日"'
        }, {
            name: "13:30:30",
            value: "h:mm:ss"
        }, {
            name: "13:30",
            value: "h:mm"
        }, {
            name: "下午01:30",
            value: "上午/下午 hh:mm"
        }, {
            name: "下午1:30",
            value: "上午/下午 h:mm"
        }, {
            name: "下午1:30:30",
            value: "上午/下午 h:mm:ss"
        }, {
            name: "08-05 下午01:30",
            value: "MM-dd 上午/下午 hh:mm"
        }],
        fontFamily: {
            MicrosoftYaHei: "Microsoft YaHei"
        },
        fontarray: ["Times New Roman", "Arial", "Tahoma", "Verdana", "微软雅黑", "宋体", "黑体", "楷体", "仿宋", "新宋体", "华文新魏", "华文行楷", "华文隶书"],
        fontjson: {
            "times new roman": 0,
            arial: 1,
            tahoma: 2,
            verdana: 3,
            "微软雅黑": 4,
            "microsoft yahei": 4,
            "宋体": 5,
            simsun: 5,
            "黑体": 6,
            simhei: 6,
            "楷体": 7,
            kaiti: 7,
            "仿宋": 8,
            fangsong: 8,
            "新宋体": 9,
            nsimsun: 9,
            "华文新魏": 10,
            stxinwei: 10,
            "华文行楷": 11,
            stxingkai: 11,
            "华文隶书": 12,
            stliti: 12
        },
        border: {
            borderTop: "上框线",
            borderBottom: "下框线",
            borderLeft: "左框线",
            borderRight: "右框线",
            borderNone: "无",
            borderAll: "所有",
            borderOutside: "外侧",
            borderInside: "内侧",
            borderHorizontal: "内侧横线",
            borderVertical: "内侧竖线",
            borderColor: "边框颜色",
            borderSize: "边框粗细"
        },
        merge: {
            mergeAll: "全部合并",
            mergeV: "垂直合并",
            mergeH: "水平合并",
            mergeCancel: "取消合并",
            overlappingError: "不能合并重叠区域",
            partiallyError: "无法对部分合并单元格执行此操作"
        },
        align: {
            left: "左对齐",
            center: "中间对齐",
            right: "右对齐",
            top: "顶部对齐",
            middle: "居中对齐",
            bottom: "底部对齐"
        },
        textWrap: {
            overflow: "溢出",
            wrap: "自动换行",
            clip: "截断"
        },
        rotation: {
            none: "无旋转",
            angleup: "向上倾斜",
            angledown: "向下倾斜",
            vertical: "竖排文字",
            rotationUp: "向上90°",
            rotationDown: "向下90°"
        },
        freezen: {
            default: "冻结首行",
            freezenRow: "冻结首行",
            freezenColumn: "冻结首列",
            freezenRC: "冻结行列",
            freezenRowRange: "冻结行到选区",
            freezenColumnRange: "冻结列到选区",
            freezenRCRange: "冻结行列到选区",
            freezenCancel: "取消冻结",
            noSeletionError: "没有选区"
        },
        sort: {
            asc: "升序",
            desc: "降序",
            custom: "自定义排序",
            hasTitle: "数据具有标题行",
            sortBy: "排序依据",
            addOthers: "添加其他排序列",
            close: "关闭",
            confirm: "排序",
            columnOperation: "列",
            secondaryTitle: "次要排序",
            sortTitle: "排序范围",
            sortRangeTitle: "排序范围从",
            sortRangeTitleTo: "到",
            noRangeError: "不能对多重选择区域执行此操作，请选择单个区域，然后再试",
            mergeError: "选区有合并单元格，无法执行此操作！"
        },
        filter: (_filter = {
            filter: "筛选",
            clearFilter: "清除筛选",
            sortByAsc: "以A-Z升序排列",
            sortByDesc: "以Z-A降序排列",
            filterByColor: "按颜色筛选",
            filterByCondition: "按条件过滤",
            filterByValues: "按值过滤",
            filiterInputNone: "无",
            filiterInputTip: "输入筛选值",
            filiterRangeStartTip: "范围开始",
            filiterRangeEndTip: "范围结束",
            filterValueByAllBtn: "全选",
            filterValueByClearBtn: "清除",
            filterValueByInverseBtn: "反选",
            filterValueByTip: "按照值进行筛选",
            filterConform: "确 认",
            filterCancel: "取 消"
        },
        _defineProperty(_filter, "clearFilter", "清除筛选"),
        _defineProperty(_filter, "conditionNone", "无"),
        _defineProperty(_filter, "conditionCellIsNull", "单元格为空"),
        _defineProperty(_filter, "conditionCellNotNull", "单元格有数据"),
        _defineProperty(_filter, "conditionCellTextContain", "文本包含"),
        _defineProperty(_filter, "conditionCellTextNotContain", "文本不包含"),
        _defineProperty(_filter, "conditionCellTextStart", "文本开头为"),
        _defineProperty(_filter, "conditionCellTextEnd", "文本结尾为"),
        _defineProperty(_filter, "conditionCellTextEqual", "文本等于"),
        _defineProperty(_filter, "conditionCellDateEqual", "日期等于"),
        _defineProperty(_filter, "conditionCellDateBefore", "日期早于"),
        _defineProperty(_filter, "conditionCellDateAfter", "日期晚于"),
        _defineProperty(_filter, "conditionCellGreater", "大于"),
        _defineProperty(_filter, "conditionCellGreaterEqual", "大于等于"),
        _defineProperty(_filter, "conditionCellLess", "小于"),
        _defineProperty(_filter, "conditionCellLessEqual", "小于等于"),
        _defineProperty(_filter, "conditionCellEqual", "等于"),
        _defineProperty(_filter, "conditionCellNotEqual", "不等于"),
        _defineProperty(_filter, "conditionCellBetween", "介于"),
        _defineProperty(_filter, "conditionCellNotBetween", "不在其中"),
        _defineProperty(_filter, "filiterMoreDataTip", "数据量大！请稍后"),
        _defineProperty(_filter, "filiterMonthText", "月"),
        _defineProperty(_filter, "filiterYearText", "年"),
        _defineProperty(_filter, "filiterByColorTip", "按单元格颜色筛选"),
        _defineProperty(_filter, "filiterByTextColorTip", "按单元格字体颜色筛选"),
        _defineProperty(_filter, "filterContainerOneColorTip", "本列仅包含一种颜色"),
        _defineProperty(_filter, "filterDateFormatTip", "日期格式"),
        _defineProperty(_filter, "valueBlank", "(空白)"),
        _defineProperty(_filter, "mergeError", "筛选选区有合并单元格，无法执行此操作！"),
        _filter),
        rightclick: {
            copy: "复制",
            copyAs: "复制为",
            paste: "粘贴",
            insert: "插入",
            delete: "删除",
            deleteCell: "删除单元格",
            deleteSelected: "删除选中",
            hide: "隐藏",
            hideSelected: "隐藏选中",
            showHide: "显示隐藏",
            to: "向",
            left: "左",
            right: "右",
            top: "上",
            bottom: "下",
            moveLeft: "左移",
            moveUp: "上移",
            add: "增加",
            row: "行",
            column: "列",
            width: "宽",
            height: "高",
            number: "数字",
            confirm: "确认",
            orderAZ: "A-Z顺序排列",
            orderZA: "Z-A降序排列",
            clearContent: "清除内容",
            matrix: "矩阵操作选区",
            sortSelection: "排序选区",
            filterSelection: "筛选选区",
            chartGeneration: "图表生成",
            firstLineTitle: "首行为标题",
            untitled: "无标题",
            array1: "一维数组",
            array2: "二维数组",
            array3: "多维数组",
            diagonal: "对角线",
            antiDiagonal: "反对角线",
            diagonalOffset: "对角偏移",
            offset: "偏移量",
            boolean: "布尔值",
            flip: "翻转",
            upAndDown: "上下",
            leftAndRight: "左右",
            clockwise: "顺时针",
            counterclockwise: "逆时针",
            transpose: "转置",
            matrixCalculation: "矩阵计算",
            plus: "加",
            minus: "减",
            multiply: "乘",
            divided: "除",
            power: "次方",
            root: "次方根",
            log: "log",
            delete0: "删除两端0值",
            removeDuplicate: "删除重复值",
            byRow: "按行",
            byCol: "按列",
            generateNewMatrix: "生成新矩阵"
        },
        comment: {
            insert: "新建批注",
            edit: "编辑批注",
            delete: "删除",
            showOne: "显示/隐藏批注",
            showAll: "显示/隐藏所有批注"
        },
        screenshot: {
            screenshotTipNoSelection: "请框选需要截图的范围",
            screenshotTipTitle: "提示！",
            screenshotTipHasMerge: "无法对合并单元格执行此操作",
            screenshotTipHasMulti: "无法对多重选择区域执行此操作",
            screenshotTipSuccess: "截取成功",
            screenshotImageName: "截图",
            downLoadClose: "关闭",
            downLoadCopy: "复制到剪切板",
            downLoadBtn: "下载",
            browserNotTip: "下载功能IE浏览器不支持！",
            rightclickTip: "请在图片上右键点击'复制'",
            successTip: "已成功复制（如果粘贴失败，请在图片上右键点击'复制图片'）"
        },
        splitText: {
            splitDelimiters: "分割符号",
            splitOther: "其它",
            splitContinueSymbol: "连续分隔符号视为单个处理",
            splitDataPreview: "数据预览",
            splitTextTitle: "文本分列",
            splitConfirmToExe: "此处已有数据，是否替换它？",
            tipNoMulti: "不能对多重选择区域执行此操作，请选择单个区域，然后再试",
            tipNoMultiColumn: "一次只能转换一列数据，选定区域可以有多行，但不能有多列，请在选定单列区域以后再试"
        },
        imageText: {
            imageSetting: "图片设置",
            close: "关闭",
            conventional: "常规",
            moveCell1: "移动并调整单元格大小",
            moveCell2: "移动并且不调整单元格的大小",
            moveCell3: "不要移动单元格并调整其大小",
            fixedPos: "固定位置",
            border: "边框",
            width: "宽度",
            radius: "半径",
            style: "样式",
            solid: "实线",
            dashed: "虚线",
            dotted: "点状",
            double: "双线",
            color: "颜色"
        },
        punctuation: {
            tab: "Tab 键",
            semicolon: "分号",
            comma: "逗号",
            space: "空格"
        },
        findAndReplace: {
            find: "查找",
            replace: "替换",
            goto: "转到",
            location: "定位条件",
            formula: "公式",
            date: "日期",
            number: "数字",
            string: "字符",
            error: "错误",
            condition: "条件格式",
            rowSpan: "间隔行",
            columnSpan: "间隔列",
            locationExample: "定位",
            lessTwoRowTip: "请选择最少两行",
            lessTwoColumnTip: "请选择最少两行",
            findTextbox: "查找内容",
            replaceTextbox: "替换内容",
            regexTextbox: "正则表达式匹配",
            wholeTextbox: "整词匹配",
            distinguishTextbox: "区分大小写匹配",
            allReplaceBtn: "全部替换",
            replaceBtn: "替换",
            allFindBtn: "查找全部",
            findBtn: "查找下一个",
            noFindTip: "没有查找到该内容",
            modeTip: "该模式下不可进行此操作",
            searchTargetSheet: "工作表",
            searchTargetCell: "单元格",
            searchTargetValue: "值",
            searchInputTip: "请输入查找内容",
            noReplceTip: "没有可替换的内容",
            noMatchTip: "找不到匹配项",
            successTip: "已经帮您搜索并进行了${xlength}处替换",
            locationConstant: "常量",
            locationFormula: "公式",
            locationDate: "日期",
            locationDigital: "数字",
            locationString: "字符",
            locationBool: "逻辑值",
            locationError: "错误",
            locationNull: "空值",
            locationCondition: "条件格式",
            locationRowSpan: "间隔行",
            locationColumnSpan: "间隔列",
            locationTiplessTwoRow: "请选择最少两行",
            locationTiplessTwoColumn: "请选择最少两列",
            locationTipNotFindCell: "未找到单元格"
        },
        sheetconfig: {
            delete: "删除",
            copy: "复制",
            rename: "重命名",
            changeColor: "更改颜色",
            hide: "隐藏",
            unhide: "取消隐藏",
            moveLeft: "向左移",
            moveRight: "向右移",
            resetColor: "重置颜色",
            cancelText: "取消",
            chooseText: "确定颜色",
            tipNameRepeat: "标签页的名称不能重复！请重新修改",
            noMoreSheet: "工作薄内至少含有一张可视工作表。若需删除选定的工作表，请先插入一张新工作表或显示一张隐藏的工作表。",
            confirmDelete: "是否删除",
            redoDelete: "可以通过Ctrl+Z撤销删除",
            noHide: "不能隐藏, 至少保留一个sheet标签",
            chartEditNoOpt: "图表编辑模式下不允许该操作！",
            sheetNameSpecCharError: "名称不能包含:[ ] :  ? * / ' \""
        },
        conditionformat: {
            conditionformat_greaterThan: "条件格式——大于",
            conditionformat_greaterThan_title: "为大于以下值的单元格设置格式",
            conditionformat_lessThan: "条件格式——小于",
            conditionformat_lessThan_title: "为小于以下值的单元格设置格式",
            conditionformat_betweenness: "条件格式——介于",
            conditionformat_betweenness_title: "为介于以下值的单元格设置格式",
            conditionformat_equal: "条件格式——等于",
            conditionformat_equal_title: "为等于以下值的单元格设置格式",
            conditionformat_textContains: "条件格式——文本包含",
            conditionformat_textContains_title: "为包含以下文本的单元格设置格式",
            conditionformat_occurrenceDate: "条件格式——发生日期",
            conditionformat_occurrenceDate_title: "为包含以下日期的单元格设置格式",
            conditionformat_duplicateValue: "条件格式——重复值",
            conditionformat_duplicateValue_title: "为包含以下类型值的单元格设置格式",
            conditionformat_top10: "条件格式——前 10 项",
            conditionformat_top10_percent: "条件格式——前 10%",
            conditionformat_top10_title: "为值最大的那些单元格设置格式",
            conditionformat_last10: "条件格式——最后 10 项",
            conditionformat_last10_percent: "条件格式——最后 10%",
            conditionformat_last10_title: "为值最小的那些单元格设置格式",
            conditionformat_AboveAverage: "条件格式——高于平均值",
            conditionformat_AboveAverage_title: "为高于平均值的单元格设置格式",
            conditionformat_SubAverage: "条件格式——低于平均值",
            conditionformat_SubAverage_title: "为低于平均值的单元格设置格式",
            rule: "规则",
            newRule: "新建规则",
            editRule: "编辑规则",
            deleteRule: "删除规则",
            deleteCellRule: "清除所选单元格的规则",
            deleteSheetRule: "清除整个工作表的规则",
            manageRules: "管理规则",
            showRules: "显示其格式规则",
            highlightCellRules: "突出显示单元格规则",
            itemSelectionRules: "项目选取规则",
            conditionformatManageRules: "条件格式规则管理器",
            format: "格式",
            setFormat: "设置格式",
            setAs: "设置为",
            setAsByArea: "针对选定区域，设置为",
            applyRange: "应用范围",
            selectRange: "点击选择应用范围",
            selectRange_percent: "所选范围的百分比",
            selectRange_average: "选定范围的平均值",
            selectRange_value: "选定范围中的数值",
            pleaseSelectRange: "请选择应用范围",
            selectDataRange: "点击选择数据范围",
            selectCell: "选择单元格",
            pleaseSelectCell: "请选择单元格",
            pleaseSelectADate: "请选择日期",
            pleaseEnterInteger: "请输入一个介于 1 和 1000 之间的整数",
            onlySingleCell: "只能对单个单元格进行引用",
            conditionValueCanOnly: "条件值只能是数字或者单个单元格",
            ruleTypeItem1: "基于各自值设置所有单元格的格式",
            ruleTypeItem2: "只为包含以下内容的单元格设置格式",
            ruleTypeItem2_title: "只为满足以下条件的单元格",
            ruleTypeItem3: "仅对排名靠前或靠后的数值设置格式",
            ruleTypeItem3_title: "为以下排名内的值",
            ruleTypeItem4: "仅对高于或低于平均值的数值设置格式",
            ruleTypeItem4_title: "为满足以下条件的值",
            ruleTypeItem5: "仅对唯一值或重复值设置格式",
            textColor: "文本颜色",
            cellColor: "单元格颜色",
            confirm: "确定",
            confirmColor: "确定颜色",
            cancel: "取消",
            close: "关闭",
            clearColorSelect: "清除颜色选择",
            sheet: "表",
            currentSheet: "当前工作表",
            dataBar: "数据条",
            dataBarColor: "数据条颜色",
            gradientDataBar_1: "蓝-白渐变数据条",
            gradientDataBar_2: "绿-白渐变数据条",
            gradientDataBar_3: "红-白渐变数据条",
            gradientDataBar_4: "橙-白渐变数据条",
            gradientDataBar_5: "浅蓝-白渐变数据条",
            gradientDataBar_6: "紫-白渐变数据条",
            solidColorDataBar_1: "蓝色数据条",
            solidColorDataBar_2: "绿色数据条",
            solidColorDataBar_3: "红色数据条",
            solidColorDataBar_4: "橙色数据条",
            solidColorDataBar_5: "浅蓝色数据条",
            solidColorDataBar_6: "紫色数据条",
            colorGradation: "色阶",
            colorGradation_1: "绿-黄-红色阶",
            colorGradation_2: "红-黄-绿色阶",
            colorGradation_3: "绿-白-红色阶",
            colorGradation_4: "红-白-绿色阶",
            colorGradation_5: "蓝-白-红色阶",
            colorGradation_6: "红-白-蓝色阶",
            colorGradation_7: "白-红色阶",
            colorGradation_8: "红-白色阶",
            colorGradation_9: "绿-白色阶",
            colorGradation_10: "白-绿色阶",
            colorGradation_11: "绿-黄色阶",
            colorGradation_12: "黄-绿色阶",
            icons: "图标集",
            pleaseSelectIcon: "请点击选择一组图标：",
            cellValue: "单元格值",
            specificText: "特定文本",
            occurrence: "发生日期",
            greaterThan: "大于",
            lessThan: "小于",
            between: "介于",
            equal: "等于",
            in: "和",
            to: "到",
            between2: "之间",
            contain: "包含",
            textContains: "文本包含",
            duplicateValue: "重复值",
            uniqueValue: "唯一值",
            top: "前",
            top10: "前 10 项",
            top10_percent: "前 10%",
            last: "后",
            last10: "后 10 项",
            last10_percent: "后 10%",
            oneself: "个",
            above: "高于",
            aboveAverage: "高于平均值",
            below: "低于",
            belowAverage: "低于平均值",
            all: "全部",
            yesterday: "昨天",
            today: "今天",
            tomorrow: "明天",
            lastWeek: "上周",
            thisWeek: "本周",
            lastMonth: "上月",
            thisMonth: "本月",
            lastYear: "去年",
            thisYear: "本年",
            last7days: "最近7天",
            last30days: "最近30天",
            next7days: "未来7天",
            next30days: "未来30天",
            next60days: "未来60天",
            chooseRuleType: "选择规则类型",
            editRuleDescription: "编辑规则说明",
            newFormatRule: "新建格式规则",
            editFormatRule: "编辑格式规则",
            formatStyle: "格式样式",
            fillType: "填充类型",
            color: "颜色",
            twocolor: "双色",
            tricolor: "三色",
            multicolor: "彩色",
            grayColor: "灰色",
            gradient: "渐变",
            solid: "实心",
            maxValue: "最大值",
            medianValue: "中间值",
            minValue: "最小值",
            direction: "方向",
            threeWayArrow: "三向箭头",
            fourWayArrow: "四向箭头",
            fiveWayArrow: "五向箭头",
            threeTriangles: "3个三角形",
            shape: "形状",
            threeColorTrafficLight: "三色交通灯",
            fourColorTrafficLight: "四色交通灯",
            threeSigns: "三标志",
            greenRedBlackGradient: "绿-红-黑渐变",
            rimless: "无边框",
            bordered: "有边框",
            mark: "标记",
            threeSymbols: "三个符号",
            tricolorFlag: "三色旗",
            circled: "有圆圈",
            noCircle: "无圆圈",
            grade: "等级",
            grade4: "四等级",
            grade5: "五等级",
            threeStars: "3个星形",
            fiveQuadrantDiagram: "五象限图",
            fiveBoxes: "5个框"
        },
        insertLink: {
            linkText: "文本",
            linkType: "链接类型",
            external: "外部链接",
            internal: "内部链接",
            linkAddress: "链接地址",
            linkSheet: "工作表",
            linkCell: "单元格引用",
            linkTooltip: "提示",
            placeholder1: "请输入网页链接地址",
            placeholder2: "请输入要引用的单元格，例A1",
            placeholder3: "请输入提示内容",
            tooltipInfo1: "请输入有效的链接",
            tooltipInfo2: "请输入正确的单元格引用"
        },
        dataVerification: {
            cellRange: "单元格范围",
            selectCellRange: "点击选择单元格范围",
            selectCellRange2: "请选择单元格范围",
            verificationCondition: "验证条件",
            dropdown: "下拉列表",
            checkbox: "复选框",
            number: "数字",
            number_integer: "数字-整数",
            number_decimal: "数字-小数",
            text_content: "文本-内容",
            text_length: "文本-长度",
            date: "日期",
            validity: "有效性",
            placeholder1: "请输入选项，以英文逗号分隔，如1,2,3,4,5",
            placeholder2: "请输入内容",
            placeholder3: "数值，如10",
            placeholder4: "请输入指定的文本",
            placeholder5: "请输入选中单元格时显示的提示语",
            selected: "选择时",
            notSelected: "未选择",
            between: "介于",
            notBetween: "不介于",
            equal: "等于",
            notEqualTo: "不等于",
            moreThanThe: "大于",
            lessThan: "小于",
            greaterOrEqualTo: "大于等于",
            lessThanOrEqualTo: "小于等于",
            include: "包括",
            exclude: "不包括",
            earlierThan: "早于",
            noEarlierThan: "不早于",
            laterThan: "晚于",
            noLaterThan: "不晚于",
            identificationNumber: "身份证号码",
            phoneNumber: "手机号",
            remote: "自动远程获取选项",
            prohibitInput: "输入数据无效时禁止输入",
            hintShow: "选中单元格时显示提示语",
            deleteVerification: "删除验证",
            tooltipInfo1: "下拉列表选项不可为空",
            tooltipInfo2: "复选框内容不可为空",
            tooltipInfo3: "输入的值不是数值类型",
            tooltipInfo4: "数值2不能小于数值1",
            tooltipInfo5: "文本内容不能为空",
            tooltipInfo6: "输入的值不是日期类型",
            tooltipInfo7: "日期2不能小于日期1"
        },
        formula: {
            sum: "求和",
            average: "平均值",
            count: "计数",
            max: "最大值",
            min: "最小值",
            ifGenerate: "if公式生成器",
            find: "更多函数",
            tipNotBelongToIf: "该单元格函数不属于if公式！",
            tipSelectCell: "请选择单元格插入函数",
            ifGenCompareValueTitle: "比较值",
            ifGenSelectCellTitle: "点击选择单元格",
            ifGenRangeTitle: "范围",
            ifGenRangeTo: "至",
            ifGenRangeEvaluate: "范围评估",
            ifGenSelectRangeTitle: "点击选择范围",
            ifGenCutWay: "划分方式",
            ifGenCutSame: "划分值相同",
            ifGenCutNpiece: "划分为N份",
            ifGenCutCustom: "自定义输入",
            ifGenCutConfirm: "生成",
            ifGenTipSelectCell: "选择单元格",
            ifGenTipSelectCellPlace: "请选择单元格",
            ifGenTipSelectRange: "选择单范围",
            ifGenTipSelectRangePlace: "请选择范围",
            ifGenTipNotNullValue: "比较值不能为空！",
            ifGenTipLableTitile: "标签",
            ifGenTipRangeNotforNull: "范围不能为空！",
            ifGenTipCutValueNotforNull: "划分值不能为空！",
            ifGenTipNotGenCondition: "没有生成可用的条件！"
        },
        formulaMore: {
            valueTitle: "值",
            tipSelectDataRange: "选取数据范围",
            tipDataRangeTile: "数据范围",
            findFunctionTitle: "查找函数",
            tipInputFunctionName: "请输入您要查找的函数名称或函数功能的简要描述",
            Array: "数组",
            Database: "数据源",
            Date: "日期",
            Engineering: "工程计算",
            Filter: "过滤器",
            Financial: "财务",
            luckysheet: "Luckysheet内置",
            other: "其它",
            Logical: "逻辑",
            Lookup: "查找",
            Math: "数学",
            Operator: "运算符",
            Parser: "转换工具",
            Statistical: "统计",
            Text: "文本",
            dataMining: "数据挖掘",
            selectFunctionTitle: "选择函数",
            calculationResult: "计算结果",
            tipSuccessText: "成功",
            tipParamErrorText: "参数类型错误",
            helpClose: "关闭",
            helpCollapse: "收起",
            helpExample: "示例",
            helpAbstract: "摘要",
            execfunctionError: '提示", "公式存在错误',
            execfunctionSelfError: "公式不可引用其本身的单元格",
            execfunctionSelfErrorResult: "公式不可引用其本身的单元格，会导致计算结果不准确",
            allowRepeatText: "可重复",
            allowOptionText: "可选",
            selectCategory: "或选择类别"
        },
        drag: {
            noMerge: "无法对合并单元格执行此操作",
            affectPivot: "无法对所选单元格进行此更改，因为它会影响数据透视表！",
            noMulti: "无法对多重选择区域执行此操作,请选择单个区域",
            noPaste: "无法在此处粘贴此内容，请选择粘贴区域的一个单元格，然后再次尝试粘贴",
            noPartMerge: "无法对部分合并单元格执行此操作",
            inputCorrect: "请输入正确的数值",
            notLessOne: "行列数不能小于1",
            offsetColumnLessZero: "偏移列不能为负数！",
            pasteMustKeybordAlert: "Copy and paste in the Sheet: Ctrl + C to copy, Ctrl + V to paste, Ctrl + X to cut",
            pasteMustKeybordAlertHTMLTitle: "Copy and paste in the Sheet",
            pasteMustKeybordAlertHTML: "<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut"
        },
        pivotTable: {
            title: "数据透视表",
            closePannel: "关闭",
            editRange: "编辑范围",
            tipPivotFieldSelected: "选择需要添加到数据透视表的字段",
            tipClearSelectedField: "清除所有已选字段",
            btnClearSelectedField: "清除",
            btnFilter: "筛选",
            titleRow: "行",
            titleColumn: "列",
            titleValue: "数值",
            tipShowColumn: "统计字段显示为列",
            tipShowRow: "统计字段显示为行",
            titleSelectionDataRange: "选取数据范围",
            titleDataRange: "数据范围",
            valueSum: "总计",
            valueStatisticsSUM: "求和",
            valueStatisticsCOUNT: "数值计数",
            valueStatisticsCOUNTA: "计数",
            valueStatisticsCOUNTUNIQUE: "去重计数",
            valueStatisticsAVERAGE: "平均值",
            valueStatisticsMAX: "最大值",
            valueStatisticsMIN: "最小值",
            valueStatisticsMEDIAN: "中位数",
            valueStatisticsPRODUCT: "乘积",
            valueStatisticsSTDEV: "标准差",
            valueStatisticsSTDEVP: "整体标准差",
            valueStatisticslet: "方差",
            valueStatisticsVARP: "整体方差",
            errorNotAllowEdit: "非编辑模式下禁止该操作！",
            errorNotAllowMulti: "不能对多重选择区域执行此操作，请选择单个区域，然后再试",
            errorSelectRange: "请选择新建透视表的区域",
            errorIsDamage: "此数据透视表的源数据已损坏！",
            errorNotAllowPivotData: "不可选择数据透视表为源数据！",
            errorSelectionRange: "选择失败, 输入范围错误！",
            errorIncreaseRange: "请扩大选择的数据范围!",
            titleAddColumn: "添加列到数据透视表",
            titleMoveColumn: "移动该列到下方白框",
            titleClearColumnFilter: "清除该列的筛选条件",
            titleFilterColumn: "筛选该列",
            titleSort: "排序",
            titleNoSort: "无排序",
            titleSortAsc: "升序",
            titleSortDesc: "降序",
            titleSortBy: "排序依据",
            titleShowSum: "显示总计",
            titleStasticTrue: "是",
            titleStasticFalse: "否"
        },
        dropCell: {
            copyCell: "复制单元格",
            sequence: "填充序列",
            onlyFormat: "仅填充格式",
            noFormat: "不带格式填充",
            day: "以天数填充",
            workDay: "以工作日填充",
            month: "以月填充",
            year: "以年填充",
            chineseNumber: "以中文小写数字填充"
        },
        imageCtrl: {
            borderTile: "图片边框颜色选择",
            borderCur: "当前颜色"
        },
        protection: {
            protectiontTitle: "保护工作表",
            enterPassword: "请输入密码（可留空）",
            enterHint: "您试图更改的单元格或图表位于受保护的工作表中。若要更改，请取消工作表保护。您可能需要输入密码",
            swichProtectionTip: "保护工作表及锁定的单元格内容",
            authorityTitle: "允许此工作表的用户进行:",
            selectLockedCells: "选定锁定单元格",
            selectunLockedCells: "选定解除锁定的单元格",
            formatCells: "设置单元格格式",
            formatColumns: "设置列格式",
            formatRows: "设置行格式",
            insertColumns: "插入列",
            insertRows: "插入行",
            insertHyperlinks: "插入超链接",
            deleteColumns: "删除列",
            deleteRows: "删除行",
            sort: "排序",
            filter: "使用自动筛选",
            usePivotTablereports: "使用数据透视表和报表",
            editObjects: "编辑对象",
            editScenarios: "编辑方案",
            allowRangeTitle: "允许用户编辑区域",
            allowRangeAdd: "新建...",
            allowRangeAddTitle: "标题",
            allowRangeAddSqrf: "引用单元格",
            selectCellRange: "点击选择单元格范围",
            selectCellRangeHolder: "请输入单元格范围",
            allowRangeAddTitlePassword: "密码",
            allowRangeAddTitleHint: "提示",
            allowRangeAddTitleHintTitle: "设置密码后，提示用户输入密码(可留空)",
            allowRangeAddtitleDefault: "请输入区域名称",
            rangeItemDblclick: "双击进行编辑",
            rangeItemHasPassword: "已设置密码",
            rangeItemErrorTitleNull: "标题不能为空",
            rangeItemErrorRangeNull: "单元格范围不能为空",
            rangeItemErrorRange: "单元格范围格式错误",
            validationTitle: "验证提示",
            validationTips: "需要输入密码来撤销工作表的保护",
            validationInputHint: "请输入密码",
            checkPasswordNullalert: "密码不能为空！",
            checkPasswordWrongalert: "密码错误，请重试！",
            checkPasswordSucceedalert: "解锁成功，可以编辑该区域!",
            defaultRangeHintText: "该单元格正在受密码保护。",
            defaultSheetHintText: "该单元格或图表位于受保护的工作表中，若要进行更改，请取消工作表保护，您可能需要输入密码。"
        },
        cellFormat: {
            cellFormatTitle: "设置单元格格式",
            protection: "保护",
            locked: "锁定单元格",
            hidden: "隐藏公式",
            protectionTips: "只有保护工作表功能(在菜单栏点击保护工作表按钮进行设置)开启后，锁定单元格或隐藏公式才能生效",
            tipsPart: "部分选中",
            tipsAll: "全部选中",
            selectionIsNullAlert: "请选择一个范围！",
            sheetDataIsNullAlert: "数据为空无法设置！"
        },
        print: {
            normalBtn: "常规视图",
            layoutBtn: "页面布局",
            pageBtn: "分页预览",
            menuItemPrint: "打印(Ctrl+P)",
            menuItemAreas: "打印区域",
            menuItemRows: "打印标题行",
            menuItemColumns: "打印标题列"
        }
    }, es = {
        functionlist: [{
            n: "SUMIF",
            t: 0,
            d: "Returns a conditional sum across a range.",
            a: "A conditional sum across a range.",
            m: [2, 3],
            p: [{
                name: "range",
                detail: "The range which is tested against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sum_range",
                detail: "The range to be summed, if different from `range`.",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TAN",
            t: 0,
            d: "Returns the tangent of an angle provided in radians.",
            a: "Tangent of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the tangent of, in radians.",
                example: "45*PI()/180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TANH",
            t: 0,
            d: "Returns the hyperbolic tangent of any real number.",
            a: "Hyperbolic tangent of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic tangent of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CEILING",
            t: 0,
            d: "Rounds a number up to the nearest integer multiple of specified significance `factor`.",
            a: "Rounds number up to nearest multiple of a factor.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round up to the nearest integer multiple of `factor`.",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN",
            t: 0,
            d: "Returns the inverse tangent of a value, in radians.",
            a: "Inverse tangent of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse tangent.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ASINH",
            t: 0,
            d: "Returns the inverse hyperbolic sine of a number.",
            a: "Inverse hyperbolic sine of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic sine.",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ABS",
            t: 0,
            d: "Returns the absolute value of a number.",
            a: "Absolute value of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number of which to return the absolute value.",
                example: "-2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOS",
            t: 0,
            d: "Returns the inverse cosine of a value, in radians.",
            a: "Inverse cosine of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse cosine. Must be between `-1` and `1`, inclusive.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACOSH",
            t: 0,
            d: "Returns the inverse hyperbolic cosine of a number.",
            a: "Inverse hyperbolic cosine of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic cosine. Must be greater than or equal to `1`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTINOMIAL",
            t: 0,
            d: "Returns the factorial of the sum of values divided by the product of the values' factorials.",
            a: "Multinomial distribution function.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "ATANH",
            t: 0,
            d: "Returns the inverse hyperbolic tangent of a number.",
            a: "Inverse hyperbolic tangent of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse hyperbolic tangent. Must be between -1 and 1, exclusive.",
                example: "0.9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ATAN2",
            t: 0,
            d: "Returns the angle between the x-axis and a line segment from the origin (0,0) to specified coordinate pair (`x`,`y`), in radians.",
            a: "Arctangent of a value.",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The x coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "y",
                detail: "The y coordinate of the endpoint of the line segment for which to calculate the angle from the x-axis.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTBLANK",
            t: 1,
            d: "Returns the number of empty values in a list of values and ranges.",
            a: "Number of empty values.",
            m: [1, 1],
            p: [{
                name: "value1",
                detail: "The first value or range in which to count the number of blanks.",
                example: "A2:C100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "COSH",
            t: 0,
            d: "Returns the hyperbolic cosine of any real number.",
            a: "Hyperbolic cosine of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic cosine of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INT",
            t: 0,
            d: "Rounds a number down to the nearest integer that is less than or equal to it.",
            a: "Rounds number down to nearest integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round down to the nearest integer.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISEVEN",
            t: 0,
            d: "Checks whether the provided value is even.",
            a: "Whether the provided value is even.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as even.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISODD",
            t: 0,
            d: "Checks whether the provided value is odd.",
            a: "Whether the provided value is odd.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as odd.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LCM",
            t: 0,
            d: "Returns the least common multiple of one or more integers.",
            a: "Least common multiple of one or more integers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range whose factors to consider in a calculation to find the least common multiple.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges whose factors to consider to find the least common multiple.",
                example: "3",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LN",
            t: 0,
            d: "Returns the logarithm of a number, base e (Euler's number).",
            a: "The logarithm of a number, base e (euler's number).",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm, base e.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG",
            t: 0,
            d: "Returns the logarithm of a number with respect to a base.",
            a: "The logarithm of a number with respect to a base.",
            m: [1, 2],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm.",
                example: "128",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "base",
                detail: "The base to use for calculation of the logarithm.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOG10",
            t: 0,
            d: "Returns the logarithm of a number, base 10.",
            a: "The logarithm of a number, base 10.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the logarithm, base 10.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MOD",
            t: 0,
            d: "Returns the result of the modulo operator, the remainder after a division operation.",
            a: "Modulo (remainder) operator.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided to find the remainder.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MROUND",
            t: 0,
            d: "Rounds one number to the nearest integer multiple of another.",
            a: "Rounds a number to the nearest integer multiple.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The number to round to the nearest integer multiple of another.",
                example: "21",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ODD",
            t: 0,
            d: "Rounds a number up to the nearest odd integer.",
            a: "Rounds a number up to the nearest odd integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round to the next greatest odd number.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMSQ",
            t: 0,
            d: "Returns the sum of the squares of a series of numbers and/or cells.",
            a: "Sum of squares.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first number or range whose squares to add together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional numbers or ranges whose squares to add to the square(s) of `value1`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMBIN",
            t: 0,
            d: "Returns the number of ways to choose some number of objects from a pool of a given size of objects.",
            a: "Number of combinations from a set of objects.",
            m: [2, 2],
            p: [{
                name: "n",
                detail: "The size of the pool of objects to choose from.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "The number of objects to choose.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUM",
            t: 0,
            d: "Returns the sum of a series of numbers and/or cells.",
            a: "Sum of a series of numbers and/or cells.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first number or range to add together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional numbers or ranges to add to `value1`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SUBTOTAL",
            t: 0,
            d: "Returns a subtotal for a vertical range of cells using a specified aggregation function.",
            a: "Subtotal for a range using a specific function.",
            m: [2, 256],
            p: [{
                name: "function_code",
                detail: "The function to use in subtotal aggregation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "range1",
                detail: "The first range over which to calculate a subtotal.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "range2",
                detail: "Additional ranges over which to calculate subtotals.",
                example: "B2:B8",
                require: "o",
                repeat: "y",
                type: "range"
            }]
        }, {
            n: "ASIN",
            t: 0,
            d: "Returns the inverse sine of a value, in radians.",
            a: "Inverse sine of a value, in radians.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse sine. Must be between `-1` and `1`, inclusive.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUNTIF",
            t: 1,
            d: "Returns a conditional count across a range.",
            a: "A conditional count across a range.",
            m: [2, 2],
            p: [{
                name: "range",
                detail: "The range that is tested against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RADIANS",
            t: 0,
            d: "Converts an angle value in degrees to radians.",
            a: "Converts an angle value in degrees to radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to convert from degrees to radians.",
                example: "180",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RAND",
            t: 0,
            d: "Returns a random number between 0 inclusive and 1 exclusive.",
            a: "A random number between 0 inclusive and 1 exclusive.",
            m: [0, 0],
            p: []
        }, {
            n: "COUNTUNIQUE",
            t: 0,
            d: "Counts the number of unique values in a list of specified values and ranges.",
            a: "Counts number of unique values in a range.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider for uniqueness.",
                example: "A1:C100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider for uniqueness.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DEGREES",
            t: 0,
            d: "Converts an angle value in radians to degrees.",
            a: "Converts an angle value in radians to degrees.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to convert from radians to degrees.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ERFC",
            t: 9,
            d: "Returns the complementary Gauss error function of a value.",
            a: "Complementary gauss error function of a value.",
            m: [1, 1],
            p: [{
                name: "z",
                detail: "The number for which to calculate the complementary Gauss error function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EVEN",
            t: 0,
            d: "Rounds a number up to the nearest even integer.",
            a: "Rounds a number up to the nearest even integer.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to round to the next greatest even number.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EXP",
            t: 0,
            d: "Returns Euler's number, e (~2.718) raised to a power.",
            a: "Euler's number, e (~2.718) raised to a power.",
            m: [1, 1],
            p: [{
                name: "exponent",
                detail: "The exponent to raise e to.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACT",
            t: 0,
            d: "Returns the factorial of a number.",
            a: "Factorial of a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number or reference to a number whose factorial will be calculated and returned.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FACTDOUBLE",
            t: 0,
            d: 'Returns the "double factorial" of a number.',
            a: '"double factorial" of a number.',
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number or reference to a number whose double factorial will be calculated and returned.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PI",
            t: 0,
            d: "Returns the value of Pi to 14 decimal places.",
            a: "The number pi.",
            m: [0, 0],
            p: []
        }, {
            n: "FLOOR",
            t: 0,
            d: "Rounds a number down to the nearest integer multiple of specified significance `factor`.",
            a: "Rounds number down to nearest multiple of a factor.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round down to the nearest integer multiple of `factor`.",
                example: "23.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The number to whose multiples `value` will be rounded.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GCD",
            t: 0,
            d: "Returns the greatest common divisor of one or more integers.",
            a: "Greatest common divisor of one or more integers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range whose factors to consider in a calculation to find the greatest common divisor.",
                example: "A2:A5",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges whose factors to consider to find the greatest common divisor.",
                example: "96",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANDBETWEEN",
            t: 0,
            d: "Returns a uniformly random integer between two values, inclusive.",
            a: "Random integer between two values, inclusive.",
            m: [2, 2],
            p: [{
                name: "low",
                detail: "The low end of the random range.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "high",
                detail: "The high end of the random range.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUND",
            t: 0,
            d: "Rounds a number to a certain number of decimal places according to standard rules.",
            a: "Rounds a number according to standard rules.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDDOWN",
            t: 0,
            d: "Rounds a number to a certain number of decimal places, always rounding down to the next valid increment.",
            a: "Rounds down a number.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places, always rounding down.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ROUNDUP",
            t: 0,
            d: "Rounds a number to a certain number of decimal places, always rounding up to the next valid increment.",
            a: "Rounds up a number.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to round to `places` number of places, always rounding up.",
                example: "99.44",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of decimal places to which to round.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SERIESSUM",
            t: 0,
            d: "Given parameters `x`, `n`, `m`, and `a`, returns the power series sum a",
            a: "Sum of a power series.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the power series. Varies depending on the type of approximation, may be angle, exponent, or some other value.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "The initial power to which to raise `x` in the power series.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "m",
                detail: "The additive increment by which to increase `x`.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "a",
                detail: "The array or range containing the coefficients of the power series.",
                example: "{FACT(0)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIGN",
            t: 0,
            d: "Given an input number, returns `-1` if it is negative, `1` if positive, and `0` if it is zero.",
            a: "Sign of a provided number (+/-/0).",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value whose sign will be evaluated.",
                example: "-42",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SIN",
            t: 0,
            d: "Returns the sine of an angle provided in radians.",
            a: "Sine of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the sine of, in radians.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SINH",
            t: 0,
            d: "Returns the hyperbolic sine of any real number.",
            a: "Hyperbolic sine of any real number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Any real value to calculate the hyperbolic sine of.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRT",
            t: 0,
            d: "Returns the positive square root of a positive number.",
            a: "Positive square root of a positive number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number for which to calculate the positive square root.",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SQRTPI",
            t: 0,
            d: "Returns the positive square root of the product of Pi and the given positive number.",
            a: "Square root of the product of pi and number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The number which will be multiplied by Pi and have the product's square root returned",
                example: "9",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GAMMALN",
            t: 1,
            d: "Returns the logarithm of a specified Gamma function, base e (Euler's number).",
            a: "Logarithm of gamma function.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The input to the Gamma function. The natural logarithm of Gamma(`value`) will be returned.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COS",
            t: 0,
            d: "Returns the cosine of an angle provided in radians.",
            a: "Cosine of an angle provided in radians.",
            m: [1, 1],
            p: [{
                name: "angle",
                detail: "The angle to find the cosine of, in radians.",
                example: "PI()",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRUNC",
            t: 0,
            d: "Truncates a number to a certain number of significant digits by omitting less significant digits.",
            a: "Truncates a number.",
            m: [1, 2],
            p: [{
                name: "value",
                detail: "The value to be truncated.",
                example: "3.141592654",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "places",
                detail: "The number of significant digits to the right of the decimal point to retain.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUOTIENT",
            t: 0,
            d: "Returns one number divided by another.",
            a: "One number divided by another.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POWER",
            t: 0,
            d: "Returns a number raised to a power.",
            a: "A number raised to a power.",
            m: [2, 2],
            p: [{
                name: "base",
                detail: "The number to raise to the `exponent` power.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "exponent",
                detail: "The exponent to raise `base` to.",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMIFS",
            t: 0,
            d: "Returns the sum of a range depending on multiple criteria.",
            a: "Sums a range depending on multiple criteria.",
            m: [3, 257],
            p: [{
                name: "sum_range",
                detail: "The range to sum.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criteria_range1",
                detail: "The range to check against criterion1.",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to criteria_range1.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " C1:C10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTIFS",
            t: 1,
            d: "Returns the count of a range depending on multiple criteria.",
            a: "Count values depending on multiple criteria.",
            m: [2, 256],
            p: [{
                name: "criteria_range1",
                detail: "The range to check against `criterion1`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to `criteria_range1`.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " B1:B10",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PRODUCT",
            t: 0,
            d: "Returns the result of multiplying a series of numbers together.",
            a: "Result of multiplying a series of numbers together.",
            m: [1, 255],
            p: [{
                name: "factor1",
                detail: "The first number or range to calculate for the product.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor2",
                detail: "More numbers or ranges to calculate for the product.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HARMEAN",
            t: 1,
            d: "Calculates the harmonic mean of a dataset.",
            a: "The harmonic mean of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "HYPGEOMDIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of successes in a certain number of tries given a population of a certain size containing a certain number of successes, without replacement of draws.",
            a: "Hypergeometric distribution probability.",
            m: [5, 5],
            p: [{
                name: "num_successes",
                detail: "The desired number of successes.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_draws",
                detail: "The number of permitted draws.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "successes_in_pop",
                detail: "The total number of successes in the population.",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pop_size",
                detail: "The total size of the population",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf cumulative is TRUE(), HYPGEOM.DIST returns the cumulative distribution function;\n\nif FALSE(), it returns the probability density function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INTERCEPT",
            t: 1,
            d: "Calculates the y-value at which the line resulting from linear regression of a dataset will intersect the y-axis (x=0).",
            a: "Y-intercept of line derived via linear regression.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "KURT",
            t: 1,
            d: 'Calculates the kurtosis of a dataset, which describes the shape, and in particular the "peakedness" of that dataset.',
            a: "Kurtosis of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LARGE",
            t: 1,
            d: "Returns the nth largest element from a data set, where n is user-defined.",
            a: "Nth largest element from a data set.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "n",
                detail: "The rank from largest to smallest of the element to return.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVA",
            t: 1,
            d: "Calculates the standard deviation based on a sample, setting text to the value `0`.",
            a: "Standard deviation of sample (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STDEVP",
            t: 1,
            d: "Calculates the standard deviation based on an entire population.",
            a: "Standard deviation of an entire population.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "GEOMEAN",
            t: 1,
            d: "Calculates the geometric mean of a dataset.",
            a: "The geometric mean of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "RANK_EQ",
            t: 1,
            d: "Returns the rank of a specified value in a dataset. If there is more than one entry of the same value in the dataset, the top rank of the entries will be returned.",
            a: "Top rank of a specified value in a dataset.",
            m: [2, 3],
            p: [{
                name: "value",
                detail: "The value whose rank will be determined.",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "is_ascending",
                detail: "Whether to consider the values in `data` in descending or ascending order. If omitted, the default is descending (FALSE).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANK_AVG",
            t: 1,
            d: "Returns the rank of a specified value in a dataset. If there is more than one entry of the same value in the dataset, the average rank of the entries will be returned.",
            a: "Average rank of a specified value in a dataset.",
            m: [2, 3],
            p: [{
                name: "value",
                detail: "The value whose rank will be determined.",
                example: "A10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "is_ascending",
                detail: "Whether to consider the values in `data` in descending or ascending order. If omitted, the default is descending (FALSE).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERCENTRANK_EXC",
            t: 1,
            d: "Returns the percentage rank (percentile) from 0 to 1 exclusive of a specified value in a dataset.",
            a: "Percentage rank (percentile) from 0 to 1 exclusive.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value",
                detail: "The value whose percentage rank will be determined.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant figures to use in the calculation. Default is 3.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTRANK_INC",
            t: 1,
            d: "Returns the percentage rank (percentile) from 0 to 1 inclusive of a specified value in a dataset.",
            a: "Percentage rank (percentile) from 0 to 1 inclusive.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value",
                detail: "The value whose percentage rank will be determined.",
                example: " A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant figures to use in the calculation. Default is 3.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FORECAST",
            t: 1,
            d: "Calculates the expected y-value for a specified x based on a linear regression of a dataset.",
            a: "Expected y-value based of linear regression.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The value on the x-axis to forecast.",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHERINV",
            t: 1,
            d: "Returns the inverse Fisher transformation of a specified value.",
            a: "Inverse fisher transformation of a specified value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the inverse Fisher transformation.",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FISHER",
            t: 1,
            d: "Returns the Fisher transformation of a specified value.",
            a: "Fisher transformation of a specified value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value for which to calculate the Fisher transformation.",
                example: "0.962",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MODE_SNGL",
            t: 1,
            d: "Returns the most commonly occurring value in a dataset.",
            a: "Most commonly occurring value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating mode.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating mode.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "WEIBULL_DIST",
            t: 1,
            d: "Returns the value of the Weibull distribution function (or Weibull cumulative distribution function) for a specified shape and scale.",
            a: "Weibull distribution function.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the Weibull distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "shape",
                detail: "The shape parameter of the Weibull distribution function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "scale",
                detail: "The scale parameter of the Weibull distribution function.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the cumulative distribution function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COUNT",
            t: 1,
            d: "Returns the number of numeric values in a dataset.",
            a: "The number of numeric values in dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when counting.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when counting.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COUNTA",
            t: 1,
            d: "Returns the number of values in a dataset.",
            a: "The number of values in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when counting.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when counting.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVEDEV",
            t: 1,
            d: "Calculates the average of the magnitudes of deviations of data from a dataset's mean.",
            a: "Average magnitude of deviations from mean.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "AVERAGE",
            t: 1,
            d: "Returns the numerical average value in a dataset, ignoring text.",
            a: "Numerical average value in a dataset, ignoring text.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the average value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the average value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEA",
            t: 1,
            d: "Returns the numerical average value in a dataset.",
            a: "Numerical average value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the average value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the average value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_DIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of successes (or a maximum number of successes) in a certain number of tries given a population of a certain size containing a certain number of successes, with replacement of draws.",
            a: "Binomial distribution probability.",
            m: [4, 4],
            p: [{
                name: "num_successes",
                detail: "The number of successes for which to calculate the probability in `num_trials` trials.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_trials",
                detail: "The number of independent trials.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the binomial cumulative distribution.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BINOM_INV",
            t: 1,
            d: "Calculates the smallest value for which the cumulative binomial distribution is greater than or equal to a specified criteria.",
            a: "Inverse cumulative binomial distribution function.",
            m: [3, 3],
            p: [{
                name: "num_trials",
                detail: "The number of independent trials.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.005",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "target_prob",
                detail: "The desired threshold probability.",
                example: "0.8",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONFIDENCE_NORM",
            t: 1,
            d: "Calculates the width of half the confidence interval for a normal distribution.",
            a: "Confidence interval for a normal distribution.",
            m: [3, 3],
            p: [{
                name: "alpha",
                detail: "One minus the desired confidence level. E.g. `0.1` for `0.9`, or 90%, confidence.",
                example: "0.05",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation of the population.",
                example: "1.6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "pop_size",
                detail: "The size of the population.",
                example: "250",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CORREL",
            t: 1,
            d: "Calculates r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Pearson Product-Moment Correlation Coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_P",
            t: 1,
            d: "Calculates the covariance of a dataset.",
            a: "The covariance of a dataset.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COVARIANCE_S",
            t: 1,
            d: "Calculates the sample covariance of a dataset.",
            a: "The sample covariance of a dataset.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEVSQ",
            t: 1,
            d: "Calculates the sum of squares of deviations based on a sample.",
            a: "The sum of squares of deviations based on a sample.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "EXPON_DIST",
            t: 1,
            d: "Returns the value of the exponential distribution function with a specified lambda at a specified value.",
            a: "Exponential distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the exponential distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "lambda",
                detail: "The lambda to specify the exponential distribution function.",
                example: "0.5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the exponential cumulative distribution.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIF",
            t: 1,
            d: "Returns the average of a range depending on criteria.",
            a: "Average of values depending on criteria.",
            m: [2, 3],
            p: [{
                name: "criteria_range",
                detail: "The range to check against `criterion`.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion",
                detail: "The pattern or test to apply to `criteria_range`.",
                example: '">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "average_range",
                detail: "The range to average. If not included, `criteria_range` is used for the average instead.",
                example: "B1:B10",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AVERAGEIFS",
            t: 1,
            d: "Returns the average of a range depending on multiple criteria.",
            a: "Average of values depending on multiple criteria.",
            m: [2, 255],
            p: [{
                name: "average_range",
                detail: "The range to average.",
                example: "A1:A10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range1",
                detail: "The range to check against `criterion1`.",
                example: " B1:B10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criterion1",
                detail: "The pattern or test to apply to `criteria_range1`.",
                example: ' ">20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria_range2",
                detail: "Additional ranges to check.",
                example: " C1:C10",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PERMUT",
            t: 1,
            d: "Returns the number of ways to choose some number of objects from a pool of a given size of objects, considering order.",
            a: "Number of permutations from a number of objects.",
            m: [2, 2],
            p: [{
                name: "n",
                detail: "The size of the pool of objects to choose from.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "k",
                detail: "The number of objects to choose.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRIMMEAN",
            t: 1,
            d: "Calculates the mean of a dataset excluding some proportion of data from the high and low ends of the dataset.",
            a: "Mean of a dataset excluding high/low ends.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "exclude_proportion",
                detail: "The proportion of the dataset to exclude, from the extremities of the set.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_EXC",
            t: 1,
            d: "Returns the value at a given percentile of a dataset exclusive of 0 and 1.",
            a: "Value at a given percentile of a dataset exclusive of 0 and 1.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "percentile",
                detail: "The percentile, exclusive of 0 and 1, whose value within 'data' will be calculated and returned.",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PERCENTILE_INC",
            t: 1,
            d: "Returns the value at a given percentile of a dataset.",
            a: "Value at a given percentile of a dataset.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "percentile",
                detail: "The percentile whose value within `data` will be calculated and returned.`",
                example: "0.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PEARSON",
            t: 1,
            d: "Calculates r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Pearson Product-Moment Correlation Coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_INV",
            t: 1,
            d: "Returns the value of the inverse standard normal distribution function for a specified value.",
            a: "Inverse standard normal distribution function.",
            m: [1, 1],
            p: [{
                name: "x",
                detail: "The input to the inverse standard normal distribution function.",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_S_DIST",
            t: 1,
            d: "Returns the value of the standard normal cumulative distribution function for a specified value.",
            a: "Standard normal cumulative distribution function.",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the standard normal cumulative distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NORM_INV",
            t: 1,
            d: "Returns the value of the inverse normal distribution function for a specified value, mean, and standard deviation.",
            a: "Inverse normal distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the inverse normal distribution function.",
                example: "0.75",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the normal distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the normal distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NORM_DIST",
            t: 1,
            d: "Returns the value of the normal distribution function (or normal cumulative distribution function) for a specified value, mean, and standard deviation.",
            a: "Normal distribution function.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the normal distribution function.",
                example: "2.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the normal distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the normal distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the normal cumulative distribution function rather than the distribution function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NEGBINOM_DIST",
            t: 1,
            d: "Calculates the probability of drawing a certain number of failures before a certain number of successes given a probability of success in independent trials.",
            a: "Negative binomial distribution probability.",
            m: [4, 4],
            p: [{
                name: "num_failures",
                detail: "The number of failures to model.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "num_successes",
                detail: "The number of successes to model.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "prob_success",
                detail: "The probability of success in any given trial.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINA",
            t: 1,
            d: "Returns the minimum numeric value in a dataset.",
            a: "Minimum numeric value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the minimum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the minimum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MIN",
            t: 1,
            d: "Returns the minimum value in a numeric dataset.",
            a: "Minimum value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the minimum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the minimum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MEDIAN",
            t: 1,
            d: "Returns the median value in a numeric dataset.",
            a: "Median value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the median value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the median value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAXA",
            t: 1,
            d: "Returns the maximum numeric value in a dataset.",
            a: "Maximum numeric value in a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the maximum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the maximum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "MAX",
            t: 1,
            d: "Returns the maximum value in a numeric dataset.",
            a: "Maximum value in a numeric dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range to consider when calculating the maximum value.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to consider when calculating the maximum value.",
                example: "B2:B100",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_INV",
            t: 1,
            d: "Returns the value of the inverse log-normal cumulative distribution with given mean and standard deviation at a specified value.",
            a: "Inverse log-normal cumulative distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the inverse log-normal cumulative distribution function.",
                example: "0.4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the inverse log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the inverse log-normal cumulative distribution function.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LOGNORM_DIST",
            t: 1,
            d: "Returns the value of the log-normal cumulative distribution with given mean and standard deviation at a specified value.",
            a: "Log-normal cumulative distribution probability.",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the log-normal cumulative distribution function.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation (sigma) of the log-normal cumulative distribution function.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Determine the logical value of the function form. \n\nIf TRUE(), it returns the cumulative distribution function;\n\nIf it is FALSE(), it returns the probability density function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "Z_TEST",
            t: 1,
            d: "Returns the one-tailed p-value of a Z-test with standard distribution.",
            a: "One-tailed p-value of a z-test.",
            m: [2, 3],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "value",
                detail: "The test statistic to use in the Z-test.",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation to assume for the Z-test. If this is not provided, the standard deviation of the data will be used.",
                example: "3",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PROB",
            t: 1,
            d: "Given a set of values and corresponding probabilities, calculates the probability that a value chosen at random falls between two limits.",
            a: "Probability values lie in a range.",
            m: [3, 4],
            p: [{
                name: "data",
                detail: "Array or range containing the dataset to consider.",
                example: "A3:A6",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "probabilities",
                detail: "Array or range containing probabilities corresponding to `data`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "low_limit",
                detail: "The lower bound on the value range for which to calculate the probability.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "high_limit",
                detail: "The upper bound on the value range for which to calculate the probability.",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_EXC",
            t: 1,
            d: "Returns a value nearest to a specified quartile of a dataset exclusive of 0 and 4.",
            a: "Value nearest to a specific quartile of a dataset exclusive of 0 and 4.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quartile_number",
                detail: "Which quartile to return.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "QUARTILE_INC",
            t: 1,
            d: "Returns a value nearest to a specified quartile of a dataset.",
            a: "Value nearest to a specific quartile of a dataset.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "quartile_number",
                detail: "Which quartile value to return.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "POISSON_DIST",
            t: 1,
            d: "Returns the value of the Poisson distribution function (or Poisson cumulative distribution function) for a specified value and mean.",
            a: "Poisson distribution function.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the Poisson distribution function.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean (mu) of the Poisson distribution function.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Whether to use the Poisson cumulative distribution function rather than the distribution function.",
                example: "FALSE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RSQ",
            t: 1,
            d: "Calculates the square of r, the Pearson product-moment correlation coefficient of a dataset.",
            a: "Square of the correlation coefficient.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST",
            t: 1,
            d: "Calculates the left tail probability for a Student's t-distribution with a given input (x).",
            a: "The left-tailed Student's t-distribution",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T_DIST_2T",
            t: 1,
            d: "Calculates the probability for two tailed Student's t-distribution with a given input (x).",
            a: "The two tailed Student's t-distribution",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_DIST_RT",
            t: 1,
            d: "Calculates the right tail probability for a Student's t-distribution with a given input (x).",
            a: "The right-tailed Student's t-distribution",
            m: [2, 2],
            p: [{
                name: "x",
                detail: "The input to the t-distribution function.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "30",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV",
            t: 1,
            d: "Calculates the negative inverse of the one-tailed TDIST function.",
            a: "T.INV",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "The probability associated with the two-tailed t-distribution.",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_INV_2T",
            t: 1,
            d: "Calculates the inverse of the two-tailed TDIST function.",
            a: "T.INV.2T",
            m: [2, 2],
            p: [{
                name: "probability",
                detail: "The probability associated with the two-tailed t-distribution.",
                example: "0.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom",
                detail: "The number of degrees of freedom.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "T_TEST",
            t: 1,
            d: "t-test. Returns the probability associated with Student's t-test. Determines whether two samples are likely to have come from the same two underlying populations that have the same mean.",
            a: "Returns the probability associated with t-test.",
            m: [4, 4],
            p: [{
                name: "range1",
                detail: "The first sample of data or group of cells to consider for the t-test.",
                example: "A1:A4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "range2",
                detail: "The second sample of data or group of cells to consider for the t-test.",
                example: "B1:B4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "tails",
                detail: "Specifies the number of distribution tails.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "type",
                detail: "Specifies the type of t-test.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "F_DIST",
            t: 1,
            d: "Calculates the left-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.",
            a: "F probability distribution (left-tailed).",
            m: [4, 4],
            p: [{
                name: "x",
                detail: "The input to the F probability distribution function. The value at which to evaluate the function.",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "The numerator of the number of degrees of freedom.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "The denominator of the number of degrees of freedom.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cumulative",
                detail: "Logical value that determines the form of the function.",
                example: "TRUE()",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "F_DIST_RT",
            t: 1,
            d: "Calculates the right-tailed F probability distribution (degree of diversity) for two data sets with given input x. Alternately called Fisher-Snedecor distribution or Snedecor's F distribution.",
            a: "F probability distribution.",
            m: [3, 3],
            p: [{
                name: "x",
                detail: "The input to the F probability distribution function. The value at which to evaluate the function.",
                example: "15.35",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom1",
                detail: "The numerator of the number of degrees of freedom.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "degrees_freedom2",
                detail: "The denominator of the number of degrees of freedom.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_P",
            t: 1,
            d: "Calculates the variance based on an entire population.",
            a: "Variance of entire population.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VAR_S",
            t: 1,
            d: "Calculates the variance based on a sample.",
            a: "Variance.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARA",
            t: 1,
            d: "Calculates the variance based on a sample, setting text to the value `0`.",
            a: "Variance of sample (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the sample.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the sample.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "VARPA",
            t: 1,
            d: "Calculates the variance based on an entire population, setting text to the value `0`.",
            a: "Variance of entire population (text as 0).",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the population.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the population.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "STEYX",
            t: 1,
            d: "Calculates the standard error of the predicted y-value for each x in the regression of a dataset.",
            a: "Standard error of predicted y-values in regression.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "STANDARDIZE",
            t: 1,
            d: "Calculates the normalized equivalent of a random variable given mean and standard deviation of the distribution.",
            a: "Normalized equivalent of a random variable.",
            m: [3, 3],
            p: [{
                name: "value",
                detail: "The value of the random variable to normalize.",
                example: "96",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "mean",
                detail: "The mean of the distribution.",
                example: "80",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "standard_deviation",
                detail: "The standard deviation of the distribution.",
                example: "6.7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SMALL",
            t: 1,
            d: "Returns the nth smallest element from a data set, where n is user-defined.",
            a: "Nth smallest element in a data set.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the dataset to consider.",
                example: "A2:B100",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "n",
                detail: "The rank from smallest to largest of the element to return.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLOPE",
            t: 1,
            d: "Calculates the slope of the line resulting from linear regression of a dataset.",
            a: "Slope of line from linear regression of data.",
            m: [2, 2],
            p: [{
                name: "data_y",
                detail: "The range representing the array or matrix of dependent data.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "data_x",
                detail: "The range representing the array or matrix of independent data.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SKEW",
            t: 1,
            d: "Calculates the skewness of a dataset, which describes the symmetry of that dataset about the mean.",
            a: "Skewness of a dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SKEW_P",
            t: 1,
            d: "Calculates the skewness of a dataset, which describes the symmetry of that dataset about the mean. This assumes the dataset is for the population.",
            a: "Skewness of a population's dataset.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first value or range of the dataset.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional values or ranges to include in the dataset.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "VLOOKUP",
            t: 2,
            d: "Vertical lookup. Searches down the first column of a range for a key and returns the value of a specified cell in the row found.",
            a: "Vertical lookup.",
            m: [3, 4],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The range to consider for the search. The first column in the range is searched for the key specified in `search_key`.",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "index",
                detail: "The column index of the value to be returned, where the first column in `range` is numbered 1.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_sorted",
                detail: "Indicates whether the column to be searched (the first column of the specified range) is sorted, in which case the closest match for `search_key` will be returned.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HLOOKUP",
            t: 2,
            d: "Horizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.",
            a: "Horizontal lookup",
            m: [3, 4],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The range to consider for the search. The first row in the range is searched for the key specified in `search_key`.",
                example: "A2:Z6",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "index",
                detail: "The row index of the value to be returned, where the first row in `range` is numbered 1.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_sorted",
                detail: "Indicates whether the row to be searched (the first row of the specified range) is sorted.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOOKUP",
            t: 2,
            d: "Looks through a sorted row or column for a key and returns the value of the cell in a result range located in the same position as the search row or column.",
            a: "Look up a value.",
            m: [2, 3],
            p: [{
                name: "search_key",
                detail: 'The value to search for in the row or column. For example, `42`, `"Cats"`, or `I24`.',
                example: "10003",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "search_range|search_result_array",
                detail: "One method of using this function is to provide a single sorted row or column `search_range` to look through for the `search_key` with a second argument `result_range`. The other way is to combine these two arguments into one `search_result_array` where the first row or column is searched and a value is returned from the last row or column in the array. If `search_key` is not found, a non-exact match may be returned.",
                example: "A1:A100",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "result_range",
                detail: "The range from which to return a result. The value returned corresponds to the location where `search_key` is found in `search_range`. This range must be only a single row or column and should not be used if using the `search_result_array` method.",
                example: "B1:B100",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADDRESS",
            t: 2,
            d: "Returns a cell reference as a string.",
            a: "Cell reference as a string.",
            m: [2, 5],
            p: [{
                name: "row",
                detail: "The row number of the cell reference",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column",
                detail: "The column number (not name) of the cell reference. `A` is column number `1`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "absolute_relative_mode",
                detail: "An indicator of whether the reference is row/column absolute. `1` is row and column absolute (e.g. $A$1), `2` is row absolute and column relative (e.g. A$1), `3` is row relative and column absolute (e.g. $A1), and `4` is row and column relative (e.g. A1).",
                example: "4",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "use_a1_notation",
                detail: "A boolean indicating whether to use `A1` style notation (TRUE) or `R1C1` style notation (FALSE).",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sheet",
                detail: "Text indicating the name of the sheet into which the address points.",
                example: '"Sheet2"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "INDIRECT",
            t: 2,
            d: "Returns a cell reference specified by a string.",
            a: "A cell reference specified by a string.",
            m: [1, 2],
            p: [{
                name: "cell_reference_as_string",
                detail: "A cell reference, written as a string with surrounding quotation marks.",
                example: '"Sheet2!"&B10',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "is_A1_notation",
                detail: "Indicates if the cell reference is in A1 notation (TRUE) or R1C1 notation (FALSE).",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROW",
            t: 2,
            d: "Returns the row number of a specified cell.",
            a: "Row number of a specified cell.",
            m: [0, 1],
            p: [{
                name: "cell_reference",
                detail: "The cell whose row number will be returned.",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROWS",
            t: 2,
            d: "Returns the number of rows in a specified array or range.",
            a: "Number of rows in a specified array or range.",
            m: [1, 1],
            p: [{
                name: "range",
                detail: "The range whose row count will be returned.",
                example: "A9:A62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COLUMN",
            t: 2,
            d: "Returns the column number of a specified cell, with `A=1`.",
            a: "Column number of a specified cell.",
            m: [0, 1],
            p: [{
                name: "cell_reference",
                detail: "The cell whose column number will be returned. Column `A` corresponds to `1`.",
                example: "A9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNS",
            t: 2,
            d: "Returns the number of columns in a specified array or range.",
            a: "Number of columns in a specified array or range.",
            m: [1, 1],
            p: [{
                name: "range",
                detail: "The range whose column count will be returned.",
                example: "A9:W62",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OFFSET",
            t: 2,
            d: "Returns a range reference shifted a specified number of rows and columns from a starting cell reference.",
            a: "A range reference offset relative to a cell.",
            m: [3, 5],
            p: [{
                name: "cell_reference",
                detail: "The starting point from which to count the offset rows and columns.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "offset_rows",
                detail: "The number of rows to offset by.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "offset_columns",
                detail: "The number of columns to offset by.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "height",
                detail: "The height of the range to return starting at the offset target.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "width",
                detail: "The width of the range to return starting at the offset target.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MATCH",
            t: 2,
            d: "Returns the relative position of an item in a range that matches a specified value.",
            a: "Position of item in range that matches value.",
            m: [2, 3],
            p: [{
                name: "search_key",
                detail: 'The value to search for. For example, `42`, `"Cats"`, or `I24`.',
                example: '"Sunday"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "range",
                detail: "The one-dimensional array to be searched.",
                example: "A2:A9",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "search_type",
                detail: "The search method. `1` (default) finds the largest value less than or equal to `search_key` when `range` is sorted in ascending order. `0` finds the exact value when `range` is unsorted. `-1` finds the smallest value greater than or equal to `search_key` when `range` is sorted in descending order.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INDEX",
            t: 2,
            d: "Returns the content of a cell, specified by row and column offset.",
            a: "Content of cell specified by row and column offset.",
            m: [2, 3],
            p: [{
                name: "reference",
                detail: "The array of cells to be offset into.",
                example: "A1:C20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "row",
                detail: "The number of offset rows.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "column",
                detail: "The number of offset columns.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GETPIVOTDATA",
            t: 2,
            d: "Extracts an aggregated value from a pivot table that corresponds to the specified row and column headings.",
            a: "Extracts an aggregated value from a pivot table that corresponds to the specified row and column headings.",
            m: [2, 254],
            p: [{
                name: "value_name",
                detail: "The name of the value in the pivot table for which you want to get data.",
                example: '"SUM of number of units"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "any_pivot_table_cell",
                detail: "Any reference to a cell in the desired pivot table (top corner recommended).",
                example: "'Pivot table'!A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "original_column",
                detail: "The name of the column in the original data set (not the pivot table).",
                example: '"division"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }, {
                name: "pivot_item",
                detail: "The name of the row or column shown in the pivot table corresponding to *original_column* that you want to retrieve.",
                example: '"east"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CHOOSE",
            t: 2,
            d: "Returns an element from a list of choices based on index.",
            a: "An element from a list of choices based on index.",
            m: [2, 255],
            p: [{
                name: "index",
                detail: "Which choice (of the up to 30 provided) to return.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "choice1",
                detail: "A potential value to return. Required. May be a reference to a cell or an individual value.",
                example: '"A"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "choice2",
                detail: "Additional values among which to choose.",
                example: '"B"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "HYPERLINK",
            t: 2,
            d: "Creates a hyperlink inside a cell.",
            a: "Creates a hyperlink inside a cell.",
            p: [{
                name: "url",
                detail: "The full URL of the link location enclosed in quotation marks, or a reference to a cell containing such a URL.",
                example: '"http://www.luckysheet.com/"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "link_label",
                detail: "The text to display in the cell as the link, enclosed in quotation marks, or a reference to a cell containing such a label.",
                example: '"luckysheet"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TIME",
            t: 6,
            d: "Converts a provided hour, minute, and second into a time.",
            a: "Converts hour/minute/second into a time.",
            m: [3, 3],
            p: [{
                name: "hour",
                detail: "The hour component of the time.",
                example: "11",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "minute",
                detail: "The minute component of the time.",
                example: "40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "second",
                detail: "The second component of the time.",
                example: "59",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TIMEVALUE",
            t: 6,
            d: "Returns the fraction of a 24-hour day the time represents.",
            a: "Converts a time string into its serial number representation.",
            m: [1, 1],
            p: [{
                name: "time_string",
                detail: "The string that holds the time representation.",
                example: '"2:15 PM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EOMONTH",
            t: 6,
            d: "Returns a date on the last day of a month that falls a specified number of months before or after another date.",
            a: "Last day of a month before or after a date.",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "The date from which to calculate the result.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "The number of months before (negative) or after (positive) 'start_date' to consider.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "EDATE",
            t: 6,
            d: "Returns a date a specified number of months before or after another date.",
            a: "Date a number of months before/after another date.",
            m: [2, 2],
            p: [{
                name: "start_date",
                detail: "The date from which to calculate the result.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "months",
                detail: "The number of months before (negative) or after (positive) 'start_date' to calculate.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SECOND",
            t: 6,
            d: "Returns the second component of a specific time, in numeric format.",
            a: "Second component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the second component",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MINUTE",
            t: 6,
            d: "Returns the minute component of a specific time, in numeric format.",
            a: "Minute component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the minute component.",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HOUR",
            t: 6,
            d: "Returns the hour component of a specific time, in numeric format.",
            a: "Hour component of a specific time.",
            m: [1, 1],
            p: [{
                name: "time",
                detail: "The time from which to calculate the hour component.",
                example: "TIME(11",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOW",
            t: 6,
            d: "Returns the current date and time as a date value.",
            a: "Current date and time as a date value.",
            m: [0, 0],
            p: []
        }, {
            n: "NETWORKDAYS",
            t: 6,
            d: "Returns the number of net working days between two provided days.",
            a: "Net working days between two provided days.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date of the period from which to calculate the number of net working days.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date of the period from which to calculate the number of net working days.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the date serial numbers to consider holidays.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NETWORKDAYS_INTL",
            t: 6,
            d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
            a: "Net working days between two dates (specifying weekends).",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "The start date of the period from which to calculate the number of net working days.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date of the period from which to calculate the number of net working days.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "weekend",
                detail: "A number or string representing which days of the week are considered weekends.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider as holidays.",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISOWEEKNUM",
            t: 6,
            d: "Returns a number representing the ISO week of the year where the provided date falls.",
            a: "ISO week number of the year.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date for which to determine the ISO week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WEEKNUM",
            t: 6,
            d: "Returns a number representing the week of the year where the provided date falls.",
            a: "Week number of the year.",
            m: [1, 2],
            p: [{
                name: "date",
                detail: "The date for which to determine the week number. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "type",
                detail: "A number representing the day that a week starts on. Sunday = 1.",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "WEEKDAY",
            t: 6,
            d: "Returns a number representing the day of the week of the date provided.",
            a: "Day of the week of the date provided (as number).",
            m: [1, 2],
            p: [{
                name: "date",
                detail: "The date for which to determine the day of the week. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "type",
                detail: "A number indicating which numbering system to use to represent weekdays. By default, counts starting with Sunday = 1.",
                example: "7",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DAY",
            t: 6,
            d: "Returns the day of the month that a specific date falls on, in numeric format.",
            a: "Day of the month that a specific date falls on.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the day.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS",
            t: 6,
            d: "Returns the number of days between two dates.",
            a: "Number of days between two dates.",
            m: [2, 2],
            p: [{
                name: "end_date",
                detail: "The end of the date range.",
                example: "2011-3-15",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "start_date",
                detail: "The start of the date range.",
                example: "2011-2-1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DAYS360",
            t: 6,
            d: "Returns the difference between two days based on the 360 day year used in some financial interest calculations.",
            a: "Days between two dates on a 360-day year.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "method",
                detail: "An indicator of what day count method to use.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATE",
            t: 6,
            d: "Converts a provided year, month, and day into a date.",
            a: "Converts year/month/day into a date.",
            m: [3, 3],
            p: [{
                name: "year",
                detail: "The year component of the date.",
                example: "1969",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "The month component of the date.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day",
                detail: "The day component of the date.",
                example: "20",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATEVALUE",
            t: 6,
            d: "Converts a provided date string in a known format to a date value.",
            a: "Converts a date string to a date value.",
            m: [1, 1],
            p: [{
                name: "date_string",
                detail: "The string representing the date.",
                example: '"1969-7-20"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DATEDIF",
            t: 6,
            d: "Calculates the number of days, months, or years between two dates.",
            a: "Date Difference.",
            m: [3, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "unit",
                detail: 'A string abbreviation for unit of time. For example, "M" for month. Accepted values are "Y","M","D","MD","YM","YD".',
                example: "16)",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY",
            t: 6,
            d: "Calculates the date after a number of working days from a specified start date.",
            a: "Number of working days from start date.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The date from which to begin counting.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_days",
                detail: "The number of working days to advance from `start_date`. If negative, counts backwards.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider holidays.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "WORKDAY_INTL",
            t: 6,
            d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
            a: "Date after a number of workdays (specifying weekends).",
            m: [2, 4],
            p: [{
                name: "start_date",
                detail: "The date from which to begin counting.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "num_days",
                detail: "The number of working days to advance from `start_date`. If negative, counts backwards.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "weekend",
                detail: "A number or string representing which days of the week are considered weekends.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "holidays",
                detail: "A range or array constant containing the dates to consider holidays.",
                example: "DATE(1969",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEAR",
            t: 6,
            d: "Returns the year specified by a given date.",
            a: "Year specified by a given date.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the year.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "YEARFRAC",
            t: 6,
            d: "Returns the number of years, including fractional years, between two dates using a specified day count convention.",
            a: "Exact number of years between two dates.",
            m: [2, 3],
            p: [{
                name: "start_date",
                detail: "The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_date",
                detail: "The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number.",
                example: "7",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "16)",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TODAY",
            t: 6,
            d: "Returns the current date as a date value.",
            a: "Current date as a date value.",
            m: [0, 0],
            p: []
        }, {
            n: "MONTH",
            t: 6,
            d: "Returns the month of the year a specific date falls in, in numeric format.",
            a: "Month of the year a specific date falls in.",
            m: [1, 1],
            p: [{
                name: "date",
                detail: "The date from which to extract the month.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EFFECT",
            t: 8,
            d: "Calculates the annual effective interest rate given the nominal rate and number of compounding periods per year.",
            a: "Annual effective interest rate.",
            m: [2, 2],
            p: [{
                name: "nominal_rate",
                detail: "The nominal interest rate per year.",
                example: "0.99",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "periods_per_year",
                detail: "The number of compounding periods per year.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLAR",
            t: 12,
            d: "Formats a number into the currency specific to your spreadsheet locale.",
            a: "Formats a number as currency specific to your spreadsheet locale.",
            m: [1, 2],
            p: [{
                name: "number",
                detail: "The value to be formatted.",
                example: "1.2351",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_places",
                detail: "The number of decimal places to display.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARDE",
            t: 8,
            d: "Converts a price quotation given as a decimal fraction into a decimal value.",
            a: "Converts a decimal fraction to decimal value.",
            m: [2, 2],
            p: [{
                name: "fractional_price",
                detail: "The price quotation given using fractional decimal conventions.",
                example: "100.10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "unit",
                detail: "The units of the fraction, e.g. `8` for 1/8ths or `32` for 1/32nds.",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DOLLARFR",
            t: 8,
            d: "Converts a price quotation given as a decimal value into a decimal fraction.",
            a: "Converts a decimal value to decimal fraction.",
            m: [2, 2],
            p: [{
                name: "decimal_price",
                detail: "The price quotation given as a decimal value.",
                example: "100.125",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "unit",
                detail: "The units of the desired fraction, e.g. `8` for 1/8ths or `32` for 1/32nds.",
                example: "32",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DB",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the arithmetic declining balance method.",
            a: "Depreciation via declining balance method.",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "month",
                detail: "The number of months in the first year of depreciation.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DDB",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the double-declining balance method.",
            a: "Depreciation via double-declining balance method.",
            m: [4, 5],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor",
                detail: "The factor by which depreciation decreases.",
                example: "2.25",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RATE",
            t: 8,
            d: "Calculates the interest rate of an annuity investment based on constant-amount periodic payments and the assumption of a constant interest rate.",
            a: "Interest rate of an annuity investment.",
            m: [3, 6],
            p: [{
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_per_period",
                detail: "The amount per period to be paid.",
                example: "-100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the interest rate will be.",
                example: "0.1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CUMPRINC",
            t: 8,
            d: "Calculates the cumulative principal paid over a range of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Cumulative principal paid over a set of periods.",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "first_period",
                detail: "The number of the payment period to begin the cumulative calculation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "last_period",
                detail: "The number of the payment period to end the cumulative calculation.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNUM",
            t: 8,
            d: "Calculates the number of coupons, or interest payments, between the settlement date and the maturity date of the investment.",
            a: "Number of coupons between settlement and maturity.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "02",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SYD",
            t: 8,
            d: "Calculates the depreciation of an asset for a specified period using the sum of years digits method.",
            a: "Depreciation via sum of years digits method.",
            m: [4, 4],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "50",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The single period within `life` for which to calculate depreciation.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLEQ",
            t: 8,
            d: "Calculates the equivalent annualized rate of return of a US Treasury Bill based on discount rate.",
            a: "Equivalent rate of return for a Treasury bill.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the bill at time of purchase.",
                example: "2)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLYIELD",
            t: 8,
            d: "Calculates the yield of a US Treasury Bill based on price.",
            a: "The yield of a us treasury bill based on price.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TBILLPRICE",
            t: 8,
            d: "Calculates the price of a US Treasury Bill based on discount rate.",
            a: "Price of US treasury bill.",
            m: [3, 3],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the bill at time of purchase.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PV",
            t: 8,
            d: "Calculates the present value of an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Present value of an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount per period to be paid.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "D2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ACCRINT",
            t: 8,
            d: "Calculates the accrued interest of a security that has periodic payments.",
            a: "Accrued interest of security with periodic payments.",
            m: [6, 8],
            p: [{
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "first_payment",
                detail: "The first date interest will be paid.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "calc_method",
                detail: "[Optional-defaults to TRUE()] - A logical value that specifies the method used to calculate the total accrued interest when the settlement date is later than the first interest accrual date. \n\nIf the value is TRUE, the total accrued interest from the issue date to the settlement date is returned. \n\nIf the value is FALSE, return the accrued interest from the first interest accrual date to the settlement date.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ACCRINTM",
            t: 8,
            d: "Calculates the accrued interest of a security that pays interest at maturity.",
            a: "Accrued interest of security paying at maturity.",
            m: [4, 5],
            p: [{
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity date of the security.",
                example: "DATE(1969",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "1000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYBS",
            t: 8,
            d: "Calculates the number of days from the first coupon, or interest payment, until settlement.",
            a: "Number of days from first coupon to settlement.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYS",
            t: 8,
            d: "Calculates the number of days in the coupon, or interest payment, period that contains the specified settlement date.",
            a: "Days in coupon period containing settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPDAYSNC",
            t: 8,
            d: "Calculates the number of days from the settlement date until the next coupon, or interest payment.",
            a: "Days from settlement until next coupon.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPNCD",
            t: 8,
            d: "Calculates next coupon, or interest payment, date after the settlement date.",
            a: "Next coupon date after the settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COUPPCD",
            t: 8,
            d: "Calculates last coupon, or interest payment, date before the settlement date.",
            a: "Last coupon date before settlement date.",
            m: [3, 4],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "01)",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "DATE(2019",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FV",
            t: 8,
            d: "Calculates the future value of an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Future value of an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount per period to be paid.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "400",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FVSCHEDULE",
            t: 8,
            d: "Calculates the future value of some principal based on a specified series of potentially varying interest rates.",
            a: "Future value of principal from series of rates.",
            m: [2, 2],
            p: [{
                name: "principal",
                detail: "The amount of initial capital or value to compound against.",
                example: "10000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "rate_schedule",
                detail: "A series of interest rates to compound against the `principal`.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "YIELD",
            t: 8,
            d: "Calculates the annual yield of a security paying periodic interest, such as a US Treasury Bond, based on price.",
            a: "Annual yield of a security paying periodic interest.",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "YIELDDISC",
            t: 8,
            d: "Calculates the annual yield of a discount (non-interest-bearing) security, based on price.",
            a: "Annual yield of a discount security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "95",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NOMINAL",
            t: 8,
            d: "Calculates the annual nominal interest rate given the effective rate and number of compounding periods per year.",
            a: "Annual nominal interest rate.",
            m: [2, 2],
            p: [{
                name: "effective_rate",
                detail: "The effective interest rate per year.",
                example: "0.85",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "periods_per_year",
                detail: "The number of compounding periods per year.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "XIRR",
            t: 8,
            d: "Calculates the internal rate of return of an investment based on a specified series of potentially irregularly spaced cash flows.",
            a: "Internal rate of return given non-periodic cashflows.",
            m: [2, 3],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "cashflow_dates",
                detail: "An array or range with dates corresponding to the cash flows in `cashflow_amounts`.",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the internal rate of return will be.",
                example: "250",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MIRR",
            t: 8,
            d: "Calculates the modified internal rate of return on an investment based on a series of periodic cash flows and the difference between the interest rate paid on financing versus the return received on reinvested income.",
            a: "Modified internal rate of return.",
            m: [3, 3],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "financing_rate",
                detail: "The interest rate paid on funds invested.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "reinvestment_return_rate",
                detail: "The return (as a percentage) earned on reinvestment of income received from the investment.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IRR",
            t: 8,
            d: "Calculates the internal rate of return on an investment based on a series of periodic cash flows.",
            a: "Internal rate of return given periodic cashflows.",
            m: [1, 2],
            p: [{
                name: "cashflow_amounts",
                detail: "An array or range containing the income or payments associated with the investment.",
                example: "A2:A25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "rate_guess",
                detail: "An estimate for what the internal rate of return will be.",
                example: "200",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPV",
            t: 8,
            d: "Calculates the net present value of an investment based on a series of periodic cash flows and a discount rate.",
            a: "The net present value of an investment based on a series of periodic cash flows and a discount rate.",
            m: [2, 255],
            p: [{
                name: "discount",
                detail: "The discount rate of the investment over one period.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cashflow1",
                detail: "The first future cash flow.",
                example: "200",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "cashflow2",
                detail: "Additional future cash flows.",
                example: "250",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "XNPV",
            t: 8,
            d: "Calculates the net present value of an investment based on a specified series of potentially irregularly spaced cash flows and a discount rate.",
            a: "Net present value given non-periodic cashflows.",
            m: [3, 3],
            p: [{
                name: "discount",
                detail: "The discount rate of the investment over one period.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "cashflow_amounts",
                detail: "A range of cells containing the income or payments associated with the investment.",
                example: "B2:B25",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "cashflow_dates",
                detail: "A range of cells with dates corresponding to the cash flows in `cashflow_amounts`.",
                example: "C2:C25",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CUMIPMT",
            t: 8,
            d: "Calculates the cumulative interest over a range of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Cumulative interest paid over a set of periods.",
            m: [6, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "first_period",
                detail: "The number of the payment period to begin the cumulative calculation.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "last_period",
                detail: "The number of the payment period to end the cumulative calculation.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PMT",
            t: 8,
            d: "Calculates the periodic payment for an annuity investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Periodic payment for an annuity investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: " 100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "D2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IPMT",
            t: 8,
            d: "Calculates the payment on interest for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Payment on interest for an investment.",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The amortization period, in terms of number of periods.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "80000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "E2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PPMT",
            t: 8,
            d: "Calculates the payment on the principal of an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Payment on the principal of an investment.",
            m: [4, 6],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "period",
                detail: "The amortization period, in terms of number of periods.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_periods",
                detail: "The number of payments to be made.",
                example: "3*12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "INTRATE",
            t: 8,
            d: "Calculates the effective interest rate generated when an investment is purchased at one price and sold at another with no interest or dividends generated by the investment itself.",
            a: "Calculates effective interest rate.",
            m: [4, 5],
            p: [{
                name: "buy_date",
                detail: "The date of purchase of the investment.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "sell_date",
                detail: "The date of sale of the investment.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "buy_price",
                detail: "The price at which the investment was purchased.",
                example: "100000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sell_price",
                detail: "The price at which the investment was sold.",
                example: "101200",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICE",
            t: 8,
            d: "Calculates the price of a security paying periodic interest, such as a US Treasury Bond, based on expected yield.",
            a: "Price of a security paying periodic interest.",
            m: [6, 7],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.057",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.065",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEDISC",
            t: 8,
            d: "Calculates the price of a discount (non-interest-bearing) security, based on expected yield.",
            a: "Price of a discount security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "discount",
                detail: "The discount rate of the security at time of purchase.",
                example: "0.0525",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "PRICEMAT",
            t: 8,
            d: "Calculates the price of a security paying interest at maturity, based on expected yield.",
            a: "Price of security paying interest at maturity.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "issue",
                detail: "The date the security was initially issued.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.061",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RECEIVED",
            t: 8,
            d: "Calculates the amount received at maturity for an investment in fixed-income securities purchased on a given date.",
            a: "Amount received at maturity for a security.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "investment",
                detail: "The amount invested (irrespective of face value of each security).",
                example: "10000000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "discount",
                detail: "The discount rate of the security invested in.",
                example: "0.0575",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DISC",
            t: 8,
            d: "Calculates the discount rate of a security based on price.",
            a: "The discount rate of a security based on price.",
            m: [4, 5],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "price",
                detail: "The price at which the security is bought per 100 face value.",
                example: "97.975",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "redemption",
                detail: "The redemption amount per 100 face value, or par.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "12",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "NPER",
            t: 8,
            d: "Calculates the number of payment periods for an investment based on constant-amount periodic payments and a constant interest rate.",
            a: "Number of payment periods for an investment.",
            m: [3, 5],
            p: [{
                name: "rate",
                detail: "The interest rate.",
                example: "0.12",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "payment_amount",
                detail: "The amount of each payment made.",
                example: "500",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "present_value",
                detail: "The current value of the annuity.",
                example: "40000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "future_value",
                detail: "The future value remaining after the final payment has been made.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "end_or_beginning",
                detail: "Whether payments are due at the end (`0`) or beginning (`1`) of each period.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SLN",
            t: 8,
            d: "Calculates the depreciation of an asset for one period using the straight-line method.",
            a: "Depreciation of asset using the straight-line method.",
            m: [3, 3],
            p: [{
                name: "cost",
                detail: "The initial cost of the asset.",
                example: "300000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "salvage",
                detail: "The value of the asset at the end of depreciation.",
                example: "75000",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "life",
                detail: "The number of periods over which the asset is depreciated.",
                example: "10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DURATION",
            t: 8,
            d: "Calculates the number of compounding periods required for an investment of a specified present value appreciating at a given rate to reach a target value.",
            a: "Number of periods for an investment to reach a value.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MDURATION",
            t: 8,
            d: "Calculates the modified Macaulay duration of a security paying periodic interest, such as a US Treasury Bond, based on expected yield.",
            a: "Modified Macaulay duration.",
            m: [5, 6],
            p: [{
                name: "settlement",
                detail: "The settlement date of the security, the date after issuance when the security is delivered to the buyer.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "maturity",
                detail: "The maturity or end date of the security, when it can be redeemed at face, or par value.",
                example: "DATE(2010",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "rate",
                detail: "The annualized rate of interest.",
                example: "0.08",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "yield",
                detail: "The expected annual yield of the security.",
                example: "0.09",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "frequency",
                detail: "The number of interest or coupon payments per year (1, 2, or 4).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "day_count_convention",
                detail: "An indicator of what day count method to use.",
                example: "0",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2DEC",
            t: 9,
            d: "Converts a signed binary number to decimal format.",
            a: "Converts a signed binary number to decimal format.",
            m: [1, 1],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to decimal, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIN2HEX",
            t: 9,
            d: "Converts a signed binary number to signed hexadecimal format.",
            a: "Converts a binary number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to signed hexademical, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "BIN2OCT",
            t: 9,
            d: "Converts a signed binary number to signed octal format.",
            a: "Converts a binary number to octal.",
            m: [1, 2],
            p: [{
                name: "signed_binary_number",
                detail: "The signed 10-bit binary value to be converted to signed octal, provided as a string.",
                example: "101",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2BIN",
            t: 9,
            d: "Converts a decimal number to signed binary format.",
            a: "Converts a decimal number to signed binary format.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed binary, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2HEX",
            t: 9,
            d: "Converts a decimal number to signed hexadecimal format.",
            a: "Converts a decimal number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed hexadecimal, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DEC2OCT",
            t: 9,
            d: "Converts a decimal number to signed octal format.",
            a: "Converts a decimal number to signed octal format.",
            m: [1, 2],
            p: [{
                name: "decimal_number",
                detail: "The decimal value to be converted to signed octal, provided as a string.",
                example: "100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2BIN",
            t: 9,
            d: "Converts a signed hexadecimal number to signed binary format.",
            a: "Converts a hexadecimal number to binary.",
            m: [1, 2],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to signed binary, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "HEX2DEC",
            t: 9,
            d: "Converts a signed hexadecimal number to decimal format.",
            a: "Converts a hexadecimal number to decimal.",
            m: [1, 1],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to decimal, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "HEX2OCT",
            t: 9,
            d: "Converts a signed hexadecimal number to signed octal format.",
            a: "Converts a hexadecimal number to octal.",
            m: [1, 2],
            p: [{
                name: "signed_hexadecimal_number",
                detail: "The signed 40-bit hexadecimal value to be converted to signed octal, provided as a string.",
                example: '"f3"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2BIN",
            t: 9,
            d: "Converts a signed octal number to signed binary format.",
            a: "Converts an octal number to binary.",
            m: [1, 2],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to signed binary, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "OCT2DEC",
            t: 9,
            d: "Converts a signed octal number to decimal format.",
            a: "Converts a signed octal number to decimal format.",
            m: [1, 1],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to decimal, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OCT2HEX",
            t: 9,
            d: "Converts a signed octal number to signed hexadecimal format.",
            a: "Converts an octal number to hexadecimal.",
            m: [1, 2],
            p: [{
                name: "signed_octal_number",
                detail: "The signed 30-bit octal value to be converted to signed hexadecimal, provided as a string.",
                example: "37",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "significant_digits",
                detail: "The number of significant digits to ensure in the result.",
                example: "8",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "COMPLEX",
            t: 9,
            d: "Creates a complex number given real and imaginary coefficients.",
            a: "Creates a complex number.",
            m: [2, 3],
            p: [{
                name: "real_part",
                detail: "The real coefficient.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "imaginary_part",
                detail: "The imaginary coefficient.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "suffix",
                detail: "The suffix for the imaginary coefficient, can only be 'i' or 'j'. If omitted, 'i' will be used.",
                example: '"j"',
                require: "o",
                repeat: "n",
                type: "rangestring"
            }]
        }, {
            n: "IMREAL",
            t: 9,
            d: "Returns the real coefficient of a complex number.",
            a: "The real coefficient of a complex number.",
            m: [1, 1],
            p: [{
                name: "complex_number",
                detail: "The complex number, in the a+bi or a+bj format.",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMAGINARY",
            t: 9,
            d: "Returns the imaginary coefficient of a complex number.",
            a: "The imaginary coefficient of a complex number.",
            m: [1, 1],
            p: [{
                name: "complex_number",
                detail: "The complex number, in the a+bi or a+bj format.",
                example: '"4+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMCONJUGATE",
            t: 9,
            d: "Returns the complex conjugate of a number.",
            a: "The complex conjugate of a number.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The complex number to calculate the conjugate for.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMABS",
            t: 9,
            d: "Returns absolute value (or modulus) of a complex number.",
            a: "The absolute value of a complex number.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The complex number to calculate the absolute value of.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DELTA",
            t: 9,
            d: "Compare two numeric values, returning 1 if they're equal.",
            a: "Compare two numeric values.",
            m: [1, 2],
            p: [{
                name: "number1",
                detail: "The first number to compare.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number2",
                detail: "The second number to compare.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "IMSUM",
            t: 9,
            d: "Returns the sum of a series of complex numbers.",
            a: "Sum of a series of complex numbers.",
            m: [1, 255],
            p: [{
                name: "value1",
                detail: "The first complex number or range to add together.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "Additional complex numbers or ranges to add to `value1`.",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMSUB",
            t: 9,
            d: "Returns the difference between two complex numbers.",
            a: "The difference between two complex numbers.",
            m: [2, 2],
            p: [{
                name: "first_number",
                detail: "The complex number to subtract second_number from.",
                example: '"6+5i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "second_number",
                detail: "The complex number to subtract from first_number.",
                example: '"2+3i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IMPRODUCT",
            t: 9,
            d: "Returns the result of multiplying a series of complex numbers together.",
            a: "Result of multiplying a series of complex numbers together.",
            m: [1, 255],
            p: [{
                name: "factor1",
                detail: "The first number or range to calculate for the product.",
                example: '"3+4i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "factor2",
                detail: "Additional complex numbers or ranges to calculate for the product.",
                example: '"5-3i"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IMDIV",
            t: 9,
            d: "Returns one complex number divided by another.",
            a: "One complex number divided by another.",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The complex number to be divided.",
                example: '"11+16i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "divisor",
                detail: "The complex number to divide by.",
                example: '"3+2i"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NOT",
            t: 10,
            d: "Returns the opposite of a logical value - `NOT(TRUE)` returns `FALSE`; `NOT(FALSE)` returns `TRUE`.",
            a: "Returns opposite of provided logical value.",
            m: [1, 1],
            p: [{
                name: "logical_expression",
                detail: "An expression or reference to a cell holding an expression that represents some logical value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRUE",
            t: 10,
            d: "Returns the logical value `TRUE`.",
            a: "Logical value `true`.",
            m: [0, 0],
            p: []
        }, {
            n: "FALSE",
            t: 10,
            d: "Returns the logical value `FALSE`.",
            a: "Logical value `false`.",
            m: [0, 0],
            p: []
        }, {
            n: "AND",
            t: 10,
            d: "Returns true if all of the provided arguments are logically true, and false if any of the provided arguments are logically false.",
            a: "Logical `and` operator.",
            m: [1, 255],
            p: [{
                name: "logical_expression1",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`, or an expression that can be coerced to a logical value.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "logical_expression2",
                detail: "More expressions that represent logical values.",
                example: 'A3 = "bar"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "IFERROR",
            t: 10,
            d: "Returns the first argument if it is not an error value, otherwise returns the second argument if present, or a blank if the second argument is absent.",
            a: "Value if it is not an error, otherwise 2nd argument.",
            m: [2, 2],
            p: [{
                name: "value",
                detail: "The value to return if `value` itself is not an error.",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_error",
                detail: "The value the function returns if `value` is an error.",
                example: '"Error in cell A1"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "IF",
            t: 10,
            d: "Returns one value if a logical expression is `TRUE` and another if it is `FALSE`.",
            a: "Returns value depending on logical expression.",
            m: [2, 3],
            p: [{
                name: "logical_expression",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_true",
                detail: "The value the function returns if `logical_expression` is `TRUE`.",
                example: '"A2 is foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_if_false",
                detail: "The value the function returns if `logical_expression` is `FALSE`.",
                example: '"A2 was false"',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "OR",
            t: 10,
            d: "Returns true if any of the provided arguments are logically true, and false if all of the provided arguments are logically false.",
            a: "Logical `or` operator.",
            m: [1, 255],
            p: [{
                name: "logical_expression1",
                detail: "An expression or reference to a cell containing an expression that represents some logical value, i.e. `TRUE` or `FALSE`, or an expression that can be coerced to a logical value.",
                example: 'A2 = "foo"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "logical_expression2",
                detail: "More expressions that evaluate to logical values.",
                example: ' A3 = "bar"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "NE",
            t: 11,
            d: "Returns `TRUE` if two specified values are not equal and `FALSE` otherwise. Equivalent to the `!=` operator.",
            a: "Not equal.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to test against `value1` for inequality.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EQ",
            t: 11,
            d: "Returns `TRUE` if two specified values are equal and `FALSE` otherwise. Equivalent to the `==` operator.",
            a: "Equal.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to test against `value1` for equality.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GT",
            t: 11,
            d: "Returns `TRUE` if the first argument is strictly greater than the second, and `FALSE` otherwise. Equivalent to the `>` operator.",
            a: "Strictly greater than.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being greater than `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "GTE",
            t: 11,
            d: "Returns `TRUE` if the first argument is greater than or equal to the second, and `FALSE` otherwise. Equivalent to the `>=` operator.",
            a: "Greater than or equal to.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being greater than or equal to `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LT",
            t: 11,
            d: "Returns `TRUE` if the first argument is strictly less than the second, and `FALSE` otherwise. Equivalent to the `<` operator.",
            a: "Less than.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being less than `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LTE",
            t: 11,
            d: "Returns `TRUE` if the first argument is less than or equal to the second, and `FALSE` otherwise. Equivalent to the `<=` operator.",
            a: "Less than or equal to.",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to test as being less than or equal to `value2`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The second value.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ADD",
            t: 11,
            d: "Returns the sum of two numbers. Equivalent to the `+` operator.",
            a: "Sum of two numbers",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The first addend.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "The second addend.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINUS",
            t: 11,
            d: "Returns the difference of two numbers. Equivalent to the `-` operator.",
            a: "Difference of two numbers",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The minuend, or number to be subtracted from.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "value2",
                detail: "The subtrahend, or number to subtract from `value1`.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MULTIPLY",
            t: 11,
            d: "Returns the product of two numbers. Equivalent to the `*` operator.",
            a: "Product of two numbers",
            m: [2, 2],
            p: [{
                name: "factor1",
                detail: "The first multiplicand.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "factor2",
                detail: "The second multiplicand.",
                example: "B2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DIVIDE",
            t: 11,
            d: "Returns one number divided by another. Equivalent to the `/` operator.",
            a: "One number divided by another",
            m: [2, 2],
            p: [{
                name: "dividend",
                detail: "The number to be divided.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "divisor",
                detail: "The number to divide by.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCAT",
            t: 11,
            d: "Returns the concatenation of two values. Equivalent to the `&` operator.",
            a: "Concatenation of two values",
            m: [2, 2],
            p: [{
                name: "value1",
                detail: "The value to which `value2` will be appended.",
                example: '"de"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value2",
                detail: "The value to append to `value1`.",
                example: '"mystify"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNARY_PERCENT",
            t: 11,
            d: "Returns a value interpreted as a percentage; that is, `UNARY_PERCENT(100)` equals `1`.",
            a: "Value interpreted as a percentage.",
            m: [1, 1],
            p: [{
                name: "percentage",
                detail: "The value to interpret as a percentage.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CONCATENATE",
            t: 12,
            d: "Appends strings to one another.",
            a: "Appends strings to one another.",
            m: [1, 255],
            p: [{
                name: "string1",
                detail: "The initial string.",
                example: '"Super"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "string2",
                detail: "More strings to append in sequence.",
                example: '"calla"',
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "CODE",
            t: 12,
            d: "Returns the numeric Unicode map value of the first character in the string provided.",
            a: "Numeric unicode map value of character.",
            m: [1, 1],
            p: [{
                name: "string",
                detail: "The string whose first character's Unicode map value will be returned.",
                example: '"a"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CHAR",
            t: 12,
            d: "Convert a number into a character according to the current Unicode table.",
            a: "Gets character associated with number.",
            m: [1, 1],
            p: [{
                name: "table_number",
                detail: "The number of the character to look up from the current Unicode table in decimal format.",
                example: "97",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ARABIC",
            t: 12,
            d: "Computes the value of a Roman numeral.",
            a: "Computes the value of a roman numeral.",
            m: [1, 1],
            p: [{
                name: "roman_numeral",
                detail: "The Roman numeral to format, whose value must be between 1 and 3999, inclusive.",
                example: '"XIV"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ROMAN",
            t: 12,
            d: "Formats a number in Roman numerals.",
            a: "Formats a number in Roman numerals.",
            m: [1, 1],
            p: [{
                name: "number",
                detail: "The number to format, between 1 and 3999, inclusive.",
                example: "499",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "REGEXEXTRACT",
            t: 12,
            d: "Extracts matching substrings according to a regular expression.",
            a: "Extracts matching substrings with regular expression.",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "The input text.",
                example: '"Needle in a haystack"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The first part of `text` that matches this expression will be returned.",
                example: '".e{2}dle"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXMATCH",
            t: 12,
            d: "Whether a piece of text matches a regular expression.",
            a: "Whether a piece of text matches regular expression.",
            m: [2, 2],
            p: [{
                name: "text",
                detail: "The text to be tested against the regular expression.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The regular expression to test the text against.",
                example: '"S.r"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REGEXREPLACE",
            t: 12,
            d: "Replaces part of a text string with a different text string using regular expressions.",
            a: "Replaces text with regular expressions.",
            m: [3, 3],
            p: [{
                name: "text",
                detail: "The text, a part of which will be replaced.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "regular_expression",
                detail: "The regular expression.  All matching instances in `text` will be replaced.",
                example: '"S.*d"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "replacement",
                detail: "The text which will be inserted into the original text.",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "T",
            t: 12,
            d: "Returns string arguments as text, or the empty string if the value is not text.",
            a: "String arguments as text.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument to be converted to text.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIXED",
            t: 12,
            d: "Formats a number with a fixed number of decimal places.",
            a: "Formats number with fixed number of decimal places.",
            m: [1, 3],
            p: [{
                name: "number",
                detail: "The number to format.",
                example: "3.141592653",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "number_of_places",
                detail: "The number of decimal places to display in the result.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "suppress_separator",
                detail: "Whether or not to suppress the thousands separator used in some locales (e.g. `1,000` becomes `1000`). Separators will be present if this value is 0 or omitted, and absent otherwise.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FIND",
            t: 12,
            d: "Returns the position at which a string is first found within text where the capitalization of letters matters. Returns `#VALUE!` if the string is not found.",
            a: "First position of string found in text, case-sensitive.",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "14",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "FINDB",
            t: 12,
            d: "Returns the position at which a string is first found within text counting each double-character as 2.",
            a: "Position at which a string is first found within text (binary).",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"new"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: '"new year"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "2",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "JOIN",
            t: 12,
            d: "Concatenates the elements of one or more one-dimensional arrays using a specified delimiter.",
            a: "Concatenates elements of arrays with delimiter.",
            m: [2, 255],
            p: [{
                name: "delimiter",
                detail: "The character or string to place between each concatenated value.",
                example: '" and-a "',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_or_array1",
                detail: "The value or values to be appended using `delimiter`.",
                example: "{1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "value_or_array2",
                detail: "More values to be appended using `delimiter`.",
                example: "2",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "LEFT",
            t: 12,
            d: "Returns a substring from the beginning of a specified string.",
            a: "Substring from beginning of specified string.",
            m: [1, 2],
            p: [{
                name: "string",
                detail: "The string from which the left portion will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_characters",
                detail: "The number of characters to return from the left side of `string`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "RIGHT",
            t: 12,
            d: "Returns a substring from the end of a specified string.",
            a: "A substring from the end of a specified string.",
            m: [1, 2],
            p: [{
                name: "string",
                detail: "The string from which the right portion will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_characters",
                detail: "The number of characters to return from the right side of `string`.",
                example: "2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MID",
            t: 12,
            d: "Returns a segment of a string.",
            a: "A segment of a string.",
            m: [3, 3],
            p: [{
                name: "string",
                detail: "The string to extract a segment from.",
                example: '"get this"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The index from the left of `string` from which to begin extracting. The first character in `string` has the index 1.",
                example: "5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "extract_length",
                detail: "The length of the segment to extract.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "LEN",
            t: 12,
            d: "Returns the length of a string.",
            a: "Length of a string.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string whose length will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LENB",
            t: 12,
            d: "Returns the length of a string in bytes.",
            a: "Length of a string in bytes.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string whose length will be returned.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOWER",
            t: 12,
            d: "Converts a specified string to lowercase.",
            a: "Converts a specified string to lowercase.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string to convert to lowercase.",
                example: '"LOREM IPSUM"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UPPER",
            t: 12,
            d: "Converts a specified string to uppercase.",
            a: "Converts a specified string to uppercase.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string to convert to uppercase.",
                example: '"lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "EXACT",
            t: 12,
            d: "Tests whether two strings are identical.",
            a: "Tests whether two strings are identical.",
            m: [2, 2],
            p: [{
                name: "string1",
                detail: "The first string to compare",
                example: "A1",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "string2",
                detail: "The second string to compare",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPLACE",
            t: 12,
            d: "Replaces part of a text string with a different text string.",
            a: "Replaces part of a text string with different text.",
            m: [4, 4],
            p: [{
                name: "text",
                detail: "The text, a part of which will be replaced.",
                example: '"Spreadsheets"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "position",
                detail: "The position where the replacement will begin (starting from 1).",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "length",
                detail: "The number of characters in the text to be replaced.",
                example: "6",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_text",
                detail: "The text which will be inserted into the original text.",
                example: '"Bed"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "REPT",
            t: 12,
            d: "Returns specified text repeated a number of times.",
            a: "Specified text repeated a number of times.",
            m: [2, 2],
            p: [{
                name: "text_to_repeat",
                detail: "The character or string to repeat.",
                example: '"ha"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "number_of_repetitions",
                detail: "The number of times `text_to_repeat` should appear in the value returned.",
                example: "4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEARCH",
            t: 12,
            d: "Returns the position at which a string is first found within text and ignores capitalization of letters. Returns `#VALUE!` if the string is not found.",
            a: "First position of string found in text, ignoring case.",
            m: [2, 3],
            p: [{
                name: "search_for",
                detail: "The string to look for within `text_to_search`.",
                example: '"n"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "text_to_search",
                detail: "The text to search for the first occurrence of `search_for`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "starting_at",
                detail: "The character within `text_to_search` at which to start the search.",
                example: "14",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUBSTITUTE",
            t: 12,
            d: "Replaces existing text with new text in a string.",
            a: "Replaces existing text with new text in a string.",
            m: [3, 4],
            p: [{
                name: "text_to_search",
                detail: "The text within which to search and replace.",
                example: '"search for it"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "search_for",
                detail: "The string to search for within `text_to_search`.",
                example: '"search for"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "replace_with",
                detail: "The string that will replace `search_for`.",
                example: '"Google"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "occurrence_number",
                detail: "The instance of `search_for` within `text_to_search` to replace with `replace_with`. By default, all occurrences of `search_for` are replaced; however, if `occurrence_number` is specified, only the indicated instance of `search_for` is replaced.",
                example: "3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "CLEAN",
            t: 12,
            d: "Returns the text with the non-printable ASCII characters removed.",
            a: "Removes non-printable characters from a piece of text.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The text whose non-printable characters are to be removed.",
                example: '"AF"&CHAR(31)',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TEXT",
            t: 12,
            d: "Converts a number into text according to a specified format.",
            a: "Formats a number into text.",
            m: [2, 2],
            p: [{
                name: "number",
                detail: "The number, date, or time to format.",
                example: "1.23",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "format",
                detail: "The pattern by which to format the number, enclosed in quotation marks.",
                example: '"$0.00"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRIM",
            t: 12,
            d: "Removes leading, trailing, and repeated spaces in text.",
            a: "Removes space characters.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The text or reference to a cell containing text to be trimmed.",
                example: '" lorem ipsum"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "VALUE",
            t: 12,
            d: "Converts a string in any of the date, time or number formats that Google Sheets understands into a number.",
            a: "Converts a date/time/number string into a number.",
            m: [1, 1],
            p: [{
                name: "text",
                detail: "The string containing the value to be converted.",
                example: '"123"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROPER",
            t: 12,
            d: "Capitalizes each word in a specified string.",
            a: "Capitalizes each word in a specified string.",
            m: [1, 1],
            p: [{
                name: "text_to_capitalize",
                detail: "The text which will be returned with the first letter of each word in uppercase and all other letters in lowercase.",
                example: '"united states"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CONVERT",
            t: 13,
            d: "Converts a numeric value to a different unit of measure.",
            a: "Unit conversion for numbers.",
            m: [3, 3],
            p: [{
                name: "value",
                detail: "The numeric value in `start_unit` to convert to `end_unit`.",
                example: "5.1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start_unit",
                detail: "The starting unit, the unit currently assigned to `value`.",
                example: '"g"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "end_unit",
                detail: "The unit of measure into which to convert the argument, `value`.",
                example: '"kg"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "SUMX2MY2",
            t: 14,
            d: "Calculates the sum of the differences of the squares of values in two arrays.",
            a: "Sum of the differences of squares.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values whose squares will be reduced by the squares of corresponding entries in `array_y` and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values whose squares will be subtracted from the squares of corresponding entries in `array_x` and added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMX2PY2",
            t: 14,
            d: "Calculates the sum of the sums of the squares of values in two arrays.",
            a: "Sum of the sums of squares.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values whose squares will be added to the squares of corresponding entries in `array_y` and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values whose squares will be added to the squares of corresponding entries in `array_x` and added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMXMY2",
            t: 14,
            d: "Calculates the sum of the squares of differences of values in two arrays.",
            a: "Sum of the squares of differences.",
            m: [2, 2],
            p: [{
                name: "array_x",
                detail: "The array or range of values that will be reduced by corresponding entries in `array_y`, squared, and added together.",
                example: "A2:A100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array_y",
                detail: "The array or range of values that will be subtracted from corresponding entries in `array_x`, the result squared, and all such results added together.",
                example: "B2:B100",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TRANSPOSE",
            t: 14,
            d: "Transposes the rows and columns of an array or range of cells.",
            a: "Transposes the rows and columns of an array.",
            m: [1, 1],
            p: [{
                name: "array_or_range",
                detail: "The array or range whose rows and columns will be swapped.",
                example: "{1,2}",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "TREND",
            t: 14,
            d: "Given partial data about a linear trend, fits an ideal linear trend using the least squares method and/or predicts further values.",
            a: "Fits points to linear trend derived via least-squares.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal linear trend.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_data_x",
                detail: "The data points to return the `y` values for on the ideal curve fit.",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general linear form of `y = m*x+b` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `0` and only calculates the `m` values if `FALSE`, i.e. forces the curve fit to pass through the origin.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FREQUENCY",
            t: 14,
            d: "Calculates the frequency distribution of a one-column array into specified classes.",
            a: "The frequency distribution of array.",
            m: [2, 2],
            p: [{
                name: "data",
                detail: "The array or range containing the values to be counted.",
                example: "A2:A40",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "classes",
                detail: "The array or range containing the set of classes.",
                example: "B2:B5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "GROWTH",
            t: 14,
            d: "Given partial data about an exponential growth trend, fits an ideal exponential growth trend and/or predicts further values.",
            a: "Fits points to exponential growth trend.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal exponential growth curve.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "new_data_x",
                detail: "The data points to return the `y` values for on the ideal curve fit.",
                example: "A11:A13",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general exponential form of `y = b*m^x` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `1` and only calculates the `m` values if `FALSE`.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINEST",
            t: 14,
            d: "Given partial data about a linear trend, calculates various parameters about the ideal linear trend using the least-squares method.",
            a: "Best-fit linear trend via least-squares.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal linear trend.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "calculate_b",
                detail: "Given a linear form of `y = m*x+b`, calculates the y-intercept (`b`) if `TRUE`. Otherwise, forces `b` to be `0` and only calculates the `m` values if `FALSE`, i.e. forces the curve fit to pass through the origin.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "verbose",
                detail: "A flag specifying whether to return additional regression statistics or only the linear coefficients and the y-intercept (default).",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LOGEST",
            t: 14,
            d: "Given partial data about an exponential growth curve, calculates various parameters about the best fit ideal exponential growth curve.",
            a: "Best-fit exponential growth curve.",
            m: [1, 4],
            p: [{
                name: "known_data_y",
                detail: "The array or range containing dependent (y) values that are already known, used to curve fit an ideal exponential growth curve.",
                example: "B2:B10",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "known_data_x",
                detail: "The values of the independent variable(s) corresponding with `known_data_y`.",
                example: "A2:A10",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "b",
                detail: "Given a general exponential form of `y = b*m^x` for a curve fit, calculates `b` if `TRUE` or forces `b` to be `1` and only calculates the `m` values if `FALSE`.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "verbose",
                detail: "A flag specifying whether to return additional regression statistics or only the calculated coefficient and exponents.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "MDETERM",
            t: 14,
            d: "Returns the matrix determinant of a square matrix specified as an array or range.",
            a: "Matrix determinant of a square matrix.",
            m: [1, 1],
            p: [{
                name: "square_matrix",
                detail: "An array or range with an equal number of rows and columns representing a matrix whose determinant will be calculated.",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MINVERSE",
            t: 14,
            d: "Returns the multiplicative inverse of a square matrix specified as an array or range.",
            a: "Multiplicative inverse of square matrix.",
            m: [1, 1],
            p: [{
                name: "square_matrix",
                detail: "An array or range with an equal number of rows and columns representing a matrix whose multiplicative inverse will be calculated.",
                example: "A1:D4",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "MMULT",
            t: 14,
            d: "Calculates the matrix product of two matrices specified as arrays or ranges.",
            a: "The matrix product of two matrices.",
            m: [2, 2],
            p: [{
                name: "matrix1",
                detail: "The first matrix in the matrix multiplication operation, represented as an array or range.",
                example: "A1:B3",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "matrix2",
                detail: "The second matrix in the matrix multiplication operation, represented as an array or range.",
                example: "C1:F2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SUMPRODUCT",
            t: 14,
            d: "Calculates the sum of the products of corresponding entries in two equal-sized arrays or ranges.",
            a: "Sum of products of elements in two arrays.",
            m: [1, 255],
            p: [{
                name: "array1",
                detail: "The first array or range whose entries will be multiplied with corresponding entries in the second such array or range.",
                example: "A2:C5",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "array2",
                detail: "The second array or range whose entries will be multiplied with corresponding entries in the first such array or range.",
                example: "D2:F5",
                require: "o",
                repeat: "y",
                type: "rangenumber"
            }]
        }, {
            n: "ISFORMULA",
            t: 15,
            d: "Checks whether a value is a formula.",
            a: "Whether a value is a formula.",
            m: [1, 1],
            p: [{
                name: "cell",
                detail: "The cell to be verified as containing a formula.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "CELL",
            t: 15,
            d: "Returns the requested information about the specified cell.",
            a: "Gets information about a cell.",
            m: [2, 2],
            p: [{
                name: "info_type",
                detail: "The type of information requested (see article for available types)",
                example: '"type"',
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "reference",
                detail: "The reference to the cell.",
                example: "C2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "NA",
            t: 15,
            d: 'Returns the "value not available" error, `#N/A`.',
            a: "The `#N/A` error.",
            m: [0, 0],
            p: []
        }, {
            n: "ERROR_TYPE",
            t: 15,
            d: "Returns a number corresponding to the error value in a different cell.",
            a: "Error value of cell (as number).",
            m: [1, 1],
            p: [{
                name: "reference",
                detail: "The cell to find the error number for although you can also provide the error value directly.",
                example: "A3",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISBLANK",
            t: 15,
            d: "Checks whether the referenced cell is empty.",
            a: "Whether the referenced cell is empty.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "Reference to the cell that will be checked for emptiness.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISERR",
            t: 15,
            d: "Checks whether a value is an error other than `#N/A`.",
            a: "Whether a value is an error other than `#n/a`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as an error type other than `#N/A`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISERROR",
            t: 15,
            d: "Checks whether a value is an error.",
            a: "Whether a value is an error.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as an error type.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISLOGICAL",
            t: 15,
            d: "Checks whether a value is `TRUE` or `FALSE`.",
            a: "Whether a value is `true` or `false`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a logical `TRUE` or `FALSE`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNA",
            t: 15,
            d: "Checks whether a value is the error `#N/A`.",
            a: "Whether a value is the error `#n/a`.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be compared with the error value `#N/A`.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNONTEXT",
            t: 15,
            d: "Checks whether a value is non-textual.",
            a: "Whether a value is non-textual.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be checked.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISNUMBER",
            t: 15,
            d: "Checks whether a value is a number.",
            a: "Whether a value is a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a number.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISREF",
            t: 15,
            d: "Checks whether a value is a valid cell reference.",
            a: "Whether a value is a valid cell reference.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as a cell reference.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "ISTEXT",
            t: 15,
            d: "Checks whether a value is text.",
            a: "Whether a value is text.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value to be verified as text.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TYPE",
            t: 15,
            d: "Returns a number associated with the type of data passed into the function.",
            a: "Get the type of a value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The value whose type is to be determined.",
                example: "C4",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "N",
            t: 15,
            d: "Returns the argument provided as a number. Text is converted to 0 and errors are returned as-is.",
            a: "Argument provided as a number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument to be converted to a number.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DATE",
            t: 16,
            d: "Converts a provided number to a date.",
            a: "Converts a provided number to a date.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a date.",
                example: "25405",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PURE_NUMBER",
            t: 16,
            d: "Converts a provided date/time, percentage, currency or other formatted numeric value to a pure number without formatting.",
            a: "Converts any numeric value to a pure number.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a pure number.",
                example: "50%",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_TEXT",
            t: 16,
            d: "Converts a provided numeric value to a text value.",
            a: "Converts a provided numeric value to a text value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to text.",
                example: "24",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TO_DOLLARS",
            t: 16,
            d: "Converts a provided number to a dollar value.",
            a: "Converts a provided number to a dollar value.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a dollar value.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "TO_PERCENT",
            t: 16,
            d: "Converts a provided number to a percentage.",
            a: "Converts a provided number to a percentage.",
            m: [1, 1],
            p: [{
                name: "value",
                detail: "The argument or reference to a cell to be converted to a percentage.",
                example: "A2",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DGET",
            t: 17,
            d: "Returns a single value from a database table-like array or range using a SQL-like query.",
            a: "Single value from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMAX",
            t: 17,
            d: "Returns the maximum value selected from a database table-like array or range using a SQL-like query.",
            a: "Maximum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DMIN",
            t: 17,
            d: "Returns the minimum value selected from a database table-like array or range using a SQL-like query.",
            a: "Minimum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DAVERAGE",
            t: 17,
            d: "Returns the average of a set of values selected from a database table-like array or range using a SQL-like query.",
            a: "Average of a set of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNT",
            t: 17,
            d: "Counts numeric values selected from a database table-like array or range using a SQL-like query.",
            a: "Counts values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DCOUNTA",
            t: 17,
            d: "Counts values, including text, selected from a database table-like array or range using a SQL-like query.",
            a: "Counts values and text from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DPRODUCT",
            t: 17,
            d: "Returns the product of values selected from a database table-like array or range using a SQL-like query.",
            a: "Product of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEV",
            t: 17,
            d: "Returns the standard deviation of a population sample selected from a database table-like array or range using a SQL-like query.",
            a: "Standard deviation of population sample from table.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSTDEVP",
            t: 17,
            d: "Returns the standard deviation of an entire population selected from a database table-like array or range using a SQL-like query.",
            a: "Standard deviation of entire population from table.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DSUM",
            t: 17,
            d: "Returns the sum of values selected from a database table-like array or range using a SQL-like query.",
            a: "Sum of values from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVAR",
            t: 17,
            d: "Returns the variance of a population sample selected from a database table-like array or range using a SQL-like query.",
            a: "Variance of population sample from table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "DVARP",
            t: 17,
            d: "Returns the variance of an entire population selected from a database table-like array or range using a SQL-like query.",
            a: "Variance of a population from a table-like range.",
            m: [3, 3],
            p: [{
                name: "database",
                detail: "The array or range containing the data to consider, structured in such a way that the first row contains the labels for each column's values.",
                example: "A2:F20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "field",
                detail: "Indicates which column in `database` contains the values to be extracted and operated on.",
                example: "G2",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "criteria",
                detail: "An array or range containing zero or more criteria to filter the `database` values by before operating.",
                example: "A22:D23",
                require: "m",
                repeat: "n",
                type: "range"
            }]
        }, {
            n: "AGE_BY_IDCARD",
            t: "3",
            d: "Calculate the age based on the Chinese ID number. Support 15 or 18",
            a: "Get age based on ID number.",
            m: [1, 2],
            p: [{
                name: "ID number",
                example: "A1",
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Deadline",
                example: '"2017-10-01"',
                detail: "The deadline or range of age calculation. The default is the current day.",
                require: "o",
                repeat: "n",
                type: "rangedatetime"
            }]
        }, {
            n: "SEX_BY_IDCARD",
            t: "3",
            d: "Calculate gender based on Chinese ID number. Support 15 or 18",
            a: "Get gender based on ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BIRTHDAY_BY_IDCARD",
            t: "3",
            d: "Calculate the birthday based on the Chinese ID number. Support 15 or 18",
            a: "Get the birthday based on the ID number.",
            m: [1, 2],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Birthday format",
                example: "0",
                detail: "Date type, default:0:[1900/01/01], 1:[1900-01-01], 2:[1900年1月1日]",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "PROVINCE_BY_IDCARD",
            t: "3",
            d: "Calculate the province of birthplace based on the Chinese ID number. Support 15 or 18",
            a: "Get the province of birthplace based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "CITY_BY_IDCARD",
            t: "3",
            d: "Calculate the city of birthplace based on the Chinese ID number. Support 15 or 18",
            a: "Get the city of birthplace based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "STAR_BY_IDCARD",
            t: "3",
            d: "Calculate the constellation based on the Chinese ID number. Support 15 or 18",
            a: "Get the constellation based on the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ANIMAL_BY_IDCARD",
            t: "3",
            d: "Calculate the zodiac (rat, ox, tiger, rabbit...) based on the Chinese ID number. Support 15 or 18",
            a: "Get the zodiac according to the ID number.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "ISIDCARD",
            t: "3",
            d: "Verify that the format of the ID card is correct. Support 15 or 18",
            a: "Verify the correctness of the ID card format.",
            m: [1, 1],
            p: [{
                name: "ID number",
                example: '"31033519900101XXXX"',
                detail: "15-digit or 18-digit ID number or range.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "DM_TEXT_CUTWORD",
            t: "4",
            d: "Text segmentation. Split a series of words into a series of individual words",
            a: "Chinese text segmentation.",
            m: [1, 2],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Word segmentation mode",
                example: "0",
                detail: "The default is 0[precision mode], 1[full mode], 2[search engine mode].",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TFIDF",
            t: "4",
            d: "Use tf-idf algorithm for keyword extraction. Identify keywords from a series of text",
            a: "tf-idf keyword recognition.",
            m: [1, 3],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Number of keywords",
                example: "20",
                detail: "The number of keywords returned by the algorithm, the default is 20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Corpus",
                example: "1",
                detail: "Select a corpus in a specific field, the default is 0[General], 1[Finance], 2[Medical]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DM_TEXT_TEXTRANK",
            t: "4",
            d: "Use TextRank algorithm to extract keywords. Identify keywords from a series of text",
            a: "TextRank keyword recognition.",
            m: [1, 3],
            p: [{
                name: "Text",
                example: '"I came to Beijing Tsinghua University"',
                detail: "Any text that needs word segmentation.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Number of keywords",
                example: "20",
                detail: "The number of keywords returned by the algorithm, the default is 20",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "Corpus",
                example: "1",
                detail: "Select a corpus in a specific field, the default is 0[General], 1[Finance], 2[Medical]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_CLOSE",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock closing price of A shares.",
            a: "Returns the closing price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_OPEN",
            t: "5",
            d: "According to the stock code and date, return the opening price of stock.",
            a: "Return the opening price of a shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MAX",
            t: "5",
            d: "According to the stock code and date, return the highest price of stock.",
            a: "Return the highest price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_MIN",
            t: "5",
            d: "According to the stock code and date, return the lowest price of stock.",
            a: "Returns the lowest price of stock.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_VOLUMN",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock trading volume of A shares.",
            a: "Returns the corresponding stock trading volume of A shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "DATA_CN_STOCK_AMOUNT",
            t: "5",
            d: "According to the stock code and date, return the corresponding stock turnover of A shares.",
            a: "Returns the corresponding stock turnover of A shares.",
            m: [1, 3],
            p: [{
                name: "Stock code",
                example: '"000001"',
                detail: "6-digit stock code, required.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Date",
                example: "2015-01-08",
                detail: "The trading day of the stock, the default is the latest trading day",
                require: "o",
                repeat: "n",
                type: "rangedate"
            }, {
                name: "Reversion and exclusion",
                example: "0",
                detail: "Select the ex right restoration type of the stock, default to 0 [former reversion], 1 [original price], 2 [post reversion]",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "ISDATE",
            t: "6",
            d: "Returns whether a value is a date.",
            a: "Whether a value is a date.",
            m: [1, 1],
            p: [{
                name: "value",
                example: '"1990-01-01"',
                detail: "The value to be verified as a date.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "LINESPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell to describe the continuous trend of data",
            a: "Generate sparklines line chart",
            m: [1, 8],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line thickness",
                example: "1",
                detail: "Line thickness of the line graph, the default is 1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line",
                example: "avg",
                detail: "A horizontal line, which can be min, max, avg, median, range or custom value, default 0 none",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line color",
                example: "#000",
                detail: "Color setting of auxiliary line, same as line color configuration, default #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Maximum mark",
                example: "#fc5c5c",
                detail: "Identifies the maximum value of the line graph, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Minimum mark",
                example: "#fc5c5c",
                detail: "Identify the minimum value of the line graph, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Mark size",
                example: "1.5",
                detail: "The maximum and minimum mark size settings, the default is 1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "AREASPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell area chart, generally used to describe the continuous cumulative value trend of the data",
            a: "Generate sparklines area chart",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Fill color",
                example: "#CCF3F4",
                detail: "Form an area chart, the same line color configuration, default 0 does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Line thickness",
                example: "1",
                detail: "Line thickness of the line graph, the default is 1px",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line",
                example: "avg",
                detail: "A horizontal line, which can be min, max, avg, median, range or custom value, default 0 none",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Auxiliary line color",
                example: "#000",
                detail: "Color setting of auxiliary line, same as line color configuration, default #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "COLUMNSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the vertical histogram of cells, generally used to describe the size of discrete data",
            a: "Generate sparklines vertical histogram",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the bar chart, used to standardize the length of the bar chart, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKCOLUMNSPLINES",
            t: "3",
            d: "Generate sparklines, a cumulative vertical histogram embedded in a cell, generally used to describe the numerical size of multiple dimensions of discrete data",
            a: "Generate sparklines cumulative vertical histogram",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Stack by column",
                example: "1",
                detail: "If you need to stack by row, set this item to false or 0, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the cumulative bar, used to regulate the length of the bar, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can individually set the bar color of each dimension, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BARSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the size of discrete data",
            a: "Generate sparklines horizontal bar graph",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the bar chart, used to standardize the length of the bar chart, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "STACKBARSPLINES",
            t: "3",
            d: "Generate sparklines, a cumulative horizontal bar graph embedded in a cell, which is generally used to describe the numerical size of multiple dimensions of discrete data",
            a: "Generate sparklines cumulative horizontal bar graph",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Stack by column",
                example: "1",
                detail: "If you need to stack by row, set this item to false or 0, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Max",
                example: "100",
                detail: "The maximum value of the cumulative bar, used to regulate the length of the bar, the default is to automatically calculate false, auto, null",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can individually set the bar color of each dimension, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "DISCRETESPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the trend of discrete data",
            a: "Generate sparklines discrete graph",
            m: [1, 4],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Segmentation threshold",
                example: "1",
                detail: "Discrete graph column color distinction, for example: if the value is 0, blue is greater than 0, red is less than 0, and the default is 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Above threshold color",
                example: "#2ec7c9",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #2ec7c9",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Below threshold color",
                example: "#fc5c5c",
                detail: "The color setting of the bar below the threshold, the same as the color above the threshold, default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "TRISTATESPLINES",
            t: "3",
            d: "Generate sparklines, a three-state graph embedded in the cell, which is generally used to describe the trend of three situations, such as winning, losing, or drawing.",
            a: "Generate sparklines three-state graph",
            m: [1, 6],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar interval",
                example: "1",
                detail: "The distance between bars, the default is 1",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Bar color",
                example: "#fc5c5c",
                detail: "The line color of the line graph can be range A1, color table index value or specific color value. Set it to 0 or false to not display it. It supports regx, rgb, rgba, etc. Default #fc5c5c",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Negative bar color",
                example: "#97b552",
                detail: "Negative bar color setting, representing the color of negative value, same as the bar color configuration, default #97b552",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Zero value bar color",
                example: "#999",
                detail: "Zero value bar color setting, representing 0 value color, the same color configuration of the bar, default #999",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color palette can set the color of each bar individually, multiple settings can be set, and two formats are supported: 1 color such as #000, which means that the color of the first bar is black; 2 value range: color, such as -2:# 000 indicates that the bar with a value of -2 is black, 0:5:#000 indicates that the bar with a value of 0-5 is black, and the default is empty",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "PIESPLINES",
            t: "3",
            d: "Generate sparklines pie chart embedded in the cell, generally used to describe the proportion of data",
            a: "Generate sparklines pie chart",
            m: [1, 5],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Rotation angle",
                example: "0",
                detail: "The rotation angle of the pie chart, the default is 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "border",
                example: "0",
                detail: "Pie chart border size, default is none 0",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Border color",
                example: "#000",
                detail: "The border color of the pie chart, the default is #000",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Color palette",
                example: "#97b552",
                detail: "The color of the slice can be set in the palette, which can be set to the range of A1:A10, etc. The default is #2ec7c9, #fc5c5c, #5ab1ef, #ffb980...",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "BOXSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell box plot, generally used to describe the statistical distribution of the data set",
            a: "Generate sparklines box plot",
            m: [1, 4],
            p: [{
                name: "Range",
                example: "A1:A20",
                detail: "Range，Values can be calculated effectively, such as A1:A20, {1,2,3,4,5}, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Outlier ratio",
                example: "1.5",
                detail: "The threshold range of outliers, if it is 0 or false, it will not be displayed, the default is 1.5 times",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Target value",
                example: "10",
                detail: "The target value setting on the box plot, the default is false and does not display",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Point size",
                example: "1.5",
                detail: "The radius of the target point and outlier is set, the default is 1.5",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "BULLETSPLINES",
            t: "3",
            d: "Generate sparklines embedded in the cell, generally used to describe the task achievement rate",
            a: "Generating sparklines bullets",
            m: [2, 3],
            p: [{
                name: "Target",
                example: "10",
                detail: "The numerical value can be calculated effectively for the achieved target value, such as A1, 100, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "achieved",
                example: "8",
                detail: "Only when the value is completed can the value be calculated effectively, such as A1, 100, etc.",
                require: "m",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "Contrast",
                example: "12",
                detail: "Comparative values, such as excess, minimum, and bottom line for awards, can be effectively calculated, such as A1, 100, etc. You can set up to 9 comparison values",
                require: "o",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "COMPOSESPLINES",
            t: "3",
            d: "Support multiple types of pictures in the same cell, each parameter represents a sparklines diagram",
            a: "Combine sparklines graphs into one cell",
            m: [1, 1],
            p: [{
                name: "config",
                example: "PIESPLINES(A1:A20)",
                detail: "Sparklines chart settings, such as A1:A20, a completed pie chart, line chart settings, etc.",
                require: "m",
                repeat: "y",
                type: "rangeall"
            }]
        }, {
            n: "SORT",
            t: "14",
            d: "Sorts the rows of a given array or range by the values in one or more columns.",
            a: "Sorts rows of range by specified column.",
            m: [1, 4],
            p: [{
                name: "range",
                detail: "The data to be sorted.",
                example: "A2:A17",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_column",
                detail: "The index of the column in `range` or a range outside of `range` containing the values by which to sort.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "is_ascending",
                detail: "`TRUE` or `FALSE` indicating whether to sort `sort_column` in ascending order. `FALSE` sorts in descending order.",
                example: "-1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "sort_column2",
                detail: "Additional columns.",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "FILTER",
            t: "14",
            d: "Returns a filtered version of the source range, returning only rows or columns which meet the specified conditions.",
            a: "Filters a range based off provided conditions.",
            m: [2, 3],
            p: [{
                name: "range",
                detail: "The data to be filtered.",
                example: "A5:D20",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "condition1",
                detail: "A column or row containing true or false values corresponding to the first column or row of `range`, or an array formula evaluating to true or false.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "range"
            }, {
                name: "condition2",
                detail: "Additional rows or columns containing boolean values `TRUE` or `FALSE` indicating whether the corresponding row or column in `range` should pass through `FILTER`. Can also contain array formula expressions which evaluate to such rows or columns. All conditions must be of the same type (row or column). Mixing row conditions and column conditions is not permitted.",
                example: '""',
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "UNIQUE",
            t: "14",
            d: "Returns unique rows in the provided source range, discarding duplicates. Rows are returned in the order in which they first appear in the source range.",
            a: "Unique rows in the provided source range.",
            m: [1, 3],
            p: [{
                name: "range",
                detail: "The data to filter by unique entries.",
                example: "A2:B26",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "by_col",
                detail: "[Option] - Logical value, indicating how to compare; by row = FALSE() or omitted; by column = TRUE().",
                example: "TRUE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }, {
                name: "occurs_once",
                detail: "[Option] - Logical value, only one occurrence in the unique value is returned = TRUE(); including all unique values = FALSE() or omitted.",
                example: "FALSE()",
                require: "o",
                repeat: "n",
                type: "rangeall"
            }]
        }, {
            n: "RANDARRAY",
            t: "14",
            d: "Returns a grid of random numbers between 0 inclusive and 1 exclusive. The grid size will match the provided rows and columns arguments. If neither rows nor columns are provided, then the grid will be size 1 x 1.",
            a: "Returns a grid of random numbers.",
            m: [0, 2],
            p: [{
                name: "rows",
                detail: "The number of rows to populate with a random number.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "columns",
                detail: "The number of columns to populate with a random number.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }, {
            n: "SEQUENCE",
            t: "14",
            d: "Returns a grid of sequential numbers starting at a specified start value and  increasing by a specified step size. By default, the sequence starts at and  increases by 1.",
            a: "Returns a grid of sequential numbers.",
            m: [1, 4],
            p: [{
                name: "rows",
                detail: "The number of rows in the function's resulting grid.",
                example: "1",
                require: "m",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "columns",
                detail: "The number of columns in the function's resulting grid. If omitted, the result grid will have 1 column.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "start",
                detail: "The number, at which to start the sequence. If omitted, the sequence will start at 1.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }, {
                name: "step",
                detail: "The amount each value in the sequence will differ by. If omitted, each value will differ by 1.",
                example: "1",
                require: "o",
                repeat: "n",
                type: "rangenumber"
            }]
        }],
        toolbar: {
            undo: "Deshacer",
            redo: "Rehacer",
            paintFormat: "Clonar formato",
            currencyFormat: "Formato de moneda",
            percentageFormat: "Formato de porcentaje",
            numberDecrease: "Menos decimales",
            numberIncrease: "Más decimales",
            moreFormats: "Más formatos",
            font: "Fuente",
            fontSize: "Tamaño Fuente",
            bold: "Negrita (Ctrl+B)",
            italic: "Itálica (Ctrl+I)",
            strikethrough: "Tachar (Alt+Shift+5)",
            textColor: "Color texto",
            chooseColor: "elegir color",
            resetColor: "Reinicializar",
            customColor: "PERSONALIZADO",
            alternatingColors: "Colores alternos",
            confirmColor: "Vale",
            cancelColor: "Cancelar",
            collapse: "Recoger",
            fillColor: "Color de relleno",
            border: "Borde",
            borderStyle: "Estilo Borde",
            mergeCell: "Juntar celdas",
            chooseMergeType: "Elegir tipo de unión",
            horizontalAlign: "Alineación Horizontal",
            verticalAlign: "Alineación Vertical",
            alignment: "Alineación",
            textWrap: "Ajuste de texto",
            textWrapMode: "Modo de ajuste de texto",
            textRotate: "Rotar texto",
            textRotateMode: "Modo de rotar texto",
            freezeTopRow: "Fijar fila superior",
            sortAndFilter: "Ordenar y filtrar",
            findAndReplace: "Buscar y reemplazar",
            sum: "SUMA",
            autoSum: "SUMA automática",
            moreFunction: "Más funciones",
            conditionalFormat: "Formato condicional",
            postil: "Comentario",
            pivotTable: "Tabla Dinámica",
            chart: "Gráfica",
            screenshot: "Captura de pantalla",
            splitColumn: "Separar texto",
            insertImage: "Insertar imagen",
            dataVerification: "Verificación de datos",
            protection: "Proteger la hoja",
            clearText: "Limpiar color",
            noColorSelectedText: "Ningún color seleccionado",
            toolMore: "Más",
            toolLess: "Menos",
            toolClose: "Cerrar",
            toolMoreTip: "Más funcionalidades",
            moreOptions: "Más opciones",
            cellFormat: "Configuración formato de celda",
            print: "Imprimir"
        },
        alternatingColors: {
            applyRange: "Aplicar a rango",
            selectRange: "Seleccionar un rango de datos",
            header: "Cabecera",
            footer: "Pie",
            errorInfo: "No se puede realizar esta operación en varias áreas de selección, selecciona una sola área y vuelve a intentarlo",
            textTitle: "Estilo Formato",
            custom: "PERSONALIZADO",
            close: "cerrar",
            selectionTextColor: "Haz clic para seleccionar el color del texto",
            selectionCellColor: "Haz clic para seleccionar el color de la celda",
            removeColor: "Eliminar colores alternos",
            colorShow: "color",
            currentColor: "Actual",
            tipSelectRange: "Selecciona la gama de colores alternos",
            errorNoRange: "No hay ningún rango seleccionado",
            errorExistColors: "Los colores alternos ya existen y no se pueden editar"
        },
        button: {
            confirm: "Vale",
            cancel: "Cancelar",
            close: "Cerrar",
            update: "Actualizar",
            delete: "Eliminar",
            insert: "Insertar"
        },
        paint: {
            start: "Inicio clonar formato",
            end: "ESC",
            tipSelectRange: "Selecciona el rango que quieres copiar",
            tipNotMulti: "No se puede realizar esta operación en un rango de selección múltiple"
        },
        format: {
            moreCurrency: "Más formatos de moneda",
            moreDateTime: "Más formatos de fecha y hora",
            moreNumber: "Más formatos de número",
            titleCurrency: "Formatos de moneda",
            decimalPlaces: "Decimales",
            titleDateTime: "Formatos de fecha y hora",
            titleNumber: "Formatos de números"
        },
        info: {
            detailExport: "Nuevo abierto",
            detailSaveAs: "Save As",
            detailSave: "Cache local restaurado",
            row: "",
            column: "",
            loading: "Cargando",
            copy: "Copiar",
            return: "Salir",
            rename: "Renombrar",
            tips: "Renombrar Libro",
            noName: "Hoja sin título",
            wait: "esperando actualización",
            add: "Añadir",
            addLast: "más filas al final",
            backTop: "Volver arriba",
            pageInfo: "Total ${total}，página ${totalPage}，actual ${currentPage}",
            nextPage: "Siguiente",
            tipInputNumber: "Introduce el número",
            tipInputNumberLimit: "El rango de aumento está limitado a 1-100",
            tipRowHeightLimit: "La altura de la fila debe estar entre 0 ~ 545",
            tipColumnWidthLimit: "El ancho de la columna debe estar entre 0 ~ 2038",
            pageInfoFull: "Total ${total}，página ${totalPage}，Se muestran todos los datos"
        },
        currencyDetail: {
            RMB: "RMB",
            USdollar: "Dólar US",
            EUR: "EUR",
            GBP: "GBP",
            HK: "HK",
            JPY: "JPY",
            AlbanianLek: "Albanian Lek",
            AlgerianDinar: "Algerian Dinar",
            Afghani: "Afghani",
            ArgentinePeso: "Argentine Peso",
            UnitedArabEmiratesDirham: "United Arab Emirates Dirham",
            ArubanFlorin: "Aruban Florin",
            OmaniRial: "Omani Rial",
            Azerbaijanimanat: "Azerbaijani manat",
            EgyptianPound: "Egyptian Pound",
            EthiopianBirr: "Ethiopian Birr",
            AngolaKwanza: "Angola Kwanza",
            AustralianDollar: "Australian Dollar",
            Patacas: "Patacas",
            BarbadosDollar: "Barbados Dollar",
            PapuaNewGuineaKina: "Papua New Guinea Kina",
            BahamianDollar: "Bahamian Dollar",
            PakistanRupee: "Pakistan Rupee",
            ParaguayanGuarani: "Paraguayan Guarani",
            BahrainiDinar: "Bahraini Dinar",
            PanamanianBalboa: "Panamanian Balboa",
            Brazilianreal: "Brazilian real",
            Belarusianruble: "Belarusian ruble",
            BermudianDollar: "Bermudian Dollar",
            BulgarianLev: "Bulgarian Lev",
            IcelandKrona: "Iceland Krona",
            BosniaHerzegovinaConvertibleMark: "Bosnia-Herzegovina Convertible Mark",
            PolishZloty: "Polish Zloty",
            Boliviano: "Boliviano",
            BelizeDollar: "Belize Dollar",
            BotswanaPula: "Botswana Pula",
            NotDannuzhamu: "Not Dannuzhamu",
            BurundiFranc: "Burundi Franc",
            NorthKoreanWon: "North Korean Won",
            DanishKrone: "Danish Krone",
            EastCaribbeanDollar: "East Caribbean Dollar",
            DominicaPeso: "Dominica Peso",
            RussianRuble: "Russian Ruble",
            EritreanNakfa: "Eritrean Nakfa",
            CFAfranc: "CFA franc",
            PhilippinePeso: "Philippine Peso",
            FijiDollar: "Fiji Dollar",
            CapeVerdeEscudo: "Cape Verde Escudo",
            FalklandIslandsPound: "Falkland Islands Pound",
            GambianDalasi: "Gambian Dalasi",
            Congolesefranc: "Congolese franc",
            ColombianPeso: "Colombian Peso",
            CostaRicanColon: "Costa Rican Colon",
            CubanPeso: "Cuban Peso",
            Cubanconvertiblepeso: "Cuban convertible peso",
            GuyanaDollar: "Guyana Dollar",
            KazakhstanTenge: "Kazakhstan Tenge",
            Haitiangourde: "Haitian gourde",
            won: "won",
            NetherlandsAntillesGuilder: "Netherlands Antilles Guilder",
            Honduraslempiras: "Honduras lempiras",
            DjiboutiFranc: "Djibouti Franc",
            KyrgyzstanSom: "Kyrgyzstan Som",
            GuineaFranc: "Guinea Franc",
            CanadianDollar: "Canadian Dollar",
            GhanaianCedi: "Ghanaian Cedi",
            Cambodianriel: "Cambodian riel",
            CzechKoruna: "Czech Koruna",
            ZimbabweDollar: "Zimbabwe Dollar",
            QatariRiyal: "Qatari Riyal",
            CaymanIslandsDollar: "Cayman Islands Dollar",
            Comorianfranc: "Comorian franc",
            KuwaitiDinar: "Kuwaiti Dinar",
            CroatianKuna: "Croatian Kuna",
            KenyanShilling: "Kenyan Shilling",
            LesothoLoti: "Lesotho Loti",
            LaoKip: "Lao Kip",
            LebanesePound: "Lebanese Pound",
            Lithuanianlitas: "Lithuanian litas",
            LibyanDinar: "Libyan Dinar",
            LiberianDollar: "Liberian Dollar",
            RwandaFranc: "Rwanda Franc",
            RomanianLeu: "Romanian Leu",
            MalagasyAriary: "Malagasy Ariary",
            MaldivianRufiyaa: "Maldivian Rufiyaa",
            MalawiKwacha: "Malawi Kwacha",
            MalaysianRinggit: "Malaysian Ringgit",
            MacedoniawearingDinar: "Macedonia wearing Dinar",
            MauritiusRupee: "Mauritius Rupee",
            MauritanianOuguiya: "Mauritanian Ouguiya",
            MongolianTugrik: "Mongolian Tugrik",
            BangladeshiTaka: "Bangladeshi Taka",
            PeruvianNuevoSol: "Peruvian Nuevo Sol",
            MyanmarKyat: "Myanmar Kyat",
            MoldovanLeu: "Moldovan Leu",
            MoroccanDirham: "Moroccan Dirham",
            MozambiqueMetical: "Mozambique Metical",
            MexicanPeso: "Mexican Peso",
            NamibianDollar: "Namibian Dollar",
            SouthAfricanRand: "South African Rand",
            SouthSudanesePound: "South Sudanese Pound",
            NicaraguaCordoba: "Nicaragua Cordoba",
            NepaleseRupee: "Nepalese Rupee",
            NigerianNaira: "Nigerian Naira",
            NorwegianKrone: "Norwegian Krone",
            GeorgianLari: "Georgian Lari",
            RMBOffshore: "RMB (Offshore)",
            SwedishKrona: "Swedish Krona",
            SwissFranc: "Swiss Franc",
            SerbianDinar: "Serbian Dinar",
            SierraLeone: "Sierra Leone",
            SeychellesRupee: "Seychelles Rupee",
            SaudiRiyal: "Saudi Riyal",
            SaoTomeDobra: "Sao Tome Dobra",
            SaintHelenapound: "Saint Helena pound",
            SriLankaRupee: "Sri Lanka Rupee",
            SwazilandLilangeni: "Swaziland Lilangeni",
            SudanesePound: "Sudanese Pound",
            Surinamesedollar: "Surinamese dollar",
            SolomonIslandsDollar: "Solomon Islands Dollar",
            SomaliShilling: "Somali Shilling",
            TajikistanSomoni: "Tajikistan Somoni",
            PacificFranc: "Pacific Franc",
            ThaiBaht: "Thai Baht",
            TanzanianShilling: "Tanzanian Shilling",
            TonganPaanga: "Tongan Pa'anga",
            TrinidadandTobagoDollar: "Trinidad and Tobago Dollar",
            TunisianDinar: "Tunisian Dinar",
            TurkishLira: "Turkish Lira",
            VanuatuVatu: "Vanuatu Vatu",
            GuatemalanQuetzal: "Guatemalan Quetzal",
            CommissionBolivar: "Commission Bolivar",
            BruneiDollar: "Brunei Dollar",
            UgandanShilling: "Ugandan Shilling",
            UkrainianHryvnia: "Ukrainian Hryvnia",
            UruguayanPeso: "Uruguayan Peso",
            Uzbekistansom: "Uzbekistan som",
            WesternSamoaTala: "Western Samoa Tala",
            SingaporeDollar: "Singapore Dollar",
            NT: "NT",
            NewZealandDollar: "New Zealand Dollar",
            HungarianForint: "Hungarian Forint",
            SyrianPound: "Syrian Pound",
            JamaicanDollar: "Jamaican Dollar",
            ArmenianDram: "Armenian Dram",
            YemeniRial: "Yemeni Rial",
            IraqiDinar: "Iraqi Dinar",
            IranianRial: "Iranian Rial",
            NewIsraeliShekel: "New Israeli Shekel",
            IndianRupee: "Indian Rupee",
            IndonesianRupiah: "Indonesian Rupiah",
            JordanianDinar: "Jordanian Dinar",
            VND: "VND",
            ZambianKwacha: "Zambian Kwacha",
            GibraltarPound: "Gibraltar Pound",
            ChileanPeso: "Chilean Peso",
            CFAFrancBEAC: "CFA Franc BEAC"
        },
        defaultFmt: [{
            text: "Automático",
            value: "General",
            example: ""
        }, {
            text: "Texto",
            value: "@",
            example: ""
        }, {
            text: "",
            value: "partir",
            example: ""
        }, {
            text: "Número",
            value: "##0.00",
            example: "1000.12"
        }, {
            text: "Porcentaje",
            value: "#0.00%",
            example: "12.21%"
        }, {
            text: "Científico",
            value: "0.00E+00",
            example: "1.01E+5"
        }, {
            text: "",
            value: "split",
            example: ""
        }, {
            text: "Contabilidad",
            value: "¥(0.00)",
            example: "¥(1200.09)"
        }, {
            text: "Moneda",
            value: "¥0.00",
            example: "¥1200.09"
        }, {
            text: "",
            value: "partir",
            example: ""
        }, {
            text: "Fecha",
            value: "yyyy-MM-dd",
            example: "2017-11-29"
        }, {
            text: "Hora",
            value: "hh:mm AM/PM",
            example: "3:00 PM"
        }, {
            text: "Hora 24H",
            value: "hh:mm",
            example: "15:00"
        }, {
            text: "Fecha Hora",
            value: "yyyy-MM-dd hh:mm AM/PM",
            example: "2017-11-29 3:00 PM"
        }, {
            text: "Fecha Hora 24 H",
            value: "yyyy-MM-dd hh:mm",
            example: "2017-11-29 15:00"
        }, {
            text: "",
            value: "partir",
            example: ""
        }, {
            text: "Formatos personalizados",
            value: "fmtOtherSelf",
            example: "más"
        }],
        dateFmtList: [{
            name: "1930-08-05",
            value: "yyyy-MM-dd"
        }, {
            name: "1930/8/5",
            value: "yyyy/MM/dd"
        }, {
            name: "08-05",
            value: "MM-dd"
        }, {
            name: "8-5",
            value: "M-d"
        }, {
            name: "13:30:30",
            value: "h:mm:ss"
        }, {
            name: "13:30",
            value: "h:mm"
        }, {
            name: "PM 01:30",
            value: "AM/PM hh:mm"
        }, {
            name: "PM 1:30",
            value: "AM/PM h:mm"
        }, {
            name: "PM 1:30:30",
            value: "AM/PM h:mm:ss"
        }, {
            name: "08-05 PM 01:30",
            value: "MM-dd AM/PM hh:mm"
        }],
        fontFamily: {
            MicrosoftYaHei: "YaHei"
        },
        fontarray: ["Times New Roman", "Arial", "Tahoma", "Verdana"],
        fontjson: {
            "times new roman": 0,
            arial: 1,
            tahoma: 2,
            verdana: 3
        },
        border: {
            borderTop: "borderTop",
            borderBottom: "borderBottom",
            borderLeft: "borderLeft",
            borderRight: "borderRight",
            borderNone: "borderNone",
            borderAll: "borderAll",
            borderOutside: "borderOutside",
            borderInside: "borderInside",
            borderHorizontal: "borderHorizontal",
            borderVertical: "borderVertical",
            borderColor: "borderColor",
            borderSize: "borderSize"
        },
        merge: {
            mergeAll: "Unir todo",
            mergeV: "Verticalmente",
            mergeH: "Horizontalmente",
            mergeCancel: "Separar",
            overlappingError: "No se pueden fusionar áreas superpuestas",
            partiallyError: "No se puede realizar esta operación en celdas parcialmente unidas"
        },
        align: {
            left: "izquierda",
            center: "centro",
            right: "derecha",
            top: "Arriba",
            middle: "Centro",
            bottom: "Abajo"
        },
        textWrap: {
            overflow: "Desbordar",
            wrap: "Ajustar",
            clip: "Cortar"
        },
        rotation: {
            none: "Ninguno",
            angleup: "Ladear Arriba",
            angledown: "Ladear Abajo",
            vertical: "Apilar Verticalmente",
            rotationUp: "Rotar Arriba",
            rotationDown: "Rotar Abajo"
        },
        freezen: {
            default: "Fijar",
            freezenRow: "Primera Fila",
            freezenColumn: "Primera Columna",
            freezenRC: "Ambas",
            freezenRowRange: "Fijar rango filas",
            freezenColumnRange: "Fijar rango columnas",
            freezenRCRange: "Fijar ambos rangos",
            freezenCancel: "Cancelar",
            noSeletionError: "No hay rango para seleccionar"
        },
        sort: {
            asc: "Ascendente ",
            desc: "Descendente ",
            custom: "Ordenación personalizada",
            hasTitle: "Los datos tienen una fila de encabezado",
            sortBy: "Ordenar por",
            addOthers: "Añadir otra columna de ordenación",
            close: "cerrar",
            confirm: "ordenar",
            columnOperation: "Columna",
            secondaryTitle: "y después por",
            sortTitle: "Ordenar rango",
            sortRangeTitle: "Ordenar rango de",
            sortRangeTitleTo: "a",
            noRangeError: "No se puede realizar esta operación en múltiples áreas de selección, selecciona un solo rango e intenta nuevamente",
            mergeError: "Hay celdas combinadas en la selección, ¡esta operación no se puede realizar!"
        },
        filter: {
            filter: "crear filtro",
            sortByAsc: "Ordenar A-Z",
            sortByDesc: "Ordenar Z-A",
            filterByColor: "Filtrar por color",
            filterByCondition: "Filtrar por condición",
            filterByValues: "Filtrar por valores",
            filiterInputNone: "Ninguno",
            filiterInputTip: "Introduce valor de filtro",
            filiterRangeStartTip: "Valor para fórmula",
            filiterRangeEndTip: "Valor para fórmula",
            filterValueByAllBtn: "Seleccionar todos",
            filterValueByClearBtn: "Limpiar",
            filterValueByInverseBtn: "Invertir",
            filterValueByTip: "filtrar por valores",
            filterConform: "Confirmar",
            filterCancel: "Cancelar",
            clearFilter: "Quitar filtro",
            conditionNone: "Ninguno",
            conditionCellIsNull: "Está vacío",
            conditionCellNotNull: "No está vacío",
            conditionCellTextContain: "El texto contiene",
            conditionCellTextNotContain: "El texto no contiene",
            conditionCellTextStart: "El texto empieza con",
            conditionCellTextEnd: "El texto termina con",
            conditionCellTextEqual: "El texto es exactamente",
            conditionCellDateEqual: "La fecha es",
            conditionCellDateBefore: "La fecha es anterior",
            conditionCellDateAfter: "La fecha es posterior",
            conditionCellGreater: "Mayor que",
            conditionCellGreaterEqual: "Mayor o igual que",
            conditionCellLess: "Menor que",
            conditionCellLessEqual: "Menor o igual que",
            conditionCellEqual: "Es igual a",
            conditionCellNotEqual: "No es igual a",
            conditionCellBetween: "Está entre",
            conditionCellNotBetween: "No está entre",
            filiterMoreDataTip: "¡Gran cantidad de datos! por favor espera",
            filiterMonthText: "Mes",
            filiterYearText: "Año",
            filiterByColorTip: "Filtrar por color de celda",
            filiterByTextColorTip: "Filtrar por color de fuente",
            filterContainerOneColorTip: "Esta columna contiene solo un color",
            filterDateFormatTip: "Format fecha",
            valueBlank: "(Nulo)",
            mergeError: "Hay celdas combinadas en la selección del filtro, ¡esta operación no se puede realizar!"
        },
        rightclick: {
            copy: "Copiar",
            copyAs: "Copiar como",
            paste: "Pegar",
            insert: "Insertar",
            delete: "Eliminar",
            deleteCell: "Eliminar celda",
            deleteSelected: "Eliminar seleccionado ",
            hide: "Esconder",
            hideSelected: "Esconder seleccionado ",
            showHide: "Mostrar ocultos ",
            to: "Hacia",
            left: "Izquierda",
            right: "Derecha",
            top: "Arriba",
            bottom: "Abajo",
            moveLeft: "Mover izquierda",
            moveUp: "Mover arriba",
            add: "Añadir",
            row: "Fila",
            column: "Columna",
            width: "Ancho",
            height: "Alto",
            number: "Número",
            confirm: "Confirmar",
            orderAZ: "Ordenar A-Z",
            orderZA: "Ordenar Z-A",
            clearContent: "Limpiar contenido",
            matrix: "Operación de Matriz",
            sortSelection: "Ordenar",
            filterSelection: "Filtrar",
            chartGeneration: "Crear gráfico",
            firstLineTitle: "título primera línea",
            untitled: "sin título",
            array1: "Matriz unidimensional",
            array2: "Matriz bidimensional",
            array3: "Matrices multidimensionales",
            diagonal: "Diagonal",
            antiDiagonal: "Anti-diagonal",
            diagonalOffset: "Desplazamiento Diagonal",
            offset: "Desplazamiento",
            boolean: "Booleana",
            flip: "Voltear",
            upAndDown: "Arriba y abajo",
            leftAndRight: "Izquierda y derecha",
            clockwise: "Sentido horario",
            counterclockwise: "Sentido anti-horario",
            transpose: "Transponer",
            matrixCalculation: "Cálculo de matrices",
            plus: "Suma",
            minus: "Resta",
            multiply: "Multiplicación",
            divided: "División",
            power: "Exponenciación",
            root: "Raíz Cuadrada",
            log: "Logaritmo",
            delete0: "Eliminar valores nulos en ambos extremos",
            removeDuplicate: "Eliminar valores duplicados",
            byRow: "Por fila",
            byCol: "Por columna",
            generateNewMatrix: "Generar nueva matriz"
        },
        comment: {
            insert: "Insertar",
            edit: "Editar",
            delete: "Elimiar",
            showOne: "Mostrar/Ocular",
            showAll: "Mostrar/Ocular Todo"
        },
        screenshot: {
            screenshotTipNoSelection: "Selecciona el alcance de la captura de pantalla",
            screenshotTipTitle: "¡Advertencia!",
            screenshotTipHasMerge: "Esta operación no se puede realizar en celdas combinadas",
            screenshotTipHasMulti: "Esta operación no se puede realizar en varios rangos de selección",
            screenshotTipSuccess: "Exitoso",
            screenshotImageName: "Captura de pantalla",
            downLoadClose: "Cerrar",
            downLoadCopy: "Copiar al portapapeles",
            downLoadBtn: "Descargar",
            browserNotTip: "no es compatible con el navegador IE.",
            rightclickTip: 'Haz clic con el botón derecho en la imagen y selecciona "copiar"',
            successTip: 'Con éxito (si falla el pegado, haz clic con el botón derecho en la imagen para "copiar imagen")'
        },
        splitText: {
            splitDelimiters: "Delimitadores",
            splitOther: "Otros",
            splitContinueSymbol: "Los separadores consecutivos se tratan como uno solo",
            splitDataPreview: "Previsualizar",
            splitTextTitle: "Partir texto",
            splitConfirmToExe: "Ya hay datos aquí, ¿quieres reemplazarlos?",
            tipNoMulti: "No se puede realizar esta operación en varias áreas de selección, selecciona una única área y vuelve a intentarlo",
            tipNoMultiColumn: "Solo se puede convertir una columna de datos a la vez. El área seleccionado puede tener varias filas, pero no varias columnas. Vuelve a intentarlo después de seleccionar un solo rango de columnas"
        },
        imageText: {
            imageSetting: "Configuración de imagen",
            close: "Cerrar",
            conventional: "Convencional",
            moveCell1: "Mover y cambiar el tamaño de las celdas",
            moveCell2: "Mover y no cambiar el tamaño de la celda",
            moveCell3: "No mover ni cambiar el tamaño de la celda",
            fixedPos: "Posición fija",
            border: "Borde",
            width: "Ancho",
            radius: "Radio",
            style: "Estilo",
            solid: "Sólido",
            dashed: "Discontinua",
            dotted: "Punteado",
            double: "Doble",
            color: "Color"
        },
        punctuation: {
            tab: "Tabulación",
            semicolon: "punto y coma",
            comma: "coma",
            space: "espacio"
        },
        findAndReplace: {
            find: "Encontrar",
            replace: "Reemplazar",
            goto: "Ir a",
            location: "Ubicación",
            formula: "Fórmula",
            date: "Fecha",
            number: "Número",
            string: "Texto",
            error: "Error",
            condition: "Condición",
            rowSpan: "Intervalo de filas",
            columnSpan: "Intervalo de columnas",
            locationExample: "Ubicación",
            lessTwoRowTip: "Selecciona al menos dos filas",
            lessTwoColumnTip: "Selecciona al menos dos columnas",
            findTextbox: "Encontrar Contenido",
            replaceTextbox: "Reemplazar Contenido",
            regexTextbox: "Expresión Regular",
            wholeTextbox: "Palabra entera",
            distinguishTextbox: "Distingue mayúsculas y minúsculas",
            allReplaceBtn: "Reemplazar Todo",
            replaceBtn: "Reemplazar",
            allFindBtn: "Encontrar Todo",
            findBtn: "Encontrar siguiente",
            noFindTip: "No se encontró el contenido",
            modeTip: "Esta operación no está disponible en este modo",
            searchTargetSheet: "Hoja",
            searchTargetCell: "Celda",
            searchTargetValue: "Valor",
            searchInputTip: "Introduce el contenido de la búsqueda",
            noReplceTip: "No hay nada que reemplazar",
            noMatchTip: "No se encontraron coincidencias",
            successTip: "${xlength} elementos encontrados",
            locationConstant: "Constante",
            locationFormula: "Fórmula",
            locationDate: "Fecha",
            locationDigital: "Número",
            locationString: "Texto",
            locationBool: "Lógicos",
            locationError: "Error",
            locationNull: "Nulo",
            locationCondition: "Formato condicional",
            locationRowSpan: "Intervalo fila",
            locationColumnSpan: "Intervalo columna",
            locationTiplessTwoRow: "Selecciona al menos dos filas",
            locationTiplessTwoColumn: "Selecciona al menos dos columnas",
            locationTipNotFindCell: "Celda no encontrada"
        },
        sheetconfig: {
            delete: "Eliminar",
            copy: "Copiar",
            rename: "Renombrar",
            changeColor: "Cambiar color",
            hide: "Ocultar",
            unhide: "Mostrar",
            moveLeft: "Mover izquierda",
            moveRight: "Mover derecja",
            resetColor: "Reiniciar color",
            cancelText: "Cancelar",
            chooseText: "Confirmar color",
            tipNameRepeat: "¡El nombre de la página de la pestaña no se puede repetir! Revísalo",
            noMoreSheet: "El libro de trabajo contiene al menos una hoja de trabajo visual. Para eliminar la hoja de trabajo seleccionada, inserta una nueva hoja de trabajo o muestra una hoja de trabajo oculta",
            confirmDelete: "¿Estás seguro de eliminar",
            redoDelete: "Se puede deshacer con Ctrl+Z",
            noHide: "No se puede ocultar, al menos conserva una etiqueta de hoja",
            chartEditNoOpt: "¡Esta operación no está permitida en el modo de edición de gráficos!",
            sheetNameSpecCharError: "El nombre no puede contener:[ ] :  ? * / ' \""
        },
        conditionformat: {
            conditionformat_greaterThan: "Conditionformat-GreaterThan",
            conditionformat_greaterThan_title: "Dar formato a celdas mayores que",
            conditionformat_lessThan: "Conditionformat-LessThan",
            conditionformat_lessThan_title: "Dar formato a celdas más pequeñas que",
            conditionformat_betweenness: "Conditionformat-Betweenness",
            conditionformat_betweenness_title: "Dar formato a celdas con valores entre",
            conditionformat_equal: "Conditionformat-Equal",
            conditionformat_equal_title: "Dar formato a celdas iguales a",
            conditionformat_textContains: "Conditionformat-TextContains",
            conditionformat_textContains_title: "Dar formato a las celdas que contienen el siguiente texto",
            conditionformat_occurrenceDate: "Conditionformat-OccurrenceDate",
            conditionformat_occurrenceDate_title: "Dar formato a celdas que contienen las siguientes fechas",
            conditionformat_duplicateValue: "Conditionformat-DuplicateValue",
            conditionformat_duplicateValue_title: "Dar formato a celdas que contienen los siguientes tipos de valores",
            conditionformat_top10: "Conditionformat-Top10",
            conditionformat_top10_percent: "Conditionformat-Top10%",
            conditionformat_top10_title: "Formatea las celdas con el valor más alto",
            conditionformat_last10: "Conditionformat-Last10",
            conditionformat_last10_percent: "Conditionformat-Last10%",
            conditionformat_last10_title: "Formatea las celdas con el valor más pequeño",
            conditionformat_AboveAverage: "Conditionformat-AboveAverage",
            conditionformat_AboveAverage_title: "Dar formato a celdas por encima del promedio",
            conditionformat_SubAverage: "Conditionformat-SubAverage",
            conditionformat_SubAverage_title: "Dar formato a celdas por debajo del promedio",
            rule: "Regla",
            newRule: "Nueva regla",
            editRule: "Editar regla",
            deleteRule: "Eliminar regla",
            deleteCellRule: "Eliminar regla de celda",
            deleteSheetRule: "Eliminar regla de hoja",
            manageRules: "Reglas administración",
            showRules: "Muestra sus reglas de formato",
            highlightCellRules: "Resaltar reglas de celda",
            itemSelectionRules: "Reglas de selección de elementos",
            conditionformatManageRules: "Administrador de reglas de formato condicional",
            format: "Formatear",
            setFormat: "Establecer formato",
            setAs: "Establecer como",
            setAsByArea: "Para el área seleccionada, establecer",
            applyRange: "Aplicar rango",
            selectRange: "Seleccionar rango de aplicación",
            selectRange_percent: "Porcentaje del rango seleccionado",
            selectRange_average: "Valor promedio del rango seleccionado",
            selectRange_value: "Valor en el rango seleccionado",
            pleaseSelectRange: "Selecciona el rango de aplicación",
            selectDataRange: "Seleccionar rango de datos",
            selectCell: "seleccionar celda",
            pleaseSelectCell: "Selecciona una celda",
            pleaseSelectADate: "Selecciona una fecha",
            pleaseEnterInteger: "Introduzca un número entero entre 1 y 1000",
            onlySingleCell: "Solo se puede hacer referencia a una sola celda",
            conditionValueCanOnly: "El valor de la condición solo puede ser un número o una sola celda",
            ruleTypeItem1: "Aplicar formato a todas las celdas según sus valores respectivos",
            ruleTypeItem2: "Solo formatear celdas que contengan",
            ruleTypeItem2_title: "Solo para celdas que cumplan las siguientes condiciones",
            ruleTypeItem3: "Aplicar formato solo a los números superiores o inferiores",
            ruleTypeItem3_title: "Es el valor en la siguiente clasificación",
            ruleTypeItem4: "Aplicar formato solo a los valores superiores o inferiores al promedio",
            ruleTypeItem4_title: "Es un valor que cumple las siguientes condiciones",
            ruleTypeItem5: "Aplicar formato solo a valores únicos o repetidos",
            textColor: "Color Texto",
            cellColor: "Color Celda",
            confirm: "Confirma",
            confirmColor: "Confirma color",
            cancel: "Cancela",
            close: "Cierra",
            clearColorSelect: "Limpiar selección de color",
            sheet: "Hoja",
            currentSheet: "Hoja actual",
            dataBar: "Barra de datos",
            dataBarColor: "Color barra de datos",
            gradientDataBar_1: "Barra de datos de degradado azul-blanco",
            gradientDataBar_2: "Barra de datos de degradado verde-blanco",
            gradientDataBar_3: "Barra de datos de degradado rojo-blanco",
            gradientDataBar_4: "Rayas de degradado de color naranja-blanco",
            gradientDataBar_5: "Rayas de degradado azul claro-blancas",
            gradientDataBar_6: "Barra de datos de degradado púrpura-blanco",
            solidColorDataBar_1: "Barra de datos azul",
            solidColorDataBar_2: "Barra de datos verde",
            solidColorDataBar_3: "Barra de datos roja",
            solidColorDataBar_4: "Barra de datos naranja",
            solidColorDataBar_5: "Barra de datos azul claro",
            solidColorDataBar_6: "Barra de datos púrpura",
            colorGradation: "Degradado de color",
            colorGradation_1: "Gradación de color verde-amarillo-rojo",
            colorGradation_2: "Gradación de color rojo-amarillo-verde",
            colorGradation_3: "Gradación de color verde-blanco-rojo",
            colorGradation_4: "Gradación de color rojo-blanco-verde",
            colorGradation_5: "Gradación de color azul-blanco-rojo",
            colorGradation_6: "Gradación de color rojo-blanco-azul",
            colorGradation_7: "Gradación de color blanco-rojo",
            colorGradation_8: "Gradación de color rojo-blanco",
            colorGradation_9: "Gradación de color verde-blanco",
            colorGradation_10: "Gradación de color blanco-verde",
            colorGradation_11: "Gradación de color verde-amarillo",
            colorGradation_12: "Gradación de color amarillo-verde",
            icons: "iconos",
            pleaseSelectIcon: "Haz clic para seleccionar un grupo de iconos:",
            cellValue: "Valor de celda",
            specificText: "Texto específico",
            occurrence: "Fecha",
            greaterThan: "Mayor que",
            lessThan: "Menor que",
            between: "Entre",
            equal: "Igual",
            in: "En",
            between2: "",
            contain: "Contiene",
            textContains: "Texto contiene",
            duplicateValue: "Valor duplicado",
            uniqueValue: "Valor Unico",
            top: "Mejor",
            top10: "10 mejores",
            top10_percent: "10% mejores",
            last: "Ultimo",
            last10: "Ultimos 10",
            last10_percent: "Ultimos 10%",
            oneself: "",
            above: "Encima",
            aboveAverage: "Encima media",
            below: "Debajo",
            belowAverage: "Debajo media",
            all: "Todos",
            yesterday: "Año a fecha",
            today: "Hoy",
            tomorrow: "Mañana",
            lastWeek: "Ultima semana",
            thisWeek: "Esta semana",
            lastMonth: "Ultimo mes",
            thisMonth: "Este mes",
            lastYear: "Ultimo año",
            thisYear: "Este año",
            last7days: "Ultimos 7 días",
            last30days: "Ultimos 30 días",
            next7days: "Siguientes 7 días",
            next30days: "Siguientes 30 días",
            next60days: "Siguientes 60 días",
            chooseRuleType: "Elige el tipo de regla",
            editRuleDescription: "Editar descripción de regla",
            newFormatRule: "Nueva regla de formato",
            editFormatRule: "Editar regla de formato",
            formatStyle: "Estilo",
            fillType: "Rellenar",
            color: "Color",
            twocolor: "Dos colores",
            tricolor: "Tricolor",
            multicolor: "Multi color",
            grayColor: "Color gris",
            gradient: "Gradiente",
            solid: "Sólido",
            maxValue: "Valor máximo",
            medianValue: "Valor mediano",
            minValue: "Valor mínimo",
            direction: "Dirección",
            threeWayArrow: "Flecha de tres direcciones",
            fourWayArrow: "Flecha de cuatro direcciones",
            fiveWayArrow: "Flecha de cinco direcciones",
            threeTriangles: "Tres triángulos",
            shape: "Forma",
            threeColorTrafficLight: "Semáforo de tres colores",
            fourColorTrafficLight: "Semáforo de cuatro colores",
            threeSigns: "Tres signos",
            greenRedBlackGradient: "Gradiente verde-rojo-negro",
            rimless: "Sin aros",
            bordered: "Bordeado",
            mark: "Marcar",
            threeSymbols: "Tres símbolos",
            tricolorFlag: "Bandera tricolor",
            circled: "Rodeado",
            noCircle: "Sin círculo",
            grade: "Grado",
            grade4: "4 Grado",
            grade5: "5 Grado",
            threeStars: "3 Estrellas",
            fiveQuadrantDiagram: "Diagrama de cinco cuadrantes",
            fiveBoxes: "5 Cajas"
        },
        dataVerification: {
            cellRange: "Rango celdas",
            selectCellRange: "Haz clic para seleccionar un rango de celdas",
            selectCellRange2: "Selecciona un rango de celdas",
            verificationCondition: "Condición de verificación",
            dropdown: "lista desplegable",
            checkbox: "Casilla de verificación",
            number: "Número",
            number_integer: "Número entero",
            number_decimal: "Número decimal",
            text_content: "Contenido texto",
            text_length: "Longitud texto",
            date: "Fecha",
            validity: "Eficacia",
            placeholder1: "Introduce las opciones, separadas por comas, como 1,2,3,4,5",
            placeholder2: "Introduce contenido",
            placeholder3: "Valor numérico, como 10",
            placeholder4: "Introduce el texto especificado",
            placeholder5: "Introduce el mensaje que se muestra cuando se selecciona la celda",
            selected: "Seleccionado",
            notSelected: "No seleccionado",
            between: "Entre",
            notBetween: "No entre",
            equal: "Iqual",
            notEqualTo: "No iqual a",
            moreThanThe: "Más que el",
            lessThan: "Menos que",
            greaterOrEqualTo: "Mayor o igual a",
            lessThanOrEqualTo: "Menor o igual a",
            include: "Incluir",
            exclude: "Excluir",
            earlierThan: "Antes de",
            noEarlierThan: "No antes de",
            laterThan: "Después de",
            noLaterThan: "No después de",
            identificationNumber: "Número de identificación",
            phoneNumber: "Número de teléfono",
            remote: "Opción de adquisición remota automática",
            prohibitInput: "Prohibir la entrada cuando los datos de entrada no son válidos",
            hintShow: "Mostrar mensaje cuando se selecciona la celda",
            deleteVerification: "Eliminar verificación",
            tooltipInfo1: "La opción de la lista desplegable no puede estar vacía",
            tooltipInfo2: "El contenido de la casilla de verificación no puede estar vacío",
            tooltipInfo3: "El valor ingresado no es un tipo numérico",
            tooltipInfo4: "El segundo valor no puede ser menor que el primero",
            tooltipInfo5: "El contenido del texto no puede estar vacío",
            tooltipInfo6: "El valor ingresado no es una fecha",
            tooltipInfo7: "La segunda fecha no puede ser menor que la primera"
        },
        formula: {
            sum: "Suma",
            average: "Media",
            count: "Contar",
            max: "Máx",
            min: "Mín",
            ifGenerate: "Generador de fórmula SI",
            find: "Aprender más",
            tipNotBelongToIf: "¡Esta función de celda no pertenece a la fórmula SI!",
            tipSelectCell: "Selecciona la celda para insertar la función",
            ifGenCompareValueTitle: "Valor de comparación",
            ifGenSelectCellTitle: "Haz click para seleccionar una celda",
            ifGenRangeTitle: "Rango",
            ifGenRangeTo: "a",
            ifGenRangeEvaluate: "Evaluar rango",
            ifGenSelectRangeTitle: "Haz click para seleccionar rango",
            ifGenCutWay: "Forma particionado",
            ifGenCutSame: "Mismo valor de particionado",
            ifGenCutNpiece: "Particionar por N",
            ifGenCutCustom: "Personalizado",
            ifGenCutConfirm: "Confirma",
            ifGenTipSelectCell: "Selecciona celdas",
            ifGenTipSelectCellPlace: "Por favor selecciona celdas",
            ifGenTipSelectRange: "Selecciona rango",
            ifGenTipSelectRangePlace: "Por favor selecciona rango",
            ifGenTipNotNullValue: "El valor de comparación no puede ser vacío!",
            ifGenTipLableTitile: "Etiqueta",
            ifGenTipRangeNotforNull: "El rango no puede quedar vacío!",
            ifGenTipCutValueNotforNull: "El valor de partición no puede ser vacío!",
            ifGenTipNotGenCondition: "No hay condiciones disponibles para la generación!"
        },
        formulaMore: {
            valueTitle: "Valor",
            tipSelectDataRange: "Selecciona rango de datos",
            tipDataRangeTile: "Rango de datos",
            findFunctionTitle: "Función de búsqueda",
            tipInputFunctionName: "Nombre o breve descripción de la función",
            Array: "Vector",
            Database: "Base de datos",
            Date: "Fecha",
            Engineering: "Ingeniería",
            Filter: "Filtro",
            Financial: "Financiero",
            luckysheet: "Luckysheet",
            other: "Otro",
            Logical: "Lógica",
            Lookup: "Búsqueda",
            Math: "Matemático",
            Operator: "Operadores",
            Parser: "Compilador",
            Statistical: "Estadístico",
            Text: "Texto",
            dataMining: "Minería de datos",
            selectFunctionTitle: "Selecciona una función",
            calculationResult: "Resultado",
            tipSuccessText: "Exito",
            tipParamErrorText: "Parámetro erróneo",
            helpClose: "Cerrar",
            helpCollapse: "Recoger",
            helpExample: "Ejemplo",
            helpAbstract: "Resumen",
            execfunctionError: "Error en la fórmula",
            execfunctionSelfError: "La fórmula no puede hacer referencia a su propia celda",
            execfunctionSelfErrorResult: "La fórmula no puede hacer referencia a su propia celda, lo que dará lugar a resultados de cálculo inexactos",
            allowRepeatText: "Repetir",
            allowOptionText: "Opción",
            selectCategory: "O selecciona una categoría"
        },
        drag: {
            noMerge: "No se puede realizar esta operación en celdas combinadas",
            afectarPivot: "¡Este cambio no se puede realizar en la celda seleccionada porque afectará a la tabla dinámica!",
            noMulti: "No se puede realizar esta operación en varias áreas de selección, selecciona una sola área",
            noPaste: "No se puede pegar este contenido aquí, selecciona una celda en el área de pegado e intenta pegar nuevamente",
            noPartMerge: "No se puede realizar esta operación en celdas parcialmente fusionadas",
            inputCorrect: "Introduce el valor correcto",
            notLessOne: "El número de filas y columnas no puede ser inferior a 1",
            offsetColumnLessZero: "¡La columna de desplazamiento no puede ser negativa!",
            pasteMustKeybordAlert: "在表格中进行复制粘贴: Ctrl + C 进行复制, Ctrl + V 进行粘贴, Ctrl + X 进行剪切",
            pasteMustKeybordAlertHTMLTitle: "在表格中进行复制粘贴",
            pasteMustKeybordAlertHTML: "<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切"
        },
        pivotTable: {
            title: "Tabla Dinámica",
            closePannel: "Cerrar",
            editRange: "Rango",
            tipPivotFieldSelected: "Selecciona los campos",
            tipClearSelectedField: "Limpiar todos los campos",
            btnClearSelectedField: "Limpiar",
            btnFilter: "Filtrar",
            titleRow: "Fila",
            titleColumn: "Columna",
            titleValue: "Valor",
            tipShowColumn: "Los campos de estadísticas se muestran como columnas",
            tipShowRow: "Los campos de estadísticas se muestran como filas",
            titleSelectionDataRange: "Selecciona rango",
            titleDataRange: "Rango de datos",
            valueSum: "SUMA",
            valueStatisticsSUM: "Suma",
            valueStatisticsCOUNT: "Contar",
            valueStatisticsCOUNTA: "Contar A",
            valueStatisticsCOUNTUNIQUE: "Contar Distintos",
            valueStatisticsAVERAGE: "Media",
            valueStatisticsMAX: "Máx",
            valueStatisticsMIN: "Mín",
            valueStatisticsMEDIAN: "Mediana",
            valueStatisticsPRODUCT: "Producto",
            valueStatisticsSTDEV: "Desviación Estándar",
            valueStatisticsSTDEVP: "Stdevp",
            valueStatisticslet: "Varianza",
            valueStatisticsVARP: "VarP",
            errorNotAllowEdit: "¡Esta operación está prohibida en el modo sin edición!",
            errorNotAllowMulti: "No se puede realizar esta operación en varias áreas de selección, selecciona un solo rango y vuelve a intentarlo",
            errorSelectRange: "Seleccione el rango de la nueva tabla dinámica",
            errorIsDamage: "¡Los datos de origen de esta tabla dinámica están dañados!",
            errorNotAllowPivotData: "¡No se puede seleccionar la tabla dinámica como datos de origen!",
            errorSelectionRange: "¡La selección falló, rango de entrada incorrecto!",
            errorIncreaseRange: "¡Por favor, expande el rango seleccionado!",
            titleAddColumn: "Añadir columna a la tabla dinámica",
            titleMoveColumn: "Muever la columna a la celda en blanco de abajo",
            titleClearColumnFilter: "Quitar el filtro de esta columna",
            titleFilterColumn: "Filtro",
            titleSort: "Ordenar",
            titleNoSort: "No Ordenar",
            titleSortAsc: "ASC",
            titleSortDesc: "DESC",
            titleSortBy: "Ordenar por",
            titleShowSum: "Mostrar total",
            titleStasticTrue: "Sí",
            titleStasticFalse: "No"
        },
        dropCell: {
            copyCell: "Copiar",
            sequence: "Secuencia",
            onlyFormat: "Solo formato",
            noFormat: "Sin formato",
            day: "Día",
            workDay: "Día Laborable",
            month: "Mes",
            year: "Año",
            chineseNumber: "Números Chinos"
        },
        imageCtrl: {
            borderTile: "Color de borde de imagen",
            borderCur: "Color"
        },
        protection: {
            protectiontTitle: "Protección",
            enterPassword: "Introduce una contraseña (opcional)",
            enterHintTitle: "Preguntar cuando la edición está prohibida (opcional)",
            enterHint: "La celda o el gráfico que estás intentando cambiar se encuentra en una hoja de trabajo protegida. Si quieres cambiarlo, desprotege la hoja de trabajo. Es posible que tengas que ingresar una contraseña",
            swichProtectionTip: "Protege la hoja y el contenido de las celdas bloqueadas",
            authorityTitle: "Permitir a los usuarios de esta hoja:",
            selectLockedCells: "Selecciona celdas bloqueadas",
            selectunLockedCells: "Selecciona celdas desbloqueadas",
            formatCells: "Formatear celdas",
            formatColumns: "Formatear columnas",
            formatRows: "Formatear filas",
            insertColumns: "Insertar columnas",
            insertRows: "Insertar filas",
            insertHyperlinks: "Insertar enlaces",
            deleteColumns: "Eliminar columnas",
            deleteRows: "Eliminar filas",
            sort: "Ordenar",
            filter: "Filtrar",
            usePivotTablereports: "Usar informes de tabla dinámica",
            editObjects: "Editar objetos",
            editScenarios: "Editar escenarios",
            allowRangeTitle: "Permitir a los usuarios del rango:",
            allowRangeAdd: "Nuevo...",
            allowRangeAddTitle: "Título",
            allowRangeAddSqrf: "Referencia",
            selectCellRange: "Haz clic para seleccionar un rango de celdas",
            selectCellRangeHolder: "Rango de celdas",
            allowRangeAddTitlePassword: "Contraseña",
            allowRangeAddTitleHint: "Pregunta",
            allowRangeAddTitleHintTitle: "Preguntar cuando hay una contraseña (opcional)",
            allowRangeAddtitleDefault: "Nombre del rango de entrada",
            rangeItemDblclick: "Haz doble clic para editar",
            rangeItemHasPassword: "Tiene contraseña",
            rangeItemErrorTitleNull: "El título es nulo",
            rangeItemErrorRangeNull: "La referencia es nula",
            rangeItemErrorRange: "La reference tiene un error",
            validationTitle: "Validación de contraseña",
            validationTips: "Hay que ingresar una contraseña para desbloquear la protección de la hoja de trabajo",
            validationInputHint: "Introduce una contraseña",
            checkPasswordNullalert: "Contraseña requerida!",
            checkPasswordWrongalert: "¡Contraseña incorrecta. Por favor, prueba de nuevo!",
            checkPasswordSucceedalert: "Desbloqueo conseguido!",
            defaultRangeHintText: "La celda está protegida con contraseña.",
            defaultSheetHintText: "La celda o el gráfico están en una hoja de trabajo protegida. Para realizar cambios, desprotege la hoja de trabajo. Es posible que tengas que ingresar una contraseña"
        },
        cellFormat: {
            cellFormatTitle: "Formatear celdas",
            protection: "Protección",
            locked: "Bloqueado",
            hidden: "Escondido",
            protectionTips: "Para bloquear celdas u ocultar fórmulas, protege la hoja de trabajo. En la barra de herramientas, haz clic en el botón Proteger hoja",
            tipsPart: "Comprobado parcial",
            tipsAll: "Todo seleccionado",
            selectionIsNullAlert: "Se requiere una selección!",
            sheetDataIsNullAlert: "error, no hay datos!"
        },
        print: {
            normalBtn: "Normal",
            layoutBtn: "Disposición de página",
            pageBtn: "Previsualización de saltos de página",
            menuItemPrint: "Imprimir (Ctrl+P)",
            menuItemAreas: "Imprimir áreas",
            menuItemRows: "Imprimir títulos de filas",
            menuItemColumns: "Imprimir títulos de columnas"
        }
    }, localeObj = {
        en: en,
        zh: zh,
        es: es
    };
    function locale() {
        return localeObj[Store.lang]
    }
    var gridHTML = function() {
        var url_manage = admin_url + 'hr_payroll/payslip_templates_manage';
        var e = locale()
          , t = e.info
          , r = e.print;
        return '<div class="luckysheet">\n                    <canvas id="luckysheetTableContentF" style="display:none;" class="luckysheetTableContent"></canvas> \n                    <div class="luckysheet-work-area luckysheet-noselected-text"> \n                        <div id ="luckysheet_info_detail" class="luckysheet_info_detail"> \n                            <div data-tips="'.concat(t.return, '" > \n                                                     </div> \n                            <div class="luckysheet-share-logo hide" title="${logotitle}"></div>\n                            <div class="sheet-name"> \n                                <input data-tips="').concat(t.tips, '" id="luckysheet_info_detail_input" class="luckysheet_info_detail_input luckysheet-mousedown-cancel" value="').concat(t.noName, '" tabindex="0" dir="ltr" aria-label="').concat(t.rename, '" style="visibility: visible; width: 149px;" data-tooltip="').concat(t.rename, '"> \n                            </div> \n                    <a href="'+url_manage+'" id="luckysheet_info_detail_close" class="btn btn-danger luckysheet_info_detail_close"> ').concat(t.close, ' </a> \n        <a id="luckysheet_info_detail_export" class="btn btn-info luckysheet_info_detail_export"> ').concat(t.detailExport, ' </a> \n       <button id="luckysheet_info_detail_save" class="BTNSS btn btn-info luckysheet_info_detail_save"> ').concat(t.wait, ' </button> \n                            <div class="luckysheet_info_detail_user"> ${functionButton} <span id="luckysheet_info_detail_user"></span> </div> \n                        </div> \n                        <div id="luckysheet-wa-editor" class="luckysheet-wa-editor toolbar"> ${menu} </div> \n                        <div id="luckysheet-wa-calculate" class="luckysheet-wa-calculate"> \n                            <div class="luckysheet-wa-calculate-size" id="luckysheet-wa-calculate-size"></div> \n                            <div class="luckysheet-wa-calculate-help"> \n                                <div class="luckysheet-wa-calculate-help-box"> \n                                    <div spellcheck="false" aria-hidden="false" id="luckysheet-helpbox">\n                                        <div id="luckysheet-helpbox-cell" class="luckysheet-helpbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list"></div>\n                                    </div> \n                                </div>  \n                                <div class="luckysheet-wa-calculate-help-tool">\n                                    <i class="fa fa-caret-down" aria-hidden="true" style="margin-top: 7px;"></i>\n                                </div> \n                            </div> \n                            <div id="luckysheet-wa-functionbox-cancel" class="luckysheet-wa-functionbox">\n                                <span><i class="iconfont icon-qingchu" aria-hidden="true"></i></span>\n                            </div> \n                            <div id="luckysheet-wa-functionbox-confirm" class="luckysheet-wa-functionbox">\n                                <span><i class="iconfont icon-yunhang" aria-hidden="true"></i></span>\n                            </div> \n                            <div id="luckysheet-wa-functionbox-fx" class="luckysheet-wa-functionbox">\n                                <span><i class="iconfont icon-hanshu" aria-hidden="true" style="color:#333"></i></span> \n                            </div> \n                            <div id="luckysheet-functionbox-container" class="luckysheet-mousedown-cancel">\n                                <div class="luckysheet-mousedown-cancel" dir="ltr">\n                                    <div spellcheck="false" aria-hidden="false" id="luckysheet-functionbox">\n                                        <div id="luckysheet-functionbox-cell" class="luckysheet-functionbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list" aria-label="D4"></div>\n                                    </div>\n                                </div>\n                            </div>   \n                        </div> \n                    </div> \n                    <div class="luckysheet-grid-container luckysheet-scrollbars-enabled"> \n                        <div class="luckysheet-grid-window"> \n                            <div class="luckysheet-help-sub"></div> \n                            <div class="luckysheet-grid-window-1" id="luckysheet-grid-window-1">\n                                <canvas id="luckysheetTableContent" class="luckysheetTableContent"></canvas> \n                                <table class="luckysheet-grid-window-2" cellspacing="0" cellpadding="0" dir="ltr" tabindex="-1" > \n                                    <tbody> \n                                        <tr> \n                                            <td valign="top" class="luckysheet-paneswrapper"> \n                                                <div class="luckysheet-left-top" id="luckysheet-left-top"> </div> \n                                            </td> \n                                            <td valign="top" class="luckysheet-paneswrapper"> \n                                                <div id="luckysheet-cols-h-c" class="luckysheet-cols-h-c">\n                                                    <div class="luckysheet-cols-change-size" id="luckysheet-cols-change-size"></div>  \n                                                    <div class="luckysheet-cols-menu-btn luckysheet-mousedown-cancel" id="luckysheet-cols-menu-btn"><i class="fa fa-caret-down luckysheet-mousedown-cancel" aria-hidden="true"></i></div>  \n                                                    <div class="luckysheet-cols-h-hover" id="luckysheet-cols-h-hover"></div>  \n                                                    <div id="luckysheet-cols-h-selected"></div>  \n                                                    <div class="luckysheet-grdusedrange"></div>  \n                                                    <div class="luckysheet-grdblkflowpush"></div>  ${columnHeader}\n                                                </div>\n                                            </td>\n                                        </tr>\n                                        <tr>\n                                            <td valign="top" class="luckysheet-paneswrapper"> \n                                                <div class="luckysheet-rows-h" id="luckysheet-rows-h"> \n                                                    <div class="luckysheet-rows-change-size" id="luckysheet-rows-change-size"></div> \n                                                    <div class="luckysheet-rows-h-hover" id="luckysheet-rows-h-hover"></div> \n                                                    <div id="luckysheet-rows-h-selected"></div>  \n                                                    <div class="luckysheet-grdusedrange"></div>  \n                                                    <div class="luckysheet-grdblkflowpush"></div> ${rowHeader}\n                                                </div> \n                                            </td>  \n                                            <td valign="top" class="luckysheet-paneswrapper">\n                                                <div class="luckysheet-cell-loading" id="luckysheet-cell-loading">\n                                                    <div class="luckysheet-cell-loading-inner">\n                                                        <i class="fa fa-circle-o-notch fa-spin"></i>\n                                                        <span></span>\n                                                    </div>\n                                                </div> \n                                                <div class="luckysheet-cell-freezen"></div> \n                                                <div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-x" id="luckysheet-scrollbar-x"><div></div></div> \n                                                <div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-y" id="luckysheet-scrollbar-y"><div></div></div> \n                                                <div class="luckysheet-cell-main " id="luckysheet-cell-main">\n                                                    <div id="luckysheet-formula-functionrange"></div>  \n                                                    <div id="luckysheet-formula-functionrange-select" class="luckysheet-selection-copy luckysheet-formula-functionrange-select">\n                                                        <div class="luckysheet-selection-copy-top luckysheet-copy"></div>\n                                                        <div class="luckysheet-selection-copy-right luckysheet-copy"></div>\n                                                        <div class="luckysheet-selection-copy-bottom luckysheet-copy"></div>\n                                                        <div class="luckysheet-selection-copy-left luckysheet-copy"></div>\n                                                        <div class="luckysheet-selection-copy-hc"></div>\n                                                    </div>  \n                                                    <div class="luckysheet-row-count-show luckysheet-count-show" id="luckysheet-row-count-show"></div>\n                                                    <div class="luckysheet-column-count-show luckysheet-count-show" id="luckysheet-column-count-show"></div>\n                                                    <div class="luckysheet-change-size-line" id="luckysheet-change-size-line"></div>  \n                                                    <div class="luckysheet-cell-selected-focus" id="luckysheet-cell-selected-focus"></div>  \n                                                    <div id="luckysheet-selection-copy"></div>  \n                                                    <div id="luckysheet-chart-rangeShow"></div>\n                                                    <div class="luckysheet-cell-selected-extend" id="luckysheet-cell-selected-extend"></div>  \n                                                    <div class="luckysheet-cell-selected-move" id="luckysheet-cell-selected-move"></div>  \n                                                    <div id="luckysheet-cell-selected-boxs">\n                                                        <div id="luckysheet-cell-selected" class="luckysheet-cell-selected">\n                                                            <div class="luckysheet-cs-inner-border"></div>\n                                                            <div class="luckysheet-cs-fillhandle"></div>\n                                                            <div class="luckysheet-cs-inner-border"></div>\n                                                            <div class="luckysheet-cs-draghandle-top luckysheet-cs-draghandle"></div>\n                                                            <div class="luckysheet-cs-draghandle-bottom luckysheet-cs-draghandle"></div>\n                                                            <div class="luckysheet-cs-draghandle-left luckysheet-cs-draghandle"></div>\n                                                            <div class="luckysheet-cs-draghandle-right luckysheet-cs-draghandle"></div>\n                                                            <div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-lt"><div class="luckysheet-cs-touchhandle-btn"></div></div>\n                                                            <div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-rb"><div class="luckysheet-cs-touchhandle-btn"></div></div>\n                                                        </div>\n                                                    </div>\n                                                    <div id="luckysheet-postil-showBoxs"></div>\n                                                    <div id="luckysheet-multipleRange-show"></div>  \n                                                    <div id="luckysheet-dynamicArray-hightShow"></div>  \n                                                    <div id="luckysheet-image-showBoxs">\n                                                        <div id="luckysheet-modal-dialog-activeImage" class="luckysheet-modal-dialog" style="display:none;padding:0;position:absolute;z-index:300;">\n                                                            <div class="luckysheet-modal-dialog-border" style="position:absolute;"></div> \n                                                            <div class="luckysheet-modal-dialog-content"></div>  \n                                                            <div class="luckysheet-modal-dialog-resize">\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lt" data-type="lt"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mt" data-type="mt"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lm" data-type="lm"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rm" data-type="rm"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rt" data-type="rt"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lb" data-type="lb"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mb" data-type="mb"></div>\n                                                                <div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rb" data-type="rb"></div>\n                                                            </div>\n                                                            <div class="luckysheet-modal-dialog-controll">\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-crop" role="button" tabindex="0" aria-label="裁剪" title="裁剪">\n                                                                    <i class="fa fa-pencil" aria-hidden="true"></i>\n                                                                </span>\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-restore" role="button" tabindex="0" aria-label="恢复原图" title="恢复原图">\n                                                                    <i class="fa fa-window-maximize" aria-hidden="true"></i>\n                                                                </span>\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-del" role="button" tabindex="0" aria-label="删除" title="删除">\n                                                                    <i class="fa fa-trash" aria-hidden="true"></i>\n                                                                </span>\n                                                            </div>\n                                                        </div>\n                                                        <div id="luckysheet-modal-dialog-cropping" class="luckysheet-modal-dialog" style="display:none;padding:0;position:absolute;z-index:300;">\n                                                            <div class="cropping-mask"></div>\n                                                            <div class="cropping-content"></div>\n                                                            <div class="luckysheet-modal-dialog-border" style="position:absolute;"></div>\n                                                            <div class="luckysheet-modal-dialog-resize">\n                                                                <div class="resize-item lt" data-type="lt"></div> \n                                                                <div class="resize-item mt" data-type="mt"></div> \n                                                                <div class="resize-item lm" data-type="lm"></div> \n                                                                <div class="resize-item rm" data-type="rm"></div> \n                                                                <div class="resize-item rt" data-type="rt"></div> \n                                                                <div class="resize-item lb" data-type="lb"></div> \n                                                                <div class="resize-item mb" data-type="mb"></div> \n                                                                <div class="resize-item rb" data-type="rb"></div>\n                                                            </div>\n                                                            <div class="luckysheet-modal-dialog-controll">\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-crop" role="button" tabindex="0" aria-label="裁剪" title="裁剪">\n                                                                    <i class="fa fa-pencil" aria-hidden="true"></i>\n                                                                </span>\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-restore" role="button" tabindex="0" aria-label="恢复原图" title="恢复原图">\n                                                                    <i class="fa fa-window-maximize" aria-hidden="true"></i>\n                                                                </span>\n                                                                <span class="luckysheet-modal-controll-btn luckysheet-modal-controll-del" role="button" tabindex="0" aria-label="删除" title="删除">\n                                                                    <i class="fa fa-trash" aria-hidden="true"></i>\n                                                                </span>\n                                                            </div>\n                                                        </div>\n                                                        <div class="img-list"></div>\n                                                        <div class="cell-date-picker">\n                                                            <input id="cellDatePickerBtn" class="formulaInputFocus" readonly="readonly"/>\n                                                        </div>\n                                                    </div>\n                                                    <div id="luckysheet-dataVerification-dropdown-btn"></div>\n                                                    <div id="luckysheet-dataVerification-dropdown-List" class="luckysheet-mousedown-cancel"></div>\n                                                    <div id="luckysheet-dataVerification-showHintBox" class="luckysheet-mousedown-cancel"></div>\n                                                    <div class="luckysheet-cell-copy"></div>  \n                                                    <div class="luckysheet-grdblkflowpush"></div>  ${flow} \n                                                </div> \n                                            </td> \n                                        </tr> \n                                    </tbody> \n                                </table> \n                            </div> \n                            <div class="luckysheet-sheet-area luckysheet-noselected-text" id="luckysheet-sheet-area">\n                                <div id="luckysheet-sheets-add" class="luckysheet-sheets-add lucky-button-custom"><i class="iconfont icon-jia1"></i></div>\n                                <div id="luckysheet-sheets-m" class="luckysheet-sheets-m lucky-button-custom"><i class="iconfont icon-caidan2"></i></div>\n                                <div class="luckysheet-sheet-container" id="luckysheet-sheet-container">\n                                    <div class="docs-sheet-fade docs-sheet-fade-left" style="display: none;">\n                                        <div class="docs-sheet-fade3"></div>\n                                        <div class="docs-sheet-fade2"></div>\n                                        <div class="docs-sheet-fade1"></div>\n                                    </div>\n                                    <div class="docs-sheet-fade docs-sheet-fade-right" style="display: none;">\n                                        <div class="docs-sheet-fade1"></div>\n                                        <div class="docs-sheet-fade2"></div>\n                                        <div class="docs-sheet-fade3"></div>\n                                    </div>\n                                    <div class="luckysheet-sheet-container-c" id="luckysheet-sheet-container-c"></div>\n                                </div>\n                                <div id="luckysheet-sheets-leftscroll" class="luckysheet-sheets-scroll lucky-button-custom"><i class="fa fa-caret-left"></i></div>\n                                <div id="luckysheet-sheets-rightscroll" class="luckysheet-sheets-scroll lucky-button-custom"><i class="fa fa-caret-right"></i></div>\n                            </div> \n                        </div> \n                        <div class="luckysheet-stat-area"> \n                            <div class="luckysheet-sta-c">\n                                <div class="luckysheet-zoom-content" id="luckysheet-zoom-content">\n                                    <div class="luckysheet-zoom-minus" id="luckysheet-zoom-minus">\n                                        <div class="luckysheet-zoom-minus-icon"></div>\n                                    </div>\n                                    <div class="luckysheet-zoom-slider" id="luckysheet-zoom-slider">\n                                        <div class="luckysheet-zoom-line"></div>\n                                        <div class="luckysheet-zoom-cursor" id="luckysheet-zoom-cursor"></div>\n                                        <div class="luckysheet-zoom-hundred"></div>\n                                    </div>\n                                    <div class="luckysheet-zoom-plus" id="luckysheet-zoom-plus">\n                                        <div class="luckysheet-zoom-plus-icon"></div>\n                                    </div>\n                                    <div class="luckysheet-zoom-ratioText" id="luckysheet-zoom-ratioText">100%</div>\n                                </div>\n                                <div class="luckysheet-print-viewList">\n                                    <div type="viewNormal" class="luckysheet-print-viewBtn luckysheet-print-viewNormal luckysheet-print-viewBtn-active" title="').concat(r.normalBtn, '"><i class="icon iconfont icon-putong"></i></div>\n                                    <div type="viewLayout" class="luckysheet-print-viewBtn luckysheet-print-viewLayout" title="').concat(r.layoutBtn, '"><i class="icon iconfont icon-yemianbuju"></i></div>\n                                    <div type="viewPage" class="luckysheet-print-viewBtn luckysheet-print-viewPage" title="').concat(r.pageBtn, '"><i class="icon iconfont icon-fenyeyulan"></i></div>\n                                </div>\n                                <div class="luckysheet-sta-content" id="luckysheet-sta-content"></div>  \n                                \x3c!--<div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div> --\x3e\n                            </div> \n                        </div> \n                    </div>\n                    <div id="luckysheet-copy-content" contenteditable="true"></div>\n                    <input id="luckysheet-copy-btn" type="button" data-clipboard-target="luckysheet-copy-content">\n                    <div id="testdpidiv" style="height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"></div>\n                  </div>')
    }
      , flow = '<div id="luckysheet-cell-flow_${index}" class="luckysheet-cell-flow luckysheetsheetchange" style="width:${width}px;"><div class="luckysheet-cell-flow-clip"><div class="luckysheet-grdblkpush"></div>${flow}</div></div>'
      , colsmenuHTML = "";
    function rightclickHTML() {
        var e = locale()
          , t = e.rightclick
          , r = e.toolbar
          , a = customCellRightClickConfig()
          , n = !0;
        a.insertRow || a.insertColumn || a.deleteRow || a.deleteColumn || a.deleteCell || (n = !1);
        var o = !0;
        return a.clear || a.matrix || a.sort || a.filter || a.chart || a.image || a.link || a.data || a.cellFormat || (o = !1),
        '<div id="luckysheet-rightclick-menu" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel">\n                <div id="luckysheet-copy-btn" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel luckysheet-copy-btn" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" style="display:'.concat(a.copy ? "block" : "none", ';">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.copy, '</div>\n                </div>\n                <div id="luckysheetcopyfor" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel"  style="display:').concat(a.copyAs ? "block" : "none", ';">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.copyAs, '<span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;"></span>\n                    </div>\n                </div>\n                <div id="luckysheet-copy-paste" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.paste ? "block" : "none", ';">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.paste, '</div>\n                </div>\n                <div id="luckysheet-cols-rows-handleincell">\n                    <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator" style="display:').concat(n ? "block" : "none", ';"></div>\n                    <div id="luckysheetColsRowsHandleAdd_row" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.insertRow ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.insert).concat(t.row, '<span class="luckysheet-submenu-arrow" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    <div id="luckysheetColsRowsHandleAdd_column" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.insertColumn ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.insert).concat(t.column, '<span class="luckysheet-submenu-arrow" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-delRows" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel" style="display:').concat(a.deleteRow ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.deleteSelected).concat(t.row, '<span class="luckysheet-submenu-arrow" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-delCols" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel" style="display:').concat(a.deleteColumn ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.deleteSelected).concat(t.column, '<span class="luckysheet-submenu-arrow" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    \x3c!-- cell right click remove hide button\n                    <div id="luckysheetColsRowsHandleHid" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.hide, '<span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    --\x3e\n                    <div id="luckysheetCellsHandleDel" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel" style="display:').concat(a.deleteCell ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.deleteCell, '<span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                </div>\n                <div id="luckysheet-cols-rows-add">\n                    <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>\n                    <div id="luckysheet-top-left-add-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.to, '\n                            <span class="luckysheet-cols-rows-shift-left">').concat(t.left, "</span>\n                            ").concat(t.add, '\n                            <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align:center;margin-left:5px;"/>\n                            <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-bottom-right-add-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.to, '\n                            <span class="luckysheet-cols-rows-shift-right">').concat(t.right, "</span>\n                            ").concat(t.add, '\n                            <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                            <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-del-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.deleteSelected, '\n                            <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-hide-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.hideSelected, '\n                        <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-show-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.showHide, '\n                            <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                        </div>\n                    </div>\n                    <div id="luckysheet-column-row-width-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            <span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                            <span class="luckysheet-cols-rows-shift-size luckysheet-mousedown-cancel">').concat(t.width, '</span>\n                            <input type="number" class="luckysheet-mousedown-cancel rcsize" min="0" max="255" placeholder="').concat(t.number, '" value="" style="width:50px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;">\n                            px\n                        </div>\n                    </div>\n                </div>\n                <div id="luckysheet-cols-rows-shift">\n                    <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator" style="display:').concat(a.sort ? "block" : "none", ';"></div>\n                    <div id="luckysheetorderbyasc" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.sort ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.orderAZ, '</div>\n                    </div>\n                    <div id="luckysheetorderbydesc" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.sort ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.orderZA, '</div>\n                    </div>\n                </div>\n                <div id="luckysheet-cols-rows-data">\n                    <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator" style="display:').concat(o ? "block" : "none", ';"></div>\n                    <div id="luckysheet-delete-text" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.clear ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.clearContent, '</div>\n                    </div>\n                    <div id="luckysheetmatrix" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel" style="display:').concat(a.matrix ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                            ').concat(t.matrix, '<span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;"></span>\n                        </div>\n                    </div>\n                    <div id="luckysheetorderby" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.sort ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.sortSelection, '</div>\n                    </div>\n                    <div id="luckysheetfilter" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.filter ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.filterSelection, '</div>\n                    </div>\n                    <div id="luckysheetdatavisual" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.chart ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.chartGeneration, '</div>\n                    </div>\n                    <div id="luckysheetInsertImage" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.image ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(r.insertImage, '</div>\n                    </div>\n                    <div id="luckysheetInsertLink" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.link ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(r.insertLink, '</div>\n                    </div>\n                    <div id="luckysheetDataVerification" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.data ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(r.dataVerification, '</div>\n                    </div>\n                    <div id="luckysheetCellFormatRightClickMenu" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(a.cellFormat ? "block" : "none", ';">\n                        <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(r.cellFormat, '</div>\n                    </div>\n                </div>\n            </div>\n            <div id="luckysheetcopyfor_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div id="luckysheet-copy-json-head" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">Json ').concat(t.firstLineTitle, '</div>\n                </div>\n                <div id="luckysheet-copy-json-nohead" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">Json ').concat(t.untitled, '</div>\n                </div>\n                <div id="luckysheet-copy-array1" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.array1, '</div>\n                </div>\n                <div id="luckysheet-copy-array2" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.array2, '</div>\n                </div>\n                <div id="luckysheet-copy-arraymore-confirm" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        <span class="luckysheet-mousedown-cancel">').concat(t.array3, '</span>\n                        <input type="number" id="luckysheet-copy-arraymore-row" min="1" class="luckysheet-mousedown-cancel" placeholder="').concat(t.row, '" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;"/>\n                            ×\n                            <input type="number" id="luckysheet-copy-arraymore-col" min="1" class="luckysheet-mousedown-cancel" placeholder="').concat(t.column, '" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;"/>\n                    </div>\n                </div>\n                <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>\n                <div id="luckysheet-copy-diagonal" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.diagonal, '</div>\n                </div>\n                <div id="luckysheet-copy-antidiagonal" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.antiDiagonal, '</div>\n                </div>\n                <div id="luckysheet-copy-diagonaloffset" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.diagonalOffset, '\n                        <input type="number" id="luckysheet-copy-diagonaloffset-value" class="luckysheet-mousedown-cancel" placeholder="').concat(t.offset, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        ').concat(t.column, '\n                    </div>\n                </div>\n                <div id="luckysheet-copy-boolvalue" data-clipboard-action="copy" data-clipboard-target="#luckysheet-copy-content" class="luckysheet-cols-menuitem luckysheet-copy-btn luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.boolean, '</div>\n                </div>\n            </div>\n            \n            \x3c!-- Revision: modeled on google sheet\n            \n            <div id="luckysheetColsRowsHandleAdd_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.to).concat(t.top).concat(t.add, '\n                        <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        <span class="luckysheet-mousedown-cancel">').concat(t.row, '</span>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.to).concat(t.bottom).concat(t.add, '\n                        <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        <span class="luckysheet-mousedown-cancel">').concat(t.row, '</span>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.to).concat(t.left).concat(t.add, '\n                        <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        <span class="luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.to).concat(t.right).concat(t.add, '\n                        <input type="text" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="1" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        <span class="luckysheet-mousedown-cancel">').concat(t.column, '</span>\n                    </div>\n                </div>\n            </div>\n            \n            --\x3e\n\n            \x3c!-- delete row or column\n            \n            <div id="luckysheetColsRowsHandleDel_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div id="luckysheet-delRows" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.deleteSelected).concat(t.row, '\n                    </div>\n                </div>\n                <div id="luckysheet-delCols" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.deleteSelected).concat(t.column, '\n                    </div>\n                </div>\n            </div>\n            \n            --\x3e\n\n            \x3c!--\n            <div id="luckysheetColsRowsHandleHid_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div id="luckysheet-hidRows" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.hideSelected).concat(t.row, '\n                    </div>\n                </div>\n                <div id="luckysheet-showHidRows" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.showHide).concat(t.row, '\n                    </div>\n                </div>\n                <div id="luckysheet-hidCols" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.hideSelected).concat(t.column, '\n                    </div>\n                </div>\n                <div id="luckysheet-showHidCols" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.showHide).concat(t.column, '\n                    </div>\n                </div>\n            </div>\n\n            --\x3e\n\n            <div id="luckysheetCellsHandleDel_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div id="luckysheet-delCellsMoveLeft" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.moveLeft, '\n                    </div>\n                </div>\n                <div id="luckysheet-delCellsMoveUp" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.moveUp, '\n                    </div>\n                </div>\n            </div>\n            <div id="luckysheetmatrix_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.flip, '\n                        <button id="luckysheet-matrix-turn-up" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.upAndDown, '</button>\n                        <button id="luckysheet-matrix-turn-left" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.leftAndRight, '</button>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.flip, '\n                        <button id="luckysheet-matrix-turn-cw" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.clockwise, '</button>\n                        <button id="luckysheet-matrix-turn-anticw" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.counterclockwise, '</button>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div id="luckysheet-matrix-turn-trans" class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(t.transpose, '</div>\n                </div>\n                <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>\n                <div id="luckysheet-matrix-cal-confirm" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        <div class="luckysheet-mousedown-cancel">').concat(t.matrixCalculation, '</div>\n                        <div class="luckysheet-mousedown-cancel">\n                            <select id="luckysheet-matrix-cal-type" class="luckysheet-mousedown-cancel" style="height:20px;">\n                                <option value="plus">').concat(t.plus, '</option>\n                                <option value="minus">').concat(t.minus, '</option>\n                                <option value="multiply">').concat(t.multiply, '</option>\n                                <option value="divided">').concat(t.divided, '</option>\n                                <option value="power">').concat(t.power, '</option>\n                                <option value="root">').concat(t.root, '</option>\n                                <option value="log">').concat(t.log, '</option>\n                            </select>\n                            <input type="number" id="luckysheet-matrix-cal-value" class="luckysheet-mousedown-cancel" placeholder="').concat(t.number, '" value="2" style="width:40px;height:20px;box-sizing:border-box;text-align: center;;margin-left:5px;"/>\n                        </div>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.delete0, '\n                        <button id="luckysheet-matrix-delezero-row" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.byRow, '</button>\n                        <button id="luckysheet-matrix-delezero-column" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.byCol, '</button>\n                    </div>\n                </div>\n                <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">\n                        ').concat(t.removeDuplicate, '\n                        <button id="luckysheet-matrix-delerpt-row" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.byRow, '</button>\n                        <button id="luckysheet-matrix-delerpt-column" class="btn btn-primary luckysheet-mousedown-cancel" style="margin-left:5px;padding:2px 3px;line-height:12px;font-size:12px;">').concat(t.byCol, "</button>\n                    </div>\n                </div>\n            </div>")
    }
    var pivottableconfigHTML = function() {
        var e = locale().pivotTable;
        return '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel" id="luckysheet-pivotTable-config-option"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.titleSort + '</span> <select class="luckysheet-mousedown-cancel" style="height:24px;" id="luckysheet-pivotTable-config-option-order"> <option selected="selected" value="default">' + e.titleNoSort + '</option> <option value="asc">' + e.titleSortAsc + '</option> <option value="desc">' + e.titleSortDesc + '</option> </select> </div> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.titleSortBy + '</span> <select class="luckysheet-mousedown-cancel" style="height:24px;" id="luckysheet-pivotTable-config-option-orderby"> </select> </div> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.titleShowSum + '</span> <select class="luckysheet-mousedown-cancel" style="height:24px;" id="luckysheet-pivotTable-config-option-stastic"> <option  value="0">' + e.titleStasticFalse + '</option> <option value="1" selected="selected">' + e.titleStasticTrue + "</option> </select> </div> </div> </div> </div>"
    }
      , pivottablesumHTML = function() {
        var e = locale().pivotTable;
        return '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel" id="luckysheet-pivotTable-config-option-sumtype"> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="SUM"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsSUM + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="COUNT"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsCOUNT + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="COUNTA"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsCOUNTA + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="COUNTUNIQUE"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsCOUNTUNIQUE + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="AVERAGE"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsAVERAGE + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="MAX"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsMAX + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="MIN"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsMIN + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="MEDIAN"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsMEDIAN + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="PRODUCT"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsPRODUCT + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="STDEV"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsSTDEV + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="STDEVP"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsSTDEVP + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="VAR"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticslet + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" sumtype="VARP"> <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> <span class="luckysheet-mousedown-cancel">' + e.valueStatisticsVARP + '</span> <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;"><i class="fa fa-check luckysheet-mousedown-cancel" aria-hidden="true"></i></span> </div> </div> </div>'
    }
      , sheetHTML = '<div style="${style}" id="luckysheet-sheets-item${index}" data-index="${index}" class="luckysheet-sheets-item ${active}"><span class="luckysheet-sheets-item-name" spellcheck ="false" contenteditable="false">${name}</span> <span class="luckysheet-sheets-item-menu luckysheet-mousedown-cancel"><i class="fa fa-sort-desc luckysheet-mousedown-cancel"></i></span>${colorset}</div>'
      , columnHeaderHTML = '<div class="luckysheet-cols-h-cells luckysheetsheetchange"  id="luckysheet-cols-h-cells_${index}" style="width:${width}px;"> <div class="luckysheet-cols-h-cells-c"> <div class="luckysheet-grdblkpush"></div>${column}</div></div>'
      , sheetselectlistHTML = '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel" id="luckysheet-sheet-list">${item}</div>'
      , sheetselectlistitemHTML = '<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"  id="luckysheet-sheet-btn${index}" data-index="${index}"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="${style}" ><span class="icon luckysheet-mousedown-cancel">${icon}</span>${name}</div></div>'
      , inputHTML = '<div dir="ltr"><div class="luckysheet-input-box-index" id="luckysheet-input-box-index"></div><div id="luckysheet-input-box" spellcheck="false" aria-hidden="false" class="luckysheet-input-box"><div class="luckysheet-cell-input editable" tabindex="0" role="combobox" contenteditable="true" id="luckysheet-rich-text-editor" dir="ltr" g_editable="true" aria-autocomplete="list"></div></div></div>'
      , modelHTML = '<div id="${id}" style="${style}" class="luckysheet-modal-dialog ${addclass}" tabindex="0" role="dialog" aria-labelledby=":41e" dir="ltr"> <div class="luckysheet-modal-dialog-title luckysheet-modal-dialog-title-draggable"> <span class="luckysheet-modal-dialog-title-text" role="heading">${title}</span>\t <span class="luckysheet-modal-dialog-title-close" role="button" tabindex="0" aria-label="${close}"><i class="fa fa-times" aria-hidden="true"></i></span> </div> <div class="luckysheet-modal-dialog-content">${content}</div> <div class="luckysheet-modal-dialog-buttons">\t ${botton} </div></div>'
      , maskHTML = '<div class="luckysheet-modal-dialog-mask" id="luckysheet-modal-dialog-mask"></div>';
    function sheetconfigHTML() {
        var e = locale().sheetconfig
          , t = customSheetRightClickConfig()
          , r = !0
          , a = !0;
        return t.delete || t.copy || t.rename || t.color || (r = !1,
        t.hide || (a = !1)),
        t.hide || (r = !1),
        t.move || (a = !1),
        '<div id="luckysheet-rightclick-sheet-menu" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel"> \n                <div id="luckysheetsheetconfigdelete" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:'.concat(t.delete ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.delete, '</div>\n                </div> \n                <div id="luckysheetsheetconfigcopy" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.copy ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.copy, '</div> \n                </div> \n                <div id="luckysheetsheetconfigrename" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.rename ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.rename, '</div> \n                </div> \n                <div id="luckysheetsheetconfigcolor" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel" style="display:').concat(t.color ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"> \n                        ').concat(e.changeColor, ' <span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;"></span> \n                    </div> \n                </div> \n                <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator" style="display:').concat(r ? "block" : "none", ';"></div> \n                <div id="luckysheetsheetconfighide" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.hide ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.hide, '</div> \n                </div> \n                <div id="luckysheetsheetconfigshow" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.hide ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.unhide, '</div> \n                </div> \n                <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator" style="display:').concat(a ? "block" : "none", ';"></div> \n                <div id="luckysheetsheetconfigmoveleft" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.move ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.moveLeft, '</div> \n                </div> \n                <div id="luckysheetsheetconfigmoveright" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="display:').concat(t.move ? "block" : "none", ';"> \n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.moveRight, '</div> \n                </div> \n            </div> \n            <div id="luckysheetsheetconfigcolor_sub" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel">\n                <div id="luckysheetsheetconfigcolorreset" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">\n                    <div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.resetColor, '</div>\n                </div> \n                <div class="luckysheet-mousedown-cancel"> \n                    <div class="luckysheet-mousedown-cancel"> \n                        <input type="text" id="luckysheetsheetconfigcolorur" /> \n                    </div> \n                </div> \n            </div>')
    }
    var luckysheetPivotTableHTML = function() {
        var e = locale().pivotTable;
        return '\n        <div id="luckysheet-modal-dialog-slider-pivot" class="luckysheet-modal-dialog-slider luckysheet-modal-dialog-slider-pivot">\n        <div class="luckysheet-modal-dialog-slider-title"> <span>'.concat(e.title, '</span> <span id="luckysheet-modal-dialog-slider-close" title="').concat(e.closePannel, '"><i class="fa fa-times" aria-hidden="true"></i></span> </div>\n        <div class="luckysheet-modal-dialog-slider-content">\n            <div class="luckysheet-modal-dialog-slider-range">\n                <div id="luckysheet-dialog-pivotTable-range"></div>\n                <div id="luckysheet-dialog-pivotTable-range-seleted">').concat(e.editRange, '</div>\n            </div>\n            <div class="luckysheet-modal-dialog-slider-list-title"> ').concat(e.tipPivotFieldSelected, ' <span title="').concat(e.tipClearSelectedField, '" id="luckysheet-dialog-pivotTable-clearitem">').concat(e.btnClearSelectedField, '</span></div>\n            <div id="luckysheet-modal-dialog-pivotTable-list" class="luckysheet-modal-dialog-slider-list luckysheet-scrollbars"> </div>\n            <div class="luckysheet-modal-dialog-slider-config-c">\n                <div class="luckysheet-modal-dialog-slider-config luckysheet-modal-dialog-config-filter">\n                    <div> <span><i class="fa fa-filter luckysheet-mousedown-cancel" aria-hidden="true"></i> ').concat(e.btnFilter, '</span> </div>\n                    <div id="luckysheet-modal-dialog-config-filter" class="luckysheet-modal-dialog-slider-config-list luckysheet-scrollbars"> </div>\n                </div>\n                <div class="luckysheet-modal-dialog-slider-config luckysheet-modal-dialog-config-row">\n                    <div> <span><i class="fa fa-list-alt" aria-hidden="true"></i> ').concat(e.titleRow, '</span> </div>\n                    <div id="luckysheet-modal-dialog-config-row" class="luckysheet-modal-dialog-slider-config-list luckysheet-scrollbars"> </div>\n                </div>\n                <div class="luckysheet-modal-dialog-slider-config luckysheet-modal-dialog-config-column">\n                    <div> <span><i class="fa fa-indent" aria-hidden="true"></i> ').concat(e.titleColumn, '</span> </div>\n                    <div id="luckysheet-modal-dialog-config-column" class="luckysheet-modal-dialog-slider-config-list luckysheet-scrollbars"> </div>\n                </div>\n                <div class="luckysheet-modal-dialog-slider-config luckysheet-modal-dialog-config-value">\n                    <div> <span><i class="fa fa-cube" aria-hidden="true"></i> ').concat(e.titleValue, '</span> <span style="float: right;margin-right: 10px;display:none;" id="luckysheetpivottablevaluecolrowshow"><label style="padding:0px 5px;margin:0px;font-size:12px;height:15px;line-height:15px;" title="').concat(e.tipShowColumn, '" for="luckysheetpivottablevaluecolrow">').concat(e.titleColumn, '</label> <input type="radio" checked="checked" value="1" name="luckysheetpivottablevaluecolrow" id="luckysheetpivottablevaluecolrow" /> <label style="padding:0px 5px;margin:0px;font-size:12px;height:15px;line-height:15px;" title="').concat(e.tipShowRow, '" for="luckysheetpivottablevaluecolrow1">').concat(e.titleRow, '</label> <input type="radio" value="0" name="luckysheetpivottablevaluecolrow" id="luckysheetpivottablevaluecolrow1" /></span></div>\n                    <div id="luckysheet-modal-dialog-config-value" class="luckysheet-modal-dialog-slider-config-list luckysheet-scrollbars"> </div>\n                </div>\n            </div>\n        </div>\n        </div>\n        ')
    };
    function filtermenuHTML() {
        var e = locale().filter;
        return '<div class="luckysheet-cols-menu luckysheet-mousedown-cancel luckysheet-filter-menu" id="luckysheet-${menuid}-menu"><div id="luckysheet-${menuid}-orderby-asc" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">'.concat(e.sortByAsc, '</div></div><div id="luckysheet-${menuid}-orderby-desc" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"><div style="width:205px;" class="luckysheet-mousedown-cancel">').concat(e.sortByDesc, '</div></div></div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div><div id="luckysheet-${menuid}-orderby-color" class="luckysheet-cols-menuitem luckysheet-cols-submenu luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="position: relative;">').concat(e.filterByColor, '<span class="luckysheet-submenu-arrow iconfont icon-youjiantou" style="user-select: none;right: 0;"></span></div></div><div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" id="luckysheet-${menuid}-bycondition" style="padding-top:0px;padding-bottom:0px;"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"><i class="fa fa-caret-right" aria-hidden="true"></i> ').concat(e.filterByCondition, '</div></div> <div class="luckysheet-${menuid}-bycondition" style="display:none;"><div class="luckysheet-flat-menu-button luckysheet-mousedown-cancel" id="luckysheet-${menuid}-selected"><span class="luckysheet-mousedown-cancel" data-value="null" data-type="0">').concat(e.filiterInputNone, '</span><div class="luckysheet-mousedown-cancel"><i class="fa fa-sort" aria-hidden="true"></i></div></div><div class="luckysheet-${menuid}-selected-input"><input type="text" placeholder="').concat(e.filiterInputTip, '" class="luckysheet-mousedown-cancel" /></div><div class="luckysheet-${menuid}-selected-input luckysheet-${menuid}-selected-input2"><span>从</span><input type="text" placeholder="').concat(e.filiterRangeStartTip, '" class="luckysheet-mousedown-cancel" /><span>到</span><input type="text" placeholder="').concat(e.filiterRangeEndTip, '" class="luckysheet-mousedown-cancel" /></div></div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" id="luckysheet-${menuid}-byvalue" style="padding-top:0px;padding-bottom:0px;"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"><i class="fa fa-caret-right" aria-hidden="true"></i> ').concat(e.filterByValues, '</div></div> <div class="luckysheet-${menuid}-byvalue"><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel luckysheet-mousedown-${menuid}-byvalue-btn"><span id="luckysheet-${menuid}-byvalue-btn-all" class="luckysheet-mousedown-cancel">').concat(e.filterValueByAllBtn, '</span> - <span id="luckysheet-${menuid}-byvalue-btn-clear" class="luckysheet-mousedown-cancel">').concat(e.filterValueByClearBtn, '</span> - <span id="luckysheet-${menuid}-byvalue-btn-contra" class="luckysheet-mousedown-cancel">').concat(e.filterValueByInverseBtn, '</span> <div><i class="fa fa-${menuid} luckysheet-mousedown-cancel" aria-hidden="true"></i></div></div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="padding-left:3px; padding-right:3px;"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"><input type="text" placeholder="').concat(e.filterValueByTip, '" class="luckysheet-mousedown-cancel" id="luckysheet-${menuid}-byvalue-input" /><div class="luckysheet-${menuid}-byvalue-input-icon luckysheet-mousedown-cancel"><i class="fa fa-search luckysheet-mousedown-cancel" aria-hidden="true"></i></div></div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div id="luckysheet-${menuid}-byvalue-select" class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"></div></div></div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"><div class="btn btn-primary luckysheet-mousedown-cancel" id="luckysheet-${menuid}-confirm">').concat(e.filterConform, '</div> <div class="btn btn-default luckysheet-mousedown-cancel" id="luckysheet-${menuid}-cancel">').concat(e.filterCancel, '</div> <div class="btn btn-danger luckysheet-mousedown-cancel" id="luckysheet-${menuid}-initial">').concat(e.clearFilter, "</div></div></div> </div>")
    }
    function filtersubmenuHTML() {
        var e = locale().filter;
        return '<div style="z-index:1004;overflow-y:auto;" class="luckysheet-filter-submenu luckysheet-cols-menu luckysheet-mousedown-cancel" id="luckysheet-${menuid}-submenu"><div data-value="null" data-type="0" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">'.concat(e.conditionNone, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="cellnull"  data-type="0"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellIsNull, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="cellnonull"  data-type="0"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellNotNull, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="textinclude"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellTextContain, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="textnotinclude"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellTextNotContain, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="textstart"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellTextStart, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="textend"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellTextEnd, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="textequal"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellTextEqual, '</div></div>  <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>  <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="dateequal"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellDateEqual, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="datelessthan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellDateBefore, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="datemorethan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellDateAfter, '</div></div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> <div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="morethan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellGreater, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="moreequalthan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellGreaterEqual, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="lessthan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellLess, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="lessequalthan"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellLessEqual, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="equal"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellEqual, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="noequal"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellNotEqual, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="include"  data-type="2"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellBetween, '</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-value="noinclude" data-type="2"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">').concat(e.conditionCellNotBetween, "</div></div> </div>")
    }
    function luckysheetAlternateformatHtml() {
        var e = locale()
          , t = e.alternatingColors;
        return '<div id="luckysheet-modal-dialog-slider-alternateformat" class="luckysheet-modal-dialog-slider luckysheet-modal-dialog-slider-alternateformat" style="display: block;"><div class="luckysheet-modal-dialog-slider-title"><span>' + e.toolbar.alternatingColors + '</span><span class="luckysheet-model-close-btn" title="' + t.close + '"><i class="fa fa-times" aria-hidden="true"></i></span></div><div class="luckysheet-modal-dialog-slider-content"><div class="textTitle">' + t.applyRange + '</div><div id="luckysheet-alternateformat-range"><input class="formulaInputFocus" placeholder="' + t.selectRange + '"/><i class="fa fa-table" aria-hidden="true"></i></div><div id="luckysheet-alternateformat-checkbox"><div class="cf"><input type="checkbox" id="luckysheet-alternateformat-rowHeader"/><label for="luckysheet-alternateformat-rowHeader">' + t.header + '</label></div><div class="cf"><input type="checkbox" id="luckysheet-alternateformat-rowFooter"/><label for="luckysheet-alternateformat-rowFooter">' + t.footer + '</label></div></div><div class="textTitle">' + t.textTitle + '</div><div id="luckysheet-alternateformat-modelList" class="cf"></div><div class="textTitle">' + t.custom + '</div><div id="luckysheet-alternateformat-modelCustom" class="cf"></div><div id="luckysheet-alternateformat-modelToning"><div class="toningbox header"><div class="toningShow"> ' + t.header + ' </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionTextColor + '" style="border-bottom-color: #000;margin-right: 10px;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-text-color" style="user-select: none;"> </div> </div> </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionCellColor + '" style="border-bottom-color: #fff;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-cell-color" style="user-select: none;"> </div> </div> </div></div><div class="toningbox ctOne"><div class="toningShow"> ' + t.colorShow + '1 </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionTextColor + '" style="border-bottom-color: #000;margin-right: 10px;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-text-color" style="user-select: none;"> </div> </div> </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionCellColor + '" style="border-bottom-color: #fff;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-cell-color" style="user-select: none;"> </div> </div> </div></div><div class="toningbox ctTwo"><div class="toningShow"> ' + t.colorShow + '2 </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionTextColor + '" style="border-bottom-color: #000;margin-right: 10px;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-text-color" style="user-select: none;"> </div> </div> </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionCellColor + '" style="border-bottom-color: #fff;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-cell-color" style="user-select: none;"> </div> </div> </div></div><div class="toningbox footer"><div class="toningShow"> ' + t.footer + ' </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionTextColor + '" style="border-bottom-color: #000;margin-right: 10px;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-text-color" style="user-select: none;"> </div> </div> </div><div class="luckysheet-color-menu-button-indicator" title="' + t.selectionCellColor + '" style="border-bottom-color: #fff;"> <div class="luckysheet-icon luckysheet-inline-block"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-cell-color" style="user-select: none;"> </div> </div> </div></div></div><button id="luckysheet-alternateformat-remove" class="btn btn-default" style="margin: 10px;">' + t.removeColor + "</button></div></div>"
    }
    var luckysheetchartpointconfigHTML = '<div class="luckysheet-chart-point-config"> <div class="luckysheet-chart-point-config-set"> <div class="luckysheet-chart-point-config-left"> <div class="luckysheet-chart-point-config-left-top"> <div class="luckysheet-chart-point-searchcondition"> <div class="luckysheet-datavisual-content-row" style="margin-bottom: 0px;margin-top: 0px;height: 30px;"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">选择维度</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-tips="维度选择" name="luckysheetpointconfigsearchdim" id="luckysheetpointconfigsearchdim"> </select> </div> </div> <div class="luckysheet-datavisual-content-row" style="margin-bottom: 0px;margin-top: 3px;height: 30px;"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;">排序</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <label data-tips="无排序" for="luckysheetpointconfigsearchorderno">无排序</label> <input type="radio" checked="checked" value="0" name="luckysheetpointconfigsearchorder" id="luckysheetpointconfigsearchorderno"> <label data-tips="升序" for="luckysheetpointconfigsearchorderasc">升序</label> <input type="radio" value="1" name="luckysheetpointconfigsearchorder" id="luckysheetpointconfigsearchorderasc"> <label data-tips="降序" for="luckysheetpointconfigsearchorderdesc">降序</label> <input type="radio" value="2" name="luckysheetpointconfigsearchorder" id="luckysheetpointconfigsearchorderdesc"> </div> </div> <div class="luckysheet-datavisual-content-row" style="margin-bottom: 0px;margin-top: 5px;height: 30px;"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:90%;text-align: left;"> <select data-width="70" data-tips="按照什么方式查询" name="luckysheetpointconfigsearchtype" id="luckysheetpointconfigsearchtype"> <option value="0" selected="selected">按照名称</option> <option value="1">按排序前%</option> </select> <input data-tips="查询关于点的关键字" id="luckysheetpointconfigsearchcontent" type="text" class="luckysheet-datavisual-config-input-no" style="width:40%;" placeholder="查询内容" /> <button id="luckysheetpointconfigsearchcomfirm" class="btn btn-primary luckysheet-model-conform-btn">查询</button> </div> </div> </div> </div> <div class="luckysheet-chart-point-config-left-mid"> <span id="luckysheet-chart-point-btn-all" class="luckysheet-mousedown-cancel">全选</span> - <span id="luckysheet-chart-point-btn-clear" class="luckysheet-mousedown-cancel">清除</span> - <span id="luckysheet-chart-point-btn-contra" class="luckysheet-mousedown-cancel">反选</span><span style="text-decoration:none;color:#8D8D8D;float:right;margin-right:40px;cursor:default;" class="luckysheet-mousedown-cancel">可以直接框选数据点</span> </div> <div class="luckysheet-chart-point-config-left-bottom"> <div class="luckysheet-chart-point-searchitem-c luckysheet-noselected-text">  </div> </div> </div> <div class="luckysheet-chart-point-config-right"> <div class="luckysheet-chart-point-itemconfig"> <div class="luckysheet-datavisual-content-row" style="font-size: 16px;font-weight: bold;"> 数据点设置 </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">图形颜色</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <input data-tips="颜色" class="luckysheet-datavisual-config-colorOpacity" id="scattersingleitemstylecolor" type="text" data-bigclass="scattersingle" data-attr="itemstyle" data-func="color" /> </div> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">图形大小</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-sliderdiy="scattersingleallsymbolsizeslider" data-tips="点大小设置" name="scattersingleallsymbolsize" id="scattersingleallsymbolsize" data-width="50" data-bigclass="scattersingle" data-attr="all" data-func="symbolsize"> <option value="4" selected="selected">4px</option> <option value="6">6px</option> <option value="8">8px</option> <option value="10">10px</option> <option value="12">12px</option> <option value="14">14px</option> <option value="16">16px</option> <option value="diy">自定义</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row" style="display:none;"> <div data-tips="滑动修改点大小" id="scattersingleallsymbolsizeslider" data-bigclass="scattersingle" data-attr="all" data-func="symbolsize" class="luckysheet-datavisual-config-slider" style="width:70%;" data-min="1" data-max="50" data-step="1"></div> <input data-tips="自定义点大小" data-sliderid="scattersingleallsymbolsizeslider" id="scattersingleallsymbolsizesliderdiy" type="text" class="luckysheet-datavisual-config-input" data-bigclass="scattersingle" data-attr="all" data-func="symbolsize" placeholder="请输入" style="width:10%;margin-left:10px;text-align:center;margin-right: 2px;" /><label for="scattersingleallsymbolsizesliderdiy">px</label> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">图形形状</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-tips="点类型设置" data-width="70" name="scattersingleallsymboltype" id="scattersingleallsymboltype" data-bigclass="scattersingle" data-attr="all" data-func="symboltype"> <option value="emptyCircle" selected="selected">空心圆</option> <option value="circle">圆形</option> <option value="emptyRectangle">空心矩形</option> <option value="rect">矩形</option> <option value="roundRect">圆角矩形</option> <option value="emptyTriangle">空心三角</option> <option value="triangle">三角形</option> <option value="emptyDiamond">空心菱形</option> <option value="diamond">菱形</option> <option value="droplet">水滴</option> <option value="pin">标注</option> <option value="arrow">箭头</option> <option value="heart">心形</option> <option value="star">星星</option> </select> </div> </div> <div class="luckysheet-datavisual-content-rowsplit-sub"></div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">边框粗细</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-sliderdiy="scattersingleitemstyleborderwidthslider" data-tips="点边框粗细" name="scattersingleitemstyleborderwidth" id="scattersingleitemstyleborderwidth" data-width="50" data-bigclass="scattersingle" data-attr="itemstyle" data-func="borderwidth"><option value="0" selected="selected">无</option> <option value="1">1px</option> <option value="2">2px</option> <option value="3">3px</option> <option value="4">4px</option> <option value="5">5px</option> <option value="6">6px</option> <option value="7">7px</option> <option value="8">8px</option> <option value="diy">自定义</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row" style="display:none;"> <div data-tips="滑动修改边框粗细" id="scattersingleitemstyleborderwidthslider" data-bigclass="scattersingle" data-attr="itemstyle" data-func="borderwidth" class="luckysheet-datavisual-config-slider" style="width:70%;" data-min="12" data-max="100" data-step="1"></div> <input data-tips="自定义边框粗细" data-sliderid="scattersingleitemstyleborderwidthslider" id="scattersingleitemstyleborderwidthsliderdiy" type="text" class="luckysheet-datavisual-config-input" data-bigclass="scattersingle" data-attr="itemstyle" data-func="borderwidth" placeholder="请输入" style="width:10%;margin-left:10px;text-align:center;margin-right: 2px;" /><label for="scattersingleitemstyleborderwidthsliderdiy">%</label> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">边框样式</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-tips="点边框类型设置" data-width="50" name="scattersingleitemstyleborderlinetype" id="scattersingleitemstyleborderlinetype" data-bigclass="scattersingle" data-attr="itemstyle" data-func="borderlinetype"> <option value="solid" selected="selected">实线</option> <option value="dashed">虚线</option> <option value="dotted">点线</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">边框颜色</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <input data-tips="点边框颜色" class="luckysheet-datavisual-config-colorOpacity" id="scattersingleitemstyleborderlinecolor" type="text" data-bigclass="scattersingle" data-attr="itemstyle" data-func="borderlinecolor" /> </div> </div> <div class="luckysheet-datavisual-content-rowsplit-sub"></div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;"><i class="fa fa-th-large" aria-hidden="true"></i> 文字标签</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <label data-tips="显示数据点的标签" data-bigclass="scattersingle" data-attr="label" data-func="labelshow" for="scattersinglelabellabelshow">显示</label> <input type="radio" checked="checked" value="1" name="scattersinglelabellabelshow" id="scattersinglelabellabelshow" data-bigclass="scattersingle" data-attr="label" data-func="labelshow"> <label data-tips="隐藏数据点的标签" data-bigclass="scattersingle" data-attr="label" data-func="labelshow" for="scattersinglelabellabelshow1">隐藏</label> <input type="radio" value="0" name="scattersinglelabellabelshow" id="scattersinglelabellabelshow1" data-bigclass="scattersingle" data-attr="label" data-func="labelshow"> </div> </div> <div class="luckysheet-datavisual-content-row" style="height:auto;line-height: initial;margin-left:auto;" showfor="scattersinglelabellabelshow1" hidefor="scattersinglelabellabelshow"> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:40%;">数值比例</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:50%;"> <select data-tips="刻度数值放大比例" name="scattersinglelabelformatratio" id="scattersinglelabelformatratio" data-bigclass="scattersingle" data-attr="label" data-func="formatratio"> <option value="0.01">乘以100</option> <option value="0.1">乘以10</option> <option value="1" selected="selected">默认</option> <option value="10">除以10</option> <option value="100">除以100</option> <option value="1000">除以1000</option> <option value="10000">除以1万</option> <option value="100000">除以10万</option> <option value="1000000">除以一百万</option> <option value="10000000">除以一千万</option> <option value="100000000">除以一亿</option> <option value="1000000000">除以十亿</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:40%;white-space: nowrap;">小数位数</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:50%;"> <select data-tips="数值小数点位数" name="scattersinglelabelfloatlen" id="scattersinglelabelfloatlen" data-bigclass="scattersingle" data-attr="label" data-func="floatlen"> <option value="auto" selected="selected">自动显示</option> <option value="0">整数</option> <option value="1">1位小数</option> <option value="2">2位小数</option> <option value="3">3位小数</option> <option value="4">4位小数</option> <option value="5">5位小数</option> <option value="6">6位小数</option> <option value="7">7位小数</option> <option value="8">8位小数</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row"> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:20%;">标签格式</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:70%;"> <select data-sliderdiy="scattersinglelabelcontentformatslider" data-tips="标签显示格式" name="scattersinglelabelcontentformat" id="scattersinglelabelcontentformat" data-bigclass="scattersingle" data-attr="label" data-func="contentformat"> <option value="default" selected="selected">默认</option> <option value="1">仅数据名</option> <option value="2">数据名+2维数值</option> <option value="5">数据名+全部数值</option> <option value="diy">自定义</option> </select> </div> </div> <div style="display:none;"> <div class="luckysheet-datavisual-content-row" id="scattersinglelabelcontentformatslider"> <div style="text-align:center; width:60px; display:inline-block;">数据名称</div> <label data-tips="是否显示数据名" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelshow" for="scattersinglelabeldatalabelshow" style="font-weight:bold;"><i class="fa fa-eye" aria-hidden="true"></i></label> <input type="checkbox" checked="checked" name="scattersinglelabeldatalabelshow" id="scattersinglelabeldatalabelshow" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelshow"> <input data-tips="显示在数据名前部文字" placeholder="前缀" id="scattersinglelabeldatalabelprefix" type="text" class="luckysheet-datavisual-config-input" style="width:60px;height:19px;" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelprefix" /> <input data-tips="显示在数据名尾部文字" placeholder="后缀" id="scattersinglelabeldatalabelsuffix" type="text" class="luckysheet-datavisual-config-input" style="width:60px;height:19px;" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelsuffix" /> <label data-tips="是否在数据名后换行" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelline" for="scattersinglelabeldatalabelline" style="font-weight:bold;">换行</label> <input type="checkbox" checked="checked" name="scattersinglelabeldatalabelline" id="scattersinglelabeldatalabelline" data-bigclass="scattersingle" data-attr="label" data-func="scattersingledatalabelline"> </div> </div> <div class="luckysheet-datavisual-content-row" > <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-title luckysheet-datavisual-content-column-2x" style="width:10%;white-space:nowrap;">标签位置</div> <div class="luckysheet-datavisual-content-column luckysheet-datavisual-content-column-right luckysheet-datavisual-content-column-2x" style="width:80%;"> <select data-sliderdiy="scattersinglelabellabelplaceslider" data-tips="标签距离图形位置" data-width="70" name="scattersinglelabellabelplace" id="scattersinglelabellabelplace" data-bigclass="scattersingle" data-attr="label" data-func="labelplace"> <option value="top" selected="selected">顶端</option> <option value="left">左侧</option> <option value="right">右侧</option> <option value="bottom">底部</option> <option value="inside">内部居中</option> <option value="diy">自定义</option> <option value="insideLeft">内部左侧</option> <option value="insideRight">内部右侧</option> <option value="insideTop">内部顶端</option> <option value="insideBottom">内部底端</option> <option value="insideTopLeft">内部左上</option> <option value="insideBottomLeft">内部左下</option> <option value="insideTopRight">内部右上</option> <option value="insideBottomRight">内部右下</option> </select> </div> </div> <div class="luckysheet-datavisual-content-row" style="display:none;height:65px;"> <div data-tips="滑动修改点文本水平位置" id="scattersinglelabellabelplaceslider" data-bigclass="scattersingle" data-attr="label" data-func="labelplacediy" class="luckysheet-datavisual-config-slider" style="width:70%;" data-min="-100" data-max="100" data-step="1"></div> <input data-tips="自定义点文本水平位置" data-sliderid="scattersinglelabellabelplaceslider" id="scattersinglelabellabelplacesliderdiy" type="text" class="luckysheet-datavisual-config-input" data-bigclass="scattersingle" data-attr="label" data-func="labelplacediy" placeholder="请输入" style="width:10%;margin-left:10px;text-align:center;margin-right: 2px;" /><label for="scattersinglelabellabelplacesliderdiy">px</label> <br /> <div data-tips="滑动修改点文本垂直位置" id="scattersinglelabellabelplaceslider1" data-bigclass="scattersingle" data-attr="label" data-func="labelplacediy" class="luckysheet-datavisual-config-slider" style="width:70%;" data-min="-100" data-max="100" data-step="1"></div> <input data-tips="自定义点文本垂直位置" data-sliderid="scattersinglelabellabelplaceslider1" id="scattersinglelabellabelplaceslider1diy" type="text" class="luckysheet-datavisual-config-input" data-bigclass="scattersingle" data-attr="label" data-func="labelplacediy" placeholder="请输入" style="width:10%;margin-left:10px;text-align:center;margin-right: 2px;" /><label for="scattersinglelabellabelplaceslider1diy">px</label> </div> <div class="luckysheet-datavisual-content-row"> <label data-tips="加粗" data-bigclass="scattersingle" data-attr="label" data-func="labelbold" for="scattersinglelabellabelbold" style="font-weight:bold;"><i class="fa fa-bold" aria-hidden="true"></i></label> <input type="checkbox" name="scattersinglelabellabelbold" id="scattersinglelabellabelbold" data-bigclass="scattersingle" data-attr="label" data-func="labelbold"> <label data-tips="斜体" data-bigclass="scattersingle" data-attr="label" data-func="labelitalic" for="scattersinglelabellabelitalic" class="luckysheet-datavisual-content-column-italic"><i class="fa fa-italic" aria-hidden="true"></i></label> <input type="checkbox" name="scattersinglelabellabelitalic" id="scattersinglelabellabelitalic" data-bigclass="scattersingle" data-attr="label" data-func="labelitalic"> <select data-sliderdiy="scattersinglelabellabelfontsizeslider" data-width="50" data-tips="字体大小" name="scattersinglelabellabelfontsize" id="scattersinglelabellabelfontsize" data-bigclass="scattersingle" data-attr="label" data-func="labelfontsize"> <option value="12">12px</option> <option value="14">14px</option> <option value="16">16px</option> <option value="18">18px</option> <option value="20">20px</option> <option value="22">22px</option> <option value="24">24px</option> <option value="30">30px</option> <option value="36">36px</option> <option value="diy">自定义</option> </select> <input data-tips="字体颜色" class="luckysheet-datavisual-config-color" id="scattersinglelinelabelcolor" type="text" data-bigclass="scattersingle" data-attr="label" data-func="labelcolor" /> </div> <div class="luckysheet-datavisual-content-row" style="display:none;"> <div data-tips="滑动修改字体大小" id="scattersinglelabellabelfontsizeslider" data-bigclass="scattersingle" data-attr="label" data-func="labelfontsize" class="luckysheet-datavisual-config-slider" style="width:70%;" data-min="12" data-max="100" data-step="1"></div> <input data-tips="自定义字体大小" data-sliderid="scattersinglelabellabelfontsizeslider" id="scattersinglelabellabelfontsizesliderdiy" type="text" class="luckysheet-datavisual-config-input" data-bigclass="scattersingle" data-attr="label" data-func="labelfontsize" placeholder="请输入" style="width:10%;margin-left:10px;text-align:center;margin-right: 2px;" /><label for="scattersinglelabellabelfontsizesliderdiy">px</label> </div> </div> </div> </div> </div> <div class="luckysheet-chart-point-config-chart"> <div id="luckysheet-chart-point-config-chart-c" class="luckysheet-chart-point-config-chart-c"> </div> </div> </div>'
      , luckysheetToolHTML = '<div id="luckysheet-tooltip-up" class="jfk-tooltip" role="tooltip" aria-hidden="true" style="left: 505px; top: 410px;"><div class="jfk-tooltip-contentId">组合图表</div><div class="jfk-tooltip-arrow jfk-tooltip-arrowup" style="left: 35.5px;"><div class="jfk-tooltip-arrowimplbefore"></div><div class="jfk-tooltip-arrowimplafter"></div></div></div>';
    function menuToolBar() {
        var e = locale().toolbar
          , t = locale().fontarray
          , r = locale().defaultFmt;
        return '<div class="luckysheet-toolbar-left-theme">\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="'.concat(e.undo, '"\n        id="luckysheet-icon-undo" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-undo iconfont icon-qianjin"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.redo, '"\n        id="luckysheet-icon-redo" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-redo iconfont icon-houtui"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.paintFormat, '"\n        id="luckysheet-icon-paintformat" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img iconfont icon-geshishua"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        \x3c!--<div class="luckysheet-toolbar-separator luckysheet-inline-block"\n        style="user-select: none;"> </div> <div class="luckysheet-toolbar-zoom-combobox luckysheet-toolbar-combo-button luckysheet-inline-block" data-tips="缩放" id="luckysheet-icon-zoom" style="user-select: none;"> <div class="luckysheet-toolbar-combo-button-outer-box luckysheet-inline-block" style="user-select: none;"> <div class="luckysheet-toolbar-combo-button-inner-box luckysheet-inline-block" style="user-select: none;"> <div aria-posinset="4" aria-setsize="7" class="luckysheet-inline-block luckysheet-toolbar-combo-button-caption" style="user-select: none;"> <input aria-label="缩放比例" class="luckysheet-toolbar-combo-button-input luckysheet-toolbar-textinput luckysheet-mousedown-cancel" role="combobox" style="user-select: none;" tabindex="-1" type="text" value="100%"/> </div> <div class="luckysheet-toolbar-combo-button-dropdown luckysheet-inline-block " style="user-select: none;"> </div> </div> </div> </div> --\x3e\n        <div id="toolbar-separator-paint-format" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.currencyFormat, '"\n        id="luckysheet-icon-currency" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img iconfont icon-jine"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.percentageFormat, '"\n        id="luckysheet-icon-percent" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img iconfont icon-baifenhao"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.numberDecrease, '"\n        id="luckysheet-icon-fmt-decimal-decrease" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block toolbar-decimal-icon"\n                    style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-decimal-decrease iconfont icon-jianxiaoxiaoshuwei"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.numberIncrease, '"\n        id="luckysheet-icon-fmt-decimal-increase" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block toolbar-decimal-icon"\n                    style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-decimal-increase iconfont icon-zengjiaxiaoshuwei"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.moreFormats, '"\n        id="luckysheet-icon-fmt-other" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        ').concat(r[0].text, '\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="toolbar-separator-more-format" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tooltip="').concat(e.font, '" id="luckysheet-icon-font-family" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        ').concat(t[0], '\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n\n        <div id="toolbar-separator-font-family" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-zoom-combobox luckysheet-toolbar-combo-button luckysheet-inline-block"\n        data-tips="').concat(e.fontSize, '" id="luckysheet-icon-font-size" style="user-select: none;">\n            <div class="luckysheet-toolbar-combo-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-combo-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div aria-posinset="4" aria-setsize="7" class="luckysheet-inline-block luckysheet-toolbar-combo-button-caption"\n                    style="user-select: none;">\n                        <input aria-label="').concat(e.fontSize, '" class="luckysheet-toolbar-combo-button-input luckysheet-toolbar-textinput"\n                        role="combobox" style="user-select: none;" tabindex="-1" type="text" value="10"\n                        />\n                    </div>\n                    <div class="luckysheet-toolbar-combo-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="toolbar-separator-font-size" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.bold, '"\n        id="luckysheet-icon-bold" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-bold iconfont icon-jiacu"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.italic, '"\n        id="luckysheet-icon-italic" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-italic iconfont icon-wenbenqingxie1"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="').concat(e.strikethrough, '"\n        id="luckysheet-icon-strikethrough" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-strikethrough iconfont icon-wenbenshanchuxian"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-text-color"\n        data-tips="').concat(e.textColor, '" id="luckysheet-icon-text-color" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-color-menu-button-indicator" style="border-bottom-color: rgb(0, 0, 0); user-select: none;">\n                            <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                                <div class="text-color-bar"></div>\n                                <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-text-color iconfont icon-wenbenyanse"\n                                style="user-select: none;">\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.chooseColor, '..." id="luckysheet-icon-text-color-menu" role="button"\n        style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="toolbar-separator-text-color" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-cell-color"\n        data-tips="').concat(e.fillColor, '" id="luckysheet-icon-cell-color" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-color-menu-button-indicator" style="border-bottom-color: rgb(255, 255, 255); user-select: none;">\n                            <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                                <div class="text-color-bar"></div>\n                                <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-cell-color iconfont icon-tianchong"\n                                style="user-select: none;">\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.chooseColor, '..." id="luckysheet-icon-cell-color-menu" role="button"\n        style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-border-all"\n        data-tips="').concat(e.border, '" id="luckysheet-icon-border-all" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-all iconfont icon-quanjiabiankuang"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.borderStyle, '..." id="luckysheet-icon-border-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-merge-button"\n        data-tips="').concat(e.mergeCell, '" id="luckysheet-icon-merge-button" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-merge iconfont icon-hebing"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.chooseMergeType, '..." id="luckysheet-icon-merge-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="toolbar-separator-merge-cell" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-align"\n        data-tips="').concat(e.horizontalAlign, '" id="luckysheet-icon-align" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-left iconfont icon-wenbenzuoduiqi"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.alignment, '..." id="luckysheet-icon-align-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-valign"\n        data-tips="').concat(e.verticalAlign, '" id="luckysheet-icon-valign" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-bottom iconfont icon-dibuduiqi"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.alignment, '..." id="luckysheet-icon-valign-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-textwrap"\n        data-tips="').concat(e.textWrap, '" id="luckysheet-icon-textwrap" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-clip iconfont icon-jieduan"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.textWrapMode, '..." id="luckysheet-icon-textwrap-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-rotation"\n        data-tips="').concat(e.textRotate, '" id="luckysheet-icon-rotation" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-wuxuanzhuang"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.textRotateMode, '..." id="luckysheet-icon-rotation-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="toolbar-separator-text-rotate" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.insertImage, '" id="luckysheet-insertImg-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-tupian"\n                            style="user-select: none;">\n                                <input id="luckysheet-imgUpload" type="file" accept="image/*" style="display:none;"></input>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.insertLink, '" id="luckysheet-insertLink-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-lianjie"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.chart, '" id="luckysheet-chart-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-tubiao"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>        \n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.postil, '"\n        id="luckysheet-icon-postil" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon-img-container luckysheet-toolbar-menu-button-caption luckysheet-inline-block iconfont icon-zhushi"\n                    style="user-select: none;">\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.pivotTable, '" id="luckysheet-pivot-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-shujutoushi"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>       \n        <div id="toolbar-separator-pivot-table" class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;">\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-icon-function"\n        data-tips="').concat(e.autoSum, '" id="luckysheet-icon-function" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-function iconfont icon-jisuan"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        ').concat(e.sum, '\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.moreFunction, '..." id="luckysheet-icon-function-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block luckysheet-freezen-btn-horizontal"\n        data-tips="').concat(e.freezeTopRow, '" id="luckysheet-freezen-btn-horizontal" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    \n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-dongjie1"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                    \n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-right luckysheet-toolbar-menu-button luckysheet-inline-block"\n        data-tips="').concat(e.moreOptions, '..." id="luckysheet-icon-freezen-menu" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.sortAndFilter, '"\n        id="luckysheet-icon-autofilter" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-shaixuan"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;margin-left: 0px;margin-right: 4px;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.conditionalFormat, '"\n        id="luckysheet-icon-conditionformat" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    \n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-geshitiaojian"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.dataVerification, '" id="luckysheet-dataVerification-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-shujuyanzheng"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.splitColumn, '" id="luckysheet-splitColumn-btn-title" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-wenbenfenge"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.screenshot, '" id="luckysheet-chart-btn-screenshot" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-jieping"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.findAndReplace, '"\n        id="luckysheet-icon-seachmore" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-sousuo"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;margin-left: 0px;margin-right: 4px;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-button-split-left luckysheet-toolbar-button luckysheet-inline-block"\n        data-tips="').concat(e.protection, '" id="luckysheet-icon-protection" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-menu-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                            <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-biaogesuoding"\n                            style="user-select: none;">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="').concat(e.print, '"\n        id="luckysheet-icon-print" role="button" style="user-select: none;">\n            <div class="luckysheet-toolbar-menu-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-dayin"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"\n                    style="user-select: none;margin-left: 0px;margin-right: 4px;">\n                    </div>\n                </div>\n            </div>\n        </div>\n        ')
    }
    var luckysheetlodingHTML = function() {
        return '<div id="luckysheetloadingdata" style="width:100%;text-align:center;position:absolute;top:0px;height:100%;font-size: 16px;z-index:1000000000;background:#fff;"><div style="position:relative;top:45%;width:100%;"> <div class="luckysheetLoaderGif"></div>  <span>' + locale().info.loading + "...</span></div></div>"
    }
      , luckyColor = ["#c1232b", "#27727b", "#fcce10", "#e87c25", "#b5c334", "#fe8463", "#9bca63", "#fad860", "#f3a43b", "#60c0dd", "#d7504b", "#c6e579", "#f4e001", "#f0805a", "#26c0c0", "#c12e34", "#e6b600", "#0098d9", "#2b821d", "#005eaa", "#339ca8", "#cda819", "#32a487", "#3fb1e3", "#6be6c1", "#626c91", "#a0a7e6", "#c4ebad", "#96dee8"]
      , keycode = {
        BACKSPACE: 8,
        TAB: 9,
        ENTER: 13,
        SHIFT: 16,
        CTRL: 17,
        PAUSE: 19,
        CAPSLOCK: 20,
        ESC: 27,
        SPACE: 33,
        PAGEUP: 33,
        PAGEDOWN: 34,
        END: 35,
        HOME: 36,
        LEFT: 37,
        UP: 38,
        RIGHT: 39,
        DOWN: 40,
        INSERT: 45,
        DELETE: 46,
        WIN: 91,
        WIN_R: 92,
        MENU: 93,
        F1: 112,
        F2: 113,
        F3: 114,
        F4: 115,
        F5: 116,
        F6: 117,
        F7: 118,
        F8: 119,
        F9: 120,
        F10: 121,
        F11: 122,
        F12: 123,
        NUMLOCK: 144,
        SCROLLLOCK: 145
    }
      , luckysheetdefaultstyle = {
        fillStyle: "#000000",
        textBaseline: "middle",
        strokeStyle: "#dfdfdf",
        rowFillStyle: "#5e5e5e",
        textAlign: "center"
    }
      , luckysheetdefaultFont = function() {
        return "normal normal normal " + Store.defaultFontSize + "pt " + locale().fontarray[0] + ', "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC",  "WenQuanYi Micro Hei", sans-serif'
    }
      , luckysheet_CFiconsImg = new Image;
    luckysheet_CFiconsImg.src = "data:image/png;base64, ";
    var iconfontObjects = {
        border: {
            "border-top": " iconfont icon-shangbiankuang",
            "border-bottom": " iconfont icon-xiabiankuang",
            "border-left": " iconfont icon-zuobiankuang",
            "border-right": " iconfont icon-youbiankuang",
            "border-none": " iconfont icon-wubiankuang",
            "border-all": " iconfont icon-quanjiabiankuang",
            "border-outside": " iconfont icon-sizhoujiabiankuang",
            "border-inside": " iconfont icon-neikuangxian",
            "border-horizontal": " iconfont icon-neikuanghengxian",
            "border-vertical": " iconfont icon-neikuangshuxian"
        },
        align: {
            left: " iconfont icon-wenbenzuoduiqi",
            center: " iconfont icon-wenbenjuzhongduiqi",
            right: " iconfont icon-wenbenyouduiqi",
            top: " iconfont icon-dingbuduiqi",
            middle: " iconfont icon-shuipingduiqi",
            bottom: " iconfont icon-dibuduiqi"
        },
        textWrap: {
            overflow: " iconfont icon-yichu1",
            wrap: " iconfont icon-zidonghuanhang",
            clip: " iconfont icon-jieduan"
        },
        rotation: {
            none: " iconfont icon-wuxuanzhuang",
            angleup: " iconfont icon-xiangshangqingxie",
            angledown: " iconfont icon-xiangxiaqingxie",
            vertical: " iconfont icon-shupaiwenzi",
            "rotation-up": " iconfont icon-wenbenxiangshang",
            "rotation-down": " iconfont icon-xiangxia90"
        }
    };
    function customCellRightClickConfig() {
        var e = {
            copy: !0,
            copyAs: !0,
            paste: !0,
            insertRow: !0,
            insertColumn: !0,
            deleteRow: !0,
            deleteColumn: !0,
            deleteCell: !0,
            hideRow: !0,
            hideColumn: !0,
            rowHeight: !0,
            columnWidth: !0,
            clear: !0,
            matrix: !0,
            sort: !0,
            filter: !0,
            chart: !0,
            image: !0,
            link: !0,
            data: !0,
            cellFormat: !0
        };
        return "{}" !== JSON.stringify(luckysheetConfigsetting.cellRightClickConfig) && Object.assign(e, luckysheetConfigsetting.cellRightClickConfig),
        console.info("=======cellRightClickConfig======"),
        luckysheetConfigsetting.cellRightClickConfig = e,
        e
    }
    function customSheetRightClickConfig() {
        var e = {
            delete: !0,
            copy: !0,
            rename: !0,
            color: !0,
            hide: !0,
            move: !0
        };
        return "{}" !== JSON.stringify(luckysheetConfigsetting.sheetRightClickConfig) && Object.assign(e, luckysheetConfigsetting.sheetRightClickConfig),
        luckysheetConfigsetting.sheetRightClickConfig = e,
        e
    }
    var non = "​᠎"
      , stringTrimForced = function(e) {
        return fails((function() {
            return !!whitespaces[e]() || non[e]() != non || whitespaces[e].name !== e
        }
        ))
    }
      , $trim = stringTrim.trim;
    _export({
        target: "String",
        proto: !0,
        forced: stringTrimForced("trim")
    }, {
        trim: function() {
            return $trim(this)
        }
    });
    var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport("splice")
      , USES_TO_LENGTH$5 = arrayMethodUsesToLength("splice", {
        ACCESSORS: !0,
        0: 0,
        1: 2
    })
      , max$3 = Math.max
      , min$4 = Math.min
      , MAX_SAFE_INTEGER$1 = 9007199254740991
      , MAXIMUM_ALLOWED_LENGTH_EXCEEDED = "Maximum allowed length exceeded";
    _export({
        target: "Array",
        proto: !0,
        forced: !HAS_SPECIES_SUPPORT$2 || !USES_TO_LENGTH$5
    }, {
        splice: function(e, t) {
            var r, a, n, o, l, i, s = toObject(this), c = toLength(s.length), u = toAbsoluteIndex(e, c), h = arguments.length;
            if (0 === h ? r = a = 0 : 1 === h ? (r = 0,
            a = c - u) : (r = h - 2,
            a = min$4(max$3(toInteger(t), 0), c - u)),
            c + r - a > MAX_SAFE_INTEGER$1)
                throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
            for (n = arraySpeciesCreate(s, a),
            o = 0; o < a; o++)
                (l = u + o)in s && createProperty(n, o, s[l]);
            if (n.length = a,
            r < a) {
                for (o = u; o < c - a; o++)
                    i = o + r,
                    (l = o + a)in s ? s[i] = s[l] : delete s[i];
                for (o = c; o > c - a + r; o--)
                    delete s[o - 1]
            } else if (r > a)
                for (o = c - a; o > u; o--)
                    i = o + r - 1,
                    (l = o + a - 1)in s ? s[i] = s[l] : delete s[i];
            for (o = 0; o < r; o++)
                s[o + u] = arguments[o + 2];
            return s.length = c - a + r,
            n
        }
    });
    var defineProperty$3 = objectDefineProperty.f
      , FunctionPrototype = Function.prototype
      , FunctionPrototypeToString = FunctionPrototype.toString
      , nameRE = /^\s*function ([^ (]*)/
      , NAME = "name";
    descriptors && !(NAME in FunctionPrototype) && defineProperty$3(FunctionPrototype, NAME, {
        configurable: !0,
        get: function() {
            try {
                return FunctionPrototypeToString.call(this).match(nameRE)[1]
            } catch (e) {
                return ""
            }
        }
    });
    var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f
      , toString$2 = {}.toString
      , windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []
      , getWindowNames = function(e) {
        try {
            return nativeGetOwnPropertyNames(e)
        } catch (e) {
            return windowNames.slice()
        }
    }
      , f$5 = function(e) {
        return windowNames && "[object Window]" == toString$2.call(e) ? getWindowNames(e) : nativeGetOwnPropertyNames(toIndexedObject(e))
    }
      , objectGetOwnPropertyNamesExternal = {
        f: f$5
    }
      , nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f
      , FAILS_ON_PRIMITIVES = fails((function() {
        return !Object.getOwnPropertyNames(1)
    }
    ));
    _export({
        target: "Object",
        stat: !0,
        forced: FAILS_ON_PRIMITIVES
    }, {
        getOwnPropertyNames: nativeGetOwnPropertyNames$1
    });
    var SPECIES$5 = wellKnownSymbol("species")
      , setSpecies = function(e) {
        var t = getBuiltIn(e)
          , r = objectDefineProperty.f;
        descriptors && t && !t[SPECIES$5] && r(t, SPECIES$5, {
            configurable: !0,
            get: function() {
                return this
            }
        })
    }
      , defineProperty$4 = objectDefineProperty.f
      , getOwnPropertyNames$1 = objectGetOwnPropertyNames.f
      , setInternalState = internalState.set
      , MATCH$1 = wellKnownSymbol("match")
      , NativeRegExp = global_1.RegExp
      , RegExpPrototype$1 = NativeRegExp.prototype
      , re1 = /a/g
      , re2 = /a/g
      , CORRECT_NEW = new NativeRegExp(re1) !== re1
      , UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y
      , FORCED$3 = descriptors && isForced_1("RegExp", !CORRECT_NEW || UNSUPPORTED_Y$2 || fails((function() {
        return re2[MATCH$1] = !1,
        NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || "/a/i" != NativeRegExp(re1, "i")
    }
    )));
    if (FORCED$3) {
        for (var RegExpWrapper = function(e, t) {
            var r, a = this instanceof RegExpWrapper, n = isRegexp(e), o = void 0 === t;
            if (!a && n && e.constructor === RegExpWrapper && o)
                return e;
            CORRECT_NEW ? n && !o && (e = e.source) : e instanceof RegExpWrapper && (o && (t = regexpFlags.call(e)),
            e = e.source),
            UNSUPPORTED_Y$2 && (r = !!t && t.indexOf("y") > -1) && (t = t.replace(/y/g, ""));
            var l = inheritIfRequired(CORRECT_NEW ? new NativeRegExp(e,t) : NativeRegExp(e, t), a ? this : RegExpPrototype$1, RegExpWrapper);
            return UNSUPPORTED_Y$2 && r && setInternalState(l, {
                sticky: r
            }),
            l
        }, proxy = function(e) {
            e in RegExpWrapper || defineProperty$4(RegExpWrapper, e, {
                configurable: !0,
                get: function() {
                    return NativeRegExp[e]
                },
                set: function(t) {
                    NativeRegExp[e] = t
                }
            })
        }, keys$2 = getOwnPropertyNames$1(NativeRegExp), index = 0; keys$2.length > index; )
            proxy(keys$2[index++]);
        RegExpPrototype$1.constructor = RegExpWrapper,
        RegExpWrapper.prototype = RegExpPrototype$1,
        redefine(global_1, "RegExp", RegExpWrapper)
    }
    setSpecies("RegExp"),
    _export({
        target: "String",
        proto: !0
    }, {
        repeat: stringRepeat
    });
    var sameValue = Object.is || function(e, t) {
        return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t
    }
    ;
    function getSheetIndex(e) {
        for (var t = 0; t < Store.luckysheetfile.length; t++)
            if (Store.luckysheetfile[t].index == e)
                return t;
        return null
    }
    function getRangetxt(e, t, r) {
        var a = "";
        null == r && (r = Store.currentSheetIndex),
        e != r && (a = Store.luckysheetfile[getSheetIndex(e)].name + "!");
        var n = t.row[0]
          , o = t.row[1]
          , l = t.column[0]
          , i = t.column[1];
        return null == n && null == o ? a + chatatABC(l) + ":" + chatatABC(i) : null == l && null == i ? a + (n + 1) + ":" + (o + 1) : l == i && n == o ? a + chatatABC(l) + (n + 1) : a + chatatABC(l) + (n + 1) + ":" + chatatABC(i) + (o + 1)
    }
    function getluckysheet_select_save() {
        return Store.luckysheet_select_save
    }
    function getluckysheetfile(e) {
        return e && Store.luckysheetfile.forEach((function(e) {
            e.chart && e.chart.forEach((function(e) {
                var t = Store.getChartJson(e.chart_id);
                e.chartOptions = t
            }
            ))
        }
        )),
        Store.luckysheetfile
    }
    function getconfig() {
        return Store.config
    }
    function getvisibledatarow() {
        return Store.visibledatarow
    }
    function getvisibledatacolumn() {
        return Store.visibledatacolumn
    }
    function setluckysheet_select_save(e) {
        Store.luckysheet_select_save = e
    }
    function setluckysheet_scroll_status(e) {
        Store.luckysheet_scroll_status = e
    }
    function setluckysheetfile(e) {
        Store.luckysheetfile = e
    }
    fixRegexpWellKnownSymbolLogic("search", 1, (function(e, t, r) {
        return [function(t) {
            var r = requireObjectCoercible(this)
              , a = null == t ? void 0 : t[e];
            return void 0 !== a ? a.call(t, r) : new RegExp(t)[e](String(r))
        }
        , function(e) {
            var a = r(t, e, this);
            if (a.done)
                return a.value;
            var n = anObject(e)
              , o = String(this)
              , l = n.lastIndex;
            sameValue(l, 0) || (n.lastIndex = 0);
            var i = regexpExecAbstract(n, o);
            return sameValue(n.lastIndex, l) || (n.lastIndex = l),
            null === i ? -1 : i.index
        }
        ]
    }
    ));
    var $includes = arrayIncludes.includes
      , USES_TO_LENGTH$6 = arrayMethodUsesToLength("indexOf", {
        ACCESSORS: !0,
        1: 0
    });
    _export({
        target: "Array",
        proto: !0,
        forced: !USES_TO_LENGTH$6
    }, {
        includes: function(e) {
            return $includes(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    }),
    addToUnscopables("includes");
    var $map = arrayIteration.map
      , HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport("map")
      , USES_TO_LENGTH$7 = arrayMethodUsesToLength("map");
    _export({
        target: "Array",
        proto: !0,
        forced: !HAS_SPECIES_SUPPORT$3 || !USES_TO_LENGTH$7
    }, {
        map: function(e) {
            return $map(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var browser = {
        mobilecheck: function() {
            var e = !1;
            return function(t) {
                (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) && (e = !0)
            }(navigator.userAgent || navigator.vendor || window.opera),
            document.body && document.body.clientWidth && document.body.clientHeight && document.body.clientWidth < 350 && document.body.clientHeight < 500 && (e = !0),
            e
        },
        iphoneCheck: function() {
            return /iPhone/i.test(navigator.userAgent) && !0,
            !0
        },
        isWeixin: function() {
            return "micromessenger" == navigator.userAgent.toLowerCase().match(/MicroMessenger/i)
        },
        isAndroid: function() {
            var e = navigator.userAgent;
            return e.indexOf("Android") > -1 || e.indexOf("Linux") > -1
        },
        tabletCheck: function() {
            return /ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())
        },
        BrowserType: function() {
            var e = navigator.userAgent
              , t = e.indexOf("Opera") > -1
              , r = e.indexOf("compatible") > -1 && e.indexOf("MSIE") > -1 && !t
              , a = e.indexOf("Trident") > -1 && e.indexOf("rv:11.0") > -1
              , n = e.indexOf("Edge") > -1
              , o = e.indexOf("Firefox") > -1
              , l = e.indexOf("Safari") > -1 && -1 == e.indexOf("Chrome")
              , i = e.indexOf("Chrome") > -1 && e.indexOf("Safari") > -1;
            if (r) {
                new RegExp("MSIE (\\d+\\.\\d+);").test(e);
                var s = parseFloat(RegExp.$1);
                return 7 == s ? "IE7" : 8 == s ? "IE8" : 9 == s ? "IE9" : 10 == s ? "IE10" : "0"
            }
            return o ? "FF" : t ? "Opera" : l ? "Safari" : i ? "Chrome" : n ? "Edge" : a ? "IE11" : void 0
        },
        isIE: function() {
            var e = navigator.userAgent
              , t = e.indexOf("Opera") > -1
              , r = e.indexOf("compatible") > -1 && e.indexOf("MSIE") > -1 && !t
              , a = e.indexOf("Trident") > -1 && e.indexOf("rv:11.0") > -1;
            return r || a ? "1" : "-1"
        },
        IEVersion: function() {
            var e = navigator.userAgent
              , t = e.indexOf("Opera") > -1
              , r = e.indexOf("compatible") > -1 && e.indexOf("MSIE") > -1 && !t
              , a = e.indexOf("Trident") > -1 && e.indexOf("rv:11.0") > -1
              , n = e.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !r;
            if (r) {
                new RegExp("MSIE (\\d+\\.\\d+);").test(e);
                var o = parseFloat(RegExp.$1);
                return 7 == o ? "IE7" : 8 == o ? "IE8" : 9 == o ? "IE9" : 10 == o ? "IE10" : "0"
            }
            return n ? "Edge" : a ? "IE11" : "-1"
        },
        luckysheetrefreshfixednum: null,
        luckysheetrefreshfixed: function() {
            return null == this.luckysheetrefreshfixednum && ("FF" == this.BrowserType() ? this.luckysheetrefreshfixednum = 5 : this.luckysheetrefreshfixednum = 0),
            this.luckysheetrefreshfixednum
        },
        detectOS: function() {
            var e = navigator.userAgent
              , t = "Win32" == navigator.platform || "Windows" == navigator.platform
              , r = "Mac68K" == navigator.platform || "MacPPC" == navigator.platform || "Macintosh" == navigator.platform || "MacIntel" == navigator.platform;
            if (r)
                return "Mac";
            if ("X11" == navigator.platform && !t && !r)
                return "Unix";
            if (String(navigator.platform).indexOf("Linux") > -1)
                return "Linux";
            if (t) {
                if (e.indexOf("Windows NT 5.0") > -1 || e.indexOf("Windows 2000") > -1)
                    return "Win2000";
                if (e.indexOf("Windows NT 5.1") > -1 || e.indexOf("Windows XP") > -1)
                    return "WinXP";
                if (e.indexOf("Windows NT 5.2") > -1 || e.indexOf("Windows 2003") > -1)
                    return "Win2003";
                if (e.indexOf("Windows NT 6.0") > -1 || e.indexOf("Windows Vista") > -1)
                    return "WinVista";
                if (e.indexOf("Windows NT 6.1") > -1 || e.indexOf("Windows 7") > -1)
                    return "Win7"
            }
            return "other"
        }
    }
      , tooltip = {
        info: function(e, t) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-info").remove();
            var r = locale().button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-info",
                addclass: "",
                title: e,
                content: t,
                botton: '<button class="btn btn-default luckysheet-model-close-btn">&nbsp;&nbsp;' + r.close + "&nbsp;&nbsp;</button>",
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-info").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-info").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3
            }).show()
        },
        confirm: function(e, t, r, a, n, o) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-confirm").remove();
            var l = locale().button;
            null == n && (n = l.confirm),
            null == o && (o = l.cancel),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-confirm",
                addclass: "",
                style: "z-index:100003",
                title: e,
                content: t,
                botton: '<button class="btn btn-primary luckysheet-model-conform-btn">&nbsp;&nbsp;' + n + '&nbsp;&nbsp;</button><button class="btn btn-default luckysheet-model-cancel-btn">&nbsp;&nbsp;' + o + "&nbsp;&nbsp;</button>"
            }));
            var i = $("#luckysheet-confirm").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , s = i.outerHeight()
              , c = i.outerWidth()
              , u = $(window).width()
              , h = $(window).height()
              , d = $(document).scrollLeft()
              , f = $(document).scrollTop();
            $("#luckysheet-confirm").css({
                left: (u + d - c) / 2,
                top: (h + f - s) / 3
            }).show(),
            i.find(".luckysheet-model-conform-btn").click((function() {
                "function" == typeof r && r(),
                $("#luckysheet-confirm").hide(),
                $("#luckysheet-modal-dialog-mask").hide()
            }
            )),
            i.find(".luckysheet-model-cancel-btn").click((function() {
                "function" == typeof a && a(),
                $("#luckysheet-confirm").hide(),
                $("#luckysheet-modal-dialog-mask").hide()
            }
            ))
        },
        screenshot: function(e, t, r) {
            var a = locale().screenshot;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-confirm").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-confirm",
                addclass: "",
                style: "z-index:100003",
                title: e,
                content: t,
                botton: '<a style="text-decoration:none;color:#fff;" class="download btn btn-primary luckysheet-model-conform-btn">&nbsp;&nbsp;' + a.downLoadBtn + '&nbsp;&nbsp;</a>&nbsp;&nbsp;<button class="btn btn-primary luckysheet-model-copy-btn">&nbsp;&nbsp;' + a.downLoadCopy + '&nbsp;&nbsp;</button><button class="btn btn-default luckysheet-model-cancel-btn">&nbsp;&nbsp;' + a.downLoadClose + "&nbsp;&nbsp;</button>"
            }));
            var n = $("#luckysheet-confirm").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-confirm").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show(),
            n.find(".luckysheet-model-conform-btn").click((function() {
                "1" == browser.isIE() ? alert(a.browserNotTip) : (window.ActiveXObject || "ActiveXObject"in window) && (0 === $("#IframeReportImg").length && $('<iframe style="display:none;" id="IframeReportImg" name="IframeReportImg" onload="downloadImg();" width="0" height="0" src="about:blank"></iframe>').appendTo("body"),
                $("#IframeReportImg").attr("src") != r ? $("#IframeReportImg").attr("src", r) : "about:blank" != $("#IframeReportImg").src && window.frames.IframeReportImg.document.execCommand("SaveAs"))
            }
            )),
            n.find(".luckysheet-model-cancel-btn").click((function() {
                $("#luckysheet-confirm").hide(),
                $("#luckysheet-modal-dialog-mask").hide()
            }
            )),
            $("#luckysheet-confirm .luckysheet-model-copy-btn").click((function() {
                var e = new clipboard.DT;
                e.setData("text/html", "<img src='" + r + "'>"),
                "1" == browser.isIE() ? alert(a.rightclickTip) : (clipboard.write(e),
                alert(a.successTip))
            }
            ))
        },
        chartPointConfig: function(e, t, r) {
            $("body").append(replaceHtml$1(modelHTML, {
                id: e,
                addclass: "luckysheet-chart-point-config-c",
                title: "数据点批量设置",
                content: luckysheetchartpointconfigHTML,
                botton: '<button class="btn btn-danger luckysheet-model-save-btn">&nbsp;&nbsp;保存设置&nbsp;&nbsp;</button><button class="btn btn-default luckysheet-model-close-btn">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>',
                style: "z-index:100003;height:80%;width:80%;top:10%;left:10%;"
            })),
            $("#luckysheet-modal-dialog-mask").show();
            var a = $(window).width()
              , n = $(window).height();
            $("#" + e).find(".luckysheet-chart-point-config").css("height", n - 160),
            $("#" + e).css({
                height: n - 90,
                width: a - 100,
                left: 7,
                top: 14
            }).show().find(".luckysheet-model-save-btn").click((function() {
                "function" == typeof t && t(),
                $("#" + e).hide(),
                $("#luckysheet-modal-dialog-mask").hide()
            }
            )),
            $("#" + e).find(".luckysheet-model-save-btn").click((function() {
                "function" == typeof r && r(),
                $("#" + e).hide(),
                $("#luckysheet-modal-dialog-mask").hide()
            }
            ))
        },
        sheetConfig: function() {},
        hoverTipshowState: !1,
        hoverTipshowTimeOut: null,
        createHoverTip: function(e, t) {
            var r = this;
            $(e).on("mouseover", t, (function(e) {
                r.hoverTipshowState || (clearTimeout(r.hoverTipshowTimeOut),
                r.hoverTipshowTimeOut = setTimeout((function() {
                    var t = $(e.currentTarget)
                      , r = t.offset()
                      , a = $("#luckysheet-tooltip-up")
                      , n = t.data("tips");
                    if (null != n && 0 != n.length || null != (n = t.prev().data("tips")) && 0 != n.length) {
                        0 == a.length && ($("body").append(luckysheetToolHTML),
                        a = $("#luckysheet-tooltip-up")),
                        a.removeClass("jfk-tooltip-hide").find("div.jfk-tooltip-contentId").html(n);
                        var o = a.outerWidth();
                        a.find("div.jfk-tooltip-arrow").css("left", o / 2);
                        var l = r.left + (t.outerWidth() - o) / 2;
                        l < 2 && (l = 2,
                        a.find("div.jfk-tooltip-arrow").css("left", t.outerWidth() / 2)),
                        a.css({
                            top: r.top + t.outerHeight() + 1,
                            left: l
                        })
                    }
                }
                ), 300))
            }
            )).on("mouseout", t, (function(e) {
                r.hoverTipshowState = !1,
                clearTimeout(r.hoverTipshowTimeOut),
                $("#luckysheet-tooltip-up").addClass("jfk-tooltip-hide")
            }
            )).on("click", t, (function(e) {
                r.hoverTipshowState = !0,
                clearTimeout(r.hoverTipshowTimeOut),
                $("#luckysheet-tooltip-up").addClass("jfk-tooltip-hide")
            }
            ))
        },
        popover: function(e, t, r, a, n, o) {
            var l = locale()
              , i = l.button
              , s = l.paint;
            null == n && (n = i.close);
            var c = '<div id="luckysheetpopover" class="luckysheetpopover"><div class="luckysheetpopover-content">' + s.start + '</div><div class="luckysheetpopover-btn">' + n + "</div></div>";
            $("#luckysheetpopover").remove(),
            $("body").append(c),
            $("#luckysheetpopover .luckysheetpopover-content").html(e);
            var u = $("#luckysheetpopover").outerWidth()
              , h = $("#luckysheetpopover").outerHeight()
              , d = {};
            "topLeft" == t ? (d.top = "20px",
            d.left = "20px") : "topCenter" == t ? (d.top = "20px",
            d.left = "50%",
            d["margin-left"] = -u / 2) : "topRight" == t ? (d.top = "20px",
            d.right = "20px") : "midLeft" == t ? (d.top = "50%",
            d["margin-top"] = -h / 2,
            d.left = "20px") : "center" == t ? (d.top = "50%",
            d["margin-top"] = -h / 2,
            d.left = "50%",
            d["margin-left"] = -u / 2) : "midRight" == t ? (d.top = "50%",
            d["margin-top"] = -h / 2,
            d.right = "20px") : "bottomLeft" == t ? (d.bottom = "20px",
            d.left = "20px") : "bottomCenter" == t ? (d.bottom = "20px",
            d.left = "50%",
            d["margin-left"] = -u / 2) : "bottomRight" == t ? (d.bottom = "20px",
            d.right = "20px") : (d.top = "20px",
            d.left = "50%",
            d["margin-left"] = -u / 2),
            "white" == a && (d.background = "rgba(255, 255, 255, 0.65)",
            d.color = "#000",
            $("#luckysheetpopover .luckysheetpopover-btn").css({
                border: "1px solid #000"
            })),
            setTimeout((function() {
                $("#luckysheetpopover .luckysheetpopover-content").css({
                    "margin-left": -$("#luckysheetpopover .luckysheetpopover-btn").outerWidth() / 2
                })
            }
            ), 1),
            $("#luckysheetpopover").css(d).fadeIn(),
            $("#luckysheetpopover .luckysheetpopover-btn").click((function() {
                "function" == typeof o && o()
            }
            )),
            null != r && "number" == typeof r && setTimeout((function() {
                $("#luckysheetpopover").fadeOut().remove(),
                "function" == typeof o && o()
            }
            ), r)
        }
    };
    function rhchInit(e, t) {
        if (zoomSetting(),
        null != e) {
            Store.visibledatarow = [],
            Store.rh_height = 0;
            for (var r = 0; r < e; r++) {
                var a = Store.defaultrowlen;
                null != Store.config.rowlen && null != Store.config.rowlen[r] && (a = Store.config.rowlen[r]),
                null == Store.config.rowhidden || null == Store.config.rowhidden[r] ? (Store.rh_height += Math.round((a + 1) * Store.zoomRatio),
                Store.visibledatarow.push(Store.rh_height)) : Store.visibledatarow.push(Store.rh_height)
            }
            Store.rh_height += 80
        }
        if (null != t) {
            Store.visibledatacolumn = [],
            Store.ch_width = 0;
            for (var n = 0; n < t; n++) {
                var o = Store.defaultcollen;
                null != Store.config.columnlen && null != Store.config.columnlen[n] ? o = Store.config.columnlen[n] : null != Store.flowdata[0] && null != Store.flowdata[0][n] && (o > 300 ? o = 300 : o < Store.defaultcollen && (o = Store.defaultcollen),
                o != Store.defaultcollen && (null == Store.config.columnlen && (Store.config.columnlen = {}),
                Store.config.columnlen[n] = o)),
                null == Store.config.colhidden || null == Store.config.colhidden[n] ? (Store.ch_width += Math.round((o + 1) * Store.zoomRatio),
                Store.visibledatacolumn.push(Store.ch_width)) : Store.visibledatacolumn.push(Store.ch_width)
            }
            Store.ch_width += 120
        }
    }
    function zoomSetting() {
        Store.rowHeaderWidth = luckysheetConfigsetting.rowHeaderWidth * Store.zoomRatio,
        Store.columnHeaderHeight = luckysheetConfigsetting.columnHeaderHeight * Store.zoomRatio,
        $("#luckysheet-rows-h").width(Store.rowHeaderWidth - 1.5),
        $("#luckysheet-cols-h-c").height(Store.columnHeaderHeight - 1.5),
        $("#luckysheet-left-top").css({
            width: Store.rowHeaderWidth - 1.5,
            height: Store.columnHeaderHeight - 1.5
        })
    }
    function showloading(e) {
        $("#luckysheet-cell-loading").find("span").text(e).end().show()
    }
    function hideloading() {
        $("#luckysheet-cell-loading").hide()
    }
    var FAILS_ON_PRIMITIVES$1 = fails((function() {
        objectKeys(1)
    }
    ));
    function luckysheetbinary_search(e, t) {
        for (var r = 0, a = e.length - 1; r <= a; ) {
            var n = parseInt((a + r) / 2);
            if (t < e[n] && (0 == n || t >= e[n - 1]))
                return n;
            if (t >= e[n])
                r = n + 1;
            else {
                if (!(t < e[n]))
                    return -1;
                a = n - 1
            }
        }
    }
    function luckysheetorder_search(e, t) {
        for (var r = 0, a = 0, n = -1, o = e.length - 1; r < e.length && o >= 0 && o >= r; ) {
            if (a = e[o],
            t >= (0 == o ? 0 : e[o - 1]) && t < a) {
                n = o;
                break
            }
            if (a = e[r],
            t >= (0 == r ? 0 : e[r - 1]) && t < a) {
                n = r;
                break
            }
            r++,
            o--
        }
        return n
    }
    function luckysheet_searcharray(e, t) {
        var r = e.length - 1;
        return r = e.length < 40 || t <= e[20] || t >= e[r - 20] ? luckysheetorder_search(e, t) : luckysheetbinary_search(e, t)
    }
    function rowLocationByIndex(e) {
        var t;
        return t = Store.visibledatarow[e],
        [0 == e ? 0 : Store.visibledatarow[e - 1], t, e]
    }
    function rowLocation(e) {
        var t = luckysheet_searcharray(Store.visibledatarow, e);
        return -1 == t && e > 0 ? t = Store.visibledatarow.length - 1 : -1 == t && e <= 0 && (t = 0),
        rowLocationByIndex(t)
    }
    function colLocationByIndex(e) {
        var t;
        return t = Store.visibledatacolumn[e],
        [0 == e ? 0 : Store.visibledatacolumn[e - 1], t, e]
    }
    function colLocation(e) {
        var t = luckysheet_searcharray(Store.visibledatacolumn, e);
        return -1 == t && e > 0 ? t = Store.visibledatacolumn.length - 1 : -1 == t && e <= 0 && (t = 0),
        colLocationByIndex(t)
    }
    function mouseposition(e, t) {
        var r = $("#" + Store.container).offset();
        return [e - r.left - Store.rowHeaderWidth, t - r.top - Store.infobarHeight - Store.toolbarHeight - Store.calculatebarHeight - Store.columnHeaderHeight]
    }
    function luckysheetRangeLast(e) {
        var t;
        if (document.createRange)
            if (e.innerHTML != e.innerText || "" == e.innerHTML)
                e.focus(),
                (t = window.getSelection()).selectAllChildren(e),
                t.collapseToEnd();
            else {
                var r = e.innerText.length;
                (t = document.createRange()).selectNodeContents(e),
                t.setStart(e.childNodes[0], r),
                t.collapse(!0);
                var a = window.getSelection();
                a.removeAllRanges(),
                a.addRange(t)
            }
        else
            document.selection && ((t = document.body.createTextRange()).moveToElementText(e),
            t.collapse(!1),
            t.select())
    }
    function hideMenuByCancel(e) {
        e.target.classList.contains("luckysheet-cols-rows-shift-left") || e.target.classList.contains("luckysheet-cols-rows-shift-right") || $(e.target).hasClass("luckysheet-mousedown-cancel") || 0 != $(e.target).filter("[class*='sp-palette']").length || 0 != $(e.target).filter("[class*='sp-thumb']").length || 0 != $(e.target).filter("[class*='sp-']").length || ($("#luckysheet-rightclick-menu").hide(),
        $("#luckysheet-cols-h-hover").hide(),
        $("#luckysheet-cols-menu-btn").hide(),
        $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu").hide(),
        $("body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu").hide(),
        Store.luckysheet_cols_menu_status = !1)
    }
    function selectTextDom(e) {
        if (window.getSelection) {
            var t = document.createRange();
            t.selectNodeContents(e),
            t.startContainer && isInPage(t.startContainer) && (window.getSelection().removeAllRanges(),
            window.getSelection().addRange(t))
        } else if (document.selection) {
            var r = document.body.createTextRange();
            r.moveToElementText(e),
            r.select()
        }
    }
    function selectTextContent(e) {
        if (window.getSelection) {
            var t = document.createRange()
              , r = e.firstChild;
            t.setStart(r, 0),
            t.setEnd(r, r.length),
            t.startContainer && isInPage(t.startContainer) && (window.getSelection().removeAllRanges(),
            window.getSelection().addRange(t))
        } else if (document.selection) {
            var a = document.body.createTextRange();
            a.moveToElementText(e),
            a.select()
        }
    }
    function selectTextContentCross(e, t) {
        if (window.getSelection) {
            var r = document.createRange()
              , a = e.firstChild
              , n = t.firstChild;
            r.setStart(a, 0),
            r.setEnd(n, n.length),
            r.startContainer && isInPage(r.startContainer) && (window.getSelection().removeAllRanges(),
            window.getSelection().addRange(r))
        }
    }
    function selectTextContentCollapse(e, t) {
        if (window.getSelection) {
            var r = document.createRange()
              , a = e.firstChild;
            t > a.length ? t = a.length : t < 0 && (t = 0),
            r.setStart(a, t),
            r.collapse(!0),
            r.startContainer && isInPage(r.startContainer) && (window.getSelection().removeAllRanges(),
            window.getSelection().addRange(r))
        }
    }
    function isInPage(e) {
        return e !== document.body && document.body.contains(e)
    }
    _export({
        target: "Object",
        stat: !0,
        forced: FAILS_ON_PRIMITIVES$1
    }, {
        keys: function(e) {
            return objectKeys(toObject(e))
        }
    });
    var inlineStyleAffectAttribute = {
        bl: 1,
        it: 1,
        ff: 1,
        cl: 1,
        un: 1,
        fs: 1,
        fc: 1
    }
      , inlineStyleAffectCssName = {
        "font-weight": 1,
        "font-style": 1,
        "font-family": 1,
        "text-decoration": 1,
        "border-bottom": 1,
        "font-size": 1,
        color: 1
    };
    function isInlineStringCell(e) {
        return e && null != e.ct && "inlineStr" == e.ct.t && null != e.ct.s && e.ct.s.length > 0
    }
    function isInlineStringCT(e) {
        return null != e && "inlineStr" == e.t && null != e.s && e.s.length > 0
    }
    function updateInlineStringFormat(e, t, r, a) {
        var n, o, l = window.getSelection(), i = (n = "None" == l.type ? Store.inlineStringEditRange : l.getRangeAt(0)).commonAncestorContainer;
        o = "luckysheet-rich-text-editor" == i.id ? $(i) : $(i).closest("#luckysheet-rich-text-editor");
        var s = $(i).closest("#luckysheet-functionbox-cell");
        if (0 == o.length && 0 == s.length && null != Store.inlineStringEditRange && (o = "luckysheet-rich-text-editor" == (i = (n = Store.inlineStringEditRange).commonAncestorContainer).id ? $(i) : $(i).closest("#luckysheet-rich-text-editor"),
        s = $(i).closest("#luckysheet-functionbox-cell")),
        !0 !== n.collapsed) {
            var c = n.endContainer
              , u = n.startContainer
              , h = n.endOffset
              , d = n.startOffset;
            if (o.length > 0) {
                if (u === c) {
                    var f, m = u.parentNode, p = !1, g = m.innerHTML;
                    "<span" != o.html().substr(0, 5) && (p = !0);
                    var y, v, A, b = d, k = h, w = g.length;
                    y = g.substring(0, b),
                    v = g.substring(b, k),
                    A = g.substring(k, w);
                    var x = "";
                    if ("" != y) {
                        var S = m.style.cssText;
                        if (p) {
                            var _ = $(m).closest("#luckysheet-input-box").get(0);
                            null != _ && (S = extendCssText(_.style.cssText, S))
                        }
                        x += "<span style='" + S + "'>" + y + "</span>"
                    }
                    if ("" != v) {
                        var C = getCssText(m.style.cssText, t, r);
                        if (p) {
                            var T = $(m).closest("#luckysheet-input-box").get(0);
                            null != T && (C = extendCssText(T.style.cssText, C))
                        }
                        x += "<span style='" + C + "'>" + v + "</span>"
                    }
                    if ("" != A) {
                        var E = m.style.cssText;
                        if (p) {
                            var I = $(m).closest("#luckysheet-input-box").get(0);
                            null != I && (E = extendCssText(I.style.cssText, E))
                        }
                        x += "<span style='" + E + "'>" + A + "</span>"
                    }
                    "SPAN" == u.parentNode.tagName ? (f = o.find("span").index(m),
                    $(m).replaceWith(x)) : (f = 0,
                    $(m).html(x));
                    var R = 0;
                    R = 0 == b ? f : f + 1,
                    selectTextContent(o.find("span").get(R))
                } else if ("SPAN" == u.parentNode.tagName && "SPAN" == c.parentNode.tagName) {
                    var B, N, F = u.parentNode, P = c.parentNode;
                    B = o.find("span").index(F),
                    N = o.find("span").index(P);
                    var L, O, D, M, U = F.innerHTML, H = P.innerHTML, q = d, z = h, j = H.length;
                    L = U.substring(0, q),
                    O = U.substring(q, U.length),
                    D = H.substring(0, z),
                    M = H.substring(z, j);
                    for (var V, Q, G = o.find("span"), K = (G.slice(B, N + 1),
                    ""), W = 0; W < B; W++) {
                        var Y = G.get(W)
                          , X = Y.innerHTML;
                        K += "<span style='" + Y.style.cssText + "'>" + X + "</span>"
                    }
                    if ("" != L && (K += "<span style='" + F.style.cssText + "'>" + L + "</span>"),
                    "" != O)
                        K += "<span style='" + getCssText(F.style.cssText, t, r) + "'>" + O + "</span>";
                    if (B < N)
                        for (var J = B + 1; J < N; J++) {
                            var Z = G.get(J)
                              , ee = Z.innerHTML;
                            K += "<span style='" + Z.style.cssText + "'>" + ee + "</span>"
                        }
                    if ("" != D)
                        K += "<span style='" + getCssText(P.style.cssText, t, r) + "'>" + D + "</span>";
                    "" != M && (K += "<span style='" + P.style.cssText + "'>" + M + "</span>");
                    for (var te = N + 1; te < G.length; te++) {
                        var re = G.get(te)
                          , ae = re.innerHTML;
                        K += "<span style='" + re.style.cssText + "'>" + ae + "</span>"
                    }
                    o.html(K),
                    0 == q ? (V = B,
                    Q = N) : (V = B + 1,
                    Q = N + 1),
                    selectTextContentCross((G = o.find("span")).get(V), G.get(Q))
                }
            } else
                s.length
        }
    }
    function enterKeyControll(e) {
        var t = window.getSelection();
        if ("None" != t.type) {
            var r, a = t.getRangeAt(0), n = a.commonAncestorContainer;
            r = "luckysheet-rich-text-editor" == n.id ? $(n) : $(n).closest("#luckysheet-rich-text-editor");
            var o = $(n).closest("#luckysheet-functionbox-cell")
              , l = (a.endContainer,
            a.startContainer)
              , i = (a.endOffset,
            a.startOffset);
            if (r.length > 0) {
                var s = l.parentNode;
                "luckysheet-rich-text-editor" == l.id && (0 == (s = $(l).find("span")).length && (l.innerHTML = "<span></span>",
                s = $(l).find("span")),
                i = (s = s.get(s.length - 1)).innerHTML.length),
                !1 === a.collapsed && a.deleteContents();
                var c, u, h, d, f = s.innerHTML, m = i;
                if (c = f.substring(0, m),
                u = f.substring(m, f.length),
                "SPAN" == l.parentNode.tagName) {
                    var p = r.find("span");
                    if ((h = p.index(s)) == p.length - 1 && "" == u) {
                        var g = p[h].innerHTML;
                        d = "\n" == g.substr(g.length - 1, 1) ? "<span style='" + s.style.cssText + "'>" + c + "\n</span>" : "<span style='" + s.style.cssText + "'>" + c + "\n\n</span>"
                    } else
                        d = "<span style='" + s.style.cssText + "'>" + c + "\n" + u + "</span>";
                    $(s).replaceWith(d)
                } else {
                    var y = getFontStyleByCell(e);
                    if (d = "" == u ? "<span style='" + y + "'>" + c + "\n\n</span>" : "<span style='" + y + "'>" + c + "\n" + u + "</span>",
                    "luckysheet-rich-text-editor" == l.id) {
                        $(s).replaceWith(d);
                        var v = r.find("span");
                        h = v.length - 1,
                        i = v.get(h).innerHTML.length - 1
                    } else
                        $(s).html(d),
                        h = 0
                }
                selectTextContentCollapse(r.find("span").get(h), i + 1)
            } else
                o.length
        }
    }
    function updateInlineStringFormatOutside(e, t, r) {
        if (null != e.ct) {
            var a = e.ct.s;
            if (null != a)
                for (var n = 0; n < a.length; n++) {
                    a[n][t] = r
                }
        }
    }
    function convertSpanToShareString(e) {
        for (var t, r = [], a = null, n = 0; n < e.length; n++) {
            var o = e.get(n)
              , l = convertCssToStyleList(o.style.cssText)
              , i = JSON.stringify(l)
              , s = o.innerHTML;
            s = s.replace(/\n/g, "\r\n"),
            i == a ? t.v += s : (l.v = s,
            r.push(l),
            a = i,
            t = l)
        }
        return r
    }
    function convertCssToStyleList(e) {
        if (null == e || 0 == e.length)
            return {};
        var t = e.split(";")
          , r = locale()
          , a = r.fontarray
          , n = r.fontjson
          , o = {
            ff: a[0],
            fc: "#000000",
            fs: 10,
            cl: 0,
            un: 0,
            bl: 0,
            it: 0
        };
        return t.forEach((function(e) {
            var t = textTrim((e = e.toLowerCase()).substr(0, e.indexOf(":")))
              , r = textTrim(e.substr(e.indexOf(":") + 1));
            if ("font-weight" == t && (o.bl = "bold" == r ? 1 : 0),
            "font-style" == t && (o.it = "italic" == r ? 1 : 0),
            "font-family" == t) {
                var a = n[r];
                o.ff = null == a ? r : a
            }
            "font-size" == t && (o.fs = parseInt(r)),
            "color" == t && (o.fc = r),
            "text-decoration" == t && (o.cl = 1),
            "border-bottom" == t && (o.un = 1),
            "lucky-strike" == t && (o.cl = r),
            "lucky-underline" == t && (o.un = r)
        }
        )),
        o
    }
    var luckyToCssName = {
        bl: "font-weight",
        it: "font-style",
        ff: "font-family",
        fs: "font-size",
        fc: "color",
        cl: "text-decoration",
        un: "border-bottom"
    };
    function getClassWithcss(e, t) {
        var r = e.split(";");
        if (null == t || 0 == t.length)
            return e;
        if (e.indexOf(t) > -1)
            for (var a = 0; a < r.length; a++) {
                var n = r[a]
                  , o = textTrim((n = n.toLowerCase()).substr(0, n.indexOf(":")))
                  , l = textTrim(n.substr(n.indexOf(":") + 1));
                if (o == t)
                    return l
            }
        return ""
    }
    function upsetClassWithCss(e, t, r) {
        var a = e.split(";")
          , n = "";
        if (null == t || 0 == t.length)
            return e;
        if (e.indexOf(t) > -1)
            for (var o = 0; o < a.length; o++) {
                var l = a[o]
                  , i = textTrim((l = l.toLowerCase()).substr(0, l.indexOf(":")))
                  , s = textTrim(l.substr(l.indexOf(":") + 1));
                i == t ? n += i + ":" + r + ";" : i.length > 0 && (n += i + ":" + s + ";")
            }
        else
            t.length > 0 && (n = e += t + ":" + r + ";");
        return n
    }
    function removeClassWidthCss(e, t) {
        var r = e.split(";")
          , a = ""
          , n = t;
        if (null == t || 0 == t.length)
            return e;
        if (t in luckyToCssName && (t = luckyToCssName[t]),
        e.indexOf(t) > -1)
            for (var o = 0; o < r.length; o++) {
                var l = r[o]
                  , i = textTrim((l = l.toLowerCase()).substr(0, l.indexOf(":")))
                  , s = textTrim(l.substr(l.indexOf(":") + 1));
                i == t || "cl" == n && "lucky-strike" == i || "un" == n && "lucky-underline" == i || i.length > 0 && (a += i + ":" + s + ";")
            }
        else
            a = e;
        return a
    }
    function getCssText(e, t, r) {
        var a = {};
        if (a[t] = r,
        "un" == t) {
            var n = getClassWithcss(e, "color");
            "" == n && (n = "#000000");
            var o = getClassWithcss(e, "font-size");
            "" == o && (o = 11),
            o = parseInt(o),
            a._fontSize = o,
            a._color = n
        }
        var l = getFontStyleByCell(a, void 0, void 0, !1)
          , i = textTrim(l.substr(0, l.indexOf(":")))
          , s = textTrim(l.substr(l.indexOf(":") + 1));
        return s = s.substr(0, s.length - 1),
        e = upsetClassWithCss(e = removeClassWidthCss(e, t), i, s)
    }
    function extendCssText(e, t) {
        for (var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], a = e.split(";"), n = t.split(";"), o = "", l = {}, i = 0; i < a.length; i++) {
            var s = a[i]
              , c = !0
              , u = textTrim((s = s.toLowerCase()).substr(0, s.indexOf(":")))
              , h = textTrim(s.substr(s.indexOf(":") + 1));
            if (!r || u in inlineStyleAffectCssName) {
                for (var d = 0; d < n.length; d++) {
                    var f = n[d]
                      , m = textTrim((f = f.toLowerCase()).substr(0, f.indexOf(":")))
                      , p = textTrim(f.substr(f.indexOf(":") + 1));
                    u != m || (o += m + ":" + p + ";",
                    c = !1)
                }
                c && (o += u + ":" + h + ";"),
                l[u] = 1
            }
        }
        for (var g = 0; g < n.length; g++) {
            var y = n[g]
              , v = textTrim((y = y.toLowerCase()).substr(0, y.indexOf(":")))
              , A = textTrim(y.substr(y.indexOf(":") + 1));
            r && !(v in inlineStyleAffectCssName) || (v in l || (o += v + ":" + A + ";"))
        }
        return o
    }
    function rowlenByRange(e, t, r, a) {
        var n = $.extend(!0, {}, a);
        null == n.rowlen && (n.rowlen = {}),
        null == n.customHeight && (n.customHeight = {});
        var o = $("#luckysheetTableContent").get(0).getContext("2d");
        o.textBaseline = "top";
        for (var l = t; l <= r; l++)
            if (null == n.rowhidden || null == n.rowhidden[l]) {
                var i = Store.defaultrowlen;
                if (1 != n.customHeight[l]) {
                    delete n.rowlen[l];
                    for (var s = 0; s < e[l].length; s++) {
                        var c = e[l][s];
                        if (null != c && (null != c && (null != c.v || isInlineStringCell(c)))) {
                            var u = getCellTextInfo(c, o, {
                                r: l,
                                c: s,
                                cellWidth: colLocationByIndex(s)[1] - colLocationByIndex(s)[0] - 2
                            })
                              , h = 0;
                            null != u && (h = u.textHeightAll + 2),
                            h > i && (i = h)
                        }
                    }
                    i /= Store.zoomRatio,
                    console.log(i),
                    i != Store.defaultrowlen && (n.rowlen[l] = i)
                }
            }
        return n
    }
    function computeRowlenArr(e, t) {
        for (var r = [], a = 0, n = 0; n < e; n++) {
            var o = Store.defaultrowlen;
            null != t.rowlen && null != t.rowlen[n] && (o = t.rowlen[n]),
            null == t.rowhidden || null == t.rowhidden[n] ? (a += o + 1,
            r.push(a)) : (o = t.rowhidden[n],
            r.push(a))
        }
        return r
    }
    function getMeasureText(e, t, r) {
        var a = Store.measureTextCache[e + "_" + t.font];
        if (null != r && (a = Store.measureTextCache[e + "_" + r]),
        null != a)
            return a;
        if (null != r) {
            t.font;
            t.font = r
        }
        var n = t.measureText(e)
          , o = {};
        if (o.width = n.width,
        null != r && (t.font = r),
        o.actualBoundingBoxDescent = n.actualBoundingBoxDescent,
        o.actualBoundingBoxAscent = n.actualBoundingBoxAscent,
        null == o.actualBoundingBoxDescent || null == o.actualBoundingBoxAscent || isNaN(o.actualBoundingBoxDescent) || isNaN(o.actualBoundingBoxAscent)) {
            var l = "M";
            hasChinaword(e) && (l = "田");
            var i = .8 * menuButton.getTextSize(l, t.font)[1];
            "top" == t.textBaseline ? (o.actualBoundingBoxDescent = i,
            o.actualBoundingBoxAscent = 0) : "middle" == t.textBaseline ? (o.actualBoundingBoxDescent = i / 2,
            o.actualBoundingBoxAscent = i / 2) : (o.actualBoundingBoxDescent = 0,
            o.actualBoundingBoxAscent = i)
        }
        return o.width *= Store.zoomRatio,
        o.actualBoundingBoxDescent *= Store.zoomRatio,
        o.actualBoundingBoxAscent *= Store.zoomRatio,
        Store.measureTextCache[e + "_" + Store.zoomRatio + "_" + t.font] = o,
        o
    }
    function isSupportBoundingBox(e) {
        return null != e.measureText("田").actualBoundingBoxAscent
    }
    function getCellTextInfo(e, t, r) {
        var a = r.cellWidth
          , n = r.cellHeight
          , o = ""
          , l = "";
        null == a && (o = "onlyWidth",
        l = "_");
        var i = Store.measureTextCellInfoCache[r.r + "_" + r.c + l + o];
        if (null != i)
            return i;
        var s = r.space_width
          , c = r.space_height;
        null == s && (s = 2),
        null == c && (c = 2);
        var u = checkstatusByCell(e, "ht")
          , h = checkstatusByCell(e, "vt")
          , d = checkstatusByCell(e, "tb")
          , f = checkstatusByCell(e, "tr")
          , m = checkstatusByCell(e, "rt")
          , p = 1;
        null == m && ("0" == f ? m = 0 : "1" == f ? m = 45 : "4" == f ? m = 90 : "2" == f ? m = 135 : "5" == f && (m = 180),
        null == m && (m = 0)),
        (m > 180 || m < 0) && (m = 0),
        (m = parseInt(m)) > 90 && (m = 90 - m,
        p = 0),
        t.textAlign = "start";
        var g, y, v = {
            values: []
        }, A = "0", b = "0", k = 11, w = !1, x = [];
        if (isInlineStringCell(e)) {
            for (var S = e.ct.s, _ = 0, C = 0; C < S.length; C++) {
                for (var T = S[C], E = luckysheetfontformat(T), I = T.fc, R = T.cl, B = T.un, N = T.v, F = T.fs, P = (N = N.replace(/\r\n/g, "_x000D_").replace(/&#13;&#10;/g, "_x000D_").replace(/\r/g, "_x000D_").replace(/\n/g, "_x000D_")).split("_x000D_"), $ = null, L = 0; L < P.length; L++) {
                    var O = P[L];
                    if ("" == O && L != P.length - 1)
                        x.push({
                            fontset: E,
                            fc: null == I ? "#000" : I,
                            cl: null == R ? 0 : R,
                            un: null == B ? 0 : B,
                            wrap: !0,
                            fs: null == F ? 11 : F
                        }),
                        _++;
                    else {
                        for (var D = O.split(""), M = 0; M < D.length; M++) {
                            var U = D[M];
                            x.push({
                                fontset: E,
                                fc: null == I ? "#000" : I,
                                cl: null == R ? 0 : R,
                                un: null == B ? 0 : B,
                                v: U,
                                si: _,
                                fs: null == F ? 11 : F
                            })
                        }
                        L != P.length - 1 && "" != $ && (x.push({
                            fontset: E,
                            fc: null == I ? "#000" : I,
                            cl: null == R ? 0 : R,
                            un: null == B ? 0 : B,
                            wrap: !0,
                            fs: null == F ? 11 : F
                        }),
                        _++)
                    }
                    $ = O
                }
                _++
            }
            w = !0
        } else if (g = luckysheetfontformat(e),
        t.font = g,
        A = checkstatusByCell(e, "cl"),
        b = checkstatusByCell(e, "un"),
        k = checkstatusByCell(e, "fs"),
        e instanceof Object ? null == (y = e.m) && (y = e.v) : y = e,
        isRealNull(y))
            return null;
        if ("3" == f) {
            t.textBaseline = "top";
            var H = 0
              , q = 0
              , z = 0
              , j = 0
              , V = {}
              , Q = [];
            if (w)
                for (var G = null, K = 0; K < x.length; K++) {
                    var W = x[K]
                      , Y = W.v
                      , X = W.v;
                    if (!0 === W.wrap && (Y = "M",
                    X = "",
                    null != G && !0 !== G.wrap && K < x.length - 1))
                        Q.push(j),
                        j = 0,
                        z += 1,
                        G = W;
                    else {
                        var J = getMeasureText(Y, t, W.fontset)
                          , Z = J.width + s
                          , ee = J.actualBoundingBoxAscent + J.actualBoundingBoxDescent + c;
                        j += ee,
                        "2" != d || W.wrap || j > n && null != V[z] && (Q.push(j - ee),
                        j = ee,
                        z += 1),
                        K == x.length - 1 && Q.push(j),
                        null == V[z] && (V[z] = []);
                        var te = {
                            content: X,
                            style: W,
                            width: Z,
                            height: ee,
                            left: 0,
                            top: 0,
                            colIndex: z,
                            asc: J.actualBoundingBoxAscent,
                            desc: J.actualBoundingBoxDescent,
                            inline: !0
                        };
                        !0 === W.wrap && (te.wrap = !0),
                        V[z].push(te),
                        console.log("normal", K, z, W, G, V),
                        G = W
                    }
                }
            else {
                var re = getMeasureText(y, t)
                  , ae = re.actualBoundingBoxDescent + re.actualBoundingBoxAscent
                  , ne = [];
                (y = y.toString()).length > 1 ? ne = y.split("") : ne.push(y);
                for (var oe = getMeasureText(ne[0], t).width, le = 0; le < ne.length; le++) {
                    var ie = oe + s
                      , se = ae + c;
                    j += se,
                    "2" == d && j > n && null != V[z] && (Q.push(j - se),
                    j = se,
                    z += 1),
                    le == ne.length - 1 && Q.push(j),
                    null == V[z] && (V[z] = []),
                    V[z].push({
                        content: ne[le],
                        style: g,
                        width: ie,
                        height: se,
                        left: 0,
                        top: 0,
                        colIndex: z,
                        asc: re.actualBoundingBoxAscent,
                        desc: re.actualBoundingBoxDescent
                    })
                }
            }
            for (var ce = [], ue = 0; ue < Q.length; ue++) {
                for (var he = Q[ue], de = V[ue], fe = 0, me = 0; me < de.length; me++) {
                    var pe = de[me];
                    fe = Math.max(fe, pe.width)
                }
                ce.push(fe),
                H += fe,
                q = Math.max(q, he)
            }
            if (v.type = "verticalWrap",
            v.textWidthAll = H,
            v.textHeightAll = q,
            "onlyWidth" == o)
                return v;
            for (var ge = 0, ye = 0; ye < Q.length; ye++) {
                for (var ve = Q[ye], Ae = ce[ye], be = V[ye], ke = 0, we = 0; we < be.length; we++) {
                    var xe = be[we]
                      , Se = s + ge;
                    "0" == u ? Se = a / 2 + ge - H / 2 + s * Q.length : "2" == u && (Se = a + ge - H + s);
                    var _e = n - c + ke - ve;
                    "0" == h ? _e = n / 2 + ke - ve / 2 : "1" == h && (_e = c + ke),
                    ke += xe.height,
                    xe.left = Se,
                    xe.top = _e,
                    drawLineInfo(xe, A, b, {
                        width: Ae,
                        height: xe.height,
                        left: Se,
                        top: _e + xe.height - c,
                        asc: xe.height,
                        desc: 0,
                        fs: k
                    }),
                    v.values.push(xe)
                }
                ge += Ae
            }
        } else {
            var Ce = isSupportBoundingBox(t);
            if (t.textBaseline = Ce ? "alphabetic" : "bottom",
            "2" == d || w) {
                var Te = 0
                  , Ee = 0
                  , Ie = 0
                  , Re = 0
                  , Be = {};
                v.rotate = m,
                m = Math.abs(m);
                var Ne, Fe, Pe, $e, Le = 0, Oe = 1, De = null, Me = null;
                if (w)
                    for (; Oe <= x.length; ) {
                        var Ue = x.slice(Le, Oe);
                        if (!0 !== Ue[Ue.length - 1].wrap) {
                            for (var He = 0, qe = 0, ze = 0; ze < Ue.length; ze++) {
                                var je = Ue[ze];
                                null == je.measureText && (je.measureText = getMeasureText(je.v, t, je.fontset)),
                                He += je.measureText.width,
                                qe = Math.max(je.measureText.actualBoundingBoxAscent + je.measureText.actualBoundingBoxDescent)
                            }
                            var Ve = He * Math.cos(m * Math.PI / 180) + qe * Math.sin(m * Math.PI / 180)
                              , Qe = He * Math.sin(m * Math.PI / 180) + qe * Math.cos(m * Math.PI / 180)
                              , Ge = Ue[Ue.length - 1];
                            if (" " != Ge.v && 2 != checkWordByteLength(Ge.v) || (Me = Oe),
                            0 != m)
                                if (console.log(Qe, c, n, Ue, Qe + c > n),
                                Qe + c > n && null != Be[Re] && "2" == d && Oe != x.length)
                                    if (null != Me && Me < Oe) {
                                        for (var Ke = 0; Ke < Me - Le; Ke++) {
                                            var We = Ue[Ke];
                                            Be[Re].push({
                                                content: We.v,
                                                style: We,
                                                width: We.measureText.width,
                                                height: We.measureText.actualBoundingBoxAscent + We.measureText.actualBoundingBoxDescent,
                                                left: 0,
                                                top: 0,
                                                splitIndex: Re,
                                                asc: We.measureText.actualBoundingBoxAscent,
                                                desc: We.measureText.actualBoundingBoxDescent,
                                                inline: !0,
                                                fs: We.fs
                                            })
                                        }
                                        Le = Me,
                                        Oe = Me + 1,
                                        Re += 1,
                                        Me = null
                                    } else {
                                        Le = Oe - 1;
                                        for (var Ye = 0; Ye < Ue.length - 1; Ye++) {
                                            var Xe = Ue[Ye];
                                            Be[Re].push({
                                                content: Xe.v,
                                                style: Xe,
                                                width: Xe.measureText.width,
                                                height: Xe.measureText.actualBoundingBoxAscent + Xe.measureText.actualBoundingBoxDescent,
                                                left: 0,
                                                top: 0,
                                                splitIndex: Re,
                                                asc: Xe.measureText.actualBoundingBoxAscent,
                                                desc: Xe.measureText.actualBoundingBoxDescent,
                                                inline: !0,
                                                fs: Xe.fs
                                            })
                                        }
                                        Re += 1
                                    }
                                else {
                                    if (Oe == x.length) {
                                        null == Be[Re] && (Be[Re] = []);
                                        for (var Je = 0; Je < Ue.length; Je++) {
                                            var Ze = Ue[Je];
                                            Be[Re].push({
                                                content: Ze.v,
                                                style: Ze,
                                                width: Ze.measureText.width,
                                                height: Ze.measureText.actualBoundingBoxAscent + Ze.measureText.actualBoundingBoxDescent,
                                                left: 0,
                                                top: 0,
                                                splitIndex: Re,
                                                asc: Ze.measureText.actualBoundingBoxAscent,
                                                desc: Ze.measureText.actualBoundingBoxDescent,
                                                inline: !0,
                                                fs: Ze.fs
                                            })
                                        }
                                        break
                                    }
                                    null == Be[Re] && (Be[Re] = []),
                                    Oe++
                                }
                            else if (Ve + s > a && null != Be[Re] && "2" == d && Oe != x.length)
                                if (null != Me && Me < Oe) {
                                    for (var et = 0; et < Me - Le; et++) {
                                        var tt = Ue[et];
                                        Be[Re].push({
                                            content: tt.v,
                                            style: tt,
                                            width: tt.measureText.width,
                                            height: tt.measureText.actualBoundingBoxAscent + tt.measureText.actualBoundingBoxDescent,
                                            left: 0,
                                            top: 0,
                                            splitIndex: Re,
                                            asc: tt.measureText.actualBoundingBoxAscent,
                                            desc: tt.measureText.actualBoundingBoxDescent,
                                            inline: !0,
                                            fs: tt.fs
                                        })
                                    }
                                    Le = Me,
                                    Oe = Me + 1,
                                    Re += 1,
                                    Me = null
                                } else {
                                    Le = Oe - 1;
                                    for (var rt = 0; rt < Ue.length - 1; rt++) {
                                        var at = Ue[rt];
                                        Be[Re].push({
                                            content: at.v,
                                            style: at,
                                            width: at.measureText.width,
                                            height: at.measureText.actualBoundingBoxAscent + at.measureText.actualBoundingBoxDescent,
                                            left: 0,
                                            top: 0,
                                            splitIndex: Re,
                                            asc: at.measureText.actualBoundingBoxAscent,
                                            desc: at.measureText.actualBoundingBoxDescent,
                                            inline: !0,
                                            fs: at.fs
                                        })
                                    }
                                    Re += 1
                                }
                            else {
                                if (Oe == x.length) {
                                    null == Be[Re] && (Be[Re] = []);
                                    for (var nt = 0; nt < Ue.length; nt++) {
                                        var ot = Ue[nt];
                                        Be[Re].push({
                                            content: ot.v,
                                            style: ot,
                                            width: ot.measureText.width,
                                            height: ot.measureText.actualBoundingBoxAscent + ot.measureText.actualBoundingBoxDescent,
                                            left: 0,
                                            top: 0,
                                            splitIndex: Re,
                                            asc: ot.measureText.actualBoundingBoxAscent,
                                            desc: ot.measureText.actualBoundingBoxDescent,
                                            inline: !0,
                                            fs: ot.fs
                                        })
                                    }
                                    break
                                }
                                null == Be[Re] && (Be[Re] = []),
                                Oe++
                            }
                        } else {
                            if (Le = Oe,
                            Ue.length > 1)
                                for (var lt = 0; lt < Ue.length - 1; lt++) {
                                    var it = Ue[lt]
                                      , st = {
                                        content: it.v,
                                        style: it,
                                        width: it.measureText.width,
                                        height: it.measureText.actualBoundingBoxAscent + it.measureText.actualBoundingBoxDescent,
                                        left: 0,
                                        top: 0,
                                        splitIndex: Re,
                                        asc: it.measureText.actualBoundingBoxAscent,
                                        desc: it.measureText.actualBoundingBoxDescent,
                                        inline: !0,
                                        fs: it.fs
                                    };
                                    Be[Re].push(st)
                                }
                            if (1 == Ue.length || Oe == x.length) {
                                var ct = Ue[0]
                                  , ut = getMeasureText("M", t, ct.fontset);
                                null == Be[Re] && (Be[Re] = []),
                                Be[Re].push({
                                    content: "",
                                    style: ct,
                                    width: ut.width,
                                    height: ut.actualBoundingBoxAscent + ut.actualBoundingBoxDescent,
                                    left: 0,
                                    top: 0,
                                    splitIndex: Re,
                                    asc: ut.actualBoundingBoxAscent,
                                    desc: ut.actualBoundingBoxDescent,
                                    inline: !0,
                                    wrap: !0,
                                    fs: ct.fs
                                })
                            }
                            Re += 1,
                            Oe++
                        }
                    }
                else
                    for (y = y.toString(); Oe <= y.length; ) {
                        var ht = y.substring(Le, Oe)
                          , dt = getMeasureText(ht, t)
                          , ft = dt.width
                          , mt = dt.actualBoundingBoxAscent + dt.actualBoundingBoxDescent
                          , pt = ft * Math.cos(m * Math.PI / 180) + mt * Math.sin(m * Math.PI / 180)
                          , gt = ft * Math.sin(m * Math.PI / 180) + mt * Math.cos(m * Math.PI / 180)
                          , yt = ht.substr(ht.length - 1, 1);
                        if (" " != yt && 2 != checkWordByteLength(yt) || null != $e && (De = {
                            index: Oe,
                            str: Ne,
                            width: Pe,
                            height: Fe,
                            asc: $e.actualBoundingBoxAscent,
                            desc: $e.actualBoundingBoxDescent
                        }),
                        0 != m)
                            if (gt + c > n && null != Be[Re] && Oe != y.length)
                                null != De && De.index < Oe ? (Le = De.index,
                                Oe = De.index + 1,
                                Be[Re].push({
                                    content: De.str,
                                    style: g,
                                    width: De.width,
                                    height: De.height,
                                    left: 0,
                                    top: 0,
                                    splitIndex: Re,
                                    asc: De.asc,
                                    desc: De.desc,
                                    fs: k
                                }),
                                Re += 1,
                                De = null) : (Le = Oe - 1,
                                Be[Re].push({
                                    content: Ne,
                                    style: g,
                                    left: 0,
                                    top: 0,
                                    splitIndex: Re,
                                    height: Fe,
                                    width: Pe,
                                    asc: dt.actualBoundingBoxAscent,
                                    desc: dt.actualBoundingBoxDescent,
                                    fs: k
                                }),
                                Re += 1);
                            else {
                                if (Oe == y.length) {
                                    null == Be[Re] && (Be[Re] = []),
                                    Be[Re].push({
                                        content: ht,
                                        style: g,
                                        left: 0,
                                        top: 0,
                                        splitIndex: Re,
                                        height: mt,
                                        width: ft,
                                        asc: dt.actualBoundingBoxAscent,
                                        desc: dt.actualBoundingBoxDescent,
                                        fs: k
                                    });
                                    break
                                }
                                null == Be[Re] && (Be[Re] = []),
                                Oe++
                            }
                        else if (pt + s > a && null != Be[Re] && Oe != y.length)
                            null != De && De.index < Oe ? (Le = De.index,
                            Oe = De.index + 1,
                            Be[Re].push({
                                content: De.str,
                                style: g,
                                width: De.width,
                                height: De.height,
                                left: 0,
                                top: 0,
                                splitIndex: Re,
                                asc: De.asc,
                                desc: De.desc,
                                fs: k
                            }),
                            Re += 1,
                            De = null) : (De = null,
                            Le = Oe - 1,
                            Be[Re].push({
                                content: Ne,
                                style: g,
                                width: Pe,
                                height: Fe,
                                left: 0,
                                top: 0,
                                splitIndex: Re,
                                asc: dt.actualBoundingBoxAscent,
                                desc: dt.actualBoundingBoxDescent,
                                fs: k
                            }),
                            Re += 1);
                        else {
                            if (Oe == y.length) {
                                null == Be[Re] && (Be[Re] = []),
                                Be[Re].push({
                                    content: ht,
                                    style: g,
                                    width: ft,
                                    height: mt,
                                    left: 0,
                                    top: 0,
                                    splitIndex: Re,
                                    asc: dt.actualBoundingBoxAscent,
                                    desc: dt.actualBoundingBoxDescent,
                                    fs: k
                                });
                                break
                            }
                            null == Be[Re] && (Be[Re] = []),
                            Oe++
                        }
                        Ne = ht,
                        Fe = mt,
                        Pe = ft,
                        $e = dt
                    }
                for (var vt = [], At = Object.keys(Be).length, bt = 0; bt < At; bt++) {
                    var kt = Be[bt];
                    if (null != kt) {
                        for (var wt, xt = 0, St = 0, _t = 0, Ct = 0, Tt = 0, Et = 0; Et < kt.length; Et++) {
                            var It = kt[Et];
                            xt += It.width,
                            St = Math.max(St, It.height - (Ce ? It.desc : 0)),
                            _t = Math.max(_t, Ce ? It.desc : 0),
                            Ct = Math.max(Ct, It.asc),
                            Tt++
                        }
                        wt = St / 2,
                        0 != m ? (St += wt,
                        Ie = Math.max(Ie, xt),
                        Ee += St) : (St += wt,
                        Te = Math.max(Te, xt),
                        Ee += St),
                        vt.push({
                            width: xt,
                            height: St,
                            desc: _t,
                            asc: Ct,
                            lineHeight: wt,
                            wordCount: Tt
                        })
                    }
                }
                var Rt = 0
                  , Bt = 0
                  , Nt = m * Math.PI / 180
                  , Ft = vt[At - 1]
                  , Pt = Ft.lineHeight
                  , $t = (Ee = Ee - Pt + Ft.desc) / Math.sin(Nt) + Ie * Math.cos(Nt)
                  , Lt = Ie * Math.sin(Nt)
                  , Ot = 0;
                if (0 != m ? (1 == At ? (Te = Ie + Ee / Math.tan(Nt) * 2,
                Ot = Ee / Math.tan(Nt)) : Te = Ie + Ee / Math.tan(Nt),
                v.textWidthAll = $t,
                v.textHeightAll = Lt) : (v.textWidthAll = Te,
                v.textHeightAll = Ee),
                "onlyWidth" == o)
                    return v;
                if (0 != m && "1" == p) {
                    t.textAlign = "end";
                    for (var Dt = 0; Dt < At; Dt++) {
                        var Mt = Be[Dt];
                        if (null != Mt) {
                            var Ut = vt[Dt];
                            Bt = 0;
                            for (var Ht = Mt.length - 1; Ht >= 0; Ht--) {
                                var qt = Mt[Ht]
                                  , zt = void 0
                                  , jt = void 0;
                                if (0 != m) {
                                    var Vt, Qt = Rt + Ut.asc;
                                    Vt = Rt / Math.tan(Nt) - Bt + Ie,
                                    "0" == u ? "0" == h ? (zt = Vt + a / 2 - Te / 2 + Pt * Math.cos(Nt) / 2,
                                    jt = Qt + n / 2 - Ee / 2 - Pt * Math.cos(Nt) / 2) : "1" == h ? (zt = Vt + a / 2 - Te / 2,
                                    jt = Qt - (Ee / 2 - Lt / 2)) : "2" == h && (zt = Vt + a / 2 - Te / 2 + Pt * Math.cos(Nt),
                                    jt = Qt + n - Lt / 2 - Ee / 2 - Pt * Math.cos(Nt)) : "1" == u ? "0" == h ? (zt = Vt - Lt * Math.sin(Nt) / 2 + Pt * Math.cos(Nt) / 2,
                                    jt = Qt + n / 2 + Lt * Math.cos(Nt) / 2 - Pt * Math.cos(Nt) / 2) : "1" == h ? (zt = Vt - Lt * Math.sin(Nt),
                                    jt = Qt + Lt * Math.cos(Nt)) : "2" == h && (zt = Vt + Pt * Math.cos(Nt),
                                    jt = Qt + n - Pt * Math.cos(Nt)) : "2" == u && ("0" == h ? (zt = Vt + a - $t / 2 - (Ie / 2 + Ee / 2 / Math.tan(Nt)) + Pt * Math.cos(Nt) / 2,
                                    jt = Qt + n / 2 - Ee / 2 - Pt * Math.cos(Nt) / 2) : "1" == h ? (zt = Vt + a - Te + Ot,
                                    jt = Qt - Ee) : "2" == h && (zt = Vt + a - $t * Math.cos(Nt) + Pt * Math.cos(Nt),
                                    jt = Qt + n - $t * Math.sin(Nt) - Pt * Math.cos(Nt)))
                                }
                                qt.left = zt,
                                qt.top = jt,
                                drawLineInfo(qt, A, b, {
                                    width: qt.width,
                                    height: qt.height,
                                    left: zt - qt.width,
                                    top: jt,
                                    asc: Ut.asc,
                                    desc: Ut.desc,
                                    fs: qt.fs
                                }),
                                v.values.push(qt),
                                Bt += qt.width
                            }
                            Rt += Ut.height
                        }
                    }
                } else
                    for (var Gt = 0; Gt < At; Gt++) {
                        var Kt = Be[Gt];
                        if (null != Kt) {
                            var Wt = vt[Gt];
                            Bt = 0;
                            for (var Yt = 0; Yt < Kt.length; Yt++) {
                                var Xt = Kt[Yt]
                                  , Jt = void 0
                                  , Zt = void 0;
                                if (0 != m) {
                                    var er, tr = Rt + Wt.asc;
                                    er = (Ee - Rt) / Math.tan(Nt) + Bt,
                                    "0" == u ? "0" == h ? (Jt = er + a / 2 - Te / 2 - Pt * Math.cos(Nt) / 2,
                                    Zt = tr + n / 2 - Ee / 2 + Pt * Math.cos(Nt) / 2) : "1" == h ? (Jt = er + a / 2 - Te / 2 - Pt * Math.cos(Nt) / 2,
                                    Zt = tr - (Ee / 2 - Lt / 2) + Pt * Math.cos(Nt) / 2) : "2" == h && (Jt = er + a / 2 - Te / 2 - Pt * Math.cos(Nt),
                                    Zt = tr + n - Lt / 2 - Ee / 2 - Pt * Math.cos(Nt)) : "1" == u ? "0" == h ? (Jt = er - Lt * Math.sin(Nt) / 2 - Pt * Math.cos(Nt) / 2,
                                    Zt = tr - Ee + n / 2 - Lt * Math.cos(Nt) / 2 - Pt * Math.cos(Nt) / 2) : "1" == h ? (Jt = er,
                                    Zt = tr - Ee) : "2" == h && (Jt = er - Lt * Math.sin(Nt) - Pt * Math.cos(Nt),
                                    Zt = tr - Ee + n - Lt * Math.cos(Nt) - Pt * Math.cos(Nt)) : "2" == u && ("0" == h ? (Jt = er + a - $t / 2 - Te / 2 - Pt * Math.cos(Nt) / 2,
                                    Zt = tr + n / 2 - Ee / 2 - Pt * Math.cos(Nt) / 2) : "1" == h ? (Jt = er + a - $t * Math.cos(Nt),
                                    Zt = tr + Lt * Math.cos(Nt)) : "2" == h && (Jt = er + a - Te - Pt * Math.cos(Nt) + Ot,
                                    Zt = tr + n - Pt * Math.cos(Nt))),
                                    drawLineInfo(Xt, A, b, {
                                        width: Xt.width,
                                        height: Xt.height,
                                        left: Jt,
                                        top: Zt,
                                        asc: Wt.asc,
                                        desc: Wt.desc,
                                        fs: Xt.fs
                                    })
                                } else
                                    Jt = s + Bt,
                                    "0" == u ? Jt = a / 2 + Bt - Wt.width / 2 : "2" == u && (Jt = a + Bt - Wt.width),
                                    Zt = n - c + Rt + Wt.asc - Ee,
                                    "0" == h ? Zt = n / 2 + Rt - Ee / 2 + Wt.asc : "1" == h && (Zt = c + Rt + Wt.asc),
                                    drawLineInfo(Xt, A, b, {
                                        width: Xt.width,
                                        height: Xt.height,
                                        left: Jt,
                                        top: Zt,
                                        asc: Wt.asc,
                                        desc: Wt.desc,
                                        fs: Xt.fs
                                    });
                                Xt.left = Jt,
                                Xt.top = Zt,
                                v.values.push(Xt),
                                Bt += Xt.width
                            }
                            Rt += Wt.height
                        }
                    }
                v.type = "plainWrap",
                0 != m && ("0" == u ? "0" == h ? (v.textLeftAll = a / 2,
                v.textTopAll = n / 2) : "1" == h ? (v.textLeftAll = a / 2,
                v.textTopAll = Lt / 2) : "2" == h && (v.textLeftAll = a / 2,
                v.textTopAll = n - Lt / 2) : "1" == u ? "0" == h ? (v.textLeftAll = 0,
                v.textTopAll = n / 2) : "1" == h ? (v.textLeftAll = 0,
                v.textTopAll = 0) : "2" == h && (v.textLeftAll = 0,
                v.textTopAll = n) : "2" == u && ("0" == h ? (v.textLeftAll = a - $t / 2,
                v.textTopAll = n / 2) : "1" == h ? (v.textLeftAll = a,
                v.textTopAll = 0) : "2" == h && (v.textLeftAll = a,
                v.textTopAll = n)))
            } else {
                var rr = getMeasureText(y, t)
                  , ar = rr.width
                  , nr = rr.actualBoundingBoxDescent + rr.actualBoundingBoxAscent;
                v.rotate = m;
                var or = (m = Math.abs(m)) * Math.PI / 180
                  , lr = ar * Math.cos(or) + nr * Math.sin(or)
                  , ir = ar * Math.sin(or) + nr * Math.cos(or);
                if (v.textHeightAll = 0 != m ? ir : ir + nr / 2 - rr.actualBoundingBoxDescent - c,
                v.textWidthAll = lr,
                "onlyWidth" == o)
                    return v;
                var sr = lr
                  , cr = ir
                  , ur = s + nr * Math.sin(or) * p;
                "0" == u ? ur = a / 2 - sr / 2 + nr * Math.sin(or) * p : "2" == u && (ur = a - s - sr + nr * Math.sin(or) * p);
                var hr = n - c - cr + rr.actualBoundingBoxAscent * Math.cos(or) + ar * Math.sin(or) * p;
                "0" == h ? hr = n / 2 - cr / 2 + rr.actualBoundingBoxAscent * Math.cos(or) + ar * Math.sin(or) * p : "1" == h && (hr = c + rr.actualBoundingBoxAscent * Math.cos(or) + ar * Math.sin(or) * p),
                v.type = "plain";
                var dr = {
                    content: y,
                    style: g,
                    width: sr,
                    height: cr,
                    left: ur,
                    top: hr
                };
                drawLineInfo(dr, A, b, {
                    width: ar,
                    height: nr,
                    left: ur,
                    top: hr,
                    asc: rr.actualBoundingBoxAscent,
                    desc: rr.actualBoundingBoxDescent,
                    fs: k
                }),
                v.values.push(dr),
                v.textLeftAll = ur,
                v.textTopAll = hr,
                v.asc = rr.actualBoundingBoxAscent,
                v.desc = rr.actualBoundingBoxDescent
            }
        }
        return v
    }
    function drawLineInfo(e, t, r, a) {
        var n = a.left
          , o = a.top
          , l = a.width
          , i = (a.height,
        a.asc)
          , s = a.desc
          , c = a.fs;
        if (!0 !== e.wrap && (1 == e.inline && null != e.style && (t = e.style.cl,
        r = e.style.un),
        "0" != t && (e.cancelLine = {},
        e.cancelLine.startX = n,
        e.cancelLine.startY = o - i / 2 + 1,
        e.cancelLine.endX = n + l,
        e.cancelLine.endY = o - i / 2 + 1,
        e.cancelLine.fs = c),
        "0" != r)) {
            if (e.underLine = [],
            "1" == r || "2" == r) {
                var u = {};
                u.startX = n,
                u.startY = o,
                u.endX = n + l,
                u.endY = o,
                u.fs = c,
                e.underLine.push(u)
            }
            if ("2" == r) {
                var h = {};
                h.startX = n,
                h.startY = o + s,
                h.endX = n + l,
                h.endY = o + s,
                h.fs = c,
                e.underLine.push(h)
            }
            if ("3" == r || "4" == r) {
                var d = {};
                d.startX = n,
                d.startY = o + s,
                d.endX = n + l,
                d.endY = o + s,
                d.fs = c,
                e.underLine.push(d)
            }
            if ("4" == r) {
                var f = {};
                f.startX = n,
                f.startY = o + s + 2,
                f.endX = n + l,
                f.endY = o + s + 2,
                f.fs = c,
                e.underLine.push(f)
            }
        }
    }
    var min$5 = Math.min
      , nativeLastIndexOf = [].lastIndexOf
      , NEGATIVE_ZERO$1 = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0
      , STRICT_METHOD$4 = arrayMethodIsStrict("lastIndexOf")
      , USES_TO_LENGTH$8 = arrayMethodUsesToLength("indexOf", {
        ACCESSORS: !0,
        1: 0
    })
      , FORCED$4 = NEGATIVE_ZERO$1 || !STRICT_METHOD$4 || !USES_TO_LENGTH$8
      , arrayLastIndexOf = FORCED$4 ? function(e) {
        if (NEGATIVE_ZERO$1)
            return nativeLastIndexOf.apply(this, arguments) || 0;
        var t = toIndexedObject(this)
          , r = toLength(t.length)
          , a = r - 1;
        for (arguments.length > 1 && (a = min$5(a, toInteger(arguments[1]))),
        a < 0 && (a = r + a); a >= 0; a--)
            if (a in t && t[a] === e)
                return a || 0;
        return -1
    }
    : nativeLastIndexOf;
    function isdatetime(e) {
        return !(null == e || e.toString().length < 5) && !!function(e) {
            if (!/^(\d{4})-(\d{1,2})-(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/.test(e) && !/^(\d{4})\/(\d{1,2})\/(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/.test(e))
                return !1;
            var t = RegExp.$1
              , r = RegExp.$2
              , a = RegExp.$3;
            if (t < 1900)
                return !1;
            if (r > 12)
                return !1;
            if (a > 31)
                return !1;
            if (2 == r) {
                if (29 == new Date(t,1,29).getDate() && a > 29)
                    return !1;
                if (29 != new Date(t,1,29).getDate() && a > 28)
                    return !1
            }
            return !0
        }(e)
    }
    function diff(e, t) {
        return moment(e).diff(moment(t))
    }
    function isdatatypemulti(e) {
        var t = {};
        return isdatetime(e) && (t.date = !0),
        isNaN(parseFloat(e)) || hasChinaword(e) || (t.num = !0),
        t
    }
    function isdatatype(e) {
        var t = "string";
        return isdatetime(e) ? t = "date" : isNaN(parseFloat(e)) || hasChinaword(e) || (t = "num"),
        t
    }
    _export({
        target: "Array",
        proto: !0,
        forced: arrayLastIndexOf !== [].lastIndexOf
    }, {
        lastIndexOf: arrayLastIndexOf
    });
    var SSF = {}
      , make_ssf = function(e) {
        function t(e) {
            for (var t = "", r = e.length - 1; r >= 0; )
                t += e.charAt(r--);
            return t
        }
        function r(e, t) {
            for (var r = ""; r.length < t; )
                r += e;
            return r
        }
        function a(e, t) {
            var a = "" + e;
            return a.length >= t ? a : r("0", t - a.length) + a
        }
        function n(e, t) {
            var a = "" + e;
            return a.length >= t ? a : r(" ", t - a.length) + a
        }
        function o(e, t) {
            var a = "" + e;
            return a.length >= t ? a : a + r(" ", t - a.length)
        }
        e.version = "0.11.2";
        var l = Math.pow(2, 32);
        function i(e, t) {
            return e > l || e < -l ? function(e, t) {
                var a = "" + Math.round(e);
                return a.length >= t ? a : r("0", t - a.length) + a
            }(e, t) : function(e, t) {
                var a = "" + e;
                return a.length >= t ? a : r("0", t - a.length) + a
            }(Math.round(e), t)
        }
        function s(e, t) {
            return t = t || 0,
            e.length >= 7 + t && 103 == (32 | e.charCodeAt(t)) && 101 == (32 | e.charCodeAt(t + 1)) && 110 == (32 | e.charCodeAt(t + 2)) && 101 == (32 | e.charCodeAt(t + 3)) && 114 == (32 | e.charCodeAt(t + 4)) && 97 == (32 | e.charCodeAt(t + 5)) && 108 == (32 | e.charCodeAt(t + 6))
        }
        var c = [["Sun", "Sunday"], ["Mon", "Monday"], ["Tue", "Tuesday"], ["Wed", "Wednesday"], ["Thu", "Thursday"], ["Fri", "Friday"], ["Sat", "Saturday"]]
          , u = [["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 h(e) {
            e[0] = "General",
            e[1] = "0",
            e[2] = "0.00",
            e[3] = "#,##0",
            e[4] = "#,##0.00",
            e[9] = "0%",
            e[10] = "0.00%",
            e[11] = "0.00E+00",
            e[12] = "# ?/?",
            e[13] = "# ??/??",
            e[14] = "m/d/yy",
            e[15] = "d-mmm-yy",
            e[16] = "d-mmm",
            e[17] = "mmm-yy",
            e[18] = "h:mm AM/PM",
            e[19] = "h:mm:ss AM/PM",
            e[20] = "h:mm",
            e[21] = "h:mm:ss",
            e[22] = "m/d/yy h:mm",
            e[37] = "#,##0 ;(#,##0)",
            e[38] = "#,##0 ;[Red](#,##0)",
            e[39] = "#,##0.00;(#,##0.00)",
            e[40] = "#,##0.00;[Red](#,##0.00)",
            e[45] = "mm:ss",
            e[46] = "[h]:mm:ss",
            e[47] = "mmss.0",
            e[48] = "##0.0E+0",
            e[49] = "@",
            e[56] = '"上午/下午 "hh"時"mm"分"ss"秒 "',
            e[65535] = "General"
        }
        var d = {};
        h(d);
        var f = []
          , m = 0;
        for (m = 5; m <= 8; ++m)
            f[m] = 32 + m;
        for (m = 23; m <= 26; ++m)
            f[m] = 0;
        for (m = 27; m <= 31; ++m)
            f[m] = 14;
        for (m = 50; m <= 58; ++m)
            f[m] = 14;
        for (m = 59; m <= 62; ++m)
            f[m] = m - 58;
        for (m = 67; m <= 68; ++m)
            f[m] = m - 58;
        for (m = 72; m <= 75; ++m)
            f[m] = m - 58;
        for (m = 67; m <= 68; ++m)
            f[m] = m - 57;
        for (m = 76; m <= 78; ++m)
            f[m] = m - 56;
        for (m = 79; m <= 81; ++m)
            f[m] = m - 34;
        var p = [];
        function g(e, t, r) {
            for (var a = e < 0 ? -1 : 1, n = e * a, o = 0, l = 1, i = 0, s = 1, c = 0, u = 0, h = Math.floor(n); c < t && (i = (h = Math.floor(n)) * l + o,
            u = h * c + s,
            !(n - h < 5e-8)); )
                n = 1 / (n - h),
                o = l,
                l = i,
                s = c,
                c = u;
            if (u > t && (c > t ? (u = s,
            i = o) : (u = c,
            i = l)),
            !r)
                return [0, a * i, u];
            var d = Math.floor(a * i / u);
            return [d, a * i - d * u, u]
        }
        function y(e, t, r) {
            if (e > 2958465 || e < 0)
                return null;
            var a = 0 | e
              , n = Math.floor(86400 * (e - a))
              , o = 0
              , l = []
              , i = {
                D: a,
                T: n,
                u: 86400 * (e - a) - n,
                y: 0,
                m: 0,
                d: 0,
                H: 0,
                M: 0,
                S: 0,
                q: 0
            };
            if (Math.abs(i.u) < 1e-6 && (i.u = 0),
            t && t.date1904 && (a += 1462),
            i.u > .9999 && (i.u = 0,
            86400 == ++n && (i.T = n = 0,
            ++a,
            ++i.D)),
            60 === a)
                l = r ? [1317, 10, 29] : [1900, 2, 29],
                o = 3;
            else if (0 === a)
                l = r ? [1317, 8, 29] : [1900, 1, 0],
                o = 6;
            else {
                a > 60 && --a;
                var s = new Date(1900,0,1);
                s.setDate(s.getDate() + a - 1),
                l = [s.getFullYear(), s.getMonth() + 1, s.getDate()],
                o = s.getDay(),
                a < 60 && (o = (o + 6) % 7),
                r && (o = function(e, t) {
                    t[0] -= 581;
                    var r = e.getDay();
                    e < 60 && (r = (r + 6) % 7);
                    return r
                }(s, l))
            }
            return i.y = l[0],
            i.m = l[1],
            i.d = l[2],
            i.S = n % 60,
            n = Math.floor(n / 60),
            i.M = n % 60,
            n = Math.floor(n / 60),
            i.H = n,
            i.q = o,
            i
        }
        p[5] = p[63] = '"$"#,##0_);\\("$"#,##0\\)',
        p[6] = p[64] = '"$"#,##0_);[Red]\\("$"#,##0\\)',
        p[7] = p[65] = '"$"#,##0.00_);\\("$"#,##0.00\\)',
        p[8] = p[66] = '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
        p[41] = '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',
        p[42] = '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',
        p[43] = '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',
        p[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',
        e.parse_date_code = y;
        var v = new Date(1899,11,31,0,0,0)
          , A = v.getTime()
          , b = new Date(1900,2,1,0,0,0);
        function k(e, t) {
            var r = e.getTime();
            return t ? r -= 1262304e5 : e >= b && (r += 864e5),
            (r - (A + 6e4 * (e.getTimezoneOffset() - v.getTimezoneOffset()))) / 864e5
        }
        e._general_int = function(e) {
            return e.toString(10)
        }
        ;
        var w = function() {
            var e = /(?:\.0*|(\.\d*[1-9])0+)$/;
            function t(t) {
                return -1 == t.indexOf(".") ? t : t.replace(e, "$1")
            }
            var r = /(?:\.0*|(\.\d*[1-9])0+)[Ee]/
              , a = /(E[+-])(\d)$/;
            return function(e) {
                var n, o = Math.floor(Math.log(Math.abs(e)) * Math.LOG10E);
                return n = o >= -4 && o <= -1 ? e.toPrecision(10 + o) : Math.abs(o) <= 9 ? function(e) {
                    var r = e < 0 ? 12 : 11
                      , a = t(e.toFixed(12));
                    return a.length <= r || (a = e.toPrecision(10)).length <= r ? a : e.toExponential(5)
                }(e) : 10 === o ? e.toFixed(10).substr(0, 12) : function(e) {
                    var r = t(e.toFixed(11));
                    return r.length > (e < 0 ? 12 : 11) || "0" === r || "-0" === r ? e.toPrecision(6) : r
                }(e),
                t(function(e) {
                    return -1 == e.indexOf("E") ? e : e.replace(r, "$1E").replace(a, "$10$2")
                }(n.toUpperCase()))
            }
        }();
        function x(e, t) {
            switch (_typeof(e)) {
            case "string":
                return e;
            case "boolean":
                return e ? "TRUE" : "FALSE";
            case "number":
                return (0 | e) === e ? e.toString(10) : w(e);
            case "undefined":
                return "";
            case "object":
                if (null == e)
                    return "";
                if (e instanceof Date)
                    return P(14, k(e, t && t.date1904), t)
            }
            throw new Error("unsupported value in General format: " + e)
        }
        function S(e, t, r, n) {
            var o, l = "", i = 0, s = 0, h = r.y, d = 0;
            switch (e) {
            case 98:
                h = r.y + 543;
            case 121:
                switch (t.length) {
                case 1:
                case 2:
                    o = h % 100,
                    d = 2;
                    break;
                default:
                    o = h % 1e4,
                    d = 4
                }
                break;
            case 109:
                switch (t.length) {
                case 1:
                case 2:
                    o = r.m,
                    d = t.length;
                    break;
                case 3:
                    return u[r.m - 1][1];
                case 5:
                    return u[r.m - 1][0];
                default:
                    return u[r.m - 1][2]
                }
                break;
            case 100:
                switch (t.length) {
                case 1:
                case 2:
                    o = r.d,
                    d = t.length;
                    break;
                case 3:
                    return c[r.q][0];
                default:
                    return c[r.q][1]
                }
                break;
            case 104:
                switch (t.length) {
                case 1:
                case 2:
                    o = 1 + (r.H + 11) % 12,
                    d = t.length;
                    break;
                default:
                    throw "bad hour format: " + t
                }
                break;
            case 72:
                switch (t.length) {
                case 1:
                case 2:
                    o = r.H,
                    d = t.length;
                    break;
                default:
                    throw "bad hour format: " + t
                }
                break;
            case 77:
                switch (t.length) {
                case 1:
                case 2:
                    o = r.M,
                    d = t.length;
                    break;
                default:
                    throw "bad minute format: " + t
                }
                break;
            case 115:
                if ("s" != t && "ss" != t && ".0" != t && ".00" != t && ".000" != t)
                    throw "bad second format: " + t;
                return 0 !== r.u || "s" != t && "ss" != t ? (s = n >= 2 ? 3 === n ? 1e3 : 100 : 1 === n ? 10 : 1,
                (i = Math.round(s * (r.S + r.u))) >= 60 * s && (i = 0),
                "s" === t ? 0 === i ? "0" : "" + i / s : (l = a(i, 2 + n),
                "ss" === t ? l.substr(0, 2) : "." + l.substr(2, t.length - 1))) : a(r.S, t.length);
            case 90:
                switch (t) {
                case "[h]":
                case "[hh]":
                    o = 24 * r.D + r.H;
                    break;
                case "[m]":
                case "[mm]":
                    o = 60 * (24 * r.D + r.H) + r.M;
                    break;
                case "[s]":
                case "[ss]":
                    o = 60 * (60 * (24 * r.D + r.H) + r.M) + Math.round(r.S + r.u);
                    break;
                default:
                    throw "bad abstime format: " + t
                }
                d = 3 === t.length ? 1 : 2;
                break;
            case 101:
                o = h,
                d = 1
            }
            return d > 0 ? a(o, d) : ""
        }
        function _(e) {
            if (e.length <= 3)
                return e;
            for (var t = e.length % 3, r = e.substr(0, t); t != e.length; t += 3)
                r += (r.length > 0 ? "," : "") + e.substr(t, 3);
            return r
        }
        e._general_num = w,
        e._general = x;
        var C = function() {
            var e = /%/g;
            var l = /# (\?+)( ?)\/( ?)(\d+)/;
            var s = /^#*0*\.([0#]+)/
              , c = /\).*[0#]/
              , u = /\(###\) ###\\?-####/;
            function h(e) {
                for (var t, r = "", a = 0; a != e.length; ++a)
                    switch (t = e.charCodeAt(a)) {
                    case 35:
                        break;
                    case 63:
                        r += " ";
                        break;
                    case 48:
                        r += "0";
                        break;
                    default:
                        r += String.fromCharCode(t)
                    }
                return r
            }
            function d(e, t) {
                var r = Math.pow(10, t);
                return "" + Math.round(e * r) / r
            }
            function f(e, t) {
                var r = e - Math.floor(e)
                  , a = Math.pow(10, t);
                return t < ("" + Math.round(r * a)).length ? 0 : Math.round(r * a)
            }
            function m(p, y, v) {
                if (40 === p.charCodeAt(0) && !y.match(c)) {
                    var A = y.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
                    return v >= 0 ? m("n", A, v) : "(" + m("n", A, -v) + ")"
                }
                if (44 === y.charCodeAt(y.length - 1))
                    return function(e, t, r) {
                        for (var a = t.length - 1; 44 === t.charCodeAt(a - 1); )
                            --a;
                        return C(e, t.substr(0, a), r / Math.pow(10, 3 * (t.length - a)))
                    }(p, y, v);
                if (-1 !== y.indexOf("%"))
                    return function(t, a, n) {
                        var o = a.replace(e, "")
                          , l = a.length - o.length;
                        return C(t, o, n * Math.pow(10, 2 * l)) + r("%", l)
                    }(p, y, v);
                if (-1 !== y.indexOf("E"))
                    return function e(t, r) {
                        var a, n = t.indexOf("E") - t.indexOf(".") - 1;
                        if (t.match(/^#+0.0E\+0$/)) {
                            if (0 == r)
                                return "0.0E+0";
                            if (r < 0)
                                return "-" + e(t, -r);
                            var o = t.indexOf(".");
                            -1 === o && (o = t.indexOf("E"));
                            var l = Math.floor(Math.log(r) * Math.LOG10E) % o;
                            if (l < 0 && (l += o),
                            -1 === (a = (r / Math.pow(10, l)).toPrecision(n + 1 + (o + l) % o)).indexOf("e")) {
                                var i = Math.floor(Math.log(r) * Math.LOG10E);
                                for (-1 === a.indexOf(".") ? a = a.charAt(0) + "." + a.substr(1) + "E+" + (i - a.length + l) : a += "E+" + (i - l); "0." === a.substr(0, 2); )
                                    a = (a = a.charAt(0) + a.substr(2, o) + "." + a.substr(2 + o)).replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
                                a = a.replace(/\+-/, "-")
                            }
                            a = a.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, (function(e, t, r, a) {
                                return t + r + a.substr(0, (o + l) % o) + "." + a.substr(l) + "E"
                            }
                            ))
                        } else
                            a = r.toExponential(n);
                        return t.match(/E\+00$/) && a.match(/e[+-]\d$/) && (a = a.substr(0, a.length - 1) + "0" + a.charAt(a.length - 1)),
                        t.match(/E\-/) && a.match(/e\+/) && (a = a.replace(/e\+/, "e")),
                        a.replace("e", "E")
                    }(y, v);
                if (36 === y.charCodeAt(0))
                    return "$" + m(p, y.substr(" " == y.charAt(1) ? 2 : 1), v);
                var b, k, w, x, S = Math.abs(v), T = v < 0 ? "-" : "";
                if (y.match(/^00+$/))
                    return T + i(S, y.length);
                if (y.match(/^[#?]+$/))
                    return "0" === (b = i(v, 0)) && (b = ""),
                    b.length > y.length ? b : h(y.substr(0, y.length - b.length)) + b;
                if (k = y.match(l))
                    return function(e, t, o) {
                        var l = parseInt(e[4], 10)
                          , i = Math.round(t * l)
                          , s = Math.floor(i / l)
                          , c = i - s * l
                          , u = l;
                        return o + (0 === s ? "" : "" + s) + " " + (0 === c ? r(" ", e[1].length + 1 + e[4].length) : n(c, e[1].length) + e[2] + "/" + e[3] + a(u, e[4].length))
                    }(k, S, T);
                if (y.match(/^#+0+$/))
                    return T + i(S, y.length - y.indexOf("0"));
                if (k = y.match(s))
                    return b = d(v, k[1].length).replace(/^([^\.]+)$/, "$1." + h(k[1])).replace(/\.$/, "." + h(k[1])).replace(/\.(\d*)$/, (function(e, t) {
                        return "." + t + r("0", h(k[1]).length - t.length)
                    }
                    )),
                    -1 !== y.indexOf("0.") ? b : b.replace(/^0\./, ".");
                if (y = y.replace(/^#+([0.])/, "$1"),
                k = y.match(/^(0*)\.(#*)$/))
                    return T + d(S, k[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, k[1].length ? "0." : ".");
                if (k = y.match(/^#{1,3},##0(\.?)$/))
                    return T + _(i(S, 0));
                if (k = y.match(/^#,##0\.([#0]*0)$/))
                    return v < 0 ? "-" + m(p, y, -v) : _("" + (Math.floor(v) + function(e, t) {
                        return t < ("" + Math.round((e - Math.floor(e)) * Math.pow(10, t))).length ? 1 : 0
                    }(v, k[1].length))) + "." + a(f(v, k[1].length), k[1].length);
                if (k = y.match(/^#,#*,#0/))
                    return m(p, y.replace(/^#,#*,/, ""), v);
                if (k = y.match(/^([0#]+)(\\?-([0#]+))+$/))
                    return b = t(m(p, y.replace(/[\\-]/g, ""), v)),
                    w = 0,
                    t(t(y.replace(/\\/g, "")).replace(/[0#]/g, (function(e) {
                        return w < b.length ? b.charAt(w++) : "0" === e ? "0" : ""
                    }
                    )));
                if (y.match(u))
                    return "(" + (b = m(p, "##########", v)).substr(0, 3) + ") " + b.substr(3, 3) + "-" + b.substr(6);
                var E = "";
                if (k = y.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
                    return w = Math.min(k[4].length, 7),
                    x = g(S, Math.pow(10, w) - 1, !1),
                    b = "" + T,
                    " " == (E = C("n", k[1], x[1])).charAt(E.length - 1) && (E = E.substr(0, E.length - 1) + "0"),
                    b += E + k[2] + "/" + k[3],
                    (E = o(x[2], w)).length < k[4].length && (E = h(k[4].substr(k[4].length - E.length)) + E),
                    b += E;
                if (k = y.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
                    return w = Math.min(Math.max(k[1].length, k[4].length), 7),
                    T + ((x = g(S, Math.pow(10, w) - 1, !0))[0] || (x[1] ? "" : "0")) + " " + (x[1] ? n(x[1], w) + k[2] + "/" + k[3] + o(x[2], w) : r(" ", 2 * w + 1 + k[2].length + k[3].length));
                if (k = y.match(/^[#0?]+$/))
                    return b = i(v, 0),
                    y.length <= b.length ? b : h(y.substr(0, y.length - b.length)) + b;
                if (k = y.match(/^([#0?]+)\.([#0]+)$/)) {
                    b = "" + v.toFixed(Math.min(k[2].length, 10)).replace(/([^0])0+$/, "$1"),
                    w = b.indexOf(".");
                    var I = y.indexOf(".") - w
                      , R = y.length - b.length - I;
                    return h(y.substr(0, I) + b + y.substr(y.length - R))
                }
                if (k = y.match(/^00,000\.([#0]*0)$/))
                    return w = f(v, k[1].length),
                    v < 0 ? "-" + m(p, y, -v) : _(function(e) {
                        return e < 2147483647 && e > -2147483648 ? "" + (e >= 0 ? 0 | e : e - 1 | 0) : "" + Math.floor(e)
                    }(v)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, (function(e) {
                        return "00," + (e.length < 3 ? a(0, 3 - e.length) : "") + e
                    }
                    )) + "." + a(w, k[1].length);
                switch (y) {
                case "###,##0.00":
                    return m(p, "#,##0.00", v);
                case "###,###":
                case "##,###":
                case "#,###":
                    var B = _(i(S, 0));
                    return "0" !== B ? T + B : "";
                case "###,###.00":
                    return m(p, "###,##0.00", v).replace(/^0\./, ".");
                case "#,###.00":
                    return m(p, "#,##0.00", v).replace(/^0\./, ".")
                }
                throw new Error("unsupported format |" + y + "|")
            }
            function p(i, d, f) {
                if (40 === i.charCodeAt(0) && !d.match(c)) {
                    var m = d.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
                    return f >= 0 ? p("n", m, f) : "(" + p("n", m, -f) + ")"
                }
                if (44 === d.charCodeAt(d.length - 1))
                    return function(e, t, r) {
                        for (var a = t.length - 1; 44 === t.charCodeAt(a - 1); )
                            --a;
                        return C(e, t.substr(0, a), r / Math.pow(10, 3 * (t.length - a)))
                    }(i, d, f);
                if (-1 !== d.indexOf("%"))
                    return function(t, a, n) {
                        var o = a.replace(e, "")
                          , l = a.length - o.length;
                        return C(t, o, n * Math.pow(10, 2 * l)) + r("%", l)
                    }(i, d, f);
                if (-1 !== d.indexOf("E"))
                    return function e(t, r) {
                        var a, n = t.indexOf("E") - t.indexOf(".") - 1;
                        if (t.match(/^#+0.0E\+0$/)) {
                            if (0 == r)
                                return "0.0E+0";
                            if (r < 0)
                                return "-" + e(t, -r);
                            var o = t.indexOf(".");
                            -1 === o && (o = t.indexOf("E"));
                            var l = Math.floor(Math.log(r) * Math.LOG10E) % o;
                            if (l < 0 && (l += o),
                            !(a = (r / Math.pow(10, l)).toPrecision(n + 1 + (o + l) % o)).match(/[Ee]/)) {
                                var i = Math.floor(Math.log(r) * Math.LOG10E);
                                -1 === a.indexOf(".") ? a = a.charAt(0) + "." + a.substr(1) + "E+" + (i - a.length + l) : a += "E+" + (i - l),
                                a = a.replace(/\+-/, "-")
                            }
                            a = a.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, (function(e, t, r, a) {
                                return t + r + a.substr(0, (o + l) % o) + "." + a.substr(l) + "E"
                            }
                            ))
                        } else
                            a = r.toExponential(n);
                        return t.match(/E\+00$/) && a.match(/e[+-]\d$/) && (a = a.substr(0, a.length - 1) + "0" + a.charAt(a.length - 1)),
                        t.match(/E\-/) && a.match(/e\+/) && (a = a.replace(/e\+/, "e")),
                        a.replace("e", "E")
                    }(d, f);
                if (36 === d.charCodeAt(0))
                    return "$" + p(i, d.substr(" " == d.charAt(1) ? 2 : 1), f);
                var y, v, A, b, k = Math.abs(f), w = f < 0 ? "-" : "";
                if (d.match(/^00+$/))
                    return w + a(k, d.length);
                if (d.match(/^[#?]+$/))
                    return y = "" + f,
                    0 === f && (y = ""),
                    y.length > d.length ? y : h(d.substr(0, d.length - y.length)) + y;
                if (v = d.match(l))
                    return function(e, t, a) {
                        return a + (0 === t ? "" : "" + t) + r(" ", e[1].length + 2 + e[4].length)
                    }(v, k, w);
                if (d.match(/^#+0+$/))
                    return w + a(k, d.length - d.indexOf("0"));
                if (v = d.match(s))
                    return y = (y = ("" + f).replace(/^([^\.]+)$/, "$1." + h(v[1])).replace(/\.$/, "." + h(v[1]))).replace(/\.(\d*)$/, (function(e, t) {
                        return "." + t + r("0", h(v[1]).length - t.length)
                    }
                    )),
                    -1 !== d.indexOf("0.") ? y : y.replace(/^0\./, ".");
                if (d = d.replace(/^#+([0.])/, "$1"),
                v = d.match(/^(0*)\.(#*)$/))
                    return w + ("" + k).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, v[1].length ? "0." : ".");
                if (v = d.match(/^#{1,3},##0(\.?)$/))
                    return w + _("" + k);
                if (v = d.match(/^#,##0\.([#0]*0)$/))
                    return f < 0 ? "-" + p(i, d, -f) : _("" + f) + "." + r("0", v[1].length);
                if (v = d.match(/^#,#*,#0/))
                    return p(i, d.replace(/^#,#*,/, ""), f);
                if (v = d.match(/^([0#]+)(\\?-([0#]+))+$/))
                    return y = t(p(i, d.replace(/[\\-]/g, ""), f)),
                    A = 0,
                    t(t(d.replace(/\\/g, "")).replace(/[0#]/g, (function(e) {
                        return A < y.length ? y.charAt(A++) : "0" === e ? "0" : ""
                    }
                    )));
                if (d.match(u))
                    return "(" + (y = p(i, "##########", f)).substr(0, 3) + ") " + y.substr(3, 3) + "-" + y.substr(6);
                var x = "";
                if (v = d.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
                    return A = Math.min(v[4].length, 7),
                    b = g(k, Math.pow(10, A) - 1, !1),
                    y = "" + w,
                    " " == (x = C("n", v[1], b[1])).charAt(x.length - 1) && (x = x.substr(0, x.length - 1) + "0"),
                    y += x + v[2] + "/" + v[3],
                    (x = o(b[2], A)).length < v[4].length && (x = h(v[4].substr(v[4].length - x.length)) + x),
                    y += x;
                if (v = d.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
                    return A = Math.min(Math.max(v[1].length, v[4].length), 7),
                    w + ((b = g(k, Math.pow(10, A) - 1, !0))[0] || (b[1] ? "" : "0")) + " " + (b[1] ? n(b[1], A) + v[2] + "/" + v[3] + o(b[2], A) : r(" ", 2 * A + 1 + v[2].length + v[3].length));
                if (v = d.match(/^[#0?]+$/))
                    return y = "" + f,
                    d.length <= y.length ? y : h(d.substr(0, d.length - y.length)) + y;
                if (v = d.match(/^([#0]+)\.([#0]+)$/)) {
                    y = "" + f.toFixed(Math.min(v[2].length, 10)).replace(/([^0])0+$/, "$1"),
                    A = y.indexOf(".");
                    var S = d.indexOf(".") - A
                      , T = d.length - y.length - S;
                    return h(d.substr(0, S) + y + d.substr(d.length - T))
                }
                if (v = d.match(/^00,000\.([#0]*0)$/))
                    return f < 0 ? "-" + p(i, d, -f) : _("" + f).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, (function(e) {
                        return "00," + (e.length < 3 ? a(0, 3 - e.length) : "") + e
                    }
                    )) + "." + a(0, v[1].length);
                switch (d) {
                case "###,###":
                case "##,###":
                case "#,###":
                    var E = _("" + k);
                    return "0" !== E ? w + E : "";
                default:
                    if (d.match(/\.[0#?]*$/))
                        return p(i, d.slice(0, d.lastIndexOf(".")), f) + h(d.slice(d.lastIndexOf(".")))
                }
                throw new Error("unsupported format |" + d + "|")
            }
            return function(e, t, r) {
                return (0 | r) === r ? p(e, t, r) : m(e, t, r)
            }
        }();
        function T(e) {
            for (var t = [], r = !1, a = 0, n = 0; a < e.length; ++a)
                switch (e.charCodeAt(a)) {
                case 34:
                    r = !r;
                    break;
                case 95:
                case 42:
                case 92:
                    ++a;
                    break;
                case 59:
                    t[t.length] = e.substr(n, a - n),
                    n = a + 1
                }
            if (t[t.length] = e.substr(n),
            !0 === r)
                throw new Error("Format |" + e + "| unterminated string ");
            return t
        }
        e._split = T;
        var E = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;
        function I(e) {
            for (var t = 0, r = "", a = ""; t < e.length; )
                switch (r = e.charAt(t)) {
                case "G":
                    s(e, t) && (t += 6),
                    t++;
                    break;
                case '"':
                    for (; 34 !== e.charCodeAt(++t) && t < e.length; )
                        ;
                    ++t;
                    break;
                case "\\":
                case "_":
                    t += 2;
                    break;
                case "@":
                    ++t;
                    break;
                case "B":
                case "b":
                    if ("1" === e.charAt(t + 1) || "2" === e.charAt(t + 1))
                        return !0;
                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 !0;
                case "A":
                case "a":
                case "上":
                    if ("A/P" === e.substr(t, 3).toUpperCase())
                        return !0;
                    if ("AM/PM" === e.substr(t, 5).toUpperCase())
                        return !0;
                    if ("上午/下午" === e.substr(t, 5).toUpperCase())
                        return !0;
                    ++t;
                    break;
                case "[":
                    for (a = r; "]" !== e.charAt(t++) && t < e.length; )
                        a += e.charAt(t);
                    if (a.match(E))
                        return !0;
                    break;
                case ".":
                case "0":
                case "#":
                    for (; t < e.length && ("0#?.,E+-%".indexOf(r = e.charAt(++t)) > -1 || "\\" == r && "-" == e.charAt(t + 1) && "0#".indexOf(e.charAt(t + 2)) > -1); )
                        ;
                    break;
                case "?":
                    for (; e.charAt(++t) === r; )
                        ;
                    break;
                case "*":
                    ++t,
                    " " != e.charAt(t) && "*" != e.charAt(t) || ++t;
                    break;
                case "(":
                case ")":
                    ++t;
                    break;
                case "1":
                case "2":
                case "3":
                case "4":
                case "5":
                case "6":
                case "7":
                case "8":
                case "9":
                    for (; t < e.length && "0123456789".indexOf(e.charAt(++t)) > -1; )
                        ;
                    break;
                case " ":
                default:
                    ++t
                }
            return !1
        }
        function R(e, t, r, a) {
            for (var n, o, l, i = [], c = "", u = 0, h = "", d = "t", f = "H"; u < e.length; )
                switch (h = e.charAt(u)) {
                case "G":
                    if (!s(e, u))
                        throw new Error("unrecognized character " + h + " in " + e);
                    i[i.length] = {
                        t: "G",
                        v: "General"
                    },
                    u += 7;
                    break;
                case '"':
                    for (c = ""; 34 !== (l = e.charCodeAt(++u)) && u < e.length; )
                        c += String.fromCharCode(l);
                    i[i.length] = {
                        t: "t",
                        v: c
                    },
                    ++u;
                    break;
                case "\\":
                    var m = e.charAt(++u)
                      , p = "(" === m || ")" === m ? m : "t";
                    i[i.length] = {
                        t: p,
                        v: m
                    },
                    ++u;
                    break;
                case "_":
                    i[i.length] = {
                        t: "t",
                        v: " "
                    },
                    u += 2;
                    break;
                case "@":
                    i[i.length] = {
                        t: "T",
                        v: t
                    },
                    ++u;
                    break;
                case "B":
                case "b":
                    if ("1" === e.charAt(u + 1) || "2" === e.charAt(u + 1)) {
                        if (null == n && null == (n = y(t, r, "2" === e.charAt(u + 1))))
                            return "";
                        i[i.length] = {
                            t: "X",
                            v: e.substr(u, 2)
                        },
                        d = h,
                        u += 2;
                        break
                    }
                case "M":
                case "D":
                case "Y":
                case "H":
                case "S":
                case "E":
                    h = h.toLowerCase();
                case "m":
                case "d":
                case "y":
                case "h":
                case "s":
                case "e":
                case "g":
                    if (t < 0)
                        return "";
                    if (null == n && null == (n = y(t, r)))
                        return "#####";
                    for (c = h; ++u < e.length && e.charAt(u).toLowerCase() === h; )
                        c += h;
                    "m" === h && "h" === d.toLowerCase() && (h = "M"),
                    "h" === h && (h = f),
                    i[i.length] = {
                        t: h,
                        v: c
                    },
                    d = h;
                    break;
                case "A":
                case "a":
                case "上":
                    var g = {
                        t: h,
                        v: h
                    };
                    if (null == n && (n = y(t, r)),
                    "A/P" === e.substr(u, 3).toUpperCase() ? (null != n && (g.v = n.H >= 12 ? "P" : "A"),
                    g.t = "T",
                    f = "h",
                    u += 3) : "AM/PM" === e.substr(u, 5).toUpperCase() ? (null != n && (g.v = n.H >= 12 ? "PM" : "AM"),
                    g.t = "T",
                    u += 5,
                    f = "h") : "上午/下午" === e.substr(u, 5).toUpperCase() ? (null != n && (g.v = n.H >= 12 ? "下午" : "上午"),
                    g.t = "T",
                    u += 5,
                    f = "h") : (g.t = "t",
                    ++u),
                    null == n && "T" === g.t)
                        return "";
                    i[i.length] = g,
                    d = h;
                    break;
                case "[":
                    for (c = h; "]" !== e.charAt(u++) && u < e.length; )
                        c += e.charAt(u);
                    if ("]" !== c.slice(-1))
                        throw 'unterminated "[" block: |' + c + "|";
                    if (c.match(E)) {
                        if (null == n && null == (n = y(t, r)))
                            return "";
                        i[i.length] = {
                            t: "Z",
                            v: c.toLowerCase()
                        },
                        d = c.charAt(1)
                    } else
                        c.indexOf("$") > -1 && (c = (c.match(/\$([^-\[\]]*)/) || [])[1] || "$",
                        I(e) || (i[i.length] = {
                            t: "t",
                            v: c
                        }));
                    break;
                case ".":
                    if (null != n) {
                        for (c = h; ++u < e.length && "0" === (h = e.charAt(u)); )
                            c += h;
                        i[i.length] = {
                            t: "s",
                            v: c
                        };
                        break
                    }
                case "0":
                case "#":
                    for (c = h; ++u < e.length && "0#?.,E+-%".indexOf(h = e.charAt(u)) > -1; )
                        c += h;
                    i[i.length] = {
                        t: "n",
                        v: c
                    };
                    break;
                case "?":
                    for (c = h; e.charAt(++u) === h; )
                        c += h;
                    i[i.length] = {
                        t: h,
                        v: c
                    },
                    d = h;
                    break;
                case "*":
                    ++u,
                    " " != e.charAt(u) && "*" != e.charAt(u) || ++u;
                    break;
                case "(":
                case ")":
                    i[i.length] = {
                        t: 1 === a ? "t" : h,
                        v: h
                    },
                    ++u;
                    break;
                case "1":
                case "2":
                case "3":
                case "4":
                case "5":
                case "6":
                case "7":
                case "8":
                case "9":
                    for (c = h; u < e.length && "0123456789".indexOf(e.charAt(++u)) > -1; )
                        c += e.charAt(u);
                    i[i.length] = {
                        t: "D",
                        v: c
                    };
                    break;
                case " ":
                    i[i.length] = {
                        t: h,
                        v: h
                    },
                    ++u;
                    break;
                case "$":
                    i[i.length] = {
                        t: "t",
                        v: "$"
                    },
                    ++u;
                    break;
                default:
                    if (-1 === "¤฿BsBr₵₡₫ƒFtRs.₭kr£₤Lm₥₦₱PQRSkRp৲৳R$S/.〒₮₩¥NT￥zł₴₪៛руб€＄,$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP$￥LekdinAf$dhAflRial?￡BirrKzMOPPGKRsGsB/R$ррlevkrKMzBsPNuFBuKPkrRD$NfkCFA?CVEGMDFrCDHTGNAfLFdjKGSFGGHSRielKCFknKshLSLL￡LtRFRONArRfMWKRMMURsMROS/KMDLMTnRC$kr€GELCHFSLLSCRDbSZLSDGSOSSomFCFPTShT$VUVQUGXгрнsomWSTNT$FtDramRpZMWFCFA".indexOf(h))
                        throw new Error("unrecognized character " + h + " in " + e);
                    i[i.length] = {
                        t: "t",
                        v: h
                    },
                    ++u
                }
            var v, A = 0, b = 0;
            for (u = i.length - 1,
            d = "t"; u >= 0; --u)
                switch (i[u].t) {
                case "h":
                case "H":
                    i[u].t = f,
                    d = "h",
                    A < 1 && (A = 1);
                    break;
                case "s":
                    (v = i[u].v.match(/\.0+$/)) && (b = Math.max(b, v[0].length - 1)),
                    A < 3 && (A = 3);
                case "d":
                case "y":
                case "M":
                case "e":
                    d = i[u].t;
                    break;
                case "m":
                    "s" === d && (i[u].t = "M",
                    A < 2 && (A = 2));
                    break;
                case "X":
                    break;
                case "Z":
                    A < 1 && i[u].v.match(/[Hh]/) && (A = 1),
                    A < 2 && i[u].v.match(/[Mm]/) && (A = 2),
                    A < 3 && i[u].v.match(/[Ss]/) && (A = 3)
                }
            switch (A) {
            case 0:
                break;
            case 1:
                n.u >= .5 && (n.u = 0,
                ++n.S),
                n.S >= 60 && (n.S = 0,
                ++n.M),
                n.M >= 60 && (n.M = 0,
                ++n.H);
                break;
            case 2:
                n.u >= .5 && (n.u = 0,
                ++n.S),
                n.S >= 60 && (n.S = 0,
                ++n.M)
            }
            var k, w = "";
            for (u = 0; u < i.length; ++u)
                switch (i[u].t) {
                case "t":
                case "T":
                case " ":
                case "D":
                    break;
                case "X":
                    i[u].v = "",
                    i[u].t = ";";
                    break;
                case "d":
                case "m":
                case "y":
                case "h":
                case "H":
                case "M":
                case "s":
                case "e":
                case "b":
                case "Z":
                    i[u].v = S(i[u].t.charCodeAt(0), i[u].v, n, b),
                    i[u].t = "t";
                    break;
                case "n":
                case "?":
                    for (k = u + 1; null != i[k] && ("?" === (h = i[k].t) || "D" === h || (" " === h || "t" === h) && null != i[k + 1] && ("?" === i[k + 1].t || "t" === i[k + 1].t && "/" === i[k + 1].v) || "(" === i[u].t && (" " === h || "n" === h || ")" === h) || "t" === h && ("/" === i[k].v || " " === i[k].v && null != i[k + 1] && "?" == i[k + 1].t)); )
                        i[u].v += i[k].v,
                        i[k] = {
                            v: "",
                            t: ";"
                        },
                        ++k;
                    w += i[u].v,
                    u = k - 1;
                    break;
                case "G":
                    i[u].t = "t",
                    i[u].v = x(t, r)
                }
            var _, T, R = "";
            if (w.length > 0) {
                40 == w.charCodeAt(0) ? (_ = t < 0 && 45 === w.charCodeAt(0) ? -t : t,
                T = C("n", w, _)) : (T = C("n", w, _ = t < 0 && a > 1 ? -t : t),
                _ < 0 && i[0] && "t" == i[0].t && (T = T.substr(1),
                i[0].v = "-" + i[0].v)),
                k = T.length - 1;
                var B = i.length;
                for (u = 0; u < i.length; ++u)
                    if (null != i[u] && "t" != i[u].t && i[u].v.indexOf(".") > -1) {
                        B = u;
                        break
                    }
                var N = i.length;
                if (B === i.length && -1 === T.indexOf("E")) {
                    for (u = i.length - 1; u >= 0; --u)
                        null != i[u] && -1 !== "n?".indexOf(i[u].t) && (k >= i[u].v.length - 1 ? (k -= i[u].v.length,
                        i[u].v = T.substr(k + 1, i[u].v.length)) : k < 0 ? i[u].v = "" : (i[u].v = T.substr(0, k + 1),
                        k = -1),
                        i[u].t = "t",
                        N = u);
                    k >= 0 && N < i.length && (i[N].v = T.substr(0, k + 1) + i[N].v)
                } else if (B !== i.length && -1 === T.indexOf("E")) {
                    for (k = T.indexOf(".") - 1,
                    u = B; u >= 0; --u)
                        if (null != i[u] && -1 !== "n?".indexOf(i[u].t)) {
                            for (o = i[u].v.indexOf(".") > -1 && u === B ? i[u].v.indexOf(".") - 1 : i[u].v.length - 1,
                            R = i[u].v.substr(o + 1); o >= 0; --o)
                                k >= 0 && ("0" === i[u].v.charAt(o) || "#" === i[u].v.charAt(o)) && (R = T.charAt(k--) + R);
                            i[u].v = R,
                            i[u].t = "t",
                            N = u
                        }
                    for (k >= 0 && N < i.length && (i[N].v = T.substr(0, k + 1) + i[N].v),
                    k = T.indexOf(".") + 1,
                    u = B; u < i.length; ++u)
                        if (null != i[u] && (-1 !== "n?(".indexOf(i[u].t) || u === B)) {
                            for (o = i[u].v.indexOf(".") > -1 && u === B ? i[u].v.indexOf(".") + 1 : 0,
                            R = i[u].v.substr(0, o); o < i[u].v.length; ++o)
                                k < T.length && (R += T.charAt(k++));
                            i[u].v = R,
                            i[u].t = "t",
                            N = u
                        }
                }
            }
            for (u = 0; u < i.length; ++u)
                null != i[u] && "n?".indexOf(i[u].t) > -1 && (_ = a > 1 && t < 0 && u > 0 && "-" === i[u - 1].v ? -t : t,
                i[u].v = C(i[u].t, i[u].v, _),
                i[u].t = "t");
            var F = "";
            for (u = 0; u !== i.length; ++u)
                null != i[u] && (F += i[u].v);
            return F
        }
        e.is_date = I,
        e._eval = R;
        var B = /\[[=<>]/
          , N = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
        function F(e, t) {
            if (null == t)
                return !1;
            var r = parseFloat(t[2]);
            switch (t[1]) {
            case "=":
                if (e == r)
                    return !0;
                break;
            case ">":
                if (e > r)
                    return !0;
                break;
            case "<":
                if (e < r)
                    return !0;
                break;
            case "<>":
                if (e != r)
                    return !0;
                break;
            case ">=":
                if (e >= r)
                    return !0;
                break;
            case "<=":
                if (e <= r)
                    return !0
            }
            return !1
        }
        function P(e, t, r) {
            null == r && (r = {});
            var a = "";
            switch (_typeof(e)) {
            case "string":
                a = "m/d/yy" == e && r.dateNF ? r.dateNF : e;
                break;
            case "number":
                null == (a = 14 == e && r.dateNF ? r.dateNF : (null != r.table ? r.table : d)[e]) && (a = r.table && r.table[f[e]] || d[f[e]]),
                null == a && (a = p[e] || "General")
            }
            if (a.match(/^(w|W)((0?)|(0\.0+))$/)) {
                if (isNaN(t))
                    return t;
                var n = a.slice(1)
                  , o = !1;
                !isNaN(t) && Number(t) < 0 && (o = !0,
                t = Math.abs(t));
                var l = parseInt(t).toString().length;
                if (l > 4) {
                    if (l > 8) {
                        var i = parseInt(t / 1e8)
                          , c = parseInt(parseFloat(t).subtract(1e8 * i) / 1e4)
                          , u = parseFloat(t).subtract(1e8 * i + 1e4 * c);
                        "" != n && (u = numeral(u).format(n)),
                        t = i + "亿" + c + "万" + u
                    } else {
                        c = parseInt(t / 1e4),
                        u = parseFloat(t).subtract(1e4 * c);
                        "" != n && (u = numeral(u).format(n)),
                        t = c + "万" + u
                    }
                    if (-1 != t.indexOf("亿0万0") ? t = t.replace("0万0", "") : -1 != t.indexOf("亿0万") ? t = t.replace("0万", "") : -1 != t.indexOf("万0") && (t = t.replace("万0", "万")),
                    -1 != t.indexOf("亿") && -1 == t.indexOf("万")) {
                        if ("." !== (h = t.substring(t.indexOf("亿") + 1)).substring(0, 1) && "" != h) {
                            switch ((parseInt(h) + "").length) {
                            case 1:
                                h = "000" + h;
                                break;
                            case 2:
                                h = "00" + h;
                                break;
                            case 3:
                                h = "0" + h
                            }
                            t = t.substring(0, t.indexOf("亿") + 1) + h
                        }
                    } else if (-1 == t.indexOf("亿") && -1 != t.indexOf("万")) {
                        if ("." !== (m = t.substring(t.indexOf("万") + 1)).substring(0, 1) && "" != m) {
                            switch ((parseInt(m) + "").length) {
                            case 1:
                                m = "000" + m;
                                break;
                            case 2:
                                m = "00" + m;
                                break;
                            case 3:
                                m = "0" + m
                            }
                            t = t.substring(0, t.indexOf("万") + 1) + m
                        }
                    } else if (-1 != t.indexOf("亿") && -1 != t.indexOf("万")) {
                        var h = t.substring(t.indexOf("亿") + 1, t.indexOf("万"))
                          , m = t.substring(t.indexOf("万") + 1);
                        switch ((parseInt(h) + "").length) {
                        case 1:
                            h = "000" + h;
                            break;
                        case 2:
                            h = "00" + h;
                            break;
                        case 3:
                            h = "0" + h
                        }
                        if (t = t.substring(0, t.indexOf("亿") + 1) + h + t.substring(t.indexOf("万")),
                        "." !== m.substring(0, 1) && "" != m) {
                            switch ((parseInt(m) + "").length) {
                            case 1:
                                m = "000" + m;
                                break;
                            case 2:
                                m = "00" + m;
                                break;
                            case 3:
                                m = "0" + m
                            }
                            t = t.substring(0, t.indexOf("万") + 1) + m
                        }
                    }
                } else
                    "" != n && (t = numeral(t).format(n));
                return o ? "-" + t : t
            }
            if (s(a, 0))
                return x(t, r);
            t instanceof Date && (t = k(t, r.date1904));
            var g = function(e, t) {
                var r = T(e)
                  , a = r.length
                  , n = r[a - 1].indexOf("@");
                if (a < 4 && n > -1 && --a,
                r.length > 4)
                    throw new Error("cannot find right format for |" + r.join("|") + "|");
                if ("number" != typeof t)
                    return [4, 4 === r.length || n > -1 ? r[r.length - 1] : "@"];
                switch (r.length) {
                case 1:
                    r = n > -1 ? ["General", "General", "General", r[0]] : [r[0], r[0], r[0], "@"];
                    break;
                case 2:
                    r = n > -1 ? [r[0], r[0], r[0], r[1]] : [r[0], r[1], r[0], "@"];
                    break;
                case 3:
                    r = n > -1 ? [r[0], r[1], r[0], r[2]] : [r[0], r[1], r[2], "@"]
                }
                var o = t > 0 ? r[0] : t < 0 ? r[1] : r[2];
                if (-1 === r[0].indexOf("[") && -1 === r[1].indexOf("["))
                    return [a, o];
                if (null != r[0].match(B) || null != r[1].match(B)) {
                    var l = r[0].match(N)
                      , i = r[1].match(N);
                    return F(t, l) ? [a, r[0]] : F(t, i) ? [a, r[1]] : [a, r[null != l && null != i ? 2 : 1]]
                }
                return [a, o]
            }(a, t);
            if (s(g[1]))
                return x(t, r);
            if (!0 === t)
                t = "TRUE";
            else if (!1 === t)
                t = "FALSE";
            else if ("" === t || null == t)
                return "";
            return R(g[1], t, r, g[0])
        }
        function $(e, t) {
            if ("number" != typeof t) {
                t = +t || -1;
                for (var r = 0; r < 392; ++r)
                    if (null != d[r]) {
                        if (d[r] == e) {
                            t = r;
                            break
                        }
                    } else
                        t < 0 && (t = r);
                t < 0 && (t = 391)
            }
            return d[t] = e,
            t
        }
        e.load = $,
        e._table = d,
        e.get_table = function() {
            return d
        }
        ,
        e.load_table = function(e) {
            for (var t = 0; 392 != t; ++t)
                void 0 !== e[t] && $(e[t], t)
        }
        ,
        e.init_table = h,
        e.format = P
    };
    make_ssf(SSF);
    var XLMLFormatMap = {
        "General Number": "General",
        "General Date": SSF._table[22],
        "Long Date": "dddd, mmmm dd, yyyy",
        "Medium Date": SSF._table[15],
        "Short Date": SSF._table[14],
        "Long Time": SSF._table[19],
        "Medium Time": SSF._table[18],
        "Short Time": SSF._table[20],
        Currency: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
        Fixed: SSF._table[2],
        Standard: SSF._table[4],
        Percent: SSF._table[10],
        Scientific: SSF._table[11],
        "Yes/No": '"Yes";"Yes";"No";@',
        "True/False": '"True";"True";"False";@',
        "On/Off": '"Yes";"Yes";"No";@'
    }
      , basedate = new Date(1899,11,31,0,0,0)
      , dnthresh = basedate.getTime()
      , base1904 = new Date(1900,2,1,0,0,0);
    function datenum_local(e, t) {
        var r = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds())
          , a = Date.UTC(1899, 11, 31, 0, 0, 0);
        return t ? r -= 1262304e5 : e >= base1904 && (r += 864e5),
        (r - a) / 864e5
    }
    var good_pd_date = new Date("2017-02-19T19:06:09.000Z");
    isNaN(good_pd_date.getFullYear()) && (good_pd_date = new Date("2/19/17"));
    var good_pd = 2017 == good_pd_date.getFullYear();
    function parseDate(e, t) {
        var r = new Date(e);
        if (good_pd)
            return t > 0 ? r.setTime(r.getTime() + 60 * r.getTimezoneOffset() * 1e3) : t < 0 && r.setTime(r.getTime() - 60 * r.getTimezoneOffset() * 1e3),
            r;
        if (e instanceof Date)
            return e;
        if (1917 == good_pd_date.getFullYear() && !isNaN(r.getFullYear())) {
            var a = r.getFullYear();
            return e.indexOf("" + a) > -1 || r.setFullYear(r.getFullYear() + 100),
            r
        }
        var n = e.match(/\d+/g) || ["2017", "2", "19", "0", "0", "0"]
          , o = new Date(+n[0],+n[1] - 1,+n[2],+n[3] || 0,+n[4] || 0,+n[5] || 0);
        return e.indexOf("Z") > -1 && (o = new Date(o.getTime() - 60 * o.getTimezoneOffset() * 1e3)),
        o
    }
    function fuzzynum(e) {
        var t = Number(e);
        if ("number" == typeof e)
            return e;
        if (!isNaN(t))
            return t;
        var r = 1
          , a = e.replace(/([\d]),([\d])/g, "$1$2").replace(/[$]/g, "").replace(/[%]/g, (function() {
            return r *= 100,
            ""
        }
        ));
        return isNaN(t = Number(a)) ? (a = a.replace(/[(](.*)[)]/, (function(e, t) {
            return r = -r,
            t
        }
        )),
        isNaN(t = Number(a)) ? t : t / r) : t / r
    }
    function genarate(e) {
        var t = null
          , r = {}
          , a = e;
        if (null == e)
            return null;
        if ("'" === e.toString().substr(0, 1))
            t = e.toString().substr(1),
            r = {
                fa: "@",
                t: "s"
            };
        else if ("TRUE" === e.toString().toUpperCase())
            t = "TRUE",
            r = {
                fa: "General",
                t: "b"
            },
            a = !0;
        else if ("FALSE" === e.toString().toUpperCase())
            t = "FALSE",
            r = {
                fa: "General",
                t: "b"
            },
            a = !1;
        else if (valueIsError(e))
            t = e.toString(),
            r = {
                fa: "General",
                t: "e"
            };
        else if (/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(e))
            t = e.toString(),
            r = {
                fa: "@",
                t: "s"
            };
        else if (isRealNum(e) && Math.abs(parseFloat(e)) > 0 && (Math.abs(parseFloat(e)) >= 1e11 || Math.abs(parseFloat(e)) < 1e-9)) {
            var n = (a = numeral(e).value()).toExponential();
            if (n.indexOf(".") > -1) {
                var o = n.split(".")[1].split("e")[0].length;
                o > 5 && (o = 5),
                r = {
                    fa: "#0." + new Array(o + 1).join("0") + "E+00",
                    t: "n"
                }
            } else
                r = {
                    fa: "#0.E+00",
                    t: "n"
                };
            t = SSF.format(r.fa, a)
        } else if (e.toString().indexOf("%") > -1) {
            var l = e.toString().indexOf("%")
              , i = (d = e.toString().substr(0, l)).replace(/,/g, "");
            if (l == e.toString().length - 1 && isRealNum(i))
                if (d.indexOf(".") > -1)
                    if (d.indexOf(".") == d.lastIndexOf(".")) {
                        var s = d.split(".")[0];
                        if ((f = d.split(".")[1].length) > 9 && (f = 9),
                        s.indexOf(",") > -1) {
                            for (var c = !0, u = s.split(","), h = 1; h < u.length; h++)
                                if (u[h].length < 3) {
                                    c = !1;
                                    break
                                }
                            c ? (r = {
                                fa: "#,##0." + new Array(f + 1).join("0") + "%",
                                t: "n"
                            },
                            a = numeral(e).value(),
                            t = SSF.format(r.fa, a)) : (t = e.toString(),
                            r = {
                                fa: "@",
                                t: "s"
                            })
                        } else
                            r = {
                                fa: "0." + new Array(f + 1).join("0") + "%",
                                t: "n"
                            },
                            a = numeral(e).value(),
                            t = SSF.format(r.fa, a)
                    } else
                        t = e.toString(),
                        r = {
                            fa: "@",
                            t: "s"
                        };
                else if (d.indexOf(",") > -1) {
                    for (c = !0,
                    u = d.split(","),
                    h = 1; h < u.length; h++)
                        if (u[h].length < 3) {
                            c = !1;
                            break
                        }
                    c ? (r = {
                        fa: "#,##0%",
                        t: "n"
                    },
                    a = numeral(e).value(),
                    t = SSF.format(r.fa, a)) : (t = e.toString(),
                    r = {
                        fa: "@",
                        t: "s"
                    })
                } else
                    r = {
                        fa: "0%",
                        t: "n"
                    },
                    a = numeral(e).value(),
                    t = SSF.format(r.fa, a);
            else
                t = e.toString(),
                r = {
                    fa: "@",
                    t: "s"
                }
        } else if (e.toString().indexOf(".") > -1)
            if (e.toString().indexOf(".") == e.toString().lastIndexOf(".")) {
                var d, f, m = e.toString().split(".")[0];
                if ((f = (d = e.toString().split(".")[1]).length) > 9 && (f = 9),
                m.indexOf(",") > -1) {
                    for (c = !0,
                    u = m.split(","),
                    h = 1; h < u.length; h++)
                        if (!isRealNum(u[h]) || u[h].length < 3) {
                            c = !1;
                            break
                        }
                    c ? (r = {
                        fa: "#,##0." + new Array(f + 1).join("0"),
                        t: "n"
                    },
                    a = numeral(e).value(),
                    t = SSF.format(r.fa, a)) : (t = e.toString(),
                    r = {
                        fa: "@",
                        t: "s"
                    })
                } else
                    isRealNum(m) && isRealNum(d) ? (r = {
                        fa: "0." + new Array(f + 1).join("0"),
                        t: "n"
                    },
                    a = numeral(e).value(),
                    t = SSF.format(r.fa, a)) : (t = e.toString(),
                    r = {
                        fa: "@",
                        t: "s"
                    })
            } else
                t = e.toString(),
                r = {
                    fa: "@",
                    t: "s"
                };
        else
            isRealNum(e) ? (t = e.toString(),
            r = {
                fa: "General",
                t: "n"
            },
            a = parseFloat(e)) : isdatetime(e) && (e.toString().indexOf(".") > -1 || e.toString().indexOf(":") > -1 || e.toString().length < 16) ? ((a = datenum_local(parseDate(e.toString().replace(/-/g, "/")))).toString().indexOf(".") > -1 ? e.toString().length > 18 ? r.fa = "yyyy-MM-dd hh:mm:ss" : e.toString().length > 11 ? r.fa = "yyyy-MM-dd hh:mm" : r.fa = "yyyy-MM-dd" : r.fa = "yyyy-MM-dd",
            r.t = "d",
            t = SSF.format(r.fa, a)) : (t = e,
            r.fa = "General",
            r.t = "g");
        return [t, r, a]
    }
    function update(e, t) {
        return SSF.format(e, t)
    }
    function is_date(e, t) {
        return SSF.is_date(e, t)
    }
    function valueShowEs(e, t, r) {
        var a = getcellvalue(e, t, r, "m");
        return null == a ? a = getcellvalue(e, t, r, "v") : isNaN(fuzzynum(a)) ? null != r[e][t].ct && "d" == r[e][t].ct.t || null != r[e][t].ct && "b" == r[e][t].ct.t || (a = getcellvalue(e, t, r, "v")) : "string" == typeof a && a.indexOf("%") > -1 || (a = getcellvalue(e, t, r, "v")),
        a
    }
    function countfunc() {
        if (0 != Store.luckysheet_select_save.length) {
            for (var e = 1 / 0, t = -1 / 0, r = 0, a = 0, n = 0; n < Store.luckysheet_select_save.length; n++)
                for (var o = getdatabyselectionNoCopy(Store.luckysheet_select_save[n]), l = 0; l < o.length; l++)
                    for (var i = 0; i < o[0].length; i++)
                        if (!isRealNull(o[l][i]) && (a++,
                        null == o[l][i].ct || "d" != o[l][i].ct.t)) {
                            var s = o[l][i].v;
                            isRealNum(s) && (r += s = parseFloat(s),
                            s < e && (e = s),
                            s > t && (t = s))
                        }
            var c = locale().formula
              , u = "";
            u += "<span>" + c.count + ":" + a + "</span>",
            (isFinite(t) || isFinite(e)) && (u += "<span>" + c.sum + ":" + update("w", r) + "</span>",
            u += "<span>" + c.average + ":" + update("w", Math.round(r / a * 1e4) / 1e4) + "</span>"),
            isFinite(t) && (u += "<span>" + c.max + ":" + update("w", t) + "</span>"),
            isFinite(e) && (u += "<span>" + c.min + ":" + update("w", e) + "</span>"),
            $("#luckysheet-sta-content").html(u)
        }
    }
    var iterators = {}, correctPrototypeGetter = !fails((function() {
        function e() {}
        return e.prototype.constructor = null,
        Object.getPrototypeOf(new e) !== e.prototype
    }
    )), IE_PROTO$1 = sharedKey("IE_PROTO"), ObjectPrototype = Object.prototype, objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function(e) {
        return e = toObject(e),
        has(e, IE_PROTO$1) ? e[IE_PROTO$1] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? ObjectPrototype : null
    }
    , ITERATOR = wellKnownSymbol("iterator"), BUGGY_SAFARI_ITERATORS = !1, returnThis = function() {
        return this
    }, IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
    [].keys && (arrayIterator = [].keys(),
    "next"in arrayIterator ? (PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)),
    PrototypeOfArrayIteratorPrototype !== Object.prototype && (IteratorPrototype = PrototypeOfArrayIteratorPrototype)) : BUGGY_SAFARI_ITERATORS = !0),
    null == IteratorPrototype && (IteratorPrototype = {}),
    has(IteratorPrototype, ITERATOR) || createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
    var iteratorsCore = {
        IteratorPrototype: IteratorPrototype,
        BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
    }
      , defineProperty$5 = objectDefineProperty.f
      , TO_STRING_TAG$2 = wellKnownSymbol("toStringTag")
      , setToStringTag = function(e, t, r) {
        e && !has(e = r ? e : e.prototype, TO_STRING_TAG$2) && defineProperty$5(e, TO_STRING_TAG$2, {
            configurable: !0,
            value: t
        })
    }
      , IteratorPrototype$1 = iteratorsCore.IteratorPrototype
      , returnThis$1 = function() {
        return this
    }
      , createIteratorConstructor = function(e, t, r) {
        var a = t + " Iterator";
        return e.prototype = objectCreate(IteratorPrototype$1, {
            next: createPropertyDescriptor(1, r)
        }),
        setToStringTag(e, a, !1),
        iterators[a] = returnThis$1,
        e
    }
      , IteratorPrototype$2 = iteratorsCore.IteratorPrototype
      , BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS
      , ITERATOR$1 = wellKnownSymbol("iterator")
      , KEYS = "keys"
      , VALUES = "values"
      , ENTRIES = "entries"
      , returnThis$2 = function() {
        return this
    }
      , defineIterator = function(e, t, r, a, n, o, l) {
        createIteratorConstructor(r, t, a);
        var i, s, c, u = function(e) {
            if (e === n && p)
                return p;
            if (!BUGGY_SAFARI_ITERATORS$1 && e in f)
                return f[e];
            switch (e) {
            case KEYS:
            case VALUES:
            case ENTRIES:
                return function() {
                    return new r(this,e)
                }
            }
            return function() {
                return new r(this)
            }
        }, h = t + " Iterator", d = !1, f = e.prototype, m = f[ITERATOR$1] || f["@@iterator"] || n && f[n], p = !BUGGY_SAFARI_ITERATORS$1 && m || u(n), g = "Array" == t && f.entries || m;
        if (g && (i = objectGetPrototypeOf(g.call(new e)),
        IteratorPrototype$2 !== Object.prototype && i.next && (objectGetPrototypeOf(i) !== IteratorPrototype$2 && (objectSetPrototypeOf ? objectSetPrototypeOf(i, IteratorPrototype$2) : "function" != typeof i[ITERATOR$1] && createNonEnumerableProperty(i, ITERATOR$1, returnThis$2)),
        setToStringTag(i, h, !0))),
        n == VALUES && m && m.name !== VALUES && (d = !0,
        p = function() {
            return m.call(this)
        }
        ),
        f[ITERATOR$1] !== p && createNonEnumerableProperty(f, ITERATOR$1, p),
        iterators[t] = p,
        n)
            if (s = {
                values: u(VALUES),
                keys: o ? p : u(KEYS),
                entries: u(ENTRIES)
            },
            l)
                for (c in s)
                    (BUGGY_SAFARI_ITERATORS$1 || d || !(c in f)) && redefine(f, c, s[c]);
            else
                _export({
                    target: t,
                    proto: !0,
                    forced: BUGGY_SAFARI_ITERATORS$1 || d
                }, s);
        return s
    }
      , ARRAY_ITERATOR = "Array Iterator"
      , setInternalState$1 = internalState.set
      , getInternalState = internalState.getterFor(ARRAY_ITERATOR)
      , es_array_iterator = defineIterator(Array, "Array", (function(e, t) {
        setInternalState$1(this, {
            type: ARRAY_ITERATOR,
            target: toIndexedObject(e),
            index: 0,
            kind: t
        })
    }
    ), (function() {
        var e = getInternalState(this)
          , t = e.target
          , r = e.kind
          , a = e.index++;
        return !t || a >= t.length ? (e.target = void 0,
        {
            value: void 0,
            done: !0
        }) : "keys" == r ? {
            value: a,
            done: !1
        } : "values" == r ? {
            value: t[a],
            done: !1
        } : {
            value: [a, t[a]],
            done: !1
        }
    }
    ), "values");
    iterators.Arguments = iterators.Array,
    addToUnscopables("keys"),
    addToUnscopables("values"),
    addToUnscopables("entries");
    var ITERATOR$2 = wellKnownSymbol("iterator")
      , TO_STRING_TAG$3 = wellKnownSymbol("toStringTag")
      , ArrayValues = es_array_iterator.values;
    for (var COLLECTION_NAME$1 in domIterables) {
        var Collection$1 = global_1[COLLECTION_NAME$1]
          , CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
        if (CollectionPrototype$1) {
            if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues)
                try {
                    createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$2, ArrayValues)
                } catch (error) {
                    CollectionPrototype$1[ITERATOR$2] = ArrayValues
                }
            if (CollectionPrototype$1[TO_STRING_TAG$3] || createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1),
            domIterables[COLLECTION_NAME$1])
                for (var METHOD_NAME in es_array_iterator)
                    if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME])
                        try {
                            createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME])
                        } catch (error) {
                            CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME]
                        }
        }
    }
    var arrayFill = function(e) {
        for (var t = toObject(this), r = toLength(t.length), a = arguments.length, n = toAbsoluteIndex(a > 1 ? arguments[1] : void 0, r), o = a > 2 ? arguments[2] : void 0, l = void 0 === o ? r : toAbsoluteIndex(o, r); l > n; )
            t[n++] = e;
        return t
    };
    _export({
        target: "Array",
        proto: !0
    }, {
        fill: arrayFill
    }),
    addToUnscopables("fill");
    var luckysheetPostil = {
        defaultWidth: 144,
        defaultHeight: 84,
        currentObj: null,
        currentWinW: null,
        currentWinH: null,
        resize: null,
        resizeXY: null,
        move: !1,
        moveXY: null,
        init: function() {
            var e = this;
            $("#luckysheet-postil-showBoxs").off("mousedown.showPs").on("mousedown.showPs", ".luckysheet-postil-show", (function(t) {
                checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1) && (e.currentObj = $(this).find(".luckysheet-postil-show-main"),
                $(this).hasClass("luckysheet-postil-show-active") || (e.removeActivePs(),
                $(this).addClass("luckysheet-postil-show-active"),
                $(this).find(".luckysheet-postil-dialog-resize").show(),
                $(this).find(".arrowCanvas").css("z-index", 200),
                $(this).find(".luckysheet-postil-show-main").css("z-index", 200)),
                t.stopPropagation())
            }
            )),
            $("#luckysheet-postil-showBoxs").off("mouseup.showPs").on("mouseup.showPs", ".luckysheet-postil-show", (function(e) {
                "3" == e.which && e.stopPropagation()
            }
            )),
            $("#luckysheet-postil-showBoxs").off("mousedown.resize").on("mousedown.resize", ".luckysheet-postil-show .luckysheet-postil-dialog-resize .luckysheet-postil-dialog-resize-item", (function(t) {
                if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                    e.currentObj = $(this).closest(".luckysheet-postil-show-main"),
                    e.currentWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                    e.currentWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                    e.resize = $(this).data("type");
                    var r = $("#luckysheet-cell-main").scrollTop()
                      , a = $("#luckysheet-cell-main").scrollLeft()
                      , n = mouseposition(t.pageX, t.pageY)
                      , o = n[0] + a
                      , l = n[1] + r
                      , i = e.currentObj.position()
                      , s = e.currentObj.width()
                      , c = e.currentObj.height();
                    e.resizeXY = [o, l, s, c, i.left + a, i.top + r, a, r],
                    setluckysheet_scroll_status(!0),
                    $(this).closest(".luckysheet-postil-show").hasClass("luckysheet-postil-show-active") || (e.removeActivePs(),
                    $(this).closest(".luckysheet-postil-show").addClass("luckysheet-postil-show-active"),
                    $(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-dialog-resize").show(),
                    $(this).closest(".luckysheet-postil-show").find(".arrowCanvas").css("z-index", 200),
                    $(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-show-main").css("z-index", 200)),
                    t.stopPropagation()
                }
            }
            )),
            $("#luckysheet-postil-showBoxs").off("mousedown.move").on("mousedown.move", ".luckysheet-postil-show .luckysheet-postil-dialog-move .luckysheet-postil-dialog-move-item", (function(t) {
                if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                    e.currentObj = $(this).closest(".luckysheet-postil-show-main"),
                    e.currentWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                    e.currentWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                    e.move = !0;
                    var r = $("#luckysheet-cell-main").scrollTop()
                      , a = $("#luckysheet-cell-main").scrollLeft()
                      , n = e.currentObj.offset()
                      , o = e.currentObj.position();
                    e.moveXY = [t.pageX - n.left, t.pageY - n.top, o.left, o.top, a, r],
                    setluckysheet_scroll_status(!0),
                    $(this).closest(".luckysheet-postil-show").hasClass("luckysheet-postil-show-active") || (e.removeActivePs(),
                    $(this).closest(".luckysheet-postil-show").addClass("luckysheet-postil-show-active"),
                    $(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-dialog-resize").show(),
                    $(this).closest(".luckysheet-postil-show").find(".arrowCanvas").css("z-index", 200),
                    $(this).closest(".luckysheet-postil-show").find(".luckysheet-postil-show-main").css("z-index", 200)),
                    t.stopPropagation()
                }
            }
            ))
        },
        overshow: function(e) {
            if ($("#luckysheet-postil-overshow").remove(),
            0 != $(e.target).closest("#luckysheet-cell-main").length) {
                var t = mouseposition(e.pageX, e.pageY)
                  , r = $("#luckysheet-cell-main").scrollLeft()
                  , a = $("#luckysheet-cell-main").scrollTop()
                  , n = t[0] + r
                  , o = t[1] + a;
                if (!(null != luckysheetFreezen.freezenverticaldata && t[0] < luckysheetFreezen.freezenverticaldata[0] - luckysheetFreezen.freezenverticaldata[2] || null != luckysheetFreezen.freezenhorizontaldata && t[1] < luckysheetFreezen.freezenhorizontaldata[0] - luckysheetFreezen.freezenhorizontaldata[2])) {
                    var l = rowLocation(o)[2]
                      , i = colLocation(n)[2]
                      , s = menuButton.mergeborer(Store.flowdata, l, i);
                    if (s && (l = s.row[2],
                    i = s.column[2]),
                    null != Store.flowdata[l] && null != Store.flowdata[l][i] && null != Store.flowdata[l][i].ps) {
                        var c = Store.flowdata[l][i].ps;
                        if (!(c.isshow || $("#luckysheet-postil-show_" + l + "_" + i).length > 0)) {
                            var u = null == c.value ? "" : c.value
                              , h = (Store.visibledatarow[l],
                            l - 1 == -1 ? 0 : Store.visibledatarow[l - 1])
                              , d = Store.visibledatacolumn[i];
                            i - 1 == -1 || Store.visibledatacolumn[i - 1];
                            s && (s.row[1],
                            h = s.row[0],
                            d = s.column[1],
                            s.column[0]);
                            var f = d
                              , m = h
                              , p = f + 18 * Store.zoomRatio
                              , g = m - 18 * Store.zoomRatio;
                            g < 0 && (g = 2);
                            var y = this.defaultWidth * Store.zoomRatio
                              , v = this.defaultHeight * Store.zoomRatio
                              , A = this.getArrowCanvasSize(p, g, f, m)
                              , b = '<div id="luckysheet-postil-overshow"><canvas class="arrowCanvas" width="' + A[2] + '" height="' + A[3] + '" style="position:absolute;left:' + A[0] + "px;top:" + A[1] + 'px;z-index:100;pointer-events:none;"></canvas><div style="width:' + (y - 12) + "px;min-height:" + (v - 12) + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + p + "px;top:" + g + 'px;z-index:100;">' + u + "</div></div>";
                            $(b).appendTo($("#luckysheet-cell-main"));
                            var k = $("#luckysheet-postil-overshow .arrowCanvas").get(0).getContext("2d");
                            this.drawArrow(k, A[4], A[5], A[6], A[7])
                        }
                    }
                }
            }
        },
        getArrowCanvasSize: function(e, t, r, a) {
            var n = r - 5;
            e < r && (n = e - 5);
            var o = a - 5;
            t < a && (o = t - 5);
            var l = Math.abs(e - r) + 10
              , i = Math.abs(t - a) + 10
              , s = l - 5
              , c = 5;
            e < r && (s = 5,
            c = l - 5);
            var u = i - 5
              , h = 5;
            return t < a && (u = 5,
            h = i - 5),
            [n, o, l, i, s, u, c, h]
        },
        drawArrow: function(e, t, r, a, n, o, l, i, s) {
            o = "undefined" == getObjType(o) ? 30 : o,
            l = "undefined" == getObjType(l) ? 6 : l,
            i = "undefined" == getObjType(i) ? 1 : i,
            s = "undefined" == getObjType(s) ? "#000" : s;
            var c = 180 * Math.atan2(r - n, t - a) / Math.PI
              , u = (c + o) * Math.PI / 180
              , h = (c - o) * Math.PI / 180
              , d = l * Math.cos(u)
              , f = l * Math.sin(u)
              , m = l * Math.cos(h)
              , p = l * Math.sin(h);
            e.save(),
            e.beginPath();
            var g = t - d
              , y = r - f;
            e.moveTo(g, y),
            e.moveTo(t, r),
            e.lineTo(a, n),
            e.lineWidth = i,
            e.strokeStyle = s,
            e.stroke(),
            g = a + d,
            y = n + f,
            e.moveTo(g, y),
            e.lineTo(a, n),
            g = a + m,
            y = n + p,
            e.lineTo(g, y),
            e.fillStyle = s,
            e.fill(),
            e.restore()
        },
        buildAllPs: function(e) {
            $("#luckysheet-cell-main #luckysheet-postil-showBoxs").empty();
            for (var t = 0; t < e.length; t++)
                for (var r = 0; r < e[0].length; r++)
                    if (null != e[t][r] && null != e[t][r].ps) {
                        var a = e[t][r].ps;
                        this.buildPs(t, r, a)
                    }
            this.init()
        },
        buildPs: function(e, t, r) {
            if ($("#luckysheet-postil-show_" + e + "_" + t).length > 0 && $("#luckysheet-postil-show_" + e + "_" + t).remove(),
            null != r) {
                if (null != r.isshow && r.isshow) {
                    Store.visibledatarow[e];
                    var a = e - 1 == -1 ? 0 : Store.visibledatarow[e - 1]
                      , n = Store.visibledatacolumn[t]
                      , o = (t - 1 == -1 || Store.visibledatacolumn[t - 1],
                    menuButton.mergeborer(Store.flowdata, e, t));
                    o && (o.row[1],
                    a = o.row[0],
                    n = o.column[1],
                    o.column[0]);
                    var l = n
                      , i = a
                      , s = null == r.left ? l + 18 * Store.zoomRatio : r.left * Store.zoomRatio
                      , c = null == r.top ? i - 18 * Store.zoomRatio : r.top * Store.zoomRatio
                      , u = null == r.width ? this.defaultWidth * Store.zoomRatio : r.width * Store.zoomRatio
                      , h = null == r.height ? this.defaultHeight * Store.zoomRatio : r.height * Store.zoomRatio
                      , d = null == r.value ? "" : r.value;
                    c < 0 && (c = 2);
                    var f = this.getArrowCanvasSize(s, c, l, i)
                      , m = '<div id="luckysheet-postil-show_' + e + "_" + t + '" class="luckysheet-postil-show"><canvas class="arrowCanvas" width="' + f[2] + '" height="' + f[3] + '" style="position:absolute;left:' + f[0] + "px;top:" + f[1] + 'px;z-index:100;pointer-events:none;"></canvas><div class="luckysheet-postil-show-main" style="width:' + u + "px;height:" + h + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + s + "px;top:" + c + 'px;box-sizing:border-box;z-index:100;"><div class="luckysheet-postil-dialog-move"><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-t" data-type="t"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-r" data-type="r"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-b" data-type="b"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-l" data-type="l"></div></div><div class="luckysheet-postil-dialog-resize" style="display:none;"><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lt" data-type="lt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mt" data-type="mt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lm" data-type="lm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rm" data-type="rm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rt" data-type="rt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lb" data-type="lb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mb" data-type="mb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div></div><div style="width:100%;height:100%;overflow:hidden;"><div class="formulaInputFocus" style="width:' + (u - 12) + "px;height:" + (h - 12) + 'px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true">' + d + "</div></div></div></div>";
                    $(m).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));
                    var p = $("#luckysheet-postil-show_" + e + "_" + t + " .arrowCanvas").get(0).getContext("2d");
                    this.drawArrow(p, f[4], f[5], f[6], f[7])
                }
            }
        },
        newPs: function(e, t) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects")) {
                Store.visibledatarow[e];
                var r = e - 1 == -1 ? 0 : Store.visibledatarow[e - 1]
                  , a = Store.visibledatacolumn[t]
                  , n = (t - 1 == -1 || Store.visibledatacolumn[t - 1],
                menuButton.mergeborer(Store.flowdata, e, t));
                n && (n.row[1],
                r = n.row[0],
                a = n.column[1],
                n.column[0]);
                var o = a
                  , l = r
                  , i = o + 18 * Store.zoomRatio
                  , s = l - 18 * Store.zoomRatio;
                s < 0 && (s = 2);
                var c = this.defaultWidth * Store.zoomRatio
                  , u = this.defaultHeight * Store.zoomRatio
                  , h = this.getArrowCanvasSize(i, s, o, l)
                  , d = '<div id="luckysheet-postil-show_' + e + "_" + t + '" class="luckysheet-postil-show luckysheet-postil-show-active"><canvas class="arrowCanvas" width="' + h[2] + '" height="' + h[3] + '" style="position:absolute;left:' + h[0] + "px;top:" + h[1] + 'px;z-index:100;pointer-events:none;"></canvas><div class="luckysheet-postil-show-main" style="width:' + c + "px;height:" + u + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + i + "px;top:" + s + 'px;box-sizing:border-box;z-index:100;"><div class="luckysheet-postil-dialog-move"><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-t" data-type="t"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-r" data-type="r"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-b" data-type="b"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-l" data-type="l"></div></div><div class="luckysheet-postil-dialog-resize"><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lt" data-type="lt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mt" data-type="mt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lm" data-type="lm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rm" data-type="rm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rt" data-type="rt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lb" data-type="lb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mb" data-type="mb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div></div><div style="width:100%;height:100%;overflow:hidden;"><div class="formulaInputFocus" style="width:132px;height:72px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true"></div></div></div></div>';
                $(d).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));
                var f = $("#luckysheet-postil-show_" + e + "_" + t + " .arrowCanvas").get(0).getContext("2d");
                this.drawArrow(f, h[4], h[5], h[6], h[7]),
                $("#luckysheet-postil-show_" + e + "_" + t + " .formulaInputFocus").focus(),
                this.init();
                var m = editor.deepCopyFlowData(Store.flowdata)
                  , p = [];
                null == m[e][t] && (m[e][t] = {}),
                m[e][t].ps = {
                    left: null,
                    top: null,
                    width: null,
                    height: null,
                    value: "",
                    isshow: !1
                },
                p.push(e + "_" + t),
                this.ref(m, p)
            }
        },
        editPs: function(e, t) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects")) {
                if ($("#luckysheet-postil-show_" + e + "_" + t).length > 0)
                    $("#luckysheet-postil-show_" + e + "_" + t).show(),
                    $("#luckysheet-postil-show_" + e + "_" + t).addClass("luckysheet-postil-show-active"),
                    $("#luckysheet-postil-show_" + e + "_" + t).find(".luckysheet-postil-dialog-resize").show();
                else {
                    var r = Store.flowdata[e][t].ps
                      , a = (Store.visibledatarow[e],
                    e - 1 == -1 ? 0 : Store.visibledatarow[e - 1])
                      , n = Store.visibledatacolumn[t]
                      , o = (t - 1 == -1 || Store.visibledatacolumn[t - 1],
                    menuButton.mergeborer(Store.flowdata, e, t));
                    o && (o.row[1],
                    a = o.row[0],
                    n = o.column[1],
                    o.column[0]);
                    var l = n
                      , i = a
                      , s = null == r.left ? l + 18 * Store.zoomRatio : r.left * Store.zoomRatio
                      , c = null == r.top ? i - 18 * Store.zoomRatio : r.top * Store.zoomRatio
                      , u = null == r.width ? this.defaultWidth * Store.zoomRatio : r.width * Store.zoomRatio
                      , h = null == r.height ? this.defaultHeight * Store.zoomRatio : r.height * Store.zoomRatio
                      , d = null == r.value ? "" : r.value;
                    c < 0 && (c = 2);
                    var f = this.getArrowCanvasSize(s, c, l, i)
                      , m = '<div id="luckysheet-postil-show_' + e + "_" + t + '" class="luckysheet-postil-show luckysheet-postil-show-active"><canvas class="arrowCanvas" width="' + f[2] + '" height="' + f[3] + '" style="position:absolute;left:' + f[0] + "px;top:" + f[1] + 'px;z-index:100;pointer-events:none;"></canvas><div class="luckysheet-postil-show-main" style="width:' + u + "px;height:" + h + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + s + "px;top:" + c + 'px;box-sizing:border-box;z-index:100;"><div class="luckysheet-postil-dialog-move"><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-t" data-type="t"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-r" data-type="r"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-b" data-type="b"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-l" data-type="l"></div></div><div class="luckysheet-postil-dialog-resize"><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lt" data-type="lt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mt" data-type="mt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lm" data-type="lm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rm" data-type="rm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rt" data-type="rt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lb" data-type="lb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mb" data-type="mb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div></div><div style="width:100%;height:100%;overflow:hidden;"><div class="formulaInputFocus" style="width:' + (u - 12) + "px;height:" + (h - 12) + 'px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true">' + d + "</div></div></div></div>";
                    $(m).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));
                    var p = $("#luckysheet-postil-show_" + e + "_" + t + " .arrowCanvas").get(0).getContext("2d");
                    this.drawArrow(p, f[4], f[5], f[6], f[7])
                }
                $("#luckysheet-postil-show_" + e + "_" + t + " .formulaInputFocus").focus(),
                luckysheetRangeLast($("#luckysheet-postil-show_" + e + "_" + t + " .formulaInputFocus").get(0)),
                this.init()
            }
        },
        delPs: function(e, t) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects")) {
                $("#luckysheet-postil-show_" + e + "_" + t).length > 0 && $("#luckysheet-postil-show_" + e + "_" + t).remove();
                var r = editor.deepCopyFlowData(Store.flowdata)
                  , a = [];
                delete r[e][t].ps,
                a.push(e + "_" + t),
                this.ref(r, a)
            }
        },
        showHidePs: function(e, t) {
            var r = Store.flowdata[e][t].ps
              , a = r.isshow
              , n = editor.deepCopyFlowData(Store.flowdata)
              , o = [];
            if (a)
                n[e][t].ps.isshow = !1,
                $("#luckysheet-postil-show_" + e + "_" + t).remove();
            else {
                n[e][t].ps.isshow = !0;
                Store.visibledatarow[e];
                var l = e - 1 == -1 ? 0 : Store.visibledatarow[e - 1]
                  , i = Store.visibledatacolumn[t]
                  , s = (t - 1 == -1 || Store.visibledatacolumn[t - 1],
                menuButton.mergeborer(Store.flowdata, e, t));
                s && (s.row[1],
                l = s.row[0],
                i = s.column[1],
                s.column[0]);
                var c = i
                  , u = l
                  , h = null == r.left ? c + 18 * Store.zoomRatio : r.left * Store.zoomRatio
                  , d = null == r.top ? u - 18 * Store.zoomRatio : r.top * Store.zoomRatio
                  , f = null == r.width ? this.defaultWidth * Store.zoomRatio : r.width * Store.zoomRatio
                  , m = null == r.height ? this.defaultHeight * Store.zoomRatio : r.height * Store.zoomRatio
                  , p = null == r.value ? "" : r.value;
                d < 0 && (d = 2);
                var g = this.getArrowCanvasSize(h, d, c, u)
                  , y = '<div id="luckysheet-postil-show_' + e + "_" + t + '" class="luckysheet-postil-show"><canvas class="arrowCanvas" width="' + g[2] + '" height="' + g[3] + '" style="position:absolute;left:' + g[0] + "px;top:" + g[1] + 'px;z-index:100;pointer-events:none;"></canvas><div class="luckysheet-postil-show-main" style="width:' + f + "px;height:" + m + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + h + "px;top:" + d + 'px;box-sizing:border-box;z-index:100;"><div class="luckysheet-postil-dialog-move"><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-t" data-type="t"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-r" data-type="r"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-b" data-type="b"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-l" data-type="l"></div></div><div class="luckysheet-postil-dialog-resize" style="display:none;"><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lt" data-type="lt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mt" data-type="mt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lm" data-type="lm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rm" data-type="rm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rt" data-type="rt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lb" data-type="lb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mb" data-type="mb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div></div><div style="width:100%;height:100%;overflow:hidden;"><div class="formulaInputFocus" style="width:' + (f - 12) + "px;height:" + (m - 12) + 'px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true">' + p + "</div></div></div></div>";
                $(y).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));
                var v = $("#luckysheet-postil-show_" + e + "_" + t + " .arrowCanvas").get(0).getContext("2d");
                this.drawArrow(v, g[4], g[5], g[6], g[7]),
                this.init()
            }
            o.push(e + "_" + t),
            this.ref(n, o)
        },
        showHideAllPs: function() {
            for (var e = editor.deepCopyFlowData(Store.flowdata), t = !0, r = [], a = 0; a < e.length; a++)
                for (var n = 0; n < e[0].length; n++)
                    null != e[a] && null != e[a][n] && null != e[a][n].ps && (r.push(a + "_" + n),
                    e[a][n].ps.isshow || (t = !1));
            var o = [];
            if (r.length > 0)
                if (t) {
                    $("#luckysheet-cell-main #luckysheet-postil-showBoxs").empty();
                    for (var l = 0; l < r.length; l++) {
                        var i = r[l].split("_")[0]
                          , s = r[l].split("_")[1];
                        e[i][s].ps.isshow && (e[i][s].ps.isshow = !1,
                        o.push(r[l]))
                    }
                } else
                    for (var c = 0; c < r.length; c++) {
                        var u = r[c].split("_")[0]
                          , h = r[c].split("_")[1]
                          , d = e[u][h].ps;
                        if (!d.isshow) {
                            Store.visibledatarow[u];
                            var f = u - 1 == -1 ? 0 : Store.visibledatarow[u - 1]
                              , m = Store.visibledatacolumn[h]
                              , p = (h - 1 == -1 || Store.visibledatacolumn[h - 1],
                            menuButton.mergeborer(Store.flowdata, u, h));
                            p && (p.row[1],
                            f = p.row[0],
                            m = p.column[1],
                            p.column[0]);
                            var g = m
                              , y = f
                              , v = null == d.left ? g + 18 * Store.zoomRatio : d.left * Store.zoomRatio
                              , A = null == d.top ? y - 18 * Store.zoomRatio : d.top * Store.zoomRatio
                              , b = null == d.width ? this.defaultWidth * Store.zoomRatio : d.width * Store.zoomRatio
                              , k = null == d.height ? this.defaultHeight * Store.zoomRatio : d.height * Store.zoomRatio
                              , w = null == d.value ? "" : d.value;
                            A < 0 && (A = 2);
                            var x = this.getArrowCanvasSize(v, A, g, y)
                              , S = '<div id="luckysheet-postil-show_' + u + "_" + h + '" class="luckysheet-postil-show"><canvas class="arrowCanvas" width="' + x[2] + '" height="' + x[3] + '" style="position:absolute;left:' + x[0] + "px;top:" + x[1] + 'px;z-index:100;pointer-events:none;"></canvas><div class="luckysheet-postil-show-main" style="width:' + b + "px;height:" + k + "px;color:#000;padding:5px;border:1px solid #000;background-color:rgb(255,255,225);position:absolute;left:" + v + "px;top:" + A + 'px;box-sizing:border-box;z-index:100;"><div class="luckysheet-postil-dialog-move"><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-t" data-type="t"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-r" data-type="r"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-b" data-type="b"></div><div class="luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-l" data-type="l"></div></div><div class="luckysheet-postil-dialog-resize" style="display:none;"><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lt" data-type="lt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mt" data-type="mt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lm" data-type="lm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rm" data-type="rm"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rt" data-type="rt"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-lb" data-type="lb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-mb" data-type="mb"></div><div class="luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-rb" data-type="rb"></div></div><div style="width:100%;height:100%;overflow:hidden;"><div class="formulaInputFocus" style="width:' + (b - 12) + "px;height:" + (k - 12) + 'px;line-height:20px;box-sizing:border-box;text-align: center;;word-break:break-all;" spellcheck="false" contenteditable="true">' + w + "</div></div></div></div>";
                            $(S).appendTo($("#luckysheet-cell-main #luckysheet-postil-showBoxs"));
                            var _ = $("#luckysheet-postil-show_" + u + "_" + h + " .arrowCanvas").get(0).getContext("2d");
                            this.drawArrow(_, x[4], x[5], x[6], x[7]),
                            e[u][h].ps.isshow = !0,
                            o.push(r[c])
                        }
                    }
            this.ref(e, o),
            this.init()
        },
        removeActivePs: function() {
            if ($("#luckysheet-postil-showBoxs .luckysheet-postil-show-active").length > 0) {
                var e = $("#luckysheet-postil-showBoxs .luckysheet-postil-show-active").attr("id");
                $("#" + e).removeClass("luckysheet-postil-show-active"),
                $("#" + e).find(".luckysheet-postil-dialog-resize").hide(),
                $("#" + e).find(".arrowCanvas").css("z-index", 100),
                $("#" + e).find(".luckysheet-postil-show-main").css("z-index", 100);
                var t = e.split("luckysheet-postil-show_")[1].split("_")[0]
                  , r = e.split("luckysheet-postil-show_")[1].split("_")[1]
                  , a = $("#" + e).find(".formulaInputFocus").text()
                  , n = editor.deepCopyFlowData(Store.flowdata)
                  , o = [];
                n[t][r].ps.value = a,
                o.push(t + "_" + r),
                this.ref(n, o),
                n[t][r].ps.isshow || $("#" + e).remove()
            }
        },
        ref: function(e, t) {
            if (Store.clearjfundo && (Store.jfundo = [],
            Store.jfredo.push({
                type: "postil",
                data: Store.flowdata,
                curdata: e,
                sheetIndex: Store.currentSheetIndex,
                rc: t
            })),
            Store.flowdata = e,
            editor.webWorkerFlowDataCache(Store.flowdata),
            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata,
            server.allowUpdate)
                for (var r = 0; r < t.length; r++) {
                    var a = t[r].split("_")[0]
                      , n = t[r].split("_")[1];
                    server.saveParam("v", Store.currentSheetIndex, Store.flowdata[a][n], {
                        r: a,
                        c: n
                    })
                }
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        },
        positionSync: function() {
            var e = this;
            $("#luckysheet-postil-showBoxs .luckysheet-postil-show").each((function(t, r) {
                var a = $(r).attr("id")
                  , n = a.split("luckysheet-postil-show_")[1].split("_")[0]
                  , o = a.split("luckysheet-postil-show_")[1].split("_")[1]
                  , l = Store.flowdata[n][o];
                null != l && null != l.ps ? e.buildPs(n, o, l.ps) : $("#" + a).hide()
            }
            ))
        }
    };
    function getBorderInfoComputeRange(e, t, r, a, n) {
        var o, l, i = {};
        null == n ? (o = Store.config,
        l = Store.flowdata) : (o = Store.luckysheetfile[getSheetIndex(n)].config,
        l = Store.luckysheetfile[getSheetIndex(n)].data);
        var s = o.borderInfo;
        if (null != s && s.length > 0)
            for (var c = 0; c < s.length; c++) {
                var u = s[c].rangeType;
                if ("range" == u)
                    for (var h = s[c].borderType, d = s[c].color, f = s[c].style, m = s[c].range, p = 0; p < m.length; p++) {
                        var g = m[p].row[0]
                          , y = m[p].row[1]
                          , v = m[p].column[0]
                          , A = m[p].column[1];
                        if (g < e && (g = e),
                        y > t && (y = t),
                        v < r && (v = r),
                        A > a && (A = a),
                        "border-left" == h) {
                            for (var b = g; b <= y; b++)
                                if (null == o.rowhidden || null == o.rowhidden[b]) {
                                    null == i[b + "_" + v] && (i[b + "_" + v] = {}),
                                    i[b + "_" + v].l = {
                                        color: d,
                                        style: f
                                    };
                                    var k = v - 1;
                                    if (k >= 0 && i[b + "_" + k])
                                        if (null != l[b] && "object" == getObjType(l[b][k]) && null != l[b][k].mc) {
                                            var w = l[b][k]
                                              , x = o.merge[w.mc.r + "_" + w.mc.c];
                                            x.c + x.cs - 1 == k && (i[b + "_" + k].r = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            i[b + "_" + k].r = {
                                                color: d,
                                                style: f
                                            }
                                }
                        } else if ("border-right" == h) {
                            for (var S = g; S <= y; S++)
                                if (null == o.rowhidden || null == o.rowhidden[S]) {
                                    null == i[S + "_" + A] && (i[S + "_" + A] = {}),
                                    i[S + "_" + A].r = {
                                        color: d,
                                        style: f
                                    };
                                    var _ = A + 1;
                                    if (_ < l[0].length && i[S + "_" + _])
                                        if (null != l[S] && "object" == getObjType(l[S][_]) && null != l[S][_].mc) {
                                            var C = l[S][_];
                                            o.merge[C.mc.r + "_" + C.mc.c].c == _ && (i[S + "_" + _].l = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            i[S + "_" + _].l = {
                                                color: d,
                                                style: f
                                            }
                                }
                        } else if ("border-top" == h) {
                            if (null != o.rowhidden && null != o.rowhidden[g])
                                continue;
                            for (var T = v; T <= A; T++) {
                                null == i[g + "_" + T] && (i[g + "_" + T] = {}),
                                i[g + "_" + T].t = {
                                    color: d,
                                    style: f
                                };
                                var E = g - 1;
                                if (E >= 0 && i[E + "_" + T])
                                    if (null != l[E] && "object" == getObjType(l[E][T]) && null != l[E][T].mc) {
                                        var I = l[E][T]
                                          , R = o.merge[I.mc.r + "_" + I.mc.c];
                                        R.r + R.rs - 1 == E && (i[E + "_" + T].b = {
                                            color: d,
                                            style: f
                                        })
                                    } else
                                        i[E + "_" + T].b = {
                                            color: d,
                                            style: f
                                        }
                            }
                        } else if ("border-bottom" == h) {
                            if (null != o.rowhidden && null != o.rowhidden[y])
                                continue;
                            for (var B = v; B <= A; B++) {
                                null == i[y + "_" + B] && (i[y + "_" + B] = {}),
                                i[y + "_" + B].b = {
                                    color: d,
                                    style: f
                                };
                                var N = y + 1;
                                if (N < l.length && i[N + "_" + B])
                                    if (null != l[N] && "object" == getObjType(l[N][B]) && null != l[N][B].mc) {
                                        var F = l[N][B];
                                        o.merge[F.mc.r + "_" + F.mc.c].r == N && (i[N + "_" + B].t = {
                                            color: d,
                                            style: f
                                        })
                                    } else
                                        i[N + "_" + B].t = {
                                            color: d,
                                            style: f
                                        }
                            }
                        } else if ("border-all" == h) {
                            for (var P = g; P <= y; P++)
                                if (null == o.rowhidden || null == o.rowhidden[P])
                                    for (var $ = v; $ <= A; $++) {
                                        if (null != l[P] && "object" == getObjType(l[P][$]) && null != l[P][$].mc) {
                                            var L = l[P][$]
                                              , O = o.merge[L.mc.r + "_" + L.mc.c];
                                            O.r == P && (null == i[P + "_" + $] && (i[P + "_" + $] = {}),
                                            i[P + "_" + $].t = {
                                                color: d,
                                                style: f
                                            }),
                                            O.r + O.rs - 1 == P && (null == i[P + "_" + $] && (i[P + "_" + $] = {}),
                                            i[P + "_" + $].b = {
                                                color: d,
                                                style: f
                                            }),
                                            O.c == $ && (null == i[P + "_" + $] && (i[P + "_" + $] = {}),
                                            i[P + "_" + $].l = {
                                                color: d,
                                                style: f
                                            }),
                                            O.c + O.cs - 1 == $ && (null == i[P + "_" + $] && (i[P + "_" + $] = {}),
                                            i[P + "_" + $].r = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            null == i[P + "_" + $] && (i[P + "_" + $] = {}),
                                            i[P + "_" + $].l = {
                                                color: d,
                                                style: f
                                            },
                                            i[P + "_" + $].r = {
                                                color: d,
                                                style: f
                                            },
                                            i[P + "_" + $].t = {
                                                color: d,
                                                style: f
                                            },
                                            i[P + "_" + $].b = {
                                                color: d,
                                                style: f
                                            };
                                        if (P == g) {
                                            var D = g - 1;
                                            if (D >= 0 && i[D + "_" + $])
                                                if (null != l[D] && "object" == getObjType(l[D][$]) && null != l[D][$].mc) {
                                                    var M = l[D][$]
                                                      , U = o.merge[M.mc.r + "_" + M.mc.c];
                                                    U.r + U.rs - 1 == D && (i[D + "_" + $].b = {
                                                        color: d,
                                                        style: f
                                                    })
                                                } else
                                                    i[D + "_" + $].b = {
                                                        color: d,
                                                        style: f
                                                    }
                                        }
                                        if (P == y) {
                                            var H = y + 1;
                                            if (H < l.length && i[H + "_" + $])
                                                if (null != l[H] && "object" == getObjType(l[H][$]) && null != l[H][$].mc) {
                                                    var q = l[H][$];
                                                    o.merge[q.mc.r + "_" + q.mc.c].r == H && (i[H + "_" + $].t = {
                                                        color: d,
                                                        style: f
                                                    })
                                                } else
                                                    i[H + "_" + $].t = {
                                                        color: d,
                                                        style: f
                                                    }
                                        }
                                        if ($ == v) {
                                            var z = v - 1;
                                            if (z >= 0 && i[P + "_" + z])
                                                if (null != l[P] && "object" == getObjType(l[P][z]) && null != l[P][z].mc) {
                                                    var j = l[P][z]
                                                      , V = o.merge[j.mc.r + "_" + j.mc.c];
                                                    V.c + V.cs - 1 == z && (i[P + "_" + z].r = {
                                                        color: d,
                                                        style: f
                                                    })
                                                } else
                                                    i[P + "_" + z].r = {
                                                        color: d,
                                                        style: f
                                                    }
                                        }
                                        if ($ == A) {
                                            var Q = A + 1;
                                            if (Q < l[0].length && i[P + "_" + Q])
                                                if (null != l[P] && "object" == getObjType(l[P][Q]) && null != l[P][Q].mc) {
                                                    var G = l[P][Q];
                                                    o.merge[G.mc.r + "_" + G.mc.c].c == Q && (i[P + "_" + Q].l = {
                                                        color: d,
                                                        style: f
                                                    })
                                                } else
                                                    i[P + "_" + Q].l = {
                                                        color: d,
                                                        style: f
                                                    }
                                        }
                                    }
                        } else if ("border-outside" == h) {
                            for (var K = g; K <= y; K++)
                                if (null == o.rowhidden || null == o.rowhidden[K])
                                    for (var W = v; W <= A; W++)
                                        if (K == g || K == y || W == v || W == A) {
                                            if (K == g) {
                                                null == i[K + "_" + W] && (i[K + "_" + W] = {}),
                                                i[K + "_" + W].t = {
                                                    color: d,
                                                    style: f
                                                };
                                                var Y = g - 1;
                                                if (Y >= 0 && i[Y + "_" + W])
                                                    if (null != l[Y] && "object" == getObjType(l[Y][W]) && null != l[Y][W].mc) {
                                                        var X = l[Y][W]
                                                          , J = o.merge[X.mc.r + "_" + X.mc.c];
                                                        J.r + J.rs - 1 == Y && (i[Y + "_" + W].b = {
                                                            color: d,
                                                            style: f
                                                        })
                                                    } else
                                                        i[Y + "_" + W].b = {
                                                            color: d,
                                                            style: f
                                                        }
                                            }
                                            if (K == y) {
                                                null == i[K + "_" + W] && (i[K + "_" + W] = {}),
                                                i[K + "_" + W].b = {
                                                    color: d,
                                                    style: f
                                                };
                                                var Z = y + 1;
                                                if (Z < l.length && i[Z + "_" + W])
                                                    if (null != l[Z] && "object" == getObjType(l[Z][W]) && null != l[Z][W].mc) {
                                                        var ee = l[Z][W];
                                                        o.merge[ee.mc.r + "_" + ee.mc.c].r == Z && (i[Z + "_" + W].t = {
                                                            color: d,
                                                            style: f
                                                        })
                                                    } else
                                                        i[Z + "_" + W].t = {
                                                            color: d,
                                                            style: f
                                                        }
                                            }
                                            if (W == v) {
                                                null == i[K + "_" + W] && (i[K + "_" + W] = {}),
                                                i[K + "_" + W].l = {
                                                    color: d,
                                                    style: f
                                                };
                                                var te = v - 1;
                                                if (te >= 0 && i[K + "_" + te])
                                                    if (null != l[K] && "object" == getObjType(l[K][te]) && null != l[K][te].mc) {
                                                        var re = l[K][te]
                                                          , ae = o.merge[re.mc.r + "_" + re.mc.c];
                                                        ae.c + ae.cs - 1 == te && (i[K + "_" + te].r = {
                                                            color: d,
                                                            style: f
                                                        })
                                                    } else
                                                        i[K + "_" + te].r = {
                                                            color: d,
                                                            style: f
                                                        }
                                            }
                                            if (W == A) {
                                                null == i[K + "_" + W] && (i[K + "_" + W] = {}),
                                                i[K + "_" + W].r = {
                                                    color: d,
                                                    style: f
                                                };
                                                var ne = A + 1;
                                                if (ne < l[0].length && i[K + "_" + ne])
                                                    if (null != l[K] && "object" == getObjType(l[K][ne]) && null != l[K][ne].mc) {
                                                        var oe = l[K][ne];
                                                        o.merge[oe.mc.r + "_" + oe.mc.c].c == ne && (i[K + "_" + ne].l = {
                                                            color: d,
                                                            style: f
                                                        })
                                                    } else
                                                        i[K + "_" + ne].l = {
                                                            color: d,
                                                            style: f
                                                        }
                                            }
                                        }
                        } else if ("border-inside" == h) {
                            for (var le = g; le <= y; le++)
                                if (null == o.rowhidden || null == o.rowhidden[le])
                                    for (var ie = v; ie <= A; ie++)
                                        if (le == g && ie == v)
                                            null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc || (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].r = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].b = {
                                                color: d,
                                                style: f
                                            });
                                        else if (le == y && ie == v)
                                            null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc || (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].r = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].t = {
                                                color: d,
                                                style: f
                                            });
                                        else if (le == g && ie == A)
                                            null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc || (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].l = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].b = {
                                                color: d,
                                                style: f
                                            });
                                        else if (le == y && ie == A)
                                            null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc || (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].l = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].t = {
                                                color: d,
                                                style: f
                                            });
                                        else if (le == g)
                                            if (null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc) {
                                                var se = l[le][ie]
                                                  , ce = o.merge[se.mc.r + "_" + se.mc.c];
                                                ce.c == ie ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].l = {
                                                    color: d,
                                                    style: f
                                                }) : ce.c + ce.cs - 1 == ie && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].r = {
                                                    color: d,
                                                    style: f
                                                })
                                            } else
                                                null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].l = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].r = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].b = {
                                                    color: d,
                                                    style: f
                                                };
                                        else if (le == y)
                                            if (null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc) {
                                                var ue = l[le][ie]
                                                  , he = o.merge[ue.mc.r + "_" + ue.mc.c];
                                                he.c == ie ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].l = {
                                                    color: d,
                                                    style: f
                                                }) : he.c + he.cs - 1 == ie && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].r = {
                                                    color: d,
                                                    style: f
                                                })
                                            } else
                                                null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].l = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].r = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].t = {
                                                    color: d,
                                                    style: f
                                                };
                                        else if (ie == v)
                                            if (null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc) {
                                                var de = l[le][ie]
                                                  , fe = o.merge[de.mc.r + "_" + de.mc.c];
                                                fe.r == le ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].t = {
                                                    color: d,
                                                    style: f
                                                }) : fe.r + fe.rs - 1 == le && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].b = {
                                                    color: d,
                                                    style: f
                                                })
                                            } else
                                                null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].r = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].t = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].b = {
                                                    color: d,
                                                    style: f
                                                };
                                        else if (ie == A)
                                            if (null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc) {
                                                var me = l[le][ie]
                                                  , pe = o.merge[me.mc.r + "_" + me.mc.c];
                                                pe.r == le ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].t = {
                                                    color: d,
                                                    style: f
                                                }) : pe.r + pe.rs - 1 == le && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].b = {
                                                    color: d,
                                                    style: f
                                                })
                                            } else
                                                null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                                i[le + "_" + ie].l = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].t = {
                                                    color: d,
                                                    style: f
                                                },
                                                i[le + "_" + ie].b = {
                                                    color: d,
                                                    style: f
                                                };
                                        else if (null != l[le] && "object" == getObjType(l[le][ie]) && null != l[le][ie].mc) {
                                            var ge = l[le][ie]
                                              , ye = o.merge[ge.mc.r + "_" + ge.mc.c];
                                            ye.r == le ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].t = {
                                                color: d,
                                                style: f
                                            }) : ye.r + ye.rs - 1 == le && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].b = {
                                                color: d,
                                                style: f
                                            }),
                                            ye.c == ie ? (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].l = {
                                                color: d,
                                                style: f
                                            }) : ye.c + ye.cs - 1 == ie && (null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].r = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            null == i[le + "_" + ie] && (i[le + "_" + ie] = {}),
                                            i[le + "_" + ie].l = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].r = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].t = {
                                                color: d,
                                                style: f
                                            },
                                            i[le + "_" + ie].b = {
                                                color: d,
                                                style: f
                                            }
                        } else if ("border-horizontal" == h) {
                            for (var ve = g; ve <= y; ve++)
                                if (null == o.rowhidden || null == o.rowhidden[ve])
                                    for (var Ae = v; Ae <= A; Ae++)
                                        if (ve == g)
                                            null != l[ve] && "object" == getObjType(l[ve][Ae]) && null != l[ve][Ae].mc || (null == i[ve + "_" + Ae] && (i[ve + "_" + Ae] = {}),
                                            i[ve + "_" + Ae].b = {
                                                color: d,
                                                style: f
                                            });
                                        else if (ve == y)
                                            null != l[ve] && "object" == getObjType(l[ve][Ae]) && null != l[ve][Ae].mc || (null == i[ve + "_" + Ae] && (i[ve + "_" + Ae] = {}),
                                            i[ve + "_" + Ae].t = {
                                                color: d,
                                                style: f
                                            });
                                        else if (null != l[ve] && "object" == getObjType(l[ve][Ae]) && null != l[ve][Ae].mc) {
                                            var be = l[ve][Ae]
                                              , ke = o.merge[be.mc.r + "_" + be.mc.c];
                                            ke.r == ve ? (null == i[ve + "_" + Ae] && (i[ve + "_" + Ae] = {}),
                                            i[ve + "_" + Ae].t = {
                                                color: d,
                                                style: f
                                            }) : ke.r + ke.rs - 1 == ve && (null == i[ve + "_" + Ae] && (i[ve + "_" + Ae] = {}),
                                            i[ve + "_" + Ae].b = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            null == i[ve + "_" + Ae] && (i[ve + "_" + Ae] = {}),
                                            i[ve + "_" + Ae].t = {
                                                color: d,
                                                style: f
                                            },
                                            i[ve + "_" + Ae].b = {
                                                color: d,
                                                style: f
                                            }
                        } else if ("border-vertical" == h) {
                            for (var we = g; we <= y; we++)
                                if (null == o.rowhidden || null == o.rowhidden[we])
                                    for (var xe = v; xe <= A; xe++)
                                        if (xe == v)
                                            null != l[we] && "object" == getObjType(l[we][xe]) && null != l[we][xe].mc || (null == i[we + "_" + xe] && (i[we + "_" + xe] = {}),
                                            i[we + "_" + xe].r = {
                                                color: d,
                                                style: f
                                            });
                                        else if (xe == A)
                                            null != l[we] && "object" == getObjType(l[we][xe]) && null != l[we][xe].mc || (null == i[we + "_" + xe] && (i[we + "_" + xe] = {}),
                                            i[we + "_" + xe].l = {
                                                color: d,
                                                style: f
                                            });
                                        else if (null != l[we] && "object" == getObjType(l[we][xe]) && null != l[we][xe].mc) {
                                            var Se = l[we][xe]
                                              , _e = o.merge[Se.mc.r + "_" + Se.mc.c] || {};
                                            _e.c == xe ? (null == i[we + "_" + xe] && (i[we + "_" + xe] = {}),
                                            i[we + "_" + xe].l = {
                                                color: d,
                                                style: f
                                            }) : _e.c + _e.cs - 1 == xe && (null == i[we + "_" + xe] && (i[we + "_" + xe] = {}),
                                            i[we + "_" + xe].r = {
                                                color: d,
                                                style: f
                                            })
                                        } else
                                            null == i[we + "_" + xe] && (i[we + "_" + xe] = {}),
                                            i[we + "_" + xe].l = {
                                                color: d,
                                                style: f
                                            },
                                            i[we + "_" + xe].r = {
                                                color: d,
                                                style: f
                                            }
                        } else if ("border-none" == h)
                            for (var Ce = g; Ce <= y; Ce++)
                                if (null == o.rowhidden || null == o.rowhidden[Ce])
                                    for (var Te = v; Te <= A; Te++) {
                                        if (null != i[Ce + "_" + Te] && delete i[Ce + "_" + Te],
                                        Ce == g) {
                                            var Ee = g - 1;
                                            Ee >= 0 && i[Ee + "_" + Te] && delete i[Ee + "_" + Te].b
                                        }
                                        if (Ce == y) {
                                            var Ie = y + 1;
                                            Ie < l.length && i[Ie + "_" + Te] && delete i[Ie + "_" + Te].t
                                        }
                                        if (Te == v) {
                                            var Re = v - 1;
                                            Re >= 0 && i[Ce + "_" + Re] && delete i[Ce + "_" + Re].r
                                        }
                                        if (Te == A) {
                                            var Be = A + 1;
                                            Be < l[0].length && i[Ce + "_" + Be] && delete i[Ce + "_" + Be].l
                                        }
                                    }
                    }
                else if ("cell" == u) {
                    var Ne = s[c].value
                      , Fe = Ne.row_index
                      , Pe = Ne.col_index;
                    if (Fe < e || Fe > t || Pe < r || Pe > a)
                        continue;
                    if (null != o.rowhidden && null != o.rowhidden[Fe])
                        continue;
                    if (null != Ne.l || null != Ne.r || null != Ne.t || null != Ne.b)
                        if (null == i[Fe + "_" + Pe] && (i[Fe + "_" + Pe] = {}),
                        null != l[Fe] && "object" == getObjType(l[Fe][Pe]) && null != l[Fe][Pe].mc) {
                            var $e = l[Fe][Pe]
                              , Le = o.merge[$e.mc.r + "_" + $e.mc.c] || {};
                            if (null != Ne.l && Pe == Le.c) {
                                i[Fe + "_" + Pe].l = {
                                    color: Ne.l.color,
                                    style: Ne.l.style
                                };
                                var Oe = Pe - 1;
                                if (Oe >= 0 && i[Fe + "_" + Oe])
                                    if (null != l[Fe] && "object" == getObjType(l[Fe][Oe]) && null != l[Fe][Oe].mc) {
                                        var De = l[Fe][Oe]
                                          , Me = o.merge[De.mc.r + "_" + De.mc.c];
                                        Me.c + Me.cs - 1 == Oe && (i[Fe + "_" + Oe].r = {
                                            color: Ne.l.color,
                                            style: Ne.l.style
                                        })
                                    } else
                                        i[Fe + "_" + Oe].r = {
                                            color: Ne.l.color,
                                            style: Ne.l.style
                                        }
                            } else
                                i[Fe + "_" + Pe].l = null;
                            if (null != Ne.r && Pe == Le.c + Le.cs - 1) {
                                i[Fe + "_" + Pe].r = {
                                    color: Ne.r.color,
                                    style: Ne.r.style
                                };
                                var Ue = Pe + 1;
                                if (Ue < l[0].length && i[Fe + "_" + Ue])
                                    if (null != l[Fe] && "object" == getObjType(l[Fe][Ue]) && null != l[Fe][Ue].mc) {
                                        var He = l[Fe][Ue];
                                        o.merge[He.mc.r + "_" + He.mc.c].c == Ue && (i[Fe + "_" + Ue].l = {
                                            color: Ne.r.color,
                                            style: Ne.r.style
                                        })
                                    } else
                                        i[Fe + "_" + Ue].l = {
                                            color: Ne.r.color,
                                            style: Ne.r.style
                                        }
                            } else
                                i[Fe + "_" + Pe].r = null;
                            if (null != Ne.t && Fe == Le.r) {
                                i[Fe + "_" + Pe].t = {
                                    color: Ne.t.color,
                                    style: Ne.t.style
                                };
                                var qe = Fe - 1;
                                if (qe >= 0 && i[qe + "_" + Pe])
                                    if (null != l[qe] && "object" == getObjType(l[qe][Pe]) && null != l[qe][Pe].mc) {
                                        var ze = l[qe][Pe]
                                          , je = o.merge[ze.mc.r + "_" + ze.mc.c];
                                        je.r + je.rs - 1 == qe && (i[qe + "_" + Pe].b = {
                                            color: Ne.t.color,
                                            style: Ne.t.style
                                        })
                                    } else
                                        i[qe + "_" + Pe].b = {
                                            color: Ne.t.color,
                                            style: Ne.t.style
                                        }
                            } else
                                i[Fe + "_" + Pe].t = null;
                            if (null != Ne.b && Fe == Le.r + Le.rs - 1) {
                                i[Fe + "_" + Pe].b = {
                                    color: Ne.b.color,
                                    style: Ne.b.style
                                };
                                var Ve = Fe + 1;
                                if (Ve < l.length && i[Ve + "_" + Pe])
                                    if (null != l[Ve] && "object" == getObjType(l[Ve][Pe]) && null != l[Ve][Pe].mc) {
                                        var Qe = l[Ve][Pe];
                                        o.merge[Qe.mc.r + "_" + Qe.mc.c].r == Ve && (i[Ve + "_" + Pe].t = {
                                            color: Ne.b.color,
                                            style: Ne.b.style
                                        })
                                    } else
                                        i[Ve + "_" + Pe].t = {
                                            color: Ne.b.color,
                                            style: Ne.b.style
                                        }
                            } else
                                i[Fe + "_" + Pe].b = null
                        } else {
                            if (null != Ne.l) {
                                i[Fe + "_" + Pe].l = {
                                    color: Ne.l.color,
                                    style: Ne.l.style
                                };
                                var Ge = Pe - 1;
                                if (Ge >= 0 && i[Fe + "_" + Ge])
                                    if (null != l[Fe] && "object" == getObjType(l[Fe][Ge]) && null != l[Fe][Ge].mc) {
                                        var Ke = l[Fe][Ge]
                                          , We = o.merge[Ke.mc.r + "_" + Ke.mc.c];
                                        We.c + We.cs - 1 == Ge && (i[Fe + "_" + Ge].r = {
                                            color: Ne.l.color,
                                            style: Ne.l.style
                                        })
                                    } else
                                        i[Fe + "_" + Ge].r = {
                                            color: Ne.l.color,
                                            style: Ne.l.style
                                        }
                            } else
                                i[Fe + "_" + Pe].l = null;
                            if (null != Ne.r) {
                                i[Fe + "_" + Pe].r = {
                                    color: Ne.r.color,
                                    style: Ne.r.style
                                };
                                var Ye = Pe + 1;
                                if (Ye < l[0].length && i[Fe + "_" + Ye])
                                    if (null != l[Fe] && "object" == getObjType(l[Fe][Ye]) && null != l[Fe][Ye].mc) {
                                        var Xe = l[Fe][Ye];
                                        o.merge[Xe.mc.r + "_" + Xe.mc.c].c == Ye && (i[Fe + "_" + Ye].l = {
                                            color: Ne.r.color,
                                            style: Ne.r.style
                                        })
                                    } else
                                        i[Fe + "_" + Ye].l = {
                                            color: Ne.r.color,
                                            style: Ne.r.style
                                        }
                            } else
                                i[Fe + "_" + Pe].r = null;
                            if (null != Ne.t) {
                                i[Fe + "_" + Pe].t = {
                                    color: Ne.t.color,
                                    style: Ne.t.style
                                };
                                var Je = Fe - 1;
                                if (Je >= 0 && i[Je + "_" + Pe])
                                    if (null != l[Je] && "object" == getObjType(l[Je][Pe]) && null != l[Je][Pe].mc) {
                                        var Ze = l[Je][Pe]
                                          , et = o.merge[Ze.mc.r + "_" + Ze.mc.c];
                                        et.r + et.rs - 1 == Je && (i[Je + "_" + Pe].b = {
                                            color: Ne.t.color,
                                            style: Ne.t.style
                                        })
                                    } else
                                        i[Je + "_" + Pe].b = {
                                            color: Ne.t.color,
                                            style: Ne.t.style
                                        }
                            } else
                                i[Fe + "_" + Pe].t = null;
                            if (null != Ne.b) {
                                i[Fe + "_" + Pe].b = {
                                    color: Ne.b.color,
                                    style: Ne.b.style
                                };
                                var tt = Fe + 1;
                                if (tt < l.length && i[tt + "_" + Pe])
                                    if (null != l[tt] && "object" == getObjType(l[tt][Pe]) && null != l[tt][Pe].mc) {
                                        var rt = l[tt][Pe];
                                        o.merge[rt.mc.r + "_" + rt.mc.c].r == tt && (i[tt + "_" + Pe].t = {
                                            color: Ne.b.color,
                                            style: Ne.b.style
                                        })
                                    } else
                                        i[tt + "_" + Pe].t = {
                                            color: Ne.b.color,
                                            style: Ne.b.style
                                        }
                            } else
                                i[Fe + "_" + Pe].b = null
                        }
                    else
                        delete i[Fe + "_" + Pe]
                }
            }
        return i
    }
    function getBorderInfoCompute(e) {
        var t;
        return null == e ? (Store.config,
        t = Store.flowdata) : (Store.luckysheetfile[getSheetIndex(e)].config,
        t = Store.luckysheetfile[getSheetIndex(e)].data),
        getBorderInfoComputeRange(0, t.length, 0, t[0].length, e),
        {}
    }
    var luckysheetDropCell = {
        iconHtml: '<div id="luckysheet-dropCell-icon" style="position: absolute;padding: 2px;background-color: #f1f1f1;z-index: 990;cursor: pointer;"><div id="icon_dropCell"></div></div>',
        typeListHtml: '<div id="luckysheet-dropCell-typeList" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="0"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${copyCell}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="1"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${sequence}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="2"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${onlyFormat}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="3"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${noFormat}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="4"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${day}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="5"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${workDay}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="6"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${month}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="7"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${year}</div></div><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" data-type="8"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 2px;"><span style="margin-right:5px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span>${chineseNumber}</div></div></div>',
        copyRange: {},
        applyRange: {},
        applyType: null,
        direction: null,
        chnNumChar: {
            "零": 0,
            "一": 1,
            "二": 2,
            "三": 3,
            "四": 4,
            "五": 5,
            "六": 6,
            "七": 7,
            "八": 8,
            "九": 9
        },
        chnNameValue: {
            "十": {
                value: 10,
                secUnit: !1
            },
            "百": {
                value: 100,
                secUnit: !1
            },
            "千": {
                value: 1e3,
                secUnit: !1
            },
            "万": {
                value: 1e4,
                secUnit: !0
            },
            "亿": {
                value: 1e8,
                secUnit: !0
            }
        },
        ChineseToNumber: function(e) {
            for (var t = 0, r = 0, a = 0, n = e.split(""), o = 0; o < n.length; o++) {
                var l = this.chnNumChar[n[o]];
                if (void 0 !== l)
                    a = l,
                    o == n.length - 1 && (r += a);
                else {
                    var i = this.chnNameValue[n[o]].value;
                    this.chnNameValue[n[o]].secUnit ? (t += r = (r + a) * i,
                    r = 0) : r += a * i,
                    a = 0
                }
            }
            return t + r
        },
        chnNumChar2: ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"],
        chnUnitSection: ["", "万", "亿", "万亿", "亿亿"],
        chnUnitChar: ["", "十", "百", "千"],
        SectionToChinese: function(e) {
            for (var t = "", r = "", a = 0, n = !0; e > 0; ) {
                var o = e % 10;
                0 == o ? n || (n = !0,
                r = this.chnNumChar2[o] + r) : (n = !1,
                t = this.chnNumChar2[o],
                r = (t += this.chnUnitChar[a]) + r),
                a++,
                e = Math.floor(e / 10)
            }
            return r
        },
        NumberToChinese: function(e) {
            var t = 0
              , r = ""
              , a = ""
              , n = !1;
            if (0 == e)
                return this.chnNumChar2[0];
            for (; e > 0; ) {
                var o = e % 1e4;
                n && (a = this.chnNumChar2[0] + a),
                r = this.SectionToChinese(o),
                a = (r += 0 != o ? this.chnUnitSection[t] : this.chnUnitSection[0]) + a,
                n = o < 1e3 && o > 0,
                e = Math.floor(e / 1e4),
                t++
            }
            return a
        },
        isChnNumber: function(e) {
            var t = !0;
            if (1 == e.length)
                t = "日" == e || e in this.chnNumChar;
            else
                for (var r = e.split(""), a = 0; a < r.length; a++)
                    if (!(r[a]in this.chnNumChar) && !(r[a]in this.chnNameValue)) {
                        t = !1;
                        break
                    }
            return t
        },
        isExtendNumber: function(e) {
            var t, r = /[0-9]/;
            if (t = !!r.test(e.substr(e.length - 1, 1)),
            t) {
                var a = e.split("");
                a.reverse();
                for (var n = 0, o = 0; o < a.length; o++)
                    if (!r.test(a[o])) {
                        n = o;
                        break
                    }
                return [t, e.substr(0, e.length - n), e.substr(e.length - n, n)]
            }
            return [t]
        },
        isChnWeek1: function(e) {
            var t;
            return t = 1 == e.length && ("日" == e || this.ChineseToNumber(e) < 7),
            t
        },
        isChnWeek2: function(e) {
            var t;
            return t = 2 == e.length && ("周一" == e || "周二" == e || "周三" == e || "周四" == e || "周五" == e || "周六" == e || "周日" == e),
            t
        },
        isChnWeek3: function(e) {
            var t;
            return t = 3 == e.length && ("星期一" == e || "星期二" == e || "星期三" == e || "星期四" == e || "星期五" == e || "星期六" == e || "星期日" == e),
            t
        },
        createIcon: function() {
            var e, t, r = this, a = r.copyRange.row[1], n = r.copyRange.column[1], o = r.applyRange.row[1], l = r.applyRange.column[1];
            o >= a && l >= n ? (e = o,
            t = l) : (e = a,
            t = n);
            var i = rowLocationByIndex(e)[1]
              , s = (rowLocationByIndex(e)[0],
            colLocationByIndex(t)[1]);
            colLocationByIndex(t)[0];
            $("#luckysheet-dropCell-icon").remove(),
            $("#luckysheet-cell-main").append(r.iconHtml),
            $("#luckysheet-dropCell-icon").css({
                left: s,
                top: i
            }),
            $("#luckysheet-dropCell-icon").mouseover((function() {
                $(this).css("background-color", "#ffe8e8")
            }
            )).mouseleave((function() {
                $(this).css("background-color", "#f1f1f1")
            }
            )).mousedown((function(e) {
                $("#luckysheet-dropCell-typeList").remove();
                var t = locale().dropCell;
                $("body").append(replaceHtml$1(r.typeListHtml, {
                    copyCell: t.copyCell,
                    sequence: t.sequence,
                    onlyFormat: t.onlyFormat,
                    noFormat: t.noFormat,
                    day: t.day,
                    workDay: t.workDay,
                    month: t.month,
                    year: t.year,
                    chineseNumber: t.chineseNumber
                }));
                var a = r.typeItemHide();
                a[0] || a[1] || a[2] || a[3] || a[4] || a[5] || a[6] || ($("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=1]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=4]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=5]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=6]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=7]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=8]").hide()),
                a[2] || ($("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=4]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=5]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=6]").hide(),
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=7]").hide()),
                a[3] || $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=8]").hide();
                var n = $(this).offset().left
                  , o = $(this).offset().top + 25
                  , l = $(window).height()
                  , i = $(window).width()
                  , s = $("#luckysheet-dropCell-typeList").width()
                  , c = $("#luckysheet-dropCell-typeList").height();
                n + s > i && (n -= s),
                o + c > l && (o = o - c - 38),
                o < 0 && (o = 0),
                $("#luckysheet-dropCell-typeList").css({
                    left: n,
                    top: o
                }).show(),
                $("#luckysheet-dropCell-icon").mouseleave((function() {
                    $(this).css("backgroundColor", "#ffe8e8")
                }
                ));
                var u = r.applyType;
                $("#luckysheet-dropCell-typeList .luckysheet-cols-menuitem[data-type=" + u + "]").find("span").append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>'),
                e.stopPropagation()
            }
            )),
            $(document).off("click.dCtypeList").on("click.dCtypeList", "#luckysheet-dropCell-typeList .luckysheet-cols-menuitem", (function() {
                $("#luckysheet-dropCell-typeList .fa-check").remove(),
                $(this).find("span").append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>');
                var e = $(this).attr("data-type");
                r.applyType = e,
                r.update(),
                $("#luckysheet-dropCell-typeList").hide(),
                $("#luckysheet-dropCell-icon").css("backgroundColor", "#f1f1f1"),
                $("#luckysheet-dropCell-icon").mouseleave((function() {
                    $(this).css("backgroundColor", "#f1f1f1")
                }
                )),
                countfunc()
            }
            ))
        },
        typeItemHide: function() {
            for (var e = this.copyRange, t = e.row[0], r = e.row[1], a = e.column[0], n = e.column[1], o = !1, l = !1, i = !1, s = !1, c = !1, u = !1, h = !1, d = t; d <= r; d++)
                for (var f = a; f <= n; f++)
                    if (Store.flowdata[d][f]) {
                        var m = Store.flowdata[d][f];
                        "object" == getObjType(m) && null != m.v && null == m.f && (null != m.ct && "n" == m.ct.t ? o = !0 : null != m.ct && "d" == m.ct.t ? i = !0 : this.isExtendNumber(m.m)[0] ? l = !0 : this.isChnNumber(m.m) && "日" != m.m ? s = !0 : "日" == m.m ? c = !0 : this.isChnWeek2(m.m) ? u = !0 : this.isChnWeek3(m.m) && (h = !0))
                    }
            return [o, l, i, s, c, u, h]
        },
        update: function() {
            if (checkProtectionLockedRangeList([this.applyRange], Store.currentSheetIndex) && !1 !== Store.allowEdit) {
                var e, t = editor.deepCopyFlowData(Store.flowdata), r = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)], a = $.extend(!0, {}, Store.config), n = getBorderInfoCompute(), o = $.extend(!0, {}, r.dataVerification), l = this.direction, i = (this.applyType,
                this.copyRange), s = i.row[0], c = i.row[1], u = i.column[0], h = i.column[1], d = this.getCopyData(t, s, c, u, h, l);
                "down" == l || "up" == l ? e = c - s + 1 : "right" != l && "left" != l || (e = h - u + 1);
                var f = this.applyRange
                  , m = f.row[0]
                  , p = f.row[1]
                  , g = f.column[0]
                  , y = f.column[1];
                if ("down" == l || "up" == l)
                    for (var v = p - m + 1, A = g; A <= y; A++) {
                        var b = d[A - g]
                          , k = this.getApplyData(b, e, v);
                        if ("down" == l)
                            for (var w = m; w <= p; w++) {
                                var x = k[w - m];
                                if (null != x.f) {
                                    var S = "=" + luckysheetformula.functionCopy(x.f, "down", w - m + 1)
                                      , _ = luckysheetformula.execfunction(S, w, A);
                                    if (luckysheetformula.execFunctionGroup(w, A, _[1], void 0, t),
                                    x.f = _[2],
                                    x.v = _[1],
                                    null != x.spl)
                                        x.spl = _[3].data;
                                    else if (isRealNum(x.v) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(x.v)) {
                                        if (x.v == 1 / 0 || x.v == -1 / 0)
                                            x.m = x.v.toString();
                                        else if (x.v.toString().indexOf("e") > -1) {
                                            var C = x.v.toString().split(".")[1].split("e")[0].length;
                                            C > 5 && (C = 5),
                                            x.m = x.v.toExponential(C).toString()
                                        } else {
                                            var T = genarate(Math.round(1e9 * x.v) / 1e9);
                                            x.m = T[0].toString()
                                        }
                                        x.ct = {
                                            fa: "General",
                                            t: "n"
                                        }
                                    } else {
                                        var E = genarate(x.v);
                                        x.m = E[0].toString(),
                                        x.ct = E[1]
                                    }
                                }
                                t[w][A] = x;
                                var I = s + (w - m) % e
                                  , R = A;
                                if (n[I + "_" + R]) {
                                    var B = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: w,
                                            col_index: A,
                                            l: n[I + "_" + R].l,
                                            r: n[I + "_" + R].r,
                                            t: n[I + "_" + R].t,
                                            b: n[I + "_" + R].b
                                        }
                                    };
                                    a.borderInfo.push(B)
                                } else if (n[w + "_" + A]) {
                                    var N = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: w,
                                            col_index: A,
                                            l: null,
                                            r: null,
                                            t: null,
                                            b: null
                                        }
                                    };
                                    a.borderInfo.push(N)
                                }
                                o[I + "_" + R] && (o[w + "_" + A] = o[I + "_" + R])
                            }
                        if ("up" == l)
                            for (var F = p; F >= m; F--) {
                                var P = k[p - F];
                                if (null != P.f) {
                                    var L = "=" + luckysheetformula.functionCopy(P.f, "up", p - F + 1)
                                      , O = luckysheetformula.execfunction(L, F, A);
                                    if (luckysheetformula.execFunctionGroup(F, A, O[1], void 0, t),
                                    P.f = O[2],
                                    P.v = O[1],
                                    null != P.spl)
                                        P.spl = O[3].data;
                                    else if (isRealNum(P.v) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(P.v)) {
                                        if (P.v == 1 / 0 || P.v == -1 / 0)
                                            P.m = P.v.toString();
                                        else if (P.v.toString().indexOf("e") > -1) {
                                            var D = P.v.toString().split(".")[1].split("e")[0].length;
                                            D > 5 && (D = 5),
                                            P.m = P.v.toExponential(D).toString()
                                        } else {
                                            var M = genarate(Math.round(1e9 * P.v) / 1e9);
                                            P.m = M[0].toString()
                                        }
                                        P.ct = {
                                            fa: "General",
                                            t: "n"
                                        }
                                    } else {
                                        var U = genarate(P.v);
                                        P.m = U[0].toString(),
                                        P.ct = U[1]
                                    }
                                }
                                t[F][A] = P;
                                var H = c - (p - F) % e
                                  , q = A;
                                if (n[H + "_" + q]) {
                                    var z = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: F,
                                            col_index: A,
                                            l: n[H + "_" + q].l,
                                            r: n[H + "_" + q].r,
                                            t: n[H + "_" + q].t,
                                            b: n[H + "_" + q].b
                                        }
                                    };
                                    a.borderInfo.push(z)
                                } else if (n[F + "_" + A]) {
                                    var j = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: F,
                                            col_index: A,
                                            l: null,
                                            r: null,
                                            t: null,
                                            b: null
                                        }
                                    };
                                    a.borderInfo.push(j)
                                }
                                o[H + "_" + q] && (o[F + "_" + A] = o[H + "_" + q])
                            }
                    }
                else if ("right" == l || "left" == l)
                    for (var V = y - g + 1, Q = m; Q <= p; Q++) {
                        var G = d[Q - m]
                          , K = this.getApplyData(G, e, V);
                        if ("right" == l)
                            for (var W = g; W <= y; W++) {
                                var Y = K[W - g];
                                if (null != Y.f) {
                                    var X = "=" + luckysheetformula.functionCopy(Y.f, "right", W - g + 1)
                                      , J = luckysheetformula.execfunction(X, Q, W);
                                    if (luckysheetformula.execFunctionGroup(W, Q, J[1], void 0, t),
                                    Y.f = J[2],
                                    Y.v = J[1],
                                    null != Y.spl)
                                        Y.spl = J[3].data;
                                    else if (isRealNum(Y.v) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(Y.v)) {
                                        if (Y.v == 1 / 0 || Y.v == -1 / 0)
                                            Y.m = Y.v.toString();
                                        else if (Y.v.toString().indexOf("e") > -1) {
                                            var Z = Y.v.toString().split(".")[1].split("e")[0].length;
                                            Z > 5 && (Z = 5),
                                            Y.m = Y.v.toExponential(Z).toString()
                                        } else {
                                            var ee = genarate(Math.round(1e9 * Y.v) / 1e9);
                                            Y.m = ee[0].toString()
                                        }
                                        Y.ct = {
                                            fa: "General",
                                            t: "n"
                                        }
                                    } else {
                                        var te = genarate(Y.v);
                                        Y.m = te[0].toString(),
                                        Y.ct = te[1]
                                    }
                                }
                                t[Q][W] = Y;
                                var re = Q
                                  , ae = u + (W - g) % e;
                                if (n[re + "_" + ae]) {
                                    var ne = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: Q,
                                            col_index: W,
                                            l: n[re + "_" + ae].l,
                                            r: n[re + "_" + ae].r,
                                            t: n[re + "_" + ae].t,
                                            b: n[re + "_" + ae].b
                                        }
                                    };
                                    a.borderInfo.push(ne)
                                } else if (n[Q + "_" + W]) {
                                    var oe = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: Q,
                                            col_index: W,
                                            l: null,
                                            r: null,
                                            t: null,
                                            b: null
                                        }
                                    };
                                    a.borderInfo.push(oe)
                                }
                                o[re + "_" + ae] && (o[Q + "_" + W] = o[re + "_" + ae])
                            }
                        if ("left" == l)
                            for (var le = y; le >= g; le--) {
                                var ie = K[y - le];
                                if (null != ie.f) {
                                    var se = "=" + luckysheetformula.functionCopy(ie.f, "left", y - le + 1)
                                      , ce = luckysheetformula.execfunction(se, Q, le);
                                    if (luckysheetformula.execFunctionGroup(le, Q, ce[1], void 0, t),
                                    ie.f = ce[2],
                                    ie.v = ce[1],
                                    null != ie.spl)
                                        ie.spl = ce[3].data;
                                    else if (isRealNum(ie.v) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(ie.v)) {
                                        if (ie.v == 1 / 0 || ie.v == -1 / 0)
                                            ie.m = ie.v.toString();
                                        else if (ie.v.toString().indexOf("e") > -1) {
                                            var ue = ie.v.toString().split(".")[1].split("e")[0].length;
                                            ue > 5 && (ue = 5),
                                            ie.m = ie.v.toExponential(ue).toString()
                                        } else {
                                            var he = genarate(Math.round(1e9 * ie.v) / 1e9);
                                            ie.m = he[0].toString()
                                        }
                                        ie.ct = {
                                            fa: "General",
                                            t: "n"
                                        }
                                    } else {
                                        var de = genarate(ie.v);
                                        ie.m = de[0].toString(),
                                        ie.ct = de[1]
                                    }
                                }
                                t[Q][le] = ie;
                                var fe = Q
                                  , me = h - (y - le) % e;
                                if (n[fe + "_" + me]) {
                                    var pe = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: Q,
                                            col_index: le,
                                            l: n[fe + "_" + me].l,
                                            r: n[fe + "_" + me].r,
                                            t: n[fe + "_" + me].t,
                                            b: n[fe + "_" + me].b
                                        }
                                    };
                                    a.borderInfo.push(pe)
                                } else if (n[Q + "_" + le]) {
                                    var ge = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: Q,
                                            col_index: le,
                                            l: null,
                                            r: null,
                                            t: null,
                                            b: null
                                        }
                                    };
                                    a.borderInfo.push(ge)
                                }
                                o[fe + "_" + me] && (o[Q + "_" + le] = o[fe + "_" + me])
                            }
                    }
                var ye = $.extend(!0, [], r.luckysheet_conditionformat_save);
                if (null != ye && ye.length > 0)
                    for (var ve = 0; ve < ye.length; ve++) {
                        for (var Ae = ye[ve].cellrange, be = [], ke = 0; ke < Ae.length; ke++) {
                            var we = conditionformat.CFSplitRange(Ae[ke], {
                                row: i.row,
                                column: i.column
                            }, {
                                row: f.row,
                                column: f.column
                            }, "operatePart");
                            we.length > 0 && (be = be.concat(we))
                        }
                        be.length > 0 && ye[ve].cellrange.push(f)
                    }
                var xe = {
                    cfg: a,
                    cdformat: ye,
                    dataVerification: o
                };
                jfrefreshgrid(t, Store.luckysheet_select_save, xe),
                selectHightlightShow()
            }
        },
        getCopyData: function(e, t, r, a, n, o) {
            var l, i, s, c, u = [];
            "down" == o || "up" == o ? (l = a,
            i = n,
            s = t,
            c = r) : "right" != o && "left" != o || (l = t,
            i = r,
            s = a,
            c = n);
            for (var h = l; h <= i; h++) {
                for (var d = {}, f = [], m = [], p = "", g = null, y = !0, v = s; v <= c; v++) {
                    var A = void 0;
                    "down" == o || "up" == o ? A = e[v][h] : "right" != o && "left" != o || (A = e[h][v]);
                    var b = void 0;
                    A && A.v && null == A.f ? A.ct && "n" == A.ct.t ? (b = "number",
                    g = null) : A.ct && "d" == A.ct.t ? (b = "date",
                    g = null) : this.isExtendNumber(A.m)[0] ? (b = "extendNumber",
                    null == g ? (y = !0,
                    g = this.isExtendNumber(A.m)[1]) : this.isExtendNumber(A.m)[1] != g ? (y = !1,
                    g = this.isExtendNumber(A.m)[1]) : y = !0) : this.isChnNumber(A.m) ? (b = "chnNumber",
                    g = null) : this.isChnWeek2(A.m) ? (b = "chnWeek2",
                    g = null) : this.isChnWeek3(A.m) ? (b = "chnWeek3",
                    g = null) : (b = "other",
                    g = null) : (b = "other",
                    g = null),
                    "extendNumber" == b ? v == s ? s == c ? (p = b,
                    f.push(A),
                    m.push(v - s + 1),
                    d[p] = [],
                    d[p].push({
                        data: f,
                        index: m
                    })) : (p = b,
                    f.push(A),
                    m.push(v - s + 1)) : v == c ? p == b && y ? (f.push(A),
                    m.push(v - s + 1),
                    p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    })) : (p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    }),
                    p = b,
                    (f = []).push(A),
                    (m = []).push(v - s + 1),
                    p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    })) : p == b && y ? (f.push(A),
                    m.push(v - s + 1)) : (p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    }),
                    p = b,
                    (f = []).push(A),
                    (m = []).push(v - s + 1)) : v == s ? s == c ? (p = b,
                    f.push(A),
                    m.push(v - s + 1),
                    d[p] = [],
                    d[p].push({
                        data: f,
                        index: m
                    })) : (p = b,
                    f.push(A),
                    m.push(v - s + 1)) : v == c ? p == b ? (f.push(A),
                    m.push(v - s + 1),
                    p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    })) : (p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    }),
                    p = b,
                    (f = []).push(A),
                    (m = []).push(v - s + 1),
                    p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    })) : p == b ? (f.push(A),
                    m.push(v - s + 1)) : (p in d || (d[p] = []),
                    d[p].push({
                        data: f,
                        index: m
                    }),
                    p = b,
                    (f = []).push(A),
                    (m = []).push(v - s + 1))
                }
                u.push(d)
            }
            return u
        },
        getApplyData: function(e, t, r) {
            var a = []
              , n = this.direction
              , o = this.applyType
              , l = Math.floor(r / t)
              , i = r % t
              , s = e.number
              , c = [];
            if (s)
                for (var u = 0; u < s.length; u++) {
                    var h = this.getLenS(s[u].index, i)
                      , d = s[u].index.length * l + h
                      , f = void 0;
                    f = "1" == o || "3" == o ? this.getDataByType(s[u].data, d, n, o, "number") : "2" == o ? this.getDataByType(s[u].data, d, n, o) : this.getDataByType(s[u].data, d, n, "0");
                    var m = this.getDataIndex(t, r, s[u].index);
                    c.push({
                        data: f,
                        index: m
                    })
                }
            var p = e.extendNumber
              , g = [];
            if (p)
                for (var y = 0; y < p.length; y++) {
                    var v = this.getLenS(p[y].index, i)
                      , A = p[y].index.length * l + v
                      , b = void 0;
                    b = "1" == o || "3" == o ? this.getDataByType(p[y].data, A, n, o, "extendNumber") : "2" == o ? this.getDataByType(p[y].data, A, n, o) : this.getDataByType(p[y].data, A, n, "0");
                    var k = this.getDataIndex(t, r, p[y].index);
                    g.push({
                        data: b,
                        index: k
                    })
                }
            var w = e.date
              , x = [];
            if (w)
                for (var S = 0; S < w.length; S++) {
                    var _ = this.getLenS(w[S].index, i)
                      , C = w[S].index.length * l + _
                      , T = void 0;
                    T = "1" == o || "3" == o ? this.getDataByType(w[S].data, C, n, o, "date") : "8" == o ? this.getDataByType(w[S].data, C, n, "0") : this.getDataByType(w[S].data, C, n, o);
                    var E = this.getDataIndex(t, r, w[S].index);
                    x.push({
                        data: T,
                        index: E
                    })
                }
            var I = e.chnNumber
              , R = [];
            if (I)
                for (var B = 0; B < I.length; B++) {
                    var N = this.getLenS(I[B].index, i)
                      , F = I[B].index.length * l + N
                      , P = void 0;
                    P = "1" == o || "3" == o ? this.getDataByType(I[B].data, F, n, o, "chnNumber") : "2" == o || "8" == o ? this.getDataByType(I[B].data, F, n, o) : this.getDataByType(I[B].data, F, n, "0");
                    var $ = this.getDataIndex(t, r, I[B].index);
                    R.push({
                        data: P,
                        index: $
                    })
                }
            var L = e.chnWeek2
              , O = [];
            if (L)
                for (var D = 0; D < L.length; D++) {
                    var M = this.getLenS(L[D].index, i)
                      , U = L[D].index.length * l + M
                      , H = void 0;
                    H = "1" == o || "3" == o ? this.getDataByType(L[D].data, U, n, o, "chnWeek2") : "2" == o ? this.getDataByType(L[D].data, U, n, o) : this.getDataByType(L[D].data, U, n, "0");
                    var q = this.getDataIndex(t, r, L[D].index);
                    O.push({
                        data: H,
                        index: q
                    })
                }
            var z = e.chnWeek3
              , j = [];
            if (z)
                for (var V = 0; V < z.length; V++) {
                    var Q = this.getLenS(z[V].index, i)
                      , G = z[V].index.length * l + Q
                      , K = void 0;
                    K = "1" == o || "3" == o ? this.getDataByType(z[V].data, G, n, o, "chnWeek3") : "2" == o ? this.getDataByType(z[V].data, G, n, o) : this.getDataByType(z[V].data, G, n, "0");
                    var W = this.getDataIndex(t, r, z[V].index);
                    j.push({
                        data: K,
                        index: W
                    })
                }
            var Y = e.other
              , X = [];
            if (Y)
                for (var J = 0; J < Y.length; J++) {
                    var Z = this.getLenS(Y[J].index, i)
                      , ee = Y[J].index.length * l + Z
                      , te = void 0;
                    te = "2" == o || "3" == o ? this.getDataByType(Y[J].data, ee, n, o) : this.getDataByType(Y[J].data, ee, n, "0");
                    var re = this.getDataIndex(t, r, Y[J].index);
                    X.push({
                        data: te,
                        index: re
                    })
                }
            for (var ae = 1; ae <= r; ae++) {
                if (c.length > 0)
                    for (var ne = 0; ne < c.length; ne++)
                        ae in c[ne].index && a.push(c[ne].data[c[ne].index[ae]]);
                if (g.length > 0)
                    for (var oe = 0; oe < g.length; oe++)
                        ae in g[oe].index && a.push(g[oe].data[g[oe].index[ae]]);
                if (x.length > 0)
                    for (var le = 0; le < x.length; le++)
                        ae in x[le].index && a.push(x[le].data[x[le].index[ae]]);
                if (R.length > 0)
                    for (var ie = 0; ie < R.length; ie++)
                        ae in R[ie].index && a.push(R[ie].data[R[ie].index[ae]]);
                if (O.length > 0)
                    for (var se = 0; se < O.length; se++)
                        ae in O[se].index && a.push(O[se].data[O[se].index[ae]]);
                if (j.length > 0)
                    for (var ce = 0; ce < j.length; ce++)
                        ae in j[ce].index && a.push(j[ce].data[j[ce].index[ae]]);
                if (X.length > 0)
                    for (var ue = 0; ue < X.length; ue++)
                        ae in X[ue].index && a.push(X[ue].data[X[ue].index[ae]])
            }
            return a
        },
        getLenS: function(e, t) {
            for (var r = 0, a = 0; a < e.length && e[a] <= t; a++)
                r++;
            return r
        },
        getDataIndex: function(e, t, r) {
            var a = {}
              , n = Math.floor(t / e)
              , o = t % e
              , l = 0;
            if (n > 0) {
                for (var i = 1; i <= n; i++)
                    for (var s = 0; s < r.length; s++)
                        a[r[s] + (i - 1) * e] = l,
                        l++;
                for (var c = 0; c < r.length && r[c] <= o; c++)
                    a[r[c] + e * n] = l,
                    l++
            } else
                for (var u = 0; u < r.length && r[u] <= o; u++)
                    a[r[u]] = l,
                    l++;
            return a
        },
        getDataByType: function(e, t, r, a, n) {
            var o = [];
            if ("0" == a)
                "up" != r && "left" != r || e.reverse(),
                o = this.FillCopy(e, t);
            else if ("1" == a)
                if ("number" == n)
                    o = this.FillSeries(e, t, r);
                else if ("extendNumber" == n)
                    if (1 == e.length) {
                        var l;
                        "down" == r || "right" == r ? l = 1 : "up" != r && "left" != r || (l = -1),
                        o = this.FillExtendNumber(e, t, l)
                    } else {
                        for (var i = [], s = 0; s < e.length; s++) {
                            var c = e[s].m;
                            i.push(Number(this.isExtendNumber(c)[2]))
                        }
                        if ("up" != r && "left" != r || (e.reverse(),
                        i.reverse()),
                        this.isEqualDiff(i)) {
                            var u = i[1] - i[0];
                            o = this.FillExtendNumber(e, t, u)
                        } else
                            o = this.FillCopy(e, t)
                    }
                else if ("date" == n)
                    if (1 == e.length) {
                        var h;
                        "down" == r || "right" == r ? h = 1 : "up" != r && "left" != r || (h = -1),
                        o = this.FillDays(e, t, h)
                    } else {
                        "up" != r && "left" != r || e.reverse();
                        var d = this.judgeDate(e);
                        if (d[0] && d[3]) {
                            var f = moment(e[1].m).diff(moment(e[0].m), "months");
                            o = this.FillMonths(e, t, f)
                        } else if (!d[0] && d[2]) {
                            var m = moment(e[1].m).diff(moment(e[0].m), "days");
                            o = this.FillDays(e, t, m)
                        } else
                            o = this.FillCopy(e, t)
                    }
                else if ("chnNumber" == n)
                    if (1 == e.length) {
                        var p, g;
                        if ("日" == e[0].m || this.ChineseToNumber(e[0].m) < 7)
                            "down" == r || "right" == r ? p = 1 : "up" != r && "left" != r || (p = -1),
                            o = this.FillChnWeek(e, t, p);
                        else
                            "down" == r || "right" == r ? g = 1 : "up" != r && "left" != r || (g = -1),
                            o = this.FillChnNumber(e, t, g)
                    } else {
                        for (var y = !1, v = 0; v < e.length; v++)
                            if ("日" == e[v].m) {
                                y = !0;
                                break
                            }
                        for (var A = [], b = 0, k = 0; k < e.length; k++)
                            "日" == e[k].m ? 0 == k ? A.push(0) : (b++,
                            A.push(7 * b)) : y && this.ChineseToNumber(e[k].m) > 0 && this.ChineseToNumber(e[k].m) < 7 ? A.push(this.ChineseToNumber(e[k].m) + 7 * b) : A.push(this.ChineseToNumber(e[k].m));
                        if ("up" != r && "left" != r || (e.reverse(),
                        A.reverse()),
                        this.isEqualDiff(A))
                            if (y || A[A.length - 1] < 6 && A[0] > 0 || A[0] < 6 && A[A.length - 1] > 0) {
                                var w = A[1] - A[0];
                                o = this.FillChnWeek(e, t, w)
                            } else {
                                var x = A[1] - A[0];
                                o = this.FillChnNumber(e, t, x)
                            }
                        else
                            o = this.FillCopy(e, t)
                    }
                else if ("chnWeek2" == n)
                    if (1 == e.length) {
                        var S;
                        "down" == r || "right" == r ? S = 1 : "up" != r && "left" != r || (S = -1),
                        o = this.FillChnWeek2(e, t, S)
                    } else {
                        for (var _ = [], C = 0, T = 0; T < e.length; T++) {
                            var E = e[T].m.substr(e[T].m.length - 1, 1);
                            "周日" == e[T].m ? 0 == T ? _.push(0) : (C++,
                            _.push(7 * C)) : _.push(this.ChineseToNumber(E) + 7 * C)
                        }
                        if ("up" != r && "left" != r || (e.reverse(),
                        _.reverse()),
                        this.isEqualDiff(_)) {
                            var I = _[1] - _[0];
                            o = this.FillChnWeek2(e, t, I)
                        } else
                            o = this.FillCopy(e, t)
                    }
                else if ("chnWeek3" == n)
                    if (1 == e.length) {
                        var R;
                        "down" == r || "right" == r ? R = 1 : "up" != r && "left" != r || (R = -1),
                        o = this.FillChnWeek3(e, t, R)
                    } else {
                        for (var B = [], N = 0, F = 0; F < e.length; F++) {
                            var P = e[F].m.substr(e[F].m.length - 1, 1);
                            "星期日" == e[F].m ? 0 == F ? B.push(0) : (N++,
                            B.push(7 * N)) : B.push(this.ChineseToNumber(P) + 7 * N)
                        }
                        if ("up" != r && "left" != r || (e.reverse(),
                        B.reverse()),
                        this.isEqualDiff(B)) {
                            var L = B[1] - B[0];
                            o = this.FillChnWeek3(e, t, L)
                        } else
                            o = this.FillCopy(e, t)
                    }
                else
                    "up" != r && "left" != r || e.reverse(),
                    o = this.FillCopy(e, t);
            else if ("2" == a)
                "up" != r && "left" != r || e.reverse(),
                o = this.FillOnlyFormat(e, t);
            else if ("3" == a) {
                var O = this.getDataByType(e, t, r, "1", n);
                o = this.FillWithoutFormat(O)
            } else if ("4" == a) {
                var D;
                if (1 == e.length)
                    "down" == r || "right" == r ? D = 1 : "up" != r && "left" != r || (D = -1),
                    o = this.FillDays(e, t, D);
                else if (2 == e.length) {
                    "up" != r && "left" != r || e.reverse();
                    var M = moment(e[1].m).diff(moment(e[0].m), "days");
                    o = this.FillDays(e, t, M)
                } else {
                    "up" != r && "left" != r || e.reverse();
                    var U = this.judgeDate(e);
                    if (U[0] && U[3]) {
                        var H = moment(e[1].m).diff(moment(e[0].m), "months");
                        o = this.FillMonths(e, t, H)
                    } else if (!U[0] && U[2]) {
                        var q = moment(e[1].m).diff(moment(e[0].m), "days");
                        o = this.FillDays(e, t, q)
                    } else
                        o = this.FillCopy(e, t)
                }
            } else if ("5" == a)
                if (1 == e.length) {
                    var z;
                    "down" == r || "right" == r ? z = 1 : "up" != r && "left" != r || (z = -1);
                    for (var j = Math.round(1.5 * t), V = 1; V <= j; V++) {
                        var Q = $.extend(!0, {}, e[0])
                          , G = moment(Q.m).add(V, "days").day();
                        if (0 != G && 6 != G) {
                            var K = moment(Q.m).add(z * V, "days").format("YYYY-MM-DD");
                            if (Q.m = K,
                            Q.v = genarate(K)[2],
                            o.push(Q),
                            o.length == t)
                                break
                        }
                    }
                } else if (2 == e.length)
                    if (moment(e[1].m).date() == moment(e[0].m).date() && 0 != moment(e[1].m).diff(moment(e[0].m), "months")) {
                        "up" != r && "left" != r || e.reverse();
                        for (var W = moment(e[1].m).diff(moment(e[0].m), "months"), Y = 1; Y <= t; Y++) {
                            var X = (Y - 1) % e.length
                              , J = $.extend(!0, {}, e[X])
                              , Z = moment(e[e.length - 1]).add(W * Y, "months").day()
                              , ee = void 0;
                            ee = 0 == Z ? moment(e[e.length - 1]).add(W * Y, "months").subtract(2, "days").format("YYYY-MM-DD") : 6 == Z ? moment(e[e.length - 1]).add(W * Y, "months").subtract(1, "days").format("YYYY-MM-DD") : moment(e[e.length - 1]).add(W * Y, "months").format("YYYY-MM-DD"),
                            J.m = ee,
                            J.v = genarate(ee)[2],
                            o.push(J)
                        }
                    } else if (Math.abs(moment(e[1].m).diff(moment(e[0].m))) > 7) {
                        var te, re;
                        "down" == r || "right" == r ? te = 1 : "up" != r && "left" != r || (te = -1,
                        e.reverse());
                        for (var ae = 1; ae <= t; ae++) {
                            var ne = (ae - 1) % e.length
                              , oe = $.extend(!0, {}, e[ne])
                              , le = Math.ceil(ae / e.length);
                            0 == ne && (re = moment(oe.m).add(te * le, "months").diff(moment(oe.m), "days"));
                            var ie = moment(oe.m).add(re, "days").day()
                              , se = void 0;
                            se = 0 == ie ? moment(oe.m).add(re, "days").subtract(2, "days").format("YYYY-MM-DD") : 6 == ie ? moment(oe.m).add(re, "days").subtract(1, "days").format("YYYY-MM-DD") : moment(oe.m).add(re, "days").format("YYYY-MM-DD"),
                            oe.m = se,
                            oe.v = genarate(se)[2],
                            o.push(oe)
                        }
                    } else {
                        var ce, ue;
                        "down" == r || "right" == r ? ce = 7 : "up" != r && "left" != r || (ce = -7,
                        e.reverse());
                        for (var he = 1; he <= t; he++) {
                            var de = (he - 1) % e.length
                              , fe = $.extend(!0, {}, e[de])
                              , me = Math.ceil(he / e.length);
                            0 == de && (ue = moment(fe.m).add(ce * me, "days").diff(moment(fe.m), "days"));
                            var pe = moment(fe.m).add(ue, "days").day()
                              , ge = void 0;
                            ge = 0 == pe ? moment(fe.m).add(ue, "days").subtract(2, "days").format("YYYY-MM-DD") : 6 == pe ? moment(fe.m).add(ue, "days").subtract(1, "days").format("YYYY-MM-DD") : moment(fe.m).add(ue, "days").format("YYYY-MM-DD"),
                            fe.m = ge,
                            fe.v = genarate(ge)[2],
                            o.push(fe)
                        }
                    }
                else {
                    var ye = this.judgeDate(e);
                    if (ye[0] && ye[3]) {
                        "up" != r && "left" != r || e.reverse();
                        for (var ve = moment(e[1].m).diff(moment(e[0].m), "months"), Ae = 1; Ae <= t; Ae++) {
                            var be = (Ae - 1) % e.length
                              , ke = $.extend(!0, {}, e[be])
                              , we = moment(e[e.length - 1].m).add(ve * Ae, "months").day()
                              , xe = void 0;
                            xe = 0 == we ? moment(e[e.length - 1].m).add(ve * Ae, "months").subtract(2, "days").format("YYYY-MM-DD") : 6 == we ? moment(e[e.length - 1].m).add(ve * Ae, "months").subtract(1, "days").format("YYYY-MM-DD") : moment(e[e.length - 1].m).add(ve * Ae, "months").format("YYYY-MM-DD"),
                            ke.m = xe,
                            ke.v = genarate(xe)[2],
                            o.push(ke)
                        }
                    } else if (!ye[0] && ye[2])
                        if (Math.abs(moment(e[1].m).diff(moment(e[0].m))) > 7) {
                            var Se, _e;
                            "down" == r || "right" == r ? Se = 1 : "up" != r && "left" != r || (Se = -1,
                            e.reverse());
                            for (var Ce = 1; Ce <= t; Ce++) {
                                var Te = (Ce - 1) % e.length
                                  , Ee = $.extend(!0, {}, e[Te])
                                  , Ie = Math.ceil(Ce / e.length);
                                0 == Te && (_e = moment(Ee.m).add(Se * Ie, "months").diff(moment(Ee.m), "days"));
                                var Re = moment(Ee.m).add(_e, "days").day()
                                  , Be = void 0;
                                Be = 0 == Re ? moment(Ee.m).add(_e, "days").subtract(2, "days").format("YYYY-MM-DD") : 6 == Re ? moment(Ee.m).add(_e, "days").subtract(1, "days").format("YYYY-MM-DD") : moment(Ee.m).add(_e, "days").format("YYYY-MM-DD"),
                                Ee.m = Be,
                                Ee.v = genarate(Be)[2],
                                o.push(Ee)
                            }
                        } else {
                            var Ne, Fe;
                            "down" == r || "right" == r ? Ne = 7 : "up" != r && "left" != r || (Ne = -7,
                            e.reverse());
                            for (var Pe = 1; Pe <= t; Pe++) {
                                var $e = (Pe - 1) % e.length
                                  , Le = $.extend(!0, {}, e[$e])
                                  , Oe = Math.ceil(Pe / e.length);
                                0 == $e && (Fe = moment(Le.m).add(Ne * Oe, "days").diff(moment(Le.m), "days"));
                                var De = moment(Le.m).add(Fe, "days").day()
                                  , Me = void 0;
                                Me = 0 == De ? moment(Le.m).add(Fe, "days").subtract(2, "days").format("YYYY-MM-DD") : 6 == De ? moment(Le.m).add(Fe, "days").subtract(1, "days").format("YYYY-MM-DD") : moment(Le.m).add(Fe, "days").format("YYYY-MM-DD"),
                                Le.m = Me,
                                Le.v = genarate(Me)[2],
                                o.push(Le)
                            }
                        }
                    else
                        "up" != r && "left" != r || e.reverse(),
                        o = this.FillCopy(e, t)
                }
            else if ("6" == a) {
                var Ue;
                if (1 == e.length)
                    "down" == r || "right" == r ? Ue = 1 : "up" != r && "left" != r || (Ue = -1),
                    o = this.FillMonths(e, t, Ue);
                else if (2 == e.length)
                    if (moment(e[1].m).date() == moment(e[0].m).date() && 0 != moment(e[1].m).diff(moment(e[0].m), "months")) {
                        "up" != r && "left" != r || e.reverse();
                        var He = moment(e[1].m).diff(moment(e[0].m), "months");
                        o = this.FillMonths(e, t, He)
                    } else {
                        var qe, ze;
                        "down" == r || "right" == r ? qe = 1 : "up" != r && "left" != r || (qe = -1,
                        e.reverse());
                        for (var je = 1; je <= t; je++) {
                            var Ve = (je - 1) % e.length
                              , Qe = $.extend(!0, {}, e[Ve])
                              , Ge = Math.ceil(je / e.length);
                            0 == Ve && (ze = moment(Qe.m).add(qe * Ge, "months").diff(moment(Qe.m), "days"));
                            var Ke = moment(Qe.m).add(ze, "days").format("YYYY-MM-DD");
                            Qe.m = Ke,
                            Qe.v = genarate(Ke)[2],
                            o.push(Qe)
                        }
                    }
                else {
                    var We = this.judgeDate(e);
                    if (We[0] && We[3]) {
                        "up" != r && "left" != r || e.reverse();
                        var Ye = moment(e[1].m).diff(moment(e[0].m), "months");
                        o = this.FillMonths(e, t, Ye)
                    } else if (!We[0] && We[2]) {
                        var Xe, Je;
                        "down" == r || "right" == r ? Xe = 1 : "up" != r && "left" != r || (Xe = -1,
                        e.reverse());
                        for (var Ze = 1; Ze <= t; Ze++) {
                            var et = (Ze - 1) % e.length
                              , tt = $.extend(!0, {}, e[et])
                              , rt = Math.ceil(Ze / e.length);
                            0 == et && (Je = moment(tt.m).add(Xe * rt, "months").diff(moment(tt.m), "days"));
                            var at = moment(tt.m).add(Je, "days").format("YYYY-MM-DD");
                            tt.m = at,
                            tt.v = genarate(at)[2],
                            o.push(tt)
                        }
                    } else
                        "up" != r && "left" != r || e.reverse(),
                        o = this.FillCopy(e, t)
                }
            } else if ("7" == a) {
                var nt;
                if (1 == e.length)
                    "down" == r || "right" == r ? nt = 1 : "up" != r && "left" != r || (nt = -1),
                    o = this.FillYears(e, t, nt);
                else if (2 == e.length)
                    if (moment(e[1].m).date() == moment(e[0].m).date() && moment(e[1].m).month() == moment(e[0].m).month() && 0 != moment(e[1].m).diff(moment(e[0].m), "years")) {
                        "up" != r && "left" != r || e.reverse();
                        var ot = moment(e[1].m).diff(moment(e[0].m), "years");
                        o = this.FillYears(e, t, ot)
                    } else {
                        var lt, it;
                        "down" == r || "right" == r ? lt = 1 : "up" != r && "left" != r || (lt = -1,
                        e.reverse());
                        for (var st = 1; st <= t; st++) {
                            var ct = (st - 1) % e.length
                              , ut = $.extend(!0, {}, e[ct])
                              , ht = Math.ceil(st / e.length);
                            0 == ct && (it = moment(ut.m).add(lt * ht, "years").diff(moment(ut.m), "days"));
                            var dt = moment(ut.m).add(it, "days").format("YYYY-MM-DD");
                            ut.m = dt,
                            ut.v = genarate(dt)[2],
                            o.push(ut)
                        }
                    }
                else {
                    var ft = this.judgeDate(e);
                    if (ft[0] && ft[1] && ft[4]) {
                        "up" != r && "left" != r || e.reverse();
                        var mt = moment(e[1].m).diff(moment(e[0].m), "years");
                        o = this.FillYears(e, t, mt)
                    } else if (ft[0] && ft[3] || ft[2]) {
                        var pt, gt;
                        "down" == r || "right" == r ? pt = 1 : "up" != r && "left" != r || (pt = -1,
                        e.reverse());
                        for (var yt = 1; yt <= t; yt++) {
                            var vt = (yt - 1) % e.length
                              , At = $.extend(!0, {}, e[vt])
                              , bt = Math.ceil(yt / e.length);
                            0 == vt && (gt = moment(At.m).add(pt * bt, "years").diff(moment(At.m), "days"));
                            var kt = moment(At.m).add(gt, "days").format("YYYY-MM-DD");
                            At.m = kt,
                            At.v = genarate(kt)[2],
                            o.push(At)
                        }
                    } else
                        "up" != r && "left" != r || e.reverse(),
                        o = this.FillCopy(e, t)
                }
            } else if ("8" == a)
                if (1 == e.length) {
                    var wt;
                    "down" == r || "right" == r ? wt = 1 : "up" != r && "left" != r || (wt = -1),
                    o = this.FillChnNumber(e, t, wt)
                } else {
                    for (var xt = [], St = 0; St < e.length; St++)
                        xt.push(this.ChineseToNumber(e[St].m));
                    if ("up" != r && "left" != r || (e.reverse(),
                    xt.reverse()),
                    this.isEqualDiff(xt)) {
                        var _t = xt[1] - xt[0];
                        o = this.FillChnNumber(e, t, _t)
                    } else
                        o = this.FillCopy(e, t)
                }
            return o
        },
        FillCopy: function(e, t) {
            for (var r = [], a = 1; a <= t; a++) {
                var n = (a - 1) % e.length
                  , o = $.extend(!0, {}, e[n]);
                r.push(o)
            }
            return r
        },
        FillSeries: function(e, t, r) {
            for (var a = [], n = [], o = 0; o < e.length; o++)
                n.push(Number(e[o].v));
            if (e.length > 2 && this.isEqualRatio(n))
                for (var l = 1; l <= t; l++) {
                    var i = (l - 1) % e.length
                      , s = $.extend(!0, {}, e[i])
                      , c = void 0;
                    "down" == r || "right" == r ? c = Number(e[e.length - 1].v) * Math.pow(Number(e[1].v) / Number(e[0].v), l) : "up" != r && "left" != r || (c = Number(e[0].v) / Math.pow(Number(e[1].v) / Number(e[0].v), l)),
                    s.v = c,
                    s.m = update(s.ct.fa, c),
                    a.push(s)
                }
            else
                for (var u = this.getXArr(e.length), h = 1; h <= t; h++) {
                    var d = (h - 1) % e.length
                      , f = $.extend(!0, {}, e[d])
                      , m = void 0;
                    "down" == r || "right" == r ? m = this.forecast(e.length + h, n, u) : "up" != r && "left" != r || (m = this.forecast(1 - h, n, u)),
                    f.v = m,
                    f.m = update(f.ct.fa, m),
                    a.push(f)
                }
            return a
        },
        FillExtendNumber: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = e[e.length - 1].m
                  , s = this.isExtendNumber(i)[1]
                  , c = this.isExtendNumber(i)[2];
                if ("" == c) {
                    var u = Math.abs(Number(s) + r * n);
                    "0" == s.substr(0, 1) && s.length > u.toString().length && (u = "0" + u.toString()),
                    l.v = u.toString(),
                    l.m = u.toString()
                } else {
                    var h = Math.abs(Number(c) + r * n);
                    l.v = s + h.toString(),
                    l.m = s + h.toString()
                }
                a.push(l)
            }
            return a
        },
        FillOnlyFormat: function(e, t) {
            for (var r = [], a = 1; a <= t; a++) {
                var n = (a - 1) % e.length
                  , o = $.extend(!0, {}, e[n]);
                delete o.f,
                delete o.m,
                delete o.v,
                r.push(o)
            }
            return r
        },
        FillWithoutFormat: function(e) {
            for (var t = [], r = 0; r < e.length; r++) {
                var a = $.extend(!0, {}, e[r])
                  , n = void 0;
                n = null == a.f ? {
                    m: a.v.toString(),
                    v: a.v
                } : {
                    f: a.f,
                    m: a.v.toString(),
                    v: a.v
                },
                t.push(n)
            }
            return t
        },
        FillDays: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = update("yyyy-MM-dd", l.v);
                i = moment(i).add(r * n, "days").format("YYYY-MM-DD"),
                l.v = genarate(i)[2],
                l.m = update(l.ct.fa, l.v),
                a.push(l)
            }
            return a
        },
        FillMonths: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = update("yyyy-MM-dd", l.v);
                i = moment(i).add(r * n, "months").format("YYYY-MM-DD"),
                l.v = genarate(i)[2],
                l.m = update(l.ct.fa, l.v),
                a.push(l)
            }
            return a
        },
        FillYears: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = update("yyyy-MM-dd", l.v);
                i = moment(i).add(r * n, "years").format("YYYY-MM-DD"),
                l.v = genarate(i)[2],
                l.m = update(l.ct.fa, l.v),
                a.push(l)
            }
            return a
        },
        FillChnWeek: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = void 0;
                (i = "日" == e[e.length - 1].m ? 7 + r * n : this.ChineseToNumber(e[e.length - 1].m) + r * n) < 0 && (i = 7 * Math.ceil(Math.abs(i) / 7) + i);
                var s = i % 7;
                0 == s ? (l.m = "日",
                l.v = "日") : 1 == s ? (l.m = "一",
                l.v = "一") : 2 == s ? (l.m = "二",
                l.v = "二") : 3 == s ? (l.m = "三",
                l.v = "三") : 4 == s ? (l.m = "四",
                l.v = "四") : 5 == s ? (l.m = "五",
                l.v = "五") : 6 == s && (l.m = "六",
                l.v = "六"),
                a.push(l)
            }
            return a
        },
        FillChnWeek2: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = void 0;
                if ("周日" == e[e.length - 1].m)
                    i = 7 + r * n;
                else {
                    var s = e[e.length - 1].m
                      , c = s.substr(s.length - 1, 1);
                    i = this.ChineseToNumber(c) + r * n
                }
                i < 0 && (i = 7 * Math.ceil(Math.abs(i) / 7) + i);
                var u = i % 7;
                0 == u ? (l.m = "周日",
                l.v = "周日") : 1 == u ? (l.m = "周一",
                l.v = "周一") : 2 == u ? (l.m = "周二",
                l.v = "周二") : 3 == u ? (l.m = "周三",
                l.v = "周三") : 4 == u ? (l.m = "周四",
                l.v = "周四") : 5 == u ? (l.m = "周五",
                l.v = "周五") : 6 == u && (l.m = "周六",
                l.v = "周六"),
                a.push(l)
            }
            return a
        },
        FillChnWeek3: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = void 0;
                if ("星期日" == e[e.length - 1].m)
                    i = 7 + r * n;
                else {
                    var s = e[e.length - 1].m
                      , c = s.substr(s.length - 1, 1);
                    i = this.ChineseToNumber(c) + r * n
                }
                i < 0 && (i = 7 * Math.ceil(Math.abs(i) / 7) + i);
                var u = i % 7;
                0 == u ? (l.m = "星期日",
                l.v = "星期日") : 1 == u ? (l.m = "星期一",
                l.v = "星期一") : 2 == u ? (l.m = "星期二",
                l.v = "星期二") : 3 == u ? (l.m = "星期三",
                l.v = "星期三") : 4 == u ? (l.m = "星期四",
                l.v = "星期四") : 5 == u ? (l.m = "星期五",
                l.v = "星期五") : 6 == u && (l.m = "星期六",
                l.v = "星期六"),
                a.push(l)
            }
            return a
        },
        FillChnNumber: function(e, t, r) {
            for (var a = [], n = 1; n <= t; n++) {
                var o = (n - 1) % e.length
                  , l = $.extend(!0, {}, e[o])
                  , i = this.ChineseToNumber(e[e.length - 1].m) + r * n
                  , s = void 0;
                s = i <= 0 ? "零" : this.NumberToChinese(i),
                l.v = s,
                l.m = s.toString(),
                a.push(l)
            }
            return a
        },
        isEqualDiff: function(e) {
            for (var t = !0, r = e[1] - e[0], a = 1; a < e.length; a++)
                if (e[a] - e[a - 1] != r) {
                    t = !1;
                    break
                }
            return t
        },
        isEqualRatio: function(e) {
            for (var t = !0, r = e[1] / e[0], a = 1; a < e.length; a++)
                if (e[a] / e[a - 1] != r) {
                    t = !1;
                    break
                }
            return t
        },
        getXArr: function(e) {
            for (var t = [], r = 1; r <= e; r++)
                t.push(r);
            return t
        },
        forecast: function(e, t, r) {
            function a(e) {
                for (var t = 0, r = 0; r < e.length; r++)
                    t += e[r];
                return t / e.length
            }
            for (var n, o = a(r), l = a(t), i = 0, s = 0, c = 0; c < r.length; c++)
                i += (r[c] - o) * (t[c] - l),
                s += (r[c] - o) * (r[c] - o);
            var u = l - (n = 0 == s ? 1 : i / s) * o;
            return Math.round(1e5 * (u + n * e)) / 1e5
        },
        judgeDate: function(e) {
            for (var t = !0, r = !0, a = !0, n = !0, o = !0, l = moment(e[0].m).date(), i = moment(e[0].m).month(), s = moment(e[1].m).diff(moment(e[0].m), "days"), c = moment(e[1].m).diff(moment(e[0].m), "months"), u = moment(e[1].m).diff(moment(e[0].m), "years"), h = 1; h < e.length; h++)
                moment(e[h].m).date() != l && (t = !1),
                moment(e[h].m).month() != i && (r = !1),
                moment(e[h].m).diff(moment(e[h - 1].m), "days") != s && (a = !1),
                moment(e[h].m).diff(moment(e[h - 1].m), "months") != c && (n = !1),
                moment(e[h].m).diff(moment(e[h - 1].m), "years") != u && (o = !1);
            return 0 == s && (a = !1),
            0 == c && (n = !1),
            0 == u && (o = !1),
            [t, r, a, n, o]
        }
    }
      , luckysheetFreezen = {
        freezenHorizontalHTML: '<div id="luckysheet-freezebar-horizontal" class="luckysheet-freezebar" tabindex="0"><div class="luckysheet-freezebar-handle luckysheet-freezebar-horizontal-handle" ><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-horizontal-handle-title" ></div><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-horizontal-handle-bar" ></div></div><div class="luckysheet-freezebar-drop luckysheet-freezebar-horizontal-drop" ><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-horizontal-drop-title" ></div><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-horizontal-drop-bar" >&nbsp;</div></div></div>',
        freezenVerticalHTML: '<div id="luckysheet-freezebar-vertical" class="luckysheet-freezebar" tabindex="0"><div class="luckysheet-freezebar-handle luckysheet-freezebar-vertical-handle" ><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-vertical-handle-title" ></div><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-vertical-handle-bar" ></div></div><div class="luckysheet-freezebar-drop luckysheet-freezebar-vertical-drop" ><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-vertical-drop-title" ></div><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-vertical-drop-bar" >&nbsp;</div></div></div>',
        initialHorizontal: !0,
        initialVertical: !0,
        horizontalmovestate: !1,
        horizontalmoveposition: null,
        verticalmovestate: !1,
        verticalmoveposition: null,
        windowHeight: null,
        windowWidth: null,
        freezenhorizontaldata: null,
        freezenverticaldata: null,
        cutVolumn: function(e, t) {
            if (t <= 0)
                return e;
            var r = e.slice(0, t);
            r[r.length - 1];
            return e.slice(t)
        },
        cancelFreezenVertical: function(e) {
            var t = locale().freezen;
            $("#luckysheet-freezen-btn-vertical").html('<i class="fa fa-indent"></i> ' + t.freezenColumn),
            this.freezenverticaldata = null;
            var r = $("#luckysheet-freezebar-vertical").is(":visible");
            $("#luckysheet-freezebar-vertical").hide(),
            null == e && (e = Store.currentSheetIndex);
            var a = Store.luckysheetfile[getSheetIndex(e)];
            null != a.freezen && (a.freezen.vertical = null),
            null != a.frozen && r && server.saveParam("all", e, a.frozen, {
                k: "frozen"
            })
        },
        createFreezenVertical: function(e, t) {
            var r = this;
            if (r.initialVertical) {
                r.initialVertical = !1,
                $("#luckysheet-grid-window-1").append(r.freezenVerticalHTML),
                $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-drop").hover((function() {
                    $(this).parent().addClass("luckysheet-freezebar-hover")
                }
                ), (function() {
                    $(this).parent().removeClass("luckysheet-freezebar-hover")
                }
                )),
                $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-drop").mousedown((function() {
                    r.verticalmovestate = !0,
                    r.verticalmoveposition = $(this).position().left,
                    r.windowWidth = $("#luckysheet-grid-window-1").width(),
                    $(this).parent().addClass("luckysheet-freezebar-active"),
                    $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css("cursor", "-webkit-grabbing")
                }
                ));
                var a = $("#luckysheet-grid-window-1").height();
                $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css({
                    height: a - 10,
                    width: "4px",
                    cursor: "-webkit-grab",
                    top: "0px"
                }).end().find(".luckysheet-freezebar-vertical-drop").css({
                    height: a - 10,
                    width: "4px",
                    top: "0px",
                    cursor: "-webkit-grab"
                })
            }
            if (null == e) {
                var n = $("#luckysheet-cell-main").scrollLeft()
                  , o = luckysheet_searcharray(Store.visibledatacolumn, n);
                -1 == o && (o = 0),
                t = Store.visibledatacolumn[o] - 2 - n + Store.rowHeaderWidth,
                e = [Store.visibledatacolumn[o], o + 1, n, r.cutVolumn(Store.visibledatacolumn, o + 1), t],
                r.saveFreezen(null, null, e, t)
            }
            r.freezenverticaldata = e;
            var l = '\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-function iconfont icon-dongjie1"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        '.concat(locale().freezen.freezenCancel, "\n                    </div>\n                </div>\n            </div>\n        ");
            $("#luckysheet-freezen-btn-horizontal").html(l),
            $("#luckysheet-freezebar-vertical").show().find(".luckysheet-freezebar-vertical-handle").css({
                left: t
            }).end().find(".luckysheet-freezebar-vertical-drop").css({
                left: t
            })
        },
        saveFreezen: function(e, t, r, a) {
            var n = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
            null == n.freezen && (n.freezen = {}),
            null != e && (null == n.freezen.horizontal && (n.freezen.horizontal = {}),
            n.freezen.horizontal.freezenhorizontaldata = e,
            n.freezen.horizontal.top = t),
            null != r && (null == n.freezen.vertical && (n.freezen.vertical = {}),
            n.freezen.vertical.freezenverticaldata = r,
            n.freezen.vertical.left = a),
            null != n.frozen && server.saveParam("all", Store.currentSheetIndex, n.frozen, {
                k: "frozen"
            })
        },
        initialFreezen: function(e) {
            this.frozenTofreezen();
            var t = Store.luckysheetfile[getSheetIndex(e)];
            null != t.freezen && null != t.freezen.horizontal && null != t.freezen.horizontal.freezenhorizontaldata ? this.createFreezenHorizontal(t.freezen.horizontal.freezenhorizontaldata, t.freezen.horizontal.top) : this.cancelFreezenHorizontal(e),
            null != t.freezen && null != t.freezen.vertical && null != t.freezen.vertical.freezenverticaldata ? this.createFreezenVertical(t.freezen.vertical.freezenverticaldata, t.freezen.vertical.left) : this.cancelFreezenVertical(e),
            this.createAssistCanvas()
        },
        changeFreezenIndex: function(e, t) {
            if ("v" == t && null != this.freezenverticaldata) {
                var r = this.freezenverticaldata[1]
                  , a = luckysheet_searcharray(Store.visibledatacolumn, $("#luckysheet-cell-main").scrollLeft());
                e - a < r && (e -= a)
            } else if ("h" == t && null != this.freezenhorizontaldata) {
                var n = this.freezenhorizontaldata[1]
                  , o = luckysheet_searcharray(Store.visibledatarow, $("#luckysheet-cell-main").scrollTop());
                e - o < n && (e -= o)
            }
            return e
        },
        scrollFreezen: function() {
            var e, t, r = Store.luckysheet_select_save[0].row_focus;
            r == Store.luckysheet_select_save[0].row[0] ? e = Store.luckysheet_select_save[0].row[1] : r == Store.luckysheet_select_save[0].row[1] && (e = Store.luckysheet_select_save[0].row[0]);
            var a = Store.luckysheet_select_save[0].column_focus;
            if (a == Store.luckysheet_select_save[0].column[0] ? t = Store.luckysheet_select_save[0].column[1] : a == Store.luckysheet_select_save[0].column[1] && (t = Store.luckysheet_select_save[0].column[0]),
            null != this.freezenverticaldata) {
                var n = this.freezenverticaldata[1]
                  , o = luckysheet_searcharray(this.freezenverticaldata[3], $("#luckysheet-cell-main").scrollLeft())
                  , l = this.freezenverticaldata[4];
                n += o,
                t >= Store.visibledatacolumn.length && (t = Store.visibledatacolumn.length - 1),
                n >= Store.visibledatacolumn.length && (n = Store.visibledatacolumn.length - 1),
                Store.visibledatacolumn[t] <= Store.visibledatacolumn[n] + l && (console.log(1111),
                setTimeout((function() {
                    $("#luckysheet-scrollbar-x").scrollLeft(0)
                }
                ), 100))
            }
            if (null != this.freezenhorizontaldata) {
                var i = this.freezenhorizontaldata[1]
                  , s = luckysheet_searcharray(this.freezenhorizontaldata[3], $("#luckysheet-cell-main").scrollTop())
                  , c = this.freezenhorizontaldata[4];
                i += s,
                e >= Store.visibledatarow.length && (e = Store.visibledatarow.length - 1),
                i >= Store.visibledatarow.length && (i = Store.visibledatarow.length - 1),
                Store.visibledatarow[e] <= Store.visibledatarow[i] + c && setTimeout((function() {
                    $("#luckysheet-scrollbar-y").scrollTop(0)
                }
                ), 100)
            }
        },
        cancelFreezenHorizontal: function(e) {
            var t = '\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-function iconfont icon-dongjie1"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        '.concat(locale().freezen.default, "\n                    </div>\n                </div>\n            </div>\n        ");
            $("#luckysheet-freezen-btn-horizontal").html(t),
            this.freezenhorizontaldata = null;
            var r = $("#luckysheet-freezebar-horizontal").is(":visible");
            $("#luckysheet-freezebar-horizontal").hide(),
            null == e && (e = Store.currentSheetIndex);
            var a = Store.luckysheetfile[getSheetIndex(e)];
            null != a.freezen && (a.freezen.horizontal = null),
            null != a.frozen && r && server.saveParam("all", e, a.frozen, {
                k: "frozen"
            })
        },
        createFreezenHorizontal: function(e, t) {
            var r = this;
            if (r.initialHorizontal) {
                r.initialHorizontal = !1,
                $("#luckysheet-grid-window-1").append(r.freezenHorizontalHTML),
                $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-drop").hover((function() {
                    $(this).parent().addClass("luckysheet-freezebar-hover")
                }
                ), (function() {
                    $(this).parent().removeClass("luckysheet-freezebar-hover")
                }
                )),
                $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-drop").mousedown((function() {
                    r.horizontalmovestate = !0,
                    r.horizontalmoveposition = $(this).position().top,
                    r.windowHeight = $("#luckysheet-grid-window-1").height(),
                    $(this).parent().addClass("luckysheet-freezebar-active"),
                    $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css("cursor", "-webkit-grabbing")
                }
                ));
                var a = $("#luckysheet-grid-window-1").width();
                $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({
                    width: a - 10,
                    height: "4px",
                    cursor: "-webkit-grab",
                    left: "0px"
                }).end().find(".luckysheet-freezebar-horizontal-drop").css({
                    width: a - 10,
                    height: "4px",
                    left: "0px",
                    cursor: "-webkit-grab"
                })
            }
            if (null == e) {
                var n = $("#luckysheet-cell-main").scrollTop()
                  , o = luckysheet_searcharray(Store.visibledatarow, n);
                -1 == o && (o = 0),
                t = Store.visibledatarow[o] - 2 - n + Store.columnHeaderHeight,
                e = [Store.visibledatarow[o], o + 1, n, r.cutVolumn(Store.visibledatarow, o + 1), t],
                r.saveFreezen(e, t, null, null)
            }
            r.freezenhorizontaldata = e;
            var l = '\n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block"\n            style="user-select: none;">\n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block"\n                style="user-select: none;">\n                    <div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">\n                        <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-function iconfont icon-dongjie1"\n                        style="user-select: none;">\n                        </div>\n                    </div>\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"\n                    style="user-select: none;">\n                        '.concat(locale().freezen.freezenCancel, "\n                    </div>\n                </div>\n            </div>\n        ");
            $("#luckysheet-freezen-btn-horizontal").html(l),
            $("#luckysheet-freezebar-horizontal").show().find(".luckysheet-freezebar-horizontal-handle").css({
                top: t
            }).end().find(".luckysheet-freezebar-horizontal-drop").css({
                top: t
            })
        },
        createAssistCanvas: function() {
            if (this.removeAssistCanvas(),
            null != this.freezenverticaldata || null != this.freezenhorizontaldata) {
                var e, t, r, a, n = Store.luckysheetTableContentHW[0], o = Store.luckysheetTableContentHW[1];
                null != this.freezenverticaldata && null != this.freezenhorizontaldata ? (e = this.freezenhorizontaldata[0],
                this.freezenhorizontaldata[1],
                t = this.freezenhorizontaldata[2],
                r = this.freezenverticaldata[0],
                this.freezenverticaldata[1],
                a = this.freezenverticaldata[2],
                this.createCanvas("freezen_3", r - a, e - t + 1, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1),
                this.createCanvas("freezen_4", n - r + a, e - t + 1, r - a + Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1),
                this.createCanvas("freezen_7", r - a, o - e + t - Store.columnHeaderHeight, Store.rowHeaderWidth - 1, e - t + Store.columnHeaderHeight - 1)) : null != this.freezenhorizontaldata ? (e = this.freezenhorizontaldata[0],
                this.freezenhorizontaldata[1],
                t = this.freezenhorizontaldata[2],
                this.createCanvas("freezen_h", n, e - t + 1, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1)) : null != this.freezenverticaldata && (r = this.freezenverticaldata[0],
                this.freezenverticaldata[1],
                a = this.freezenverticaldata[2],
                this.createCanvas("freezen_v", r - a, o, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1)),
                this.scrollAdapt()
            }
        },
        createCanvas: function(e, t, r, a, n) {
            $("<canvas/>").appendTo("#luckysheet-grid-window-1").attr({
                id: e,
                width: Math.ceil(t * Store.devicePixelRatio),
                height: Math.ceil(r * Store.devicePixelRatio)
            }).css({
                "user-select": "none",
                postion: "absolute",
                left: a,
                top: n,
                width: t,
                height: r,
                "z-index": 10,
                "pointer-events": "none"
            })
        },
        removeAssistCanvas: function() {
            $("#luckysheet-grid-window-1 > canvas").not($("#luckysheetTableContent")).remove(),
            $("#luckysheet-cell-selected").css("z-index", 15)
        },
        scrollAdapt: function() {
            if (null != Store.luckysheet_select_save && Store.luckysheet_select_save.length > 0 && this.scrollAdaptOfselect(),
            $("#luckysheet-cell-main .luckysheet-data-visualization-chart").length > 0) {
                var e = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].chart;
                null != e && e.length > 0 && this.scrollAdaptOfchart()
            }
            $("#luckysheet-postil-showBoxs .luckysheet-postil-show").length > 0 && this.scrollAdaptOfpostil(),
            $("#luckysheet-dropCell-icon").length > 0 && this.scrollAdaptOfdpicon(),
            $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").length > 0 && this.scrollAdaptOffilteroptions()
        },
        scrollAdaptOfselect: function() {
            $("#luckysheet-row-count-show").is(":visible") && $("#luckysheet-row-count-show").hide(),
            $("#luckysheet-column-count-show").is(":visible") && $("#luckysheet-column-count-show").hide(),
            $("#luckysheet-rows-h-selected").empty(),
            $("#luckysheet-cols-h-selected").empty();
            var e = $("#luckysheet-cell-main").scrollTop()
              , t = $("#luckysheet-cell-main").scrollLeft();
            if (null != this.freezenhorizontaldata && null != this.freezenverticaldata)
                for (var r = this.freezenhorizontaldata[0], a = this.freezenhorizontaldata[1], n = e - this.freezenhorizontaldata[2], o = this.freezenverticaldata[0], l = this.freezenverticaldata[1], i = t - this.freezenverticaldata[2], s = 0; s < Store.luckysheet_select_save.length; s++) {
                    var c = $.extend(!0, {}, Store.luckysheet_select_save[s])
                      , u = c.row[0]
                      , h = c.row[1]
                      , d = Store.visibledatarow[h]
                      , f = u - 1 == -1 ? 0 : Store.visibledatarow[u - 1]
                      , m = f
                      , p = d - f - 1
                      , g = !0;
                    u >= a ? m + p < r + n ? g = !1 : m < r + n ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        top: r + n,
                        height: p - (r + n - m)
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        top: m,
                        height: p
                    }) : h >= a ? m + p < r + n ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        top: m + n,
                        height: r - m
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        top: m + n,
                        height: p - n
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css("top", m + n);
                    var y = c.column[0]
                      , v = c.column[1]
                      , A = Store.visibledatacolumn[v]
                      , b = y - 1 == -1 ? 0 : Store.visibledatacolumn[y - 1]
                      , k = b
                      , w = A - b - 1;
                    if (y >= l ? k + w < o + i ? g = !1 : k < o + i ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        left: o + i,
                        width: w - (o + i - k)
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        left: k,
                        width: w
                    }) : v >= l ? k + w < o + i ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        left: k + i,
                        width: o - k
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css({
                        left: k + i,
                        width: w - i
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).show().css("left", k + i),
                    g || $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(s).hide(),
                    s == Store.luckysheet_select_save.length - 1) {
                        var x = null == c.row_focus ? u : c.row_focus
                          , S = null == c.column_focus ? y : c.column_focus
                          , _ = Store.visibledatarow[x]
                          , C = x - 1 == -1 ? 0 : Store.visibledatarow[x - 1]
                          , T = Store.visibledatacolumn[S]
                          , E = S - 1 == -1 ? 0 : Store.visibledatacolumn[S - 1]
                          , I = menuButton.mergeborer(Store.flowdata, x, S);
                        I && (_ = I.row[1],
                        C = I.row[0],
                        T = I.column[1],
                        E = I.column[0]);
                        var R = C
                          , B = _ - C - 1
                          , N = E
                          , F = T - E - 1
                          , P = !0;
                        R >= r ? R + B < r + n ? P = !1 : R < r + n ? $("#luckysheet-cell-selected-focus").show().css({
                            top: r + n,
                            height: B - (r + n - R)
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            top: R,
                            height: B
                        }) : R + B >= r ? R + B < r + n ? $("#luckysheet-cell-selected-focus").show().css({
                            top: R + n,
                            height: r - R
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            top: R + n,
                            height: B - n
                        }) : $("#luckysheet-cell-selected-focus").show().css("top", R + n),
                        N >= o ? N + F < o + i ? P = !1 : N < o + i ? $("#luckysheet-cell-selected-focus").show().css({
                            left: o + i,
                            width: F - (o + i - N)
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            left: N,
                            width: F
                        }) : N + F >= o ? N + F < o + i ? $("#luckysheet-cell-selected-focus").show().css({
                            left: N + i,
                            width: o - N
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            left: N + i,
                            width: F - i
                        }) : $("#luckysheet-cell-selected-focus").show().css("left", N + i),
                        P || $("#luckysheet-cell-selected-focus").hide()
                    }
                }
            else if (null != this.freezenhorizontaldata)
                for (var L = this.freezenhorizontaldata[0], O = this.freezenhorizontaldata[1], D = e - this.freezenhorizontaldata[2], M = 0; M < Store.luckysheet_select_save.length; M++) {
                    var U = $.extend(!0, {}, Store.luckysheet_select_save[M])
                      , H = U.row[0]
                      , q = U.row[1]
                      , z = Store.visibledatarow[q]
                      , j = H - 1 == -1 ? 0 : Store.visibledatarow[H - 1]
                      , V = j
                      , Q = z - j - 1;
                    if (H >= O ? V + Q < L + D ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).hide() : V < L + D ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).show().css({
                        top: L + D,
                        height: Q - (L + D - V)
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).show().css({
                        top: V,
                        height: Q
                    }) : q >= O ? V + Q < L + D ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).show().css({
                        top: V + D,
                        height: L - V
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).show().css({
                        top: V + D,
                        height: Q - D
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(M).show().css("top", V + D),
                    M == Store.luckysheet_select_save.length - 1) {
                        var G = null == U.row_focus ? H : U.row_focus
                          , K = null == U.column_focus ? U.column[0] : U.column_focus
                          , W = Store.visibledatarow[G]
                          , Y = G - 1 == -1 ? 0 : Store.visibledatarow[G - 1]
                          , X = menuButton.mergeborer(Store.flowdata, G, K);
                        X && (W = X.row[1],
                        Y = X.row[0]);
                        var J = Y
                          , Z = W - Y - 1;
                        J >= L ? J + Z < L + D ? $("#luckysheet-cell-selected-focus").hide() : J < L + D ? $("#luckysheet-cell-selected-focus").show().css({
                            top: L + D,
                            height: Z - (L + D - J)
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            top: J,
                            height: Z
                        }) : J + Z >= L ? J + Z < L + D ? $("#luckysheet-cell-selected-focus").show().css({
                            top: J + D,
                            height: L - J
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            top: J + D,
                            height: Z - D
                        }) : $("#luckysheet-cell-selected-focus").show().css("top", J + D)
                    }
                }
            else if (null != this.freezenverticaldata)
                for (var ee = this.freezenverticaldata[0], te = this.freezenverticaldata[1], re = t - this.freezenverticaldata[2], ae = 0; ae < Store.luckysheet_select_save.length; ae++) {
                    var ne = $.extend(!0, {}, Store.luckysheet_select_save[ae])
                      , oe = ne.column[0]
                      , le = ne.column[1]
                      , ie = Store.visibledatacolumn[le]
                      , se = oe - 1 == -1 ? 0 : Store.visibledatacolumn[oe - 1]
                      , ce = se
                      , ue = ie - se - 1;
                    if (oe >= te ? ce + ue < ee + re ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).hide() : ce < ee + re ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).show().css({
                        left: ee + re,
                        width: ue - (ee + re - ce)
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).show().css({
                        left: ce,
                        width: ue
                    }) : le >= te ? ce + ue < ee + re ? $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).show().css({
                        left: ce + re,
                        width: ee - ce
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).show().css({
                        left: ce + re,
                        width: ue - re
                    }) : $("#luckysheet-cell-selected-boxs").find(".luckysheet-cell-selected").eq(ae).show().css("left", ce + re),
                    ae == Store.luckysheet_select_save.length - 1) {
                        var he = null == ne.row_focus ? ne.row[0] : ne.row_focus
                          , de = null == ne.column_focus ? oe : ne.column_focus
                          , fe = Store.visibledatacolumn[de]
                          , me = de - 1 == -1 ? 0 : Store.visibledatacolumn[de - 1]
                          , pe = menuButton.mergeborer(Store.flowdata, he, de);
                        pe && (fe = pe.column[1],
                        me = pe.column[0]);
                        var ge = me
                          , ye = fe - me - 1;
                        ge >= ee ? ge + ye < ee + re ? $("#luckysheet-cell-selected-focus").hide() : ge < ee + re ? $("#luckysheet-cell-selected-focus").show().css({
                            left: ee + re,
                            width: ye - (ee + re - ge)
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            left: ge,
                            width: ye
                        }) : ge + ye >= ee ? ge + ye < ee + re ? $("#luckysheet-cell-selected-focus").show().css({
                            left: ge + re,
                            width: ee - ge
                        }) : $("#luckysheet-cell-selected-focus").show().css({
                            left: ge + re,
                            width: ye - re
                        }) : $("#luckysheet-cell-selected-focus").show().css("left", ge + re)
                    }
                }
            else
                selectHightlightShow()
        },
        scrollAdaptOfchart: function() {
            var e = $("#luckysheet-cell-main").scrollTop()
              , t = $("#luckysheet-cell-main").scrollLeft();
            if (null != this.freezenhorizontaldata && null != this.freezenverticaldata) {
                var r = this.freezenhorizontaldata[0] - this.freezenhorizontaldata[2]
                  , a = this.freezenverticaldata[0] - this.freezenverticaldata[2];
                $("#luckysheet-cell-main .luckysheet-data-visualization-chart").each((function(n, o) {
                    var l = $(o).position()
                      , i = $(o).width()
                      , s = $(o).height()
                      , c = $(o).find("canvas").width()
                      , u = $(o).find("canvas").height()
                      , h = u - s
                      , d = c - i;
                    if (l.top - h < r) {
                        var f = r - (l.top - h);
                        f > u + 40 + 2 ? $(o).css("visibility", "hidden") : ($(o).css({
                            top: r + e,
                            height: u - f,
                            visibility: "visible"
                        }),
                        $(o).find("canvas").css("top", -f))
                    } else
                        $(o).css({
                            top: l.top - h + e,
                            height: u,
                            visibility: "visible"
                        }),
                        $(o).find("canvas").css("top", 0);
                    if (l.left - d < a) {
                        var m = a - (l.left - d);
                        m > c + 20 + 2 ? $(o).css("visibility", "hidden") : ($(o).css({
                            left: a + t,
                            width: c - m,
                            visibility: "visible"
                        }),
                        $(o).find("canvas").css("left", -m))
                    } else
                        $(o).css({
                            left: l.left - d + t,
                            width: c,
                            visibility: "visible"
                        }),
                        $(o).find("canvas").css("left", 0)
                }
                ))
            } else if (null != this.freezenhorizontaldata) {
                var n = this.freezenhorizontaldata[0] - this.freezenhorizontaldata[2];
                $("#luckysheet-cell-main .luckysheet-data-visualization-chart").each((function(t, r) {
                    var a = $(r).position()
                      , o = $(r).height()
                      , l = $(r).find("canvas").height()
                      , i = l - o;
                    if (a.top - i < n) {
                        var s = n - (a.top - i);
                        s > l + 40 + 2 ? $(r).css("visibility", "hidden") : ($(r).css({
                            top: n + e,
                            height: l - s,
                            visibility: "visible"
                        }),
                        $(r).find("canvas").css("top", -s))
                    } else
                        $(r).css({
                            top: a.top - i + e,
                            height: l,
                            visibility: "visible"
                        }),
                        $(r).find("canvas").css("top", 0)
                }
                ))
            } else if (null != this.freezenverticaldata) {
                var o = this.freezenverticaldata[0] - this.freezenverticaldata[2];
                $("#luckysheet-cell-main .luckysheet-data-visualization-chart").each((function(e, r) {
                    var a = $(r).position()
                      , n = $(r).width()
                      , l = $(r).find("canvas").width()
                      , i = l - n;
                    if (a.left - i < o) {
                        var s = o - (a.left - i);
                        s > l + 20 + 2 ? $(r).css("visibility", "hidden") : ($(r).css({
                            left: o + t,
                            width: l - s,
                            visibility: "visible"
                        }),
                        $(r).find("canvas").css("left", -s))
                    } else
                        $(r).css({
                            left: a.left - i + t,
                            width: l,
                            visibility: "visible"
                        }),
                        $(r).find("canvas").css("left", 0)
                }
                ))
            } else
                $("#luckysheet-cell-main .luckysheet-data-visualization-chart").each((function(r, a) {
                    var n = $(a).position()
                      , o = $(a).width()
                      , l = $(a).height()
                      , i = $(a).find("canvas").width()
                      , s = $(a).find("canvas").height()
                      , c = s - l
                      , u = i - o;
                    $(a).css({
                        top: n.top - c + e,
                        height: s,
                        left: n.left - u + t,
                        width: i,
                        visibility: "visible"
                    }),
                    $(a).find("canvas").css({
                        top: 0,
                        left: 0
                    })
                }
                ))
        },
        scrollAdaptOfpostil: function() {
            var e = this
              , t = $("#luckysheet-cell-main").scrollTop()
              , r = $("#luckysheet-cell-main").scrollLeft();
            if (null != e.freezenhorizontaldata && null != e.freezenverticaldata) {
                var a = e.freezenhorizontaldata[0]
                  , n = e.freezenverticaldata[0]
                  , o = t - e.freezenhorizontaldata[2]
                  , l = r - e.freezenverticaldata[2];
                $("#luckysheet-postil-showBoxs .luckysheet-postil-show").each((function(t, r) {
                    var i = $(r).attr("id")
                      , s = i.split("luckysheet-postil-show_")[1].split("_")[0]
                      , c = i.split("luckysheet-postil-show_")[1].split("_")[1]
                      , u = Store.flowdata[s][c].ps
                      , h = (Store.visibledatarow[s],
                    s - 1 == -1 ? 0 : Store.visibledatarow[s - 1])
                      , d = Store.visibledatacolumn[c]
                      , f = (c - 1 == -1 || Store.visibledatacolumn[c - 1],
                    menuButton.mergeborer(Store.flowdata, s, c));
                    f && (f.row[1],
                    h = f.row[0],
                    d = f.column[1],
                    f.column[0]);
                    var m = d
                      , p = h
                      , g = null == u.left ? m + 18 : u.left
                      , y = null == u.top ? p - 18 : u.top
                      , v = null == u.width ? luckysheetPostil.defaultWidth : u.width
                      , A = null == u.height ? luckysheetPostil.defaultHeight : u.height;
                    y < 0 && (y = 2);
                    var b = luckysheetPostil.getArrowCanvasSize(g, y, m, p)
                      , k = !0
                      , w = !0;
                    s >= e.freezenhorizontaldata[1] ? y + A < a ? ($(r).show().find(".luckysheet-postil-show-main").css("top", y + o),
                    $(r).show().find(".arrowCanvas").css("top", b[1] + o)) : y < a + o ? y + A <= a + o ? k = !1 : ($(r).show().find(".luckysheet-postil-show-main").css({
                        top: a + o,
                        height: A - (a + o - y)
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-top", -(a + o - y)),
                    $(r).show().find(".arrowCanvas").hide(),
                    w = !1) : ($(r).show().find(".luckysheet-postil-show-main").css({
                        top: y,
                        height: A
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-top", 0),
                    $(r).show().find(".arrowCanvas").css("top", b[1])) : ($(r).show().find(".luckysheet-postil-show-main").css("top", y + o),
                    $(r).show().find(".arrowCanvas").css("top", b[1] + o)),
                    c >= e.freezenverticaldata[1] ? g + v < n ? ($(r).show().find(".luckysheet-postil-show-main").css("left", g + l),
                    $(r).show().find(".arrowCanvas").css("left", b[0] + l)) : g < n + l ? g + v <= n + l ? k = !1 : ($(r).show().find(".luckysheet-postil-show-main").css({
                        left: n + l,
                        width: v - (n + l - g)
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-left", -(n + l - g)),
                    $(r).show().find(".arrowCanvas").hide(),
                    w = !1) : ($(r).show().find(".luckysheet-postil-show-main").css({
                        left: g,
                        width: v
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-left", 0),
                    $(r).show().find(".arrowCanvas").css("left", b[0])) : ($(r).show().find(".luckysheet-postil-show-main").css("left", g + l),
                    $(r).show().find(".arrowCanvas").css("left", b[0] + l)),
                    k || $(r).hide(),
                    k && w && $(r).show().find(".arrowCanvas").show()
                }
                ))
            } else if (null != e.freezenhorizontaldata) {
                var i = e.freezenhorizontaldata[0]
                  , s = t - e.freezenhorizontaldata[2];
                $("#luckysheet-postil-showBoxs .luckysheet-postil-show").each((function(t, r) {
                    var a = $(r).attr("id")
                      , n = a.split("luckysheet-postil-show_")[1].split("_")[0]
                      , o = a.split("luckysheet-postil-show_")[1].split("_")[1]
                      , l = Store.flowdata[n][o].ps
                      , c = (Store.visibledatarow[n],
                    n - 1 == -1 ? 0 : Store.visibledatarow[n - 1])
                      , u = Store.visibledatacolumn[o]
                      , h = (o - 1 == -1 || Store.visibledatacolumn[o - 1],
                    menuButton.mergeborer(Store.flowdata, n, o));
                    h && (h.row[1],
                    c = h.row[0],
                    u = h.column[1],
                    h.column[0]);
                    var d = u
                      , f = c
                      , m = null == l.left ? d + 18 : l.left
                      , p = null == l.top ? f - 18 : l.top
                      , g = (null == l.width ? luckysheetPostil.defaultWidth : l.width,
                    null == l.height ? luckysheetPostil.defaultHeight : l.height);
                    p < 0 && (p = 2);
                    var y = luckysheetPostil.getArrowCanvasSize(m, p, d, f);
                    n >= e.freezenhorizontaldata[1] ? p + g < i ? ($(r).show().find(".luckysheet-postil-show-main").css("top", p + s),
                    $(r).show().find(".arrowCanvas").css("top", y[1] + s)) : p < i + s ? p + g <= i + s ? $(r).hide() : ($(r).show().find(".luckysheet-postil-show-main").css({
                        top: i + s,
                        height: g - (i + s - p)
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-top", -(i + s - p)),
                    $(r).show().find(".arrowCanvas").hide()) : luckysheetPostil.buildPs(n, o, l) : ($(r).show().find(".luckysheet-postil-show-main").css("top", p + s),
                    $(r).show().find(".arrowCanvas").css("top", y[1] + s))
                }
                ))
            } else if (null != e.freezenverticaldata) {
                var c = e.freezenverticaldata[0]
                  , u = r - e.freezenverticaldata[2];
                $("#luckysheet-postil-showBoxs .luckysheet-postil-show").each((function(t, r) {
                    var a = $(r).attr("id")
                      , n = a.split("luckysheet-postil-show_")[1].split("_")[0]
                      , o = a.split("luckysheet-postil-show_")[1].split("_")[1]
                      , l = Store.flowdata[n][o].ps
                      , i = (Store.visibledatarow[n],
                    n - 1 == -1 ? 0 : Store.visibledatarow[n - 1])
                      , s = Store.visibledatacolumn[o]
                      , h = (o - 1 == -1 || Store.visibledatacolumn[o - 1],
                    menuButton.mergeborer(Store.flowdata, n, o));
                    h && (h.row[1],
                    i = h.row[0],
                    s = h.column[1],
                    h.column[0]);
                    var d = s
                      , f = i
                      , m = null == l.left ? d + 18 : l.left
                      , p = null == l.top ? f - 18 : l.top
                      , g = null == l.width ? luckysheetPostil.defaultWidth : l.width;
                    null == l.height ? luckysheetPostil.defaultHeight : l.height;
                    p < 0 && (p = 2);
                    var y = luckysheetPostil.getArrowCanvasSize(m, p, d, f);
                    o >= e.freezenverticaldata[1] ? m + g < c ? ($(r).show().find(".luckysheet-postil-show-main").css("left", m + u),
                    $(r).show().find(".arrowCanvas").css("left", y[0] + u)) : m < c + u ? m + g <= c + u ? $(r).hide() : ($(r).show().find(".luckysheet-postil-show-main").css({
                        left: c + u,
                        width: g - (c + u - m)
                    }),
                    $(r).show().find(".formulaInputFocus").css("margin-left", -(c + u - m)),
                    $(r).show().find(".arrowCanvas").hide()) : luckysheetPostil.buildPs(n, o, l) : ($(r).show().find(".luckysheet-postil-show-main").css("left", m + u),
                    $(r).show().find(".arrowCanvas").css("left", y[0] + u))
                }
                ))
            } else
                $("#luckysheet-postil-showBoxs .luckysheet-postil-show").each((function(e, t) {
                    var r = $(t).attr("id")
                      , a = r.split("luckysheet-postil-show_")[1].split("_")[0]
                      , n = r.split("luckysheet-postil-show_")[1].split("_")[1]
                      , o = Store.flowdata[a][n].ps;
                    luckysheetPostil.buildPs(a, n, o)
                }
                ))
        },
        scrollAdaptOfdpicon: function() {
            var e, t, r = luckysheetDropCell.copyRange.row[1], a = luckysheetDropCell.copyRange.column[1], n = luckysheetDropCell.applyRange.row[1], o = luckysheetDropCell.applyRange.column[1];
            if (n >= r && o >= a ? (e = n,
            t = o) : (e = r,
            t = a),
            null != this.freezenhorizontaldata && null != this.freezenverticaldata) {
                var l = this.freezenhorizontaldata[1]
                  , i = luckysheet_searcharray(this.freezenhorizontaldata[3], $("#luckysheet-cell-main").scrollTop() - this.freezenhorizontaldata[2])
                  , s = this.freezenverticaldata[1]
                  , c = luckysheet_searcharray(this.freezenverticaldata[3], $("#luckysheet-cell-main").scrollLeft() - this.freezenverticaldata[2]);
                if (e >= l && t >= s)
                    e < l + i - 1 || t < s + c - 1 ? $("#luckysheet-dropCell-icon").hide() : $("#luckysheet-dropCell-icon").show();
                else if (e >= l)
                    if (e < l + i - 1)
                        $("#luckysheet-dropCell-icon").hide();
                    else {
                        var u = colLocationByIndex(t + c)[1];
                        $("#luckysheet-dropCell-icon").show().css("left", u)
                    }
                else if (t >= s)
                    if (t < s + c - 1)
                        $("#luckysheet-dropCell-icon").hide();
                    else {
                        var h = rowLocationByIndex(e + i)[1];
                        $("#luckysheet-dropCell-icon").show().css("top", h)
                    }
                else {
                    var d = rowLocationByIndex(e + i)[1]
                      , f = colLocationByIndex(t + c)[1];
                    $("#luckysheet-dropCell-icon").show().css({
                        left: f,
                        top: d
                    })
                }
            } else if (null != this.freezenhorizontaldata) {
                var m = this.freezenhorizontaldata[1]
                  , p = luckysheet_searcharray(this.freezenhorizontaldata[3], $("#luckysheet-cell-main").scrollTop() - this.freezenhorizontaldata[2]);
                if (e >= m)
                    e < m + p - 1 ? $("#luckysheet-dropCell-icon").hide() : $("#luckysheet-dropCell-icon").show();
                else {
                    var g = rowLocationByIndex(e + p)[1];
                    $("#luckysheet-dropCell-icon").show().css("top", g)
                }
            } else if (null != this.freezenverticaldata) {
                var y = this.freezenverticaldata[1]
                  , v = luckysheet_searcharray(this.freezenverticaldata[3], $("#luckysheet-cell-main").scrollLeft() - this.freezenverticaldata[2]);
                if (t >= y)
                    t < y + v - 1 ? $("#luckysheet-dropCell-icon").hide() : $("#luckysheet-dropCell-icon").show();
                else {
                    var A = colLocationByIndex(t + v)[1];
                    $("#luckysheet-dropCell-icon").show().css("left", A)
                }
            } else {
                var b = rowLocationByIndex(e)[1]
                  , k = colLocationByIndex(t)[1];
                $("#luckysheet-dropCell-icon").show().css({
                    left: k,
                    top: b
                })
            }
        },
        scrollAdaptOffilteroptions: function() {
            if (null != this.freezenhorizontaldata && null != this.freezenverticaldata) {
                var e = this.freezenhorizontaldata[1]
                  , t = this.freezenhorizontaldata[0] + $("#luckysheet-cell-main").scrollTop()
                  , r = this.freezenverticaldata[1]
                  , a = luckysheet_searcharray(this.freezenverticaldata[3], $("#luckysheet-cell-main").scrollLeft() - this.freezenverticaldata[2]);
                $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function(n, o) {
                    var l = $(o).data("str")
                      , i = l - 1 == -1 ? 0 : Store.visibledatarow[l - 1]
                      , s = $(o).data("cindex");
                    if (l >= e && s >= r)
                        i < t || s < r + a ? $(o).hide() : $(o).show();
                    else if (l >= e)
                        if (i < t)
                            $(o).hide();
                        else {
                            var c = Store.visibledatacolumn[s + a] - 20;
                            $(o).show().css("left", c)
                        }
                    else if (s >= r)
                        s < r + a ? $(o).hide() : $(o).show().css("top", i + $("#luckysheet-cell-main").scrollTop());
                    else {
                        var u = Store.visibledatacolumn[s + a] - 20;
                        $(o).show().css({
                            left: u,
                            top: i + $("#luckysheet-cell-main").scrollTop()
                        })
                    }
                }
                ))
            } else if (null != this.freezenhorizontaldata) {
                var n = this.freezenhorizontaldata[1]
                  , o = this.freezenhorizontaldata[0] + $("#luckysheet-cell-main").scrollTop();
                $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function(e, t) {
                    var r = $(t).data("str")
                      , a = r - 1 == -1 ? 0 : Store.visibledatarow[r - 1];
                    r >= n ? a < o ? $(t).hide() : $(t).show() : $(t).show().css("top", a + $("#luckysheet-cell-main").scrollTop())
                }
                ))
            } else if (null != this.freezenverticaldata) {
                var l = this.freezenverticaldata[1]
                  , i = luckysheet_searcharray(this.freezenverticaldata[3], $("#luckysheet-cell-main").scrollLeft() - this.freezenverticaldata[2]);
                $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function(e, t) {
                    var r = $(t).data("cindex");
                    if (r >= l)
                        r < l + i ? $(t).hide() : $(t).show();
                    else {
                        var a = Store.visibledatacolumn[r + i] - 20;
                        $(t).show().css("left", a)
                    }
                }
                ))
            } else
                $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex).empty(),
                createFilterOptions(Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].filter_select)
        },
        saveFrozen: function(e, t) {
            var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
            null == t && (t = getSheetIndex(Store.currentSheetIndex));
            var a = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , n = null == a.row_focus ? a.row[0] : a.row_focus
              , o = null == a.column_focus ? a.column[0] : a.column_focus
              , l = {
                row_focus: r.row_focus || n,
                column_focus: r.column_focus || o
            }
              , i = {
                freezenRow: {
                    type: "row"
                },
                freezenColumn: {
                    type: "column"
                },
                freezenRC: {
                    type: "both"
                },
                freezenRowRange: {
                    type: "rangeRow",
                    range: l
                },
                freezenColumnRange: {
                    type: "rangeColumn",
                    range: l
                },
                freezenRCRange: {
                    type: "rangeBoth",
                    range: l
                },
                freezenCancel: {
                    type: "cancel"
                }
            };
            Store.luckysheetfile[t].frozen = i[e]
        },
        frozenTofreezen: function() {
            var e = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]
              , t = e.frozen;
            if (null != t && null == e.freezen) {
                var r = null;
                if ("row" === t.type) {
                    var a = luckysheet_searcharray(Store.visibledatarow, 0);
                    -1 == a && (a = 0);
                    var n = Store.visibledatarow[a] - 2 - 0 + Store.columnHeaderHeight;
                    r = {
                        horizontal: {
                            freezenhorizontaldata: [Store.visibledatarow[a], a + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatarow, a + 1), n],
                            top: n
                        }
                    }
                } else if ("column" === t.type) {
                    var o = luckysheet_searcharray(Store.visibledatacolumn, 0);
                    -1 == o && (o = 0);
                    var l = Store.visibledatacolumn[o] - 2 - 0 + Store.rowHeaderWidth;
                    r = {
                        vertical: {
                            freezenverticaldata: [Store.visibledatacolumn[o], o + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, o + 1), l],
                            left: l
                        }
                    }
                } else if ("both" === t.type) {
                    var i = luckysheet_searcharray(Store.visibledatarow, 0);
                    -1 == i && (i = 0);
                    var s = Store.visibledatarow[i] - 2 - 0 + Store.columnHeaderHeight
                      , c = [Store.visibledatarow[i], i + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatarow, i + 1), s]
                      , u = luckysheet_searcharray(Store.visibledatacolumn, 0);
                    -1 == u && (u = 0);
                    var h = Store.visibledatacolumn[u] - 2 - 0 + Store.rowHeaderWidth;
                    r = {
                        horizontal: {
                            freezenhorizontaldata: c,
                            top: s
                        },
                        vertical: {
                            freezenverticaldata: [Store.visibledatacolumn[u], u + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, u + 1), h],
                            left: h
                        }
                    }
                } else if ("rangeRow" === t.type) {
                    var d = luckysheet_searcharray(Store.visibledatarow, 0)
                      , f = t.range.row_focus;
                    f > d && (d = f),
                    -1 == d && (d = 0);
                    var m = Store.visibledatarow[d] - 2 - 0 + Store.columnHeaderHeight;
                    r = {
                        horizontal: {
                            freezenhorizontaldata: [Store.visibledatarow[d], d + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatarow, d + 1), m],
                            top: m
                        }
                    }
                } else if ("rangeColumn" === t.type) {
                    var p = luckysheet_searcharray(Store.visibledatacolumn, 0)
                      , g = t.range.column_focus;
                    g > p && (p = g),
                    -1 == p && (p = 0);
                    var y = Store.visibledatacolumn[p] - 2 - 0 + Store.rowHeaderWidth;
                    r = {
                        vertical: {
                            freezenverticaldata: [Store.visibledatacolumn[p], p + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, p + 1), y],
                            left: y
                        }
                    }
                } else if ("rangeBoth" === t.type) {
                    var v = luckysheet_searcharray(Store.visibledatarow, 0)
                      , A = t.range.row_focus;
                    A > v && (v = A),
                    -1 == v && (v = 0);
                    var b = Store.visibledatarow[v] - 2 - 0 + Store.columnHeaderHeight
                      , k = [Store.visibledatarow[v], v + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatarow, v + 1), b]
                      , w = luckysheet_searcharray(Store.visibledatacolumn, 0)
                      , x = t.range.column_focus;
                    x > w && (w = x),
                    -1 == w && (w = 0);
                    var S = Store.visibledatacolumn[w] - 2 - 0 + Store.rowHeaderWidth;
                    r = {
                        horizontal: {
                            freezenhorizontaldata: k,
                            top: b
                        },
                        vertical: {
                            freezenverticaldata: [Store.visibledatacolumn[w], w + 1, 0, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, w + 1), S],
                            left: S
                        }
                    }
                } else
                    "cancel" === t.type && (r = {
                        horizontal: null,
                        vertical: null
                    });
                e.freezen = r
            }
        }
    }
      , gridW = 0
      , gridH = 0;
    function luckysheetsizeauto() {
        var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
        $('.luckysheet_info_detail_export').unbind('click');
        $('.luckysheet_info_detail_save_as').unbind('click');
        // $('.luckysheet_info_detail_save').unbind('click');

        $('.luckysheet_info_detail_export').click(function(){
          var rawData = luckysheet.getLuckysheetfile();
          var name = $("#luckysheet_info_detail_input").val();
          exportExcel(rawData, name);
        });

        $('.luckysheet_info_detail_save_as').unbind('click').bind('click', function(){
          $('#SaveAsModal').modal('show');
            var old = $("input[name='parent_id']").val();

          $('#SaveAsModal [type="submit"]').unbind('click').bind('click', function(){
            if(old != $("input[name='parent_id']").val()){
              $("input[name='id']").val('');
            }
              var url_form = $("form#spreadsheet-test-form").attr('action');
              var rawData = luckysheet.getLuckysheetfile();
              for (var i = 0; i < rawData.length; i++) {
                var rawCelldata = luckysheet.transToCellData(rawData[i].data); 
                rawData[i].celldata = rawCelldata; 
                rawData[i].data = rawData[i].data; 
              }

              var formData = new FormData();
              var finalData = JSON.stringify(rawData);
              var name = $("#luckysheet_info_detail_input").val();
              var id = $("input[name='id']").val();
              formData.append('data_form', finalData);
              formData.append('name', name);
              formData.append('parent_id', $('input[name="parent_id"]').val());
              formData.append('id', id);
              if(typeof  $('input[name="csrf_token_name"]').val() !== 'undefined'){
                formData.append('csrf_token_name', $('input[name="csrf_token_name"]').val());
              }

              var currentSheet = 0; // I'm storing only the first sheet of the document, you might want to store them all, just iterate it
              var rawData = luckysheet.getLuckysheetfile();
    var rawCelldata = luckysheet.transToCellData(rawData[currentSheet ].data); // luckysheet.transToCellData this transforms rawData into celldata format
    rawData[currentSheet].celldata = rawCelldata; // from the input json on load event, cells are read from "celldata" property
    rawData[currentSheet].data = []; // dump useless data, we don't need to store this null bloat
    var finalData1 = JSON.stringify(rawData);
    console.log('finalData+++++++', finalData);

    console.log('finalData1++++++', finalData1);


              // $.ajax({
              //   url: url_form,
              //   type: 'POST',
              //   data: formData,
              //   success: function (response, status, xhr) {
              //     response = JSON.parse(response);
              //     if(response.success == true) {
              //       alert_float('success', response.message);
              //       var disposition = xhr.getResponseHeader('content-disposition');
              //       $('#SaveAsModal').modal('hide');
              //     }
              //     else{
              //       alert_float('warning', response.message);
              //     }
              //   },
              //   cache: false,
              //   contentType: false,
              //   processData: false
              // })

          })
        });

        // $(".luckysheet_info_detail_save").unbind('click').bind('click', function(){       
        //   $("form#spreadsheet-test-form").unbind('submit').bind('submit', function(e) {
        //   e.preventDefault();    
        //   var rawData = luckysheet.getLuckysheetfile();
        //   var image_flag = "false";
        //   // for (var i = 0; i < rawData.length; i++) {
        //   //   var rawCelldata = luckysheet.transToCellData(rawData[i].data); 
        //   //   rawData[i].celldata = rawCelldata; 
        //   //   if(rawData[i].images != undefined){
        //   //     if(image_flag == "false"){
        //   //       image_flag = "true";
        //   //     }
        //   //     if(Object.keys(rawData[i].images).length > 0){
        //   //       $.each( rawData[i].images, function( key, value ) {
        //   //         rawData[i].images[key].src = "imga$imga"+rawData[i].images[key].src+"imga$imga";
        //   //       });
        //   //     }
        //   //   }
        //   //   rawData[i].data = rawData[i].data; 
        //   // }

        //   // var finalData = JSON.stringify(luckysheet.getAllSheets());
        //   var currentSheet = 0; // I'm storing only the first sheet of the document, you might want to store them all, just iterate it
        //   var rawData = luckysheet.getLuckysheetfile();
        //   var rawCelldata = luckysheet.transToCellData(rawData[currentSheet ].data); // luckysheet.transToCellData this transforms rawData into celldata format
        //   rawData[currentSheet].celldata = rawCelldata; // from the input json on load event, cells are read from "celldata" property
        //   rawData[currentSheet].data = []; // dump useless data, we don't need to store this null bloat
        //   var finalData = JSON.stringify(rawData);

        //   var formData = new FormData(this);
        //   var name = $("#luckysheet_info_detail_input").val();
        //   var id = $("input[name='id']").val();
        //   formData.append('data_form', finalData);
        //   formData.append('name', name);
        //   formData.append('id', id);
        //   formData.append('image_flag', image_flag);


        //   $.ajax({
        //     url: $(this).attr("action"),
        //     type: 'POST',
        //     data: formData,
        //     contentType: false,
        //     success: function (response, status, xhr) {
        //       response = JSON.parse(response);
        //       if(response.success == true) {
        //         alert_float('success', response.message);
        //         var disposition = xhr.getResponseHeader('content-disposition');
        //         $('#SaveAsModal').modal('hide');
        //       }
        //       else{
        //         alert_float('warning', response.message);
        //       }
        //     },
        //     cache: false,
        //     processData: false
        //   })
        // })
        // });

        luckysheetConfigsetting.showinfobar ? ($("#luckysheet_info_detail").show(),
        Store.infobarHeight = document.querySelector("#luckysheet_info_detail").offsetHeight) : (Store.infobarHeight = 0),
        Store.toobarObject && Store.toobarObject.toobarElements && 0 === Store.toobarObject.toobarElements.length ? ($("#" + Store.container).find(".luckysheet-wa-editor").hide(),
        Store.toolbarHeight = 0) : ($("#" + Store.container).find(".luckysheet-wa-editor").show(),
        Store.toolbarHeight = document.querySelector("#" + Store.container + " .luckysheet-wa-editor").offsetHeight),
        customSheetbarConfig(),
        customStatisticBarConfig();
        var t = document.querySelector("#" + Store.container + " .luckysheet-wa-calculate");
        luckysheetConfigsetting.sheetFormulaBar ? (t.style.display = "block",
        Store.calculatebarHeight = t.offsetHeight) : (t.style.display = "none",
        Store.calculatebarHeight = 0),
        $("#" + Store.container).find(".luckysheet-grid-container").css("top", Store.toolbarHeight + Store.infobarHeight + Store.calculatebarHeight),
        gridW = $("#" + Store.container).width(),
        luckysheetConfigsetting.showConfigWindowResize && ($("#luckysheet-modal-dialog-slider-pivot").is(":visible") ? gridW -= $("#luckysheet-modal-dialog-slider-pivot").outerWidth() : $(".chartSetting").is(":visible") ? gridW -= $(".chartSetting").outerWidth() : $("#luckysheet-modal-dialog-slider-alternateformat").is(":visible") && (gridW -= $("#luckysheet-modal-dialog-slider-alternateformat").outerWidth()),
        $("#luckysheet-modal-dialog-slider-protection").is(":visible") && (gridW -= $("#luckysheet-modal-dialog-slider-protection").outerWidth()));
        var r = locale()
          , a = r.toolbar
          , n = !1
          , o = '<div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="'.concat(a.toolMoreTip, '" id="luckysheet-icon-morebtn" role="button" style="user-select: none;"> \n            <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block" style="user-select: none;"> \n                <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block" style="user-select: none;">\n\n                    <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" style="user-select: none;">\n                        ').concat(a.toolMore, '\n                    </div> \n                    <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige" style="user-select: none;font-size:12px;">\n                    </div>\n\n                </div> \n            </div>\n         </div>')
          , l = '<div id="luckysheet-icon-morebtn-div" class="luckysheet-wa-editor" style="position:absolute;top:' + (Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").scrollTop()) + 'px; right:0px;z-index:1003;padding:5.5px;display:none;height:auto;white-space:initial;"></div>';
        0 == $("#luckysheet-icon-morebtn-div").length && $("body").append(l),
        $("#luckysheet-icon-morebtn-div").hide(),
        $(".luckysheet-scrollbars-enabled").css('top', '127px'),
        $("#luckysheet-icon-morebtn-div > div").each((function() {
            var e = $(this)[0]
              , t = $("#luckysheet-wa-editor")[0];
            t.appendChild(document.createTextNode(" ")),
            t.appendChild(e)
        }
        )),
        $("#luckysheet-icon-morebtn").remove();
        for (var i = Store.toobarObject.toobarWidths, s = Store.toobarObject.toobarElements, c = 0, u = i.length - 1; u >= 0; u--)
            if (i[u] < gridW - 90) {
                (c = u) < i.length - 1 && (n = !0);
                break
            }
        for (var h = c; h < s.length; h++) {
            var d = s[h];
            if (d instanceof Array) {
                var f, m = _createForOfIteratorHelper(d);
                try {
                    for (m.s(); !(f = m.n()).done; ) {
                        var p = f.value;
                        $("#luckysheet-icon-morebtn-div").append($("".concat(p)))
                    }
                } catch (e) {
                    m.e(e)
                } finally {
                    m.f()
                }
            } else
                $("#luckysheet-icon-morebtn-div").append($("".concat(d)))
        }
        n && ($("#luckysheet-wa-editor").append(o),
        $("#luckysheet-icon-morebtn").click((function() {
            var e = $(window).width() - $("#luckysheet-icon-morebtn").offset().left - $("#luckysheet-icon-morebtn").width() + $("body").scrollLeft();
            if ($("#luckysheet-icon-morebtn-div").toggle().css("right", e < 0 ? 0 : e),
            $(this).find(".luckysheet-toolbar-menu-button-caption").text().indexOf(a.toolMore) > -1) {
                var t = '\n                <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" style="user-select: none;">\n                    '.concat(a.toolClose, '\n                </div> \n                <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-shangyige" style="user-select: none;font-size:12px;">\n                </div>\n                ');
                $(this).find(".luckysheet-toolbar-button-inner-box").html(t)
            } else {
                var r = '\n                <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" style="user-select: none;">\n                    '.concat(a.toolMore, '\n                </div> \n                <div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige" style="user-select: none;font-size:12px;">\n                </div>\n                ');
                $(this).find(".luckysheet-toolbar-button-inner-box").html(r)
            }
        }
        )),
        $("#luckysheet-icon-morebtn-div .luckysheet-toolbar-button-split-left").off("hover").hover((function() {
            $(this).next(".luckysheet-toolbar-button-split-right").addClass("luckysheet-toolbar-button-split-right-hover")
        }
        ), (function() {
            $(this).next(".luckysheet-toolbar-button-split-right").removeClass("luckysheet-toolbar-button-split-right-hover")
        }
        )),
        $("#luckysheet-icon-morebtn-div .luckysheet-toolbar-button-split-right").off("hover").hover((function() {
            $(this).prev(".luckysheet-toolbar-button-split-left").addClass("luckysheet-toolbar-button-hover")
        }
        ), (function() {
            $(this).prev(".luckysheet-toolbar-button-split-left").removeClass("luckysheet-toolbar-button-hover")
        }
        )),
        tooltip.createHoverTip("#luckysheet-icon-morebtn-div", ".luckysheet-toolbar-menu-button, .luckysheet-toolbar-button, .luckysheet-toolbar-combo-button")),
        $("#" + Store.container + " .luckysheet-wa-editor .luckysheet-toolbar-button-split-left").off("hover").hover((function() {
            $(this).next(".luckysheet-toolbar-button-split-right").addClass("luckysheet-toolbar-button-split-right-hover")
        }
        ), (function() {
            $(this).next(".luckysheet-toolbar-button-split-right").removeClass("luckysheet-toolbar-button-split-right-hover")
        }
        )),
        $("#" + Store.container + " .luckysheet-wa-editor .luckysheet-toolbar-button-split-right").off("hover").hover((function() {
            $(this).prev(".luckysheet-toolbar-button-split-left").addClass("luckysheet-toolbar-button-hover")
        }
        ), (function() {
            $(this).prev(".luckysheet-toolbar-button-split-left").removeClass("luckysheet-toolbar-button-hover")
        }
        )),
        gridH = $("#" + Store.container).height(),
        $("#" + Store.container).find(".luckysheet").height(gridH - 2).width(gridW - 2),
        changeSheetContainerSize(gridW, gridH),
        e && luckysheetrefreshgrid($("#luckysheet-cell-main").scrollLeft(), $("#luckysheet-cell-main").scrollTop()),
        sheetmanage.sheetArrowShowAndHide(),
        sheetmanage.sheetBarShowAndHide()
    }
    function changeSheetContainerSize(e, t) {
        null == e && (e = $("#" + Store.container).width()),
        null == t && (t = $("#" + Store.container).height()),
        Store.cellmainHeight = t - (Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight + Store.sheetBarHeight + Store.statisticBarHeight),
        Store.cellmainWidth = e - Store.rowHeaderWidth,
        $("#luckysheet-cols-h-c, #luckysheet-cell-main").width(Store.cellmainWidth),
        $("#luckysheet-cell-main").height(Store.cellmainHeight),
        $("#luckysheet-rows-h").height(Store.cellmainHeight - Store.cellMainSrollBarSize),
        $("#luckysheet-scrollbar-y").height(Store.cellmainHeight + Store.columnHeaderHeight - Store.cellMainSrollBarSize - 3),
        $("#luckysheet-scrollbar-x").height(Store.cellMainSrollBarSize),
        $("#luckysheet-scrollbar-y").width(Store.cellMainSrollBarSize),
        $("#luckysheet-scrollbar-x").width(Store.cellmainWidth).css("left", Store.rowHeaderWidth - 2),
        Store.luckysheetTableContentHW = [Store.cellmainWidth + Store.rowHeaderWidth - Store.cellMainSrollBarSize, Store.cellmainHeight + Store.columnHeaderHeight - Store.cellMainSrollBarSize],
        $("#luckysheetTableContent, #luckysheetTableContentF").attr({
            width: Math.ceil(Store.luckysheetTableContentHW[0] * Store.devicePixelRatio),
            height: Math.ceil(Store.luckysheetTableContentHW[1] * Store.devicePixelRatio)
        }).css({
            width: Store.luckysheetTableContentHW[0],
            height: Store.luckysheetTableContentHW[1]
        }),
        $("#" + Store.container).find("#luckysheet-grid-window-1").css("bottom", Store.sheetBarHeight),
        $("#" + Store.container).find(".luckysheet-grid-window").css("bottom", Store.statisticBarHeight);
        var r = $("#luckysheet-grid-window-1").width();
        $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({
            width: r - 10
        }).end().find(".luckysheet-freezebar-horizontal-drop").css({
            width: r - 10
        });
        var a = $("#luckysheet-grid-window-1").height();
        $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css({
            height: a - 10
        }).end().find(".luckysheet-freezebar-vertical-drop").css({
            height: a - 10
        }),
        luckysheetFreezen.createAssistCanvas()
    }
    function menuToolBarWidth() {
        var e = luckysheetConfigsetting.showtoolbar
          , t = luckysheetConfigsetting.showtoolbarConfig
          , r = Store.toobarObject.toobarWidths = []
          , a = Store.toobarObject.toobarElements = []
          , n = Store.toobarObject.toobarConfig = {
            undo: {
                ele: "#luckysheet-icon-undo",
                index: 0
            },
            redo: {
                ele: "#luckysheet-icon-redo",
                index: 1
            },
            paintFormat: {
                ele: ["#luckysheet-icon-paintformat", "#toolbar-separator-paint-format"],
                index: 2
            },
            currencyFormat: {
                ele: "#luckysheet-icon-currency",
                index: 3
            },
            percentageFormat: {
                ele: "#luckysheet-icon-percent",
                index: 4
            },
            numberDecrease: {
                ele: "#luckysheet-icon-fmt-decimal-decrease",
                index: 5
            },
            numberIncrease: {
                ele: "#luckysheet-icon-fmt-decimal-increase",
                index: 6
            },
            moreFormats: {
                ele: ["#luckysheet-icon-fmt-other", "#toolbar-separator-more-format"],
                index: 7
            },
            font: {
                ele: ["#luckysheet-icon-font-family", "#toolbar-separator-font-family"],
                index: 8
            },
            fontSize: {
                ele: ["#luckysheet-icon-font-size", "#toolbar-separator-font-size"],
                index: 9
            },
            bold: {
                ele: "#luckysheet-icon-bold",
                index: 10
            },
            italic: {
                ele: "#luckysheet-icon-italic",
                index: 11
            },
            strikethrough: {
                ele: "#luckysheet-icon-strikethrough",
                index: 12
            },
            textColor: {
                ele: ["#luckysheet-icon-text-color", "#luckysheet-icon-text-color-menu", "#toolbar-separator-text-color"],
                index: 13
            },
            fillColor: {
                ele: ["#luckysheet-icon-cell-color", "#luckysheet-icon-cell-color-menu"],
                index: 14
            },
            border: {
                ele: ["#luckysheet-icon-border-all", "#luckysheet-icon-border-menu"],
                index: 15
            },
            mergeCell: {
                ele: ["#luckysheet-icon-merge-button", "#luckysheet-icon-merge-menu", "#toolbar-separator-merge-cell"],
                index: 16
            },
            horizontalAlignMode: {
                ele: ["#luckysheet-icon-align", "#luckysheet-icon-align-menu"],
                index: 17
            },
            verticalAlignMode: {
                ele: ["#luckysheet-icon-valign", "#luckysheet-icon-valign-menu"],
                index: 18
            },
            textWrapMode: {
                ele: ["#luckysheet-icon-textwrap", "#luckysheet-icon-textwrap-menu"],
                index: 19
            },
            textRotateMode: {
                ele: ["#luckysheet-icon-rotation", "#luckysheet-icon-rotation-menu", "#toolbar-separator-text-rotate"],
                index: 20
            },
            image: {
                ele: "#luckysheet-insertImg-btn-title",
                index: 21
            },
            link: {
                ele: "#luckysheet-insertLink-btn-title",
                index: 22
            },
            chart: {
                ele: "#luckysheet-chart-btn-title",
                index: 23
            },
            postil: {
                ele: "#luckysheet-icon-postil",
                index: 24
            },
            pivotTable: {
                ele: ["#luckysheet-pivot-btn-title", "#toolbar-separator-pivot-table"],
                index: 25
            },
            function: {
                ele: ["#luckysheet-icon-function", "#luckysheet-icon-function-menu"],
                index: 26
            },
            frozenMode: {
                ele: ["#luckysheet-freezen-btn-horizontal", "#luckysheet-icon-freezen-menu"],
                index: 27
            },
            sortAndFilter: {
                ele: "#luckysheet-icon-autofilter",
                index: 28
            },
            conditionalFormat: {
                ele: "#luckysheet-icon-conditionformat",
                index: 29
            },
            dataVerification: {
                ele: "#luckysheet-dataVerification-btn-title",
                index: 30
            },
            splitColumn: {
                ele: "#luckysheet-splitColumn-btn-title",
                index: 31
            },
            screenshot: {
                ele: "#luckysheet-chart-btn-screenshot",
                index: 32
            },
            findAndReplace: {
                ele: "#luckysheet-icon-seachmore",
                index: 33
            },
            protection: {
                ele: "#luckysheet-icon-protection",
                index: 34
            },
            print: {
                ele: "#luckysheet-icon-print",
                index: 35
            }
        }
          , o = {
            undo: !0,
            redo: !0,
            paintFormat: !0,
            currencyFormat: !0,
            percentageFormat: !0,
            numberDecrease: !0,
            numberIncrease: !0,
            moreFormats: !0,
            font: !0,
            fontSize: !0,
            bold: !0,
            italic: !0,
            strikethrough: !0,
            textColor: !0,
            fillColor: !0,
            border: !0,
            mergeCell: !0,
            horizontalAlignMode: !0,
            verticalAlignMode: !0,
            textWrapMode: !0,
            textRotateMode: !0,
            image: !0,
            chart: !0,
            postil: !0,
            pivotTable: !0,
            function: !0,
            frozenMode: !0,
            sortAndFilter: !0,
            conditionalFormat: !0,
            dataVerification: !0,
            splitColumn: !0,
            screenshot: !0,
            findAndReplace: !0,
            protection: !0,
            print: !0
        };
        if (!e)
            for (var l in o)
                o[l] = !1;
        for (var i in "{}" !== JSON.stringify(t) && (t.hasOwnProperty("undoRedo") && (o.undo = o.redo = t.undoRedo,
        delete t.undoRedo),
        Object.assign(o, t)),
        o)
            if (o[i])
                a.push($.extend(!0, {}, n[i]));
            else if (n[i].ele instanceof Array) {
                var s, c = _createForOfIteratorHelper(n[i].ele);
                try {
                    for (c.s(); !(s = c.n()).done; ) {
                        var u = s.value;
                        $(u).remove()
                    }
                } catch (e) {
                    c.e(e)
                } finally {
                    c.f()
                }
            } else
                $(n[i].ele).remove();
        a.sort((function(e, t) {
            return e.index > t.index ? 1 : -1
        }
        )),
        a.forEach((function(e, t, n) {
            n[t] = e.ele,
            t !== a.length - 1 ? e.ele instanceof Array ? r.push($(e.ele[0]).offset().left) : r.push($(e.ele).offset().left) : e.ele instanceof Array ? (r.push($(e.ele[0]).offset().left),
            r.push($(e.ele[0]).offset().left + $(e.ele[0]).outerWidth() + 5)) : (r.push($(e.ele).offset().left),
            r.push($(e.ele).offset().left + $(e.ele).outerWidth() + 5))
        }
        ))
    }
    function customSheetbarConfig() {
        if (!luckysheetConfigsetting.initShowsheetbarConfig) {
            luckysheetConfigsetting.initShowsheetbarConfig = !0;
            var e = {
                add: !0,
                menu: !0,
                sheet: !0
            };
            if (!luckysheetConfigsetting.showsheetbar)
                for (var t in e)
                    e[t] = !1;
            "{}" !== JSON.stringify(luckysheetConfigsetting.showsheetbarConfig) && Object.assign(e, luckysheetConfigsetting.showsheetbarConfig),
            luckysheetConfigsetting.showsheetbarConfig = e
        }
        var r = luckysheetConfigsetting.showsheetbarConfig
          , a = 0;
        for (var n in r)
            if (!r[n])
                switch (n) {
                case "add":
                    $("#luckysheet-sheets-add").hide(),
                    a++;
                    break;
                case "menu":
                    $("#luckysheet-sheets-m").hide(),
                    a++;
                    break;
                case "sheet":
                    $("#luckysheet-sheet-container").hide(),
                    $("#luckysheet-sheets-leftscroll").hide(),
                    $("#luckysheet-sheets-rightscroll").hide(),
                    a++
                }
        3 === a ? ($("#" + Store.container).find("#luckysheet-sheet-area").hide(),
        Store.sheetBarHeight = 0) : ($("#" + Store.container).find("#luckysheet-sheet-area").show(),
        Store.sheetBarHeight = 31)
    }
    function customStatisticBarConfig() {
        if (!luckysheetConfigsetting.initStatisticBarConfig) {
            luckysheetConfigsetting.initStatisticBarConfig = !0;
            var e = {
                count: !0,
                view: !0,
                zoom: !0
            };
            if (!luckysheetConfigsetting.showstatisticBar)
                for (var t in e)
                    e[t] = !1;
            "{}" !== JSON.stringify(luckysheetConfigsetting.showstatisticBarConfig) && Object.assign(e, luckysheetConfigsetting.showstatisticBarConfig),
            luckysheetConfigsetting.showstatisticBarConfig = e
        }
        var r = luckysheetConfigsetting.showstatisticBarConfig
          , a = 0;
        for (var n in r)
            if (!r[n])
                switch (n) {
                case "count":
                    $("#luckysheet-sta-content").hide(),
                    a++;
                    break;
                case "view":
                    $(".luckysheet-print-viewList").hide(),
                    a++;
                    break;
                case "zoom":
                    $("#luckysheet-zoom-content").hide(),
                    a++
                }
        3 === a ? ($("#" + Store.container).find(".luckysheet-stat-area").hide(),
        Store.statisticBarHeight = 0) : ($("#" + Store.container).find(".luckysheet-stat-area").show(),
        Store.statisticBarHeight = 23)
    }
    function setcellvalue(e, t, r, a) {
        null == r && (r = Store.flowdata);
        var n, o = r[e][t];
        if ("object" == getObjType(a) ? (null == o ? o = a : (null != a.f && (o.f = a.f),
        null != a.spl && (o.spl = a.spl),
        null != a.ct && (o.ct = a.ct)),
        n = "object" == getObjType(a.v) ? a.v.v : a.v) : n = a,
        isRealNull(n))
            return "object" == getObjType(o) ? (delete o.m,
            delete o.v) : o = null,
            void (r[e][t] = o);
        if (isRealNull(o) && (o = {}),
        "'" == n.toString().substr(0, 1))
            o.m = n.toString().substr(1),
            o.ct = {
                fa: "@",
                t: "s"
            },
            o.v = n.toString().substr(1),
            o.qp = 1;
        else if (1 == o.qp)
            o.m = n.toString(),
            o.ct = {
                fa: "@",
                t: "s"
            },
            o.v = n.toString();
        else if ("TRUE" === n.toString().toUpperCase())
            o.m = "TRUE",
            o.ct = {
                fa: "General",
                t: "b"
            },
            o.v = !0;
        else if ("FALSE" === n.toString().toUpperCase())
            o.m = "FALSE",
            o.ct = {
                fa: "General",
                t: "b"
            },
            o.v = !1;
        else if (valueIsError(n))
            o.m = n.toString(),
            null != o.ct ? o.ct.t = "e" : o.ct = {
                fa: "General",
                t: "e"
            },
            o.v = n;
        else if (null != o.f && isRealNum(n) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(n))
            if (o.v = parseFloat(n),
            null == o.ct && (o.ct = {
                fa: "General",
                t: "n"
            }),
            o.v == 1 / 0 || o.v == -1 / 0)
                o.m = o.v.toString();
            else if (o.v.toString().indexOf("e") > -1) {
                var l;
                (l = 1 == o.v.toString().split(".").length ? 0 : o.v.toString().split(".")[1].split("e")[0].length) > 5 && (l = 5),
                o.m = o.v.toExponential(l).toString()
            } else {
                var i = Math.round(1e9 * o.v) / 1e9;
                if (null == o.ct) {
                    var s = genarate(i);
                    o.m = s[0].toString()
                } else {
                    var c = update(o.ct.fa, i);
                    o.m = c.toString()
                }
            }
        else if (null != o.ct && "@" == o.ct.fa)
            o.m = n.toString(),
            o.v = n;
        else if (null != o.ct && null != o.ct.fa && "General" != o.ct.fa) {
            isRealNum(n) && (n = parseFloat(n));
            var u = update(o.ct.fa, n);
            u === n ? (u = genarate(n),
            o.m = u[0].toString(),
            o.ct = u[1],
            o.v = u[2]) : (o.m = u.toString(),
            o.v = n)
        } else if (isRealNum(n) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(n))
            if (n = parseFloat(n),
            o.v = parseFloat(n),
            o.ct = {
                fa: "General",
                t: "n"
            },
            o.v == 1 / 0 || o.v == -1 / 0)
                o.m = o.v.toString();
            else {
                var h = genarate(o.v);
                o.m = h[0].toString()
            }
        else {
            var d = genarate(n);
            o.m = d[0].toString(),
            o.ct = d[1],
            o.v = d[2]
        }
        if (!server.allowUpdate && !luckysheetConfigsetting.pointEdit && null != o.ct && 0 == /^(w|W)((0?)|(0\.0+))$/.test(o.ct.fa) && "n" == o.ct.t && null != o.v && parseInt(o.v).toString().length > 4) {
            var f = setAccuracy(luckysheetConfigsetting.autoFormatw.toString().toUpperCase(), luckysheetConfigsetting.accuracy);
            "General" != f && (o.ct.fa = f,
            o.m = update(f, o.v))
        }
        r[e][t] = o
    }
    function setAccuracy(e, t) {
        var r, a = "0.";
        if ("TRUE" == e) {
            if (null == t)
                return "w";
            var n = parseInt(t);
            if (0 == n)
                return "w0";
            a = "w0.";
            for (var o = 0; o < n; o++)
                a += "0";
            r = a
        } else {
            if (null == t)
                return "General";
            var l = parseInt(t);
            if (0 == l)
                return "0";
            for (var i = 0; i < l; i++)
                a += "0";
            r = a
        }
        return r.toString()
    }
    var dataVerificationCtrl = {
        defaultItem: {
            type: "dropdown",
            type2: null,
            value1: "",
            value2: "",
            checked: !1,
            remote: !1,
            prohibitInput: !1,
            hintShow: !1,
            hintText: ""
        },
        curItem: null,
        dataVerification: null,
        selectRange: [],
        selectStatus: !1,
        optionLabel: {
            number: "数值",
            number_integer: "整数",
            number_decimal: "小数",
            bw: "介于",
            nb: "不介于",
            eq: "等于",
            ne: "不等于",
            gt: "大于",
            lt: "小于",
            gte: "大于等于",
            lte: "小于等于",
            include: "包括",
            exclude: "不包括",
            equal: "等于",
            bf: "早于",
            nbf: "不早于",
            af: "晚于",
            naf: "不晚于",
            card: "身份证号码",
            phone: "手机号"
        },
        optionLabel_en: {
            number: "numeric",
            number_integer: "integer",
            number_decimal: "decimal",
            bw: "between",
            nb: "not between",
            eq: "equal to",
            ne: "not equal to",
            gt: "greater",
            lt: "less than",
            gte: "greater or equal to",
            lte: "less than or equal to",
            include: "include",
            exclude: "not include",
            equal: "equal to",
            bf: "earlier than",
            nbf: "not earlier than",
            af: "later than",
            naf: "not later than",
            card: "identification number",
            phone: "phone number"
        },
        createDialog: function() {
            var e = locale()
              , t = e.dataVerification
              , r = e.toolbar
              , a = e.button;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-dataVerification-dialog").remove();
            var n = '<div class="box">\n                            <div class="box-item" style="border-top:1px solid #E1E4E8;">\n                                <div class="box-item-title">'.concat(t.cellRange, '</div>\n                                <div id="data-verification-range" class="range">\n                                    <input class="formulaInputFocus" spellcheck="false">\n                                    <i class="fa fa-table" aria-hidden="true" title="').concat(t.selectCellRange, '"></i>\n                                </div>\n                            </div>\n                            <div class="box-item">\n                                <div class="box-item-title">').concat(t.verificationCondition, '</div>\n                                <select id="data-verification-type-select">\n                                    <option value="dropdown">').concat(t.dropdown, '</option>\n                                    <option value="checkbox">').concat(t.checkbox, '</option>\n                                    <option value="number">').concat(t.number, '</option>\n                                    <option value="number_integer">').concat(t.number_integer, '</option>\n                                    <option value="number_decimal">').concat(t.number_decimal, '</option>\n                                    <option value="text_content">').concat(t.text_content, '</option>\n                                    <option value="text_length">').concat(t.text_length, '</option>\n                                    <option value="date">').concat(t.date, '</option>\n                                    <option value="validity">').concat(t.validity, '</option>\n                                </select>\n                                <div class="show-box">\n                                    <div class="show-box-item show-box-item-dropdown">\n                                        <div class="range">\n                                            <input class="formulaInputFocus data-verification-value1" placeholder="').concat(t.placeholder1, '" spellcheck="false">\n                                            <i class="fa fa-table" aria-hidden="true" title="').concat(t.selectCellRange, '"></i>\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-checkbox">\n                                        <div class="check-box">\n                                            <span>').concat(t.selected, ' ——</span>\n                                            <input type="text" class="data-verification-value1" placeholder="').concat(t.placeholder2, '">\n                                        </div>\n                                        <div class="check-box">\n                                            <span>').concat(t.notSelected, ' ——</span>\n                                            <input type="text" class="data-verification-value2" placeholder="').concat(t.placeholder2, '">\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-number">\n                                        <select id="data-verification-number-select">\n                                            <option value="bw">').concat(t.between, '</option>\n                                            <option value="nb">').concat(t.notBetween, '</option>\n                                            <option value="eq">').concat(t.equal, '</option>\n                                            <option value="ne">').concat(t.notEqualTo, '</option>\n                                            <option value="gt">').concat(t.moreThanThe, '</option>\n                                            <option value="lt">').concat(t.lessThan, '</option>\n                                            <option value="gte">').concat(t.greaterOrEqualTo, '</option>\n                                            <option value="lte">').concat(t.lessThanOrEqualTo, '</option>\n                                        </select>\n                                        <div class="input input1">\n                                            <input type="number" class="data-verification-value1" placeholder="1">\n                                            <span>-</span>\n                                            <input type="number" class="data-verification-value2" placeholder="100">\n                                        </div>\n                                        <div class="input input2">\n                                            <input type="number" class="data-verification-value1" placeholder="').concat(t.placeholder3, '">\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-text">\n                                        <select id="data-verification-text-select">\n                                            <option value="include">').concat(t.include, '</option>\n                                            <option value="exclude">').concat(t.exclude, '</option>\n                                            <option value="equal">').concat(t.equal, '</option>\n                                        </select>\n                                        <div class="input input2">\n                                            <input type="text" class="data-verification-value1" placeholder="').concat(t.placeholder4, '"/>\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-textLength">\n                                        <select id="data-verification-textLength-select">\n                                            <option value="bw">').concat(t.between, '</option>\n                                            <option value="nb">').concat(t.notBetween, '</option>\n                                            <option value="eq">').concat(t.equal, '</option>\n                                            <option value="ne">').concat(t.notEqualTo, '</option>\n                                            <option value="gt">').concat(t.moreThanThe, '</option>\n                                            <option value="lt">').concat(t.lessThan, '</option>\n                                            <option value="gte">').concat(t.greaterOrEqualTo, '</option>\n                                            <option value="lte">').concat(t.lessThanOrEqualTo, '</option>\n                                        </select>\n                                        <div class="input input1">\n                                            <input type="number" class="data-verification-value1" placeholder="1">\n                                            <span>-</span>\n                                            <input type="number" class="data-verification-value2" placeholder="100">\n                                        </div>\n                                        <div class="input input2">\n                                            <input type="number" class="data-verification-value1" placeholder="').concat(t.placeholder3, '">\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-date">\n                                        <select id="data-verification-date-select">\n                                            <option value="bw">').concat(t.between, '</option>\n                                            <option value="nb">').concat(t.notBetween, '</option>\n                                            <option value="eq">').concat(t.equal, '</option>\n                                            <option value="ne">').concat(t.notEqualTo, '</option>\n                                            <option value="bf">').concat(t.earlierThan, '</option>\n                                            <option value="nbf">').concat(t.noEarlierThan, '</option>\n                                            <option value="af">').concat(t.laterThan, '</option>\n                                            <option value="naf">').concat(t.noLaterThan, '</option>\n                                        </select>\n                                        <div class="input input1">\n                                            <input type="date" class="data-verification-value1" placeholder="2020/9/10">\n                                            <span>-</span>\n                                            <input type="date" class="data-verification-value2" placeholder="2020/9/10">\n                                        </div>\n                                        <div class="input input2">\n                                            <input type="date" class="data-verification-value1" placeholder="2020/9/10">\n                                        </div>\n                                    </div>\n                                    <div class="show-box-item show-box-item-validity">\n                                        <select id="data-verification-validity-select">\n                                            <option value="card">').concat(t.identificationNumber, '</option>\n                                            <option value="phone">').concat(t.phoneNumber, '</option>\n                                        </select>\n                                    </div>\n                                </div>\n                            </div>\n                            <div class="box-item">\n                                <div class="check">\n                                    <input type="checkbox" id="data-verification-remote" class="data-verification-remote">\n                                    <label for="data-verification-remote">').concat(t.remote, '</label>\n                                </div>\n                                <div class="check">\n                                    <input type="checkbox" id="data-verification-prohibitInput">\n                                    <label for="data-verification-prohibitInput">').concat(t.prohibitInput, '</label>\n                                </div>\n                                <div class="check">\n                                    <input type="checkbox" id="data-verification-hint-show">\n                                    <label for="data-verification-hint-show">').concat(t.hintShow, '</label>\n                                </div>\n                                <div class="data-verification-hint-text">\n                                    <input type="text" placeholder="').concat(t.placeholder5, '">\n                                </div>\n                            </div>\n                        </div>');
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-dataVerification-dialog",
                addclass: "luckysheet-dataVerification-dialog",
                title: r.dataVerification,
                content: n,
                botton: '<button id="luckysheet-dataVerification-dialog-confirm" class="btn btn-primary">'.concat(a.confirm, '</button>\n                        <button id="luckysheet-dataVerification-dialog-delete" class="btn btn-default">').concat(t.deleteVerification, '</button>\n                        <button class="btn btn-default luckysheet-model-close-btn">').concat(a.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var o = $("#luckysheet-dataVerification-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 350).end()
              , l = o.outerHeight()
              , i = o.outerWidth()
              , s = $(window).width()
              , c = $(window).height()
              , u = $(document).scrollLeft()
              , h = $(document).scrollTop();
            $("#luckysheet-dataVerification-dialog").css({
                left: (s + u - i) / 2,
                top: (c + h - l) / 3
            }).show(),
            this.dataAllocation()
        },
        init: function() {
            var e = this
              , t = locale().dataVerification;
            $(document).off("click.dropdownBtn").on("click.dropdownBtn", "#luckysheet-dataVerification-dropdown-btn", (function(t) {
                e.dropdownListShow(),
                t.stopPropagation()
            }
            )),
            $(document).off("click.dropdownListItem").on("click.dropdownListItem", "#luckysheet-dataVerification-dropdown-List .dropdown-List-item", (function(e) {
                $("#luckysheet-dataVerification-dropdown-List").hide();
                var t = e.target.innerText
                  , r = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , a = r.row_focus
                  , n = r.column_focus;
                $("#luckysheet-rich-text-editor").text(t),
                luckysheetformula.updatecell(a, n),
                e.stopPropagation()
            }
            )),
            $(document).off("click.dvRange").on("click.dvRange", "#data-verification-range .fa-table", (function(t) {
                $("#luckysheet-dataVerification-dialog").hide();
                var r = $(this).siblings("input").val().trim();
                e.rangeDialog("0", r),
                e.selectRange = [];
                var a = e.getRangeByTxt(r);
                if (a.length > 0)
                    for (var n = 0; n < a.length; n++) {
                        var o = a[n].row[0]
                          , l = a[n].row[1]
                          , i = a[n].column[0]
                          , s = a[n].column[1]
                          , c = Store.visibledatarow[l]
                          , u = o - 1 == -1 ? 0 : Store.visibledatarow[o - 1]
                          , h = Store.visibledatacolumn[s]
                          , d = i - 1 == -1 ? 0 : Store.visibledatacolumn[i - 1];
                        e.selectRange.push({
                            left: d,
                            width: h - d - 1,
                            top: u,
                            height: c - u - 1,
                            left_move: d,
                            width_move: h - d - 1,
                            top_move: u,
                            height_move: c - u - 1,
                            row: [o, l],
                            column: [i, s],
                            row_focus: o,
                            column_focus: i
                        })
                    }
                selectionCopyShow(e.selectRange)
            }
            )),
            $(document).off("click.dvRange2").on("click.dvRange2", "#luckysheet-dataVerification-dialog .show-box-item-dropdown .range .fa-table", (function(t) {
                $("#luckysheet-dataVerification-dialog").hide();
                var r = $(this).siblings("input").val().trim();
                e.rangeDialog("1", r),
                e.selectRange = [];
                var a = e.getRangeByTxt(r);
                if (a.length > 0)
                    for (var n = 0; n < a.length; n++) {
                        var o = a[n].row[0]
                          , l = a[n].row[1]
                          , i = a[n].column[0]
                          , s = a[n].column[1]
                          , c = Store.visibledatarow[l]
                          , u = o - 1 == -1 ? 0 : Store.visibledatarow[o - 1]
                          , h = Store.visibledatacolumn[s]
                          , d = i - 1 == -1 ? 0 : Store.visibledatacolumn[i - 1];
                        e.selectRange.push({
                            left: d,
                            width: h - d - 1,
                            top: u,
                            height: c - u - 1,
                            left_move: d,
                            width_move: h - d - 1,
                            top_move: u,
                            height_move: c - u - 1,
                            row: [o, l],
                            column: [i, s],
                            row_focus: o,
                            column_focus: i
                        })
                    }
                selectionCopyShow(e.selectRange)
            }
            )),
            $(document).off("click.dvRangeConfirm").on("click.dvRangeConfirm", "#luckysheet-dataVerificationRange-dialog-confirm", (function(t) {
                var r = $(this).attr("data-source")
                  , a = $(this).parents("#luckysheet-dataVerificationRange-dialog").find("input").val();
                if (e.getRangeByTxt(a).length > 1)
                    tooltip.info('<i class="fa fa-exclamation-triangle"></i>', "不能对多重选择区域执行此操作，请选择单个区域，然后再试");
                else {
                    "0" == r ? $("#luckysheet-dataVerification-dialog #data-verification-range input").val(a) : "1" == r && $("#luckysheet-dataVerification-dialog .show-box-item-dropdown .range input").val(a),
                    $("#luckysheet-dataVerificationRange-dialog").hide(),
                    $("#luckysheet-modal-dialog-mask").show(),
                    $("#luckysheet-dataVerification-dialog").show();
                    selectionCopyShow([])
                }
            }
            )),
            $(document).off("click.dvRangeClose").on("click.dvRangeClose", "#luckysheet-dataVerificationRange-dialog-close", (function(e) {
                $("#luckysheet-dataVerificationRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-dataVerification-dialog").show();
                selectionCopyShow([])
            }
            )),
            $(document).on("click", "#luckysheet-dataVerificationRange-dialog .luckysheet-modal-dialog-title-close", (function(e) {
                $("#luckysheet-dataVerificationRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-dataVerification-dialog").show();
                selectionCopyShow([])
            }
            )),
            $(document).off("change.typeSelect").on("change.typeSelect", "#data-verification-type-select", (function(t) {
                $("#luckysheet-dataVerification-dialog .show-box .show-box-item").hide();
                var r = this.value
                  , a = e.curItem;
                if ("dropdown" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box .show-box-item-dropdown").show();
                    var n = "";
                    r == a.type && (n = a.value1),
                    $("#luckysheet-dataVerification-dialog .show-box-item-dropdown .data-verification-value1").val(n)
                } else if ("checkbox" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box .show-box-item-checkbox").show();
                    var o = ""
                      , l = "";
                    r == a.type && (o = a.value1,
                    l = a.value2),
                    $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value1").val(o),
                    $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value2").val(l)
                } else if ("number" == r || "number_integer" == r || "number_decimal" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box-item-number").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-number .input").hide();
                    var i = "bw"
                      , s = ""
                      , c = "";
                    "number" != a.type && "number_integer" != a.type && "number_decimal" != a.type || (i = a.type2,
                    s = a.value1,
                    c = a.value2),
                    $("#luckysheet-dataVerification-dialog #data-verification-number-select").val(i),
                    "bw" == i || "nb" == i ? $("#luckysheet-dataVerification-dialog .show-box-item-number .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-number .input2").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value1").val(s),
                    $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value2").val(c)
                } else if ("text_content" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box-item-text").show();
                    var u = "include"
                      , h = "";
                    r == a.type && (u = a.type2,
                    h = a.value1),
                    $("#luckysheet-dataVerification-dialog #data-verification-text-select").val(u),
                    $("#luckysheet-dataVerification-dialog .show-box-item-text .data-verification-value1").val(h)
                } else if ("text_length" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box-item-textLength").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input").hide();
                    var d = "bw"
                      , f = ""
                      , m = "";
                    r == a.type && (d = a.type2,
                    f = a.value1,
                    m = a.value2),
                    $("#luckysheet-dataVerification-dialog #data-verification-textLength-select").val(d),
                    "bw" == d || "nb" == d ? $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input2").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value1").val(f),
                    $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value2").val(m)
                } else if ("date" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box-item-date").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-date .input").hide();
                    var p = "bw"
                      , g = ""
                      , y = "";
                    r == a.type && (p = a.type2,
                    g = a.value1,
                    y = a.value2),
                    $("#luckysheet-dataVerification-dialog #data-verification-date-select").val(p),
                    "bw" == p || "nb" == p ? $("#luckysheet-dataVerification-dialog .show-box-item-date .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-date .input2").show(),
                    $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value1").val(g),
                    $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value2").val(y)
                } else if ("validity" == r) {
                    $("#luckysheet-dataVerification-dialog .show-box .show-box-item-validity").show();
                    var v = "card";
                    r == a.type && (v = a.type2),
                    $("#luckysheet-dataVerification-dialog #data-verification-validity-select").val(v)
                }
            }
            )),
            $(document).off("change.numberSelect").on("change.numberSelect", "#data-verification-number-select", (function(e) {
                $("#luckysheet-dataVerification-dialog .show-box-item-number .input").hide();
                var t = this.value;
                "bw" == t || "nb" == t ? $("#luckysheet-dataVerification-dialog .show-box-item-number .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-number .input2").show()
            }
            )),
            $(document).off("change.dateSelect").on("change.dateSelect", "#data-verification-date-select", (function(e) {
                $("#luckysheet-dataVerification-dialog .show-box-item-date .input").hide();
                var t = this.value;
                "bw" == t || "nb" == t ? $("#luckysheet-dataVerification-dialog .show-box-item-date .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-date .input2").show()
            }
            )),
            $(document).off("change.hintShow").on("change.hintShow", "#data-verification-hint-show", (function(e) {
                this.checked ? $("#luckysheet-dataVerification-dialog .data-verification-hint-text").show() : $("#luckysheet-dataVerification-dialog .data-verification-hint-text").hide()
            }
            )),
            $(document).off("click.confirm").on("click.confirm", "#luckysheet-dataVerification-dialog-confirm", (function(r) {
                var a = $("#luckysheet-dataVerification-dialog #data-verification-range input").val().trim()
                  , n = e.getRangeByTxt(a);
                if (0 != n.length) {
                    var o = n[n.length - 1].row[0]
                      , l = n[n.length - 1].row[1]
                      , i = n[n.length - 1].column[0]
                      , s = n[n.length - 1].column[1]
                      , c = editor.deepCopyFlowData(Store.flowdata);
                    o < 0 && (o = 0),
                    l > c.length - 1 && (l = c.length - 1),
                    i < 0 && (i = 0),
                    s > c[0].length - 1 && (s = c[0].length - 1);
                    var u = $("#luckysheet-dataVerification-dialog #data-verification-type-select").val()
                      , h = null
                      , d = ""
                      , f = "";
                    if ("dropdown" == u) {
                        if (0 == (d = $("#luckysheet-dataVerification-dialog .show-box-item-dropdown .data-verification-value1").val().trim()).length)
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo1)
                    } else if ("checkbox" == u) {
                        if (d = $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value1").val().trim(),
                        f = $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value2").val().trim(),
                        0 == d.length || 0 == f.length)
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo2)
                    } else if ("number" == u || "number_integer" == u || "number_decimal" == u) {
                        if (h = $("#luckysheet-dataVerification-dialog #data-verification-number-select").val(),
                        !isRealNum(d = $("#luckysheet-dataVerification-dialog .show-box-item-number .input:visible .data-verification-value1").val().trim()))
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo3);
                        if ("bw" == h || "nb" == h) {
                            if (!isRealNum(f = $("#luckysheet-dataVerification-dialog .show-box-item-number .input:visible .data-verification-value2").val().trim()))
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo3);
                            if (Number(f) < Number(d))
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo4)
                        }
                    } else if ("text_content" == u) {
                        if (h = $("#luckysheet-dataVerification-dialog #data-verification-text-select").val(),
                        0 == (d = $("#luckysheet-dataVerification-dialog .show-box-item-text .data-verification-value1").val().trim()).length)
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo5)
                    } else if ("text_length" == u) {
                        if (h = $("#luckysheet-dataVerification-dialog #data-verification-textLength-select").val(),
                        !isRealNum(d = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input:visible .data-verification-value1").val().trim()))
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo3);
                        if ("bw" == h || "nb" == h) {
                            if (!isRealNum(f = $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input:visible .data-verification-value2").val().trim()))
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo3);
                            if (Number(f) < Number(d))
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo4)
                        }
                    } else if ("date" == u) {
                        if (h = $("#luckysheet-dataVerification-dialog #data-verification-date-select").val(),
                        !isdatetime(d = $("#luckysheet-dataVerification-dialog .show-box-item-date .input:visible .data-verification-value1").val().trim()))
                            return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo6);
                        if ("bw" == h || "nb" == h) {
                            if (!isdatetime(f = $("#luckysheet-dataVerification-dialog .show-box-item-date .input:visible .data-verification-value2").val().trim()))
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo6);
                            if (diff(d, f) > 0)
                                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo7)
                        }
                    } else
                        "validity" == u && (h = $("#luckysheet-dataVerification-dialog #data-verification-validity-select").val());
                    var m = $("#luckysheet-dataVerification-dialog #data-verification-remote").is(":checked")
                      , p = $("#luckysheet-dataVerification-dialog #data-verification-prohibitInput").is(":checked")
                      , g = $("#luckysheet-dataVerification-dialog #data-verification-hint-show").is(":checked")
                      , y = "";
                    g && (y = $("#luckysheet-dataVerification-dialog .data-verification-hint-text input").val().trim());
                    for (var v = {
                        type: u,
                        type2: h,
                        value1: d,
                        value2: f,
                        checked: !1,
                        remote: m,
                        prohibitInput: p,
                        hintShow: g,
                        hintText: y
                    }, A = $.extend(!0, {}, e.dataVerification), b = $.extend(!0, {}, e.dataVerification), k = o; k <= l; k++)
                        for (var w = i; w <= s; w++)
                            b[k + "_" + w] = v,
                            "checkbox" == u && setcellvalue(k, w, c, v.value2);
                    "checkbox" == u ? e.refOfCheckbox(A, b, Store.currentSheetIndex, c, n[n.length - 1]) : e.ref(A, b, Store.currentSheetIndex),
                    $("#luckysheet-modal-dialog-mask").hide(),
                    $("#luckysheet-dataVerification-dialog").hide()
                } else
                    tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.selectCellRange2)
            }
            )),
            $(document).off("click.delete").on("click.delete", "#luckysheet-dataVerification-dialog-delete", (function(r) {
                var a = $("#luckysheet-dataVerification-dialog #data-verification-range input").val().trim()
                  , n = e.getRangeByTxt(a);
                if (0 != n.length) {
                    for (var o = $.extend(!0, {}, e.dataVerification), l = $.extend(!0, {}, e.dataVerification), i = n[n.length - 1].row[0], s = n[n.length - 1].row[1], c = n[n.length - 1].column[0], u = n[n.length - 1].column[1], h = i; h <= s; h++)
                        for (var d = c; d <= u; d++)
                            delete l[h + "_" + d];
                    e.ref(o, l, Store.currentSheetIndex),
                    $("#luckysheet-modal-dialog-mask").hide(),
                    $("#luckysheet-dataVerification-dialog").hide()
                } else
                    tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.selectCellRange2)
            }
            )),
            $(document).on("click", "#luckysheet-info .luckysheet-modal-dialog-title-close, #luckysheet-info .luckysheet-model-close-btn", (function(e) {
                $(this).parents("#luckysheet-info").hide(),
                $("#luckysheet-dataVerification-dialog").is(":visible") && $("#luckysheet-modal-dialog-mask").show(),
                e.stopPropagation()
            }
            ))
        },
        dataAllocation: function() {
            var e = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , t = getRangetxt(Store.currentSheetIndex, e, Store.currentSheetIndex);
            $("#luckysheet-dataVerification-dialog #data-verification-range input").val(t);
            var r = e.row_focus || e.row[0]
              , a = e.column_focus || e.column[0]
              , n = $.extend(!0, {}, this.dataVerification)[r + "_" + a];
            null == n && (n = $.extend(!0, {}, this.defaultItem)),
            this.curItem = n,
            $("#luckysheet-dataVerification-dialog #data-verification-type-select").val(n.type),
            $("#luckysheet-dataVerification-dialog .show-box .show-box-item").hide(),
            "dropdown" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box .show-box-item-dropdown").show(),
            $("#luckysheet-dataVerification-dialog .show-box-item-dropdown .data-verification-value1").val(n.value1)) : "checkbox" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box .show-box-item-checkbox").show(),
            $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value1").val(n.value1),
            $("#luckysheet-dataVerification-dialog .show-box-item-checkbox .data-verification-value2").val(n.value2)) : "number" == n.type || "number_integer" == n.type || "number_decimal" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box-item-number").show(),
            $("#luckysheet-dataVerification-dialog #data-verification-number-select").val(n.type2),
            $("#luckysheet-dataVerification-dialog .show-box-item-number .input").hide(),
            "bw" == n.type2 || "nb" == n.type2 ? $("#luckysheet-dataVerification-dialog .show-box-item-number .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-number .input2").show(),
            $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value1").val(n.value1),
            $("#luckysheet-dataVerification-dialog .show-box-item-number .data-verification-value2").val(n.value2)) : "text_content" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box-item-text").show(),
            $("#luckysheet-dataVerification-dialog #data-verification-text-select").val(n.type2),
            $("#luckysheet-dataVerification-dialog .show-box-item-text .data-verification-value1").val(n.value1)) : "text_length" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box-item-textLength").show(),
            $("#luckysheet-dataVerification-dialog #data-verification-textLength-select").val(n.type2),
            $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input").hide(),
            "bw" == n.type2 || "nb" == n.type2 ? $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-textLength .input2").show(),
            $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value1").val(n.value1),
            $("#luckysheet-dataVerification-dialog .show-box-item-textLength .data-verification-value2").val(n.value2)) : "date" == n.type ? ($("#luckysheet-dataVerification-dialog .show-box-item-date").show(),
            $("#luckysheet-dataVerification-dialog #data-verification-date-select").val(n.type2),
            $("#luckysheet-dataVerification-dialog .show-box-item-date .input").hide(),
            "bw" == n.type2 || "nb" == n.type2 ? $("#luckysheet-dataVerification-dialog .show-box-item-date .input1").show() : $("#luckysheet-dataVerification-dialog .show-box-item-date .input2").show(),
            $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value1").val(n.value1),
            $("#luckysheet-dataVerification-dialog .show-box-item-date .data-verification-value2").val(n.value2)) : "validity" == n.type && ($("#luckysheet-dataVerification-dialog .show-box .show-box-item-validity").show(),
            $("#luckysheet-dataVerification-dialog #data-verification-validity-select").val(n.type2)),
            $("#luckysheet-dataVerification-dialog #data-verification-remote").prop("checked", n.remote),
            $("#luckysheet-dataVerification-dialog #data-verification-prohibitInput").prop("checked", n.prohibitInput),
            $("#luckysheet-dataVerification-dialog #data-verification-hint-show").prop("checked", n.hintShow),
            n.hintShow ? $("#luckysheet-dataVerification-dialog .data-verification-hint-text").show() : $("#luckysheet-dataVerification-dialog .data-verification-hint-text").hide(),
            $("#luckysheet-dataVerification-dialog .data-verification-hint-text input").val(n.hintText)
        },
        rangeDialog: function(e, t) {
            var r = locale()
              , a = r.dataVerification
              , n = r.button;
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-dataVerificationRange-dialog").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-dataVerificationRange-dialog",
                addclass: "luckysheet-dataVerificationRange-dialog",
                title: a.selectCellRange,
                content: '<input readonly="readonly" placeholder="'.concat(a.selectCellRange2, '" value="').concat(t, '"/>'),
                botton: '<button id="luckysheet-dataVerificationRange-dialog-confirm" class="btn btn-primary" data-source="'.concat(e, '">').concat(n.confirm, '</button>\n                        <button id="luckysheet-dataVerificationRange-dialog-close" class="btn btn-default">').concat(n.close, "</button>"),
                style: "z-index:100003"
            }));
            var o = $("#luckysheet-dataVerificationRange-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , l = o.outerHeight()
              , i = o.outerWidth()
              , s = $(window).width()
              , c = $(window).height()
              , u = $(document).scrollLeft()
              , h = $(document).scrollTop();
            $("#luckysheet-dataVerificationRange-dialog").css({
                left: (s + u - i) / 2,
                top: (c + h - l) / 3
            }).show()
        },
        getTxtByRange: function(e) {
            if (e.length > 0) {
                for (var t = [], r = 0; r < e.length; r++) {
                    var a = e[r].row[0]
                      , n = e[r].row[1]
                      , o = e[r].column[0]
                      , l = e[r].column[1];
                    t.push(getRangetxt(Store.currentSheetIndex, {
                        row: [a, n],
                        column: [o, l]
                    }, Store.currentSheetIndex))
                }
                return t.join(",")
            }
        },
        getRangeByTxt: function(e) {
            var t = [];
            if (-1 != e.indexOf(","))
                for (var r = e.split(","), a = 0; a < r.length; a++) {
                    if (!luckysheetformula.iscelldata(r[a])) {
                        t = [];
                        break
                    }
                    t.push(luckysheetformula.getcellrange(r[a]))
                }
            else
                luckysheetformula.iscelldata(e) && t.push(luckysheetformula.getcellrange(e));
            return t
        },
        cellFocus: function(e, t, r) {
            $("#luckysheet-dataVerification-dropdown-btn").hide(),
            $("#luckysheet-dataVerification-showHintBox").hide();
            if (null != this.dataVerification && null != this.dataVerification[e + "_" + t]) {
                var a = Store.visibledatarow[e]
                  , n = 0 == e ? 0 : Store.visibledatarow[e - 1]
                  , o = Store.visibledatacolumn[t]
                  , l = 0 == t ? 0 : Store.visibledatacolumn[t - 1]
                  , i = menuButton.mergeborer(Store.flowdata, e, t);
                i && (a = i.row[1],
                n = i.row[0],
                o = i.column[1],
                l = i.column[0]);
                var s = this.dataVerification[e + "_" + t];
                if (r && "checkbox" == s.type)
                    this.checkboxChange(e, t);
                else {
                    var c;
                    if ("dropdown" == s.type) {
                        if ($("#luckysheet-dataVerification-dropdown-btn").show().css({
                            "max-width": o - l,
                            "max-height": a - n,
                            left: o - 20,
                            top: n + (a - n - 20) / 2
                        }),
                        $("#luckysheet-dataVerification-dropdown-List").is(":visible"))
                            $("#luckysheet-dataVerification-dropdown-List").prop("data-index") != e + "_" + t && $("#luckysheet-dataVerification-dropdown-List").hide()
                    } else
                        $("#luckysheet-dataVerification-dropdown-List").hide();
                    if (s.hintShow)
                        return c = "en" == Store.lang ? '<span style="color:#f5a623;">Hint: </span>' : '<span style="color:#f5a623;">提示：</span>',
                        c += this.getHintText(s),
                        void $("#luckysheet-dataVerification-showHintBox").html(c).show().css({
                            left: l,
                            top: a
                        });
                    var u, h = getcellvalue(e, t, null);
                    if (!isRealNull(h))
                        if (!this.validateCellData(h, s))
                            u = "en" == Store.lang ? '<span style="color:#f72626;">Failure: </span>' : '<span style="color:#f72626;">失效：</span>',
                            u += this.getFailureText(s),
                            $("#luckysheet-dataVerification-showHintBox").html(u).show().css({
                                left: l,
                                top: a
                            })
                }
            } else
                $("#luckysheet-dataVerification-dropdown-List").hide()
        },
        getHintText: function(e) {
            var t = e.hintText || "";
            return 0 == t.length && ("en" == Store.lang ? "dropdown" == e.type ? t += "please select an option in the drop-down list" : "checkbox" == e.type || ("number" == e.type || "number_integer" == e.type || "number_decimal" == e.type ? (t += "please enter a " + this.optionLabel_en[e.type] + " " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "text_content" == e.type ? t += "please enter text " + this.optionLabel_en[e.type2] + " " + e.value1 : "text_length" == e.type ? (t += "please enter text with length " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "date" == e.type ? (t += "please enter a date " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "validity" == e.type && (t += "please enter the correct " + this.optionLabel_en[e.type2])) : "dropdown" == e.type ? t += "请选择下拉列表中的选项" : "checkbox" == e.type || ("number" == e.type || "number_integer" == e.type || "number_decimal" == e.type ? (t += "请输入" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的" + this.optionLabel[e.type]) : "text_content" == e.type ? t += "请输入内容" + this.optionLabel[e.type2] + e.value1 + "的文本" : "text_length" == e.type ? (t += "请输入长度" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的文本") : "date" == e.type ? (t += "请输入" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的日期") : "validity" == e.type && (t += "请输入正确的" + this.optionLabel[e.type2]))),
            t
        },
        getFailureText: function(e) {
            var t = "";
            return "en" == Store.lang ? "dropdown" == e.type ? t += "what you selected is not an option in the drop-down list" : "checkbox" == e.type || ("number" == e.type || "number_integer" == e.type || "number_decimal" == e.type ? (t += "what you entered is not a " + this.optionLabel_en[e.type] + " " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "text_content" == e.type ? t += "what you entered is not text that " + this.optionLabel_en[e.type2] + " " + e.value1 : "text_length" == e.type ? (t += "the text you entered is not length " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "date" == e.type ? (t += "the date you entered is not " + this.optionLabel_en[e.type2] + " " + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += " and " + e.value2)) : "validity" == e.type && (t += "what you entered is not a correct " + this.optionLabel_en[e.type2])) : "dropdown" == e.type ? t += "你选择的不是下拉列表中的选项" : "checkbox" == e.type || ("number" == e.type || "number_integer" == e.type || "number_decimal" == e.type ? (t += "你输入的不是" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的" + this.optionLabel[e.type]) : "text_content" == e.type ? t += "你输入的不是内容" + this.optionLabel[e.type2] + e.value1 + "的文本" : "text_length" == e.type ? (t += "你输入的不是长度" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的文本") : "date" == e.type ? (t += "你输入的不是" + this.optionLabel[e.type2] + e.value1,
            "bw" != e.type2 && "nb" != e.type2 || (t += "和" + e.value2 + "之间"),
            t += "的日期") : "validity" == e.type && (t += "你输入的不是一个正确的" + this.optionLabel[e.type2])),
            t
        },
        validateCellData: function(e, t) {
            var r = t.type
              , a = t.type2
              , n = t.value1
              , o = t.value2;
            if ("dropdown" == r) {
                for (var l = this.getDropdownList(n), i = !1, s = 0; s < l.length; s++)
                    if (l[s] == e) {
                        i = !0;
                        break
                    }
                return i
            }
            if ("checkbox" == r)
                ;
            else if ("number" == r || "number_integer" == r || "number_decimal" == r) {
                if (!isRealNum(e))
                    return !1;
                if (e = Number(e),
                "number_integer" == r && e % 1 != 0)
                    return !1;
                if ("number_decimal" == r && e % 1 == 0)
                    return !1;
                if (n = Number(n),
                o = Number(o),
                "bw" == a && (e < n || e > o))
                    return !1;
                if ("nb" == a && e >= n && e <= o)
                    return !1;
                if ("eq" == a && e != n)
                    return !1;
                if ("ne" == a && e == n)
                    return !1;
                if ("gt" == a && e <= n)
                    return !1;
                if ("lt" == a && e >= n)
                    return !1;
                if ("gte" == a && e < n)
                    return !1;
                if ("lte" == a && e > n)
                    return !1
            } else if ("text_content" == r) {
                if (e = e.toString(),
                n = n.toString(),
                "include" == a && -1 == e.indexOf(n))
                    return !1;
                if ("exclude" == a && e.indexOf(n) > -1)
                    return !1;
                if ("equal" == a && e != n)
                    return !1
            } else if ("text_length" == r) {
                if (e = e.toString().length,
                n = Number(n),
                o = Number(o),
                "bw" == a && (e < n || e > o))
                    return !1;
                if ("nb" == a && e >= n && e <= o)
                    return !1;
                if ("eq" == a && e != n)
                    return !1;
                if ("ne" == a && e == n)
                    return !1;
                if ("gt" == a && e <= n)
                    return !1;
                if ("lt" == a && e >= n)
                    return !1;
                if ("gte" == a && e < n)
                    return !1;
                if ("lte" == a && e > n)
                    return !1
            } else if ("date" == r) {
                if (!isdatetime(e))
                    return !1;
                if ("bw" == a && (diff(e, n) < 0 || diff(e, o) > 0))
                    return !1;
                if ("nb" == a && diff(e, n) >= 0 && diff(e, o) <= 0)
                    return !1;
                if ("eq" == a && 0 != diff(e, n))
                    return !1;
                if ("ne" == a && 0 == diff(e, n))
                    return !1;
                if ("bf" == a && diff(e, n) >= 0)
                    return !1;
                if ("nbf" == a && diff(e, n) < 0)
                    return !1;
                if ("af" == a && diff(e, n) <= 0)
                    return !1;
                if ("naf" == a && diff(e, n) > 0)
                    return !1
            } else if ("validity" == r) {
                if ("card" == a && !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e))
                    return !1;
                if ("phone" == a && !/^[1][3,4,5,7,8][0-9]{9}$/.test(e))
                    return !1
            }
            return !0
        },
        dropdownListShow: function() {
            $("#luckysheet-dataVerification-showHintBox").hide();
            var e = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , t = e.row_focus
              , r = e.column_focus
              , a = Store.visibledatarow[t]
              , n = 0 == t ? 0 : Store.visibledatarow[t - 1]
              , o = Store.visibledatacolumn[r]
              , l = 0 == r ? 0 : Store.visibledatacolumn[r - 1]
              , i = menuButton.mergeborer(Store.flowdata, t, r);
            i && (a = i.row[1],
            n = i.row[0],
            o = i.column[1],
            l = i.column[0]);
            var s = this.dataVerification[t + "_" + r]
              , c = this.getDropdownList(s.value1)
              , u = "";
            c.forEach((function(e) {
                u += '<div class="dropdown-List-item luckysheet-mousedown-cancel">'.concat(e, "</div>")
            }
            )),
            $("#luckysheet-dataVerification-dropdown-List").html(u).prop("data-index", t + "_" + r).show().css({
                width: o - l - 1,
                left: l,
                top: a
            });
            var h = $("#luckysheet-dataVerification-dropdown-List").outerHeight();
            a + h > $("#luckysheet-cell-main")[0].scrollHeight - 42 - 6 && $("#luckysheet-dataVerification-dropdown-List").css({
                top: n - h
            })
        },
        getDropdownList: function(e) {
            var t = [];
            if (luckysheetformula.iscelldata(e)) {
                for (var r = luckysheetformula.getcellrange(e), a = Store.luckysheetfile[getSheetIndex(r.sheetIndex)].data, n = r.row[0]; n <= r.row[1]; n++)
                    for (var o = r.column[0]; o <= r.column[1]; o++)
                        if (null != a[n]) {
                            var l = a[n][o];
                            if (null != l && null != l.v) {
                                var i = l.m || l.v;
                                t.includes(i) || t.push(i)
                            }
                        }
            } else
                for (var s = e.split(","), c = 0; c < s.length; c++) {
                    var u = s[c];
                    0 != u.length && (t.includes(u) || t.push(u))
                }
            return t
        },
        checkboxChange: function(e, t) {
            var r = $.extend(!0, {}, this.dataVerification)
              , a = $.extend(!0, {}, this.dataVerification)
              , n = a[e + "_" + t];
            n.checked = !n.checked;
            var o = n.value2;
            n.checked && (o = n.value1);
            var l = editor.deepCopyFlowData(Store.flowdata);
            setcellvalue(e, t, l, o),
            this.refOfCheckbox(r, a, Store.currentSheetIndex, l, {
                row: [e, e],
                column: [t, t]
            })
        },
        ref: function(e, t, r) {
            if (Store.clearjfundo) {
                Store.jfundo = [];
                var a = {
                    type: "updateDataVerification"
                };
                a.sheetIndex = r,
                a.historyDataVerification = e,
                a.currentDataVerification = t,
                Store.jfredo.push(a)
            }
            this.dataVerification = t,
            Store.luckysheetfile[getSheetIndex(r)].dataVerification = t,
            server.allowUpdate && server.saveParam("all", r, t, {
                k: "dataVerification"
            }),
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        },
        refOfCheckbox: function(e, t, r, a, n) {
            if (Store.clearjfundo) {
                Store.jfundo = [];
                var o = {
                    type: "updateDataVerificationOfCheckbox"
                };
                o.sheetIndex = r,
                o.historyDataVerification = e,
                o.currentDataVerification = t,
                o.data = Store.flowdata,
                o.curData = a,
                o.range = n,
                Store.jfredo.push(o)
            }
            this.dataVerification = t,
            Store.luckysheetfile[getSheetIndex(r)].dataVerification = t,
            Store.flowdata = a,
            editor.webWorkerFlowDataCache(Store.flowdata),
            Store.luckysheetfile[getSheetIndex(r)].data = Store.flowdata,
            server.allowUpdate && (server.saveParam("all", r, t, {
                k: "dataVerification"
            }),
            server.historyParam(Store.flowdata, r, n)),
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        }
    }
      , isInitialProtection = !1
      , isInitialProtectionAddRang = !1
      , rangeItemListCache = []
      , isAddRangeItemState = !0
      , updateRangeItemIndex = null
      , validationAuthority = null
      , updatingSheetFile = null
      , firstInputSheetProtectionPassword = !0
      , inputRangeProtectionPassword = {}
      , initialRangePasswordHtml = !1
      , authorityItemArr = ["selectLockedCells", "selectunLockedCells", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "sort", "filter", "usePivotTablereports", "editObjects", "editScenarios"];
    function addRangeItem(e) {
        var t = locale()
          , r = t.protection
          , a = t.button
          , n = e.name
          , o = e.sqref
          , l = e.password
          , i = "";
        null != l && l.length > 0 && (i = '<i class="icon iconfont icon-bianji2" title="' + r.rangeItemHasPassword + '"></i>');
        var s = '\n        <div class="luckysheet-protection-rangeItem" title="'.concat(r.rangeItemDblclick, '">\n            <div class="luckysheet-protection-rangeItem-del" title="').concat(a.delete, '">\n                <i class="icon iconfont icon-shanchu"></i>\n            </div>\n            <div class="luckysheet-protection-rangeItem-name" title="').concat(n, '">\n                ').concat(n).concat(i, '\n            </div>\n            <div class="luckysheet-protection-rangeItem-range" title="').concat(o, '">\n                ').concat(o, '\n            </div>\n            <div class="luckysheet-protection-rangeItem-update" title="').concat(a.update, '">\n                <i class="icon iconfont icon-bianji"></i>\n            </div>\n        </div>\n    ');
        $("#luckysheet-protection-rangeItem-container").append(s)
    }
    function initialEvent(e) {
        var t = locale()
          , r = t.protection
          , a = t.button;
        $("#luckysheet-slider-protection-ok").click((function() {
            var e = $("#protection-password").val()
              , t = $("#protection-swichProtectionState").is(":checked")
              , r = $("#protection-hint").val()
              , a = updatingSheetFile
              , n = {};
            null != a && null != a.config && null != a.config.authority && (n = a.config.authority);
            var o = {};
            "••••••••" != e ? (o.password = e,
            o.algorithmName = "None",
            o.saltValue = null) : null != n ? (o.algorithmName = n.algorithmName,
            o.saltValue = n.saltValue,
            o.password = n.password) : (o.algorithmName = "None",
            o.saltValue = null,
            o.password = ""),
            o.hintText = r,
            o.sheet = 1 == t ? 1 : 0;
            for (var l = 0; l < authorityItemArr.length; l++) {
                var i = authorityItemArr[l]
                  , s = $("#" + ("luckysheet-protection-check-" + i)).is(":checked");
                o[i] = 1 == s ? 1 : 0
            }
            o.allowRangeList = rangeItemListCache,
            rangeItemListCache = [],
            firstInputSheetProtectionPassword = !0,
            null == a.config && (a.config = {}),
            a.config.authority = o,
            inputRangeProtectionPassword = {},
            closeProtectionModal()
        }
        )),
        $("#luckysheet-slider-protection-cancel, #luckysheet-modal-dialog-protection-close").click((function() {
            closeProtectionModal()
        }
        )),
        $("#luckysheet-slider-protection-addRange").click((function() {
            initialProtectionRangeModal(),
            isAddRangeItemState = !0,
            $("#luckysheet-protection-rangeItem-confirm").html(a.insert),
            openSelfModel("luckysheet-protection-rangeItem-dialog"),
            $("#protection-allowRangeAdd-title").val("Default" + rangeItemListCache.length),
            $("#protection-allowRangeAdd-range input").val(""),
            $("#protection-allowRangeAdd-password").val(""),
            $("#protection-allowRangeAdd-hint").val("")
        }
        )),
        $(document).off("click.luckysheetProtection.rangeItemUpdate").on("click.luckysheetProtection.rangeItemUpdate", "#luckysheet-protection-rangeItem-container .luckysheet-protection-rangeItem-update", (function(e) {
            initialProtectionRangeModal(),
            isAddRangeItemState = !1,
            $("#luckysheet-protection-rangeItem-confirm").html(a.update),
            openSelfModel("luckysheet-protection-rangeItem-dialog");
            var t = $(e.target).closest(".luckysheet-protection-rangeItem")
              , r = $("#luckysheet-protection-rangeItem-container").find("> div.luckysheet-protection-rangeItem").index(t)
              , n = rangeItemListCache[r];
            updateRangeItemIndex = r,
            $("#protection-allowRangeAdd-title").val(n.name),
            $("#protection-allowRangeAdd-range input").val(n.sqref),
            "None" == n.algorithmName ? $("#protection-allowRangeAdd-password").val(n.password) : $("#protection-allowRangeAdd-password").val("••••••••"),
            $("#protection-allowRangeAdd-hint").val(n.hintText)
        }
        )),
        $(document).off("click.luckysheetProtection.rangeItemDelete").on("click.luckysheetProtection.rangeItemDelete", "#luckysheet-protection-rangeItem-container .luckysheet-protection-rangeItem-del", (function(e) {
            var t = $(e.target).closest(".luckysheet-protection-rangeItem")
              , r = $("#luckysheet-protection-rangeItem-container").find("> div.luckysheet-protection-rangeItem").index(t);
            rangeItemListCache[r];
            rangeItemListCache.splice(r, 1),
            t.remove()
        }
        )),
        $(document).off("click.luckysheetProtection.rangeItemConfirm").on("click.luckysheetProtection.rangeItemConfirm", "#luckysheet-protection-rangeItem-confirm", (function() {
            var e = $("#protection-allowRangeAdd-title").val()
              , t = $("#protection-allowRangeAdd-range input").val()
              , a = $("#protection-allowRangeAdd-password").val()
              , n = $("#protection-allowRangeAdd-hint").val();
            if (0 != e.length) {
                var o = dataVerificationCtrl.getRangeByTxt(t);
                if (0 != t.length)
                    if (0 != o.length) {
                        if (t = transformRangeToAbsolute(t),
                        isAddRangeItemState) {
                            var l = {
                                name: e,
                                password: a,
                                hintText: n,
                                algorithmName: "None",
                                saltValue: null,
                                checkRangePasswordUrl: null,
                                sqref: t
                            };
                            addRangeItem(l),
                            rangeItemListCache.push(l)
                        } else {
                            var i = updateRangeItemIndex
                              , s = rangeItemListCache[i];
                            s.name = e,
                            s.sqref = t,
                            s.hintText = n,
                            "••••••••" != a && (s.password = a,
                            s.algorithmName = "None");
                            var c = $("#luckysheet-protection-rangeItem-container").find("> div.luckysheet-protection-rangeItem").eq(i)
                              , u = c.find(".luckysheet-protection-rangeItem-name")
                              , h = "";
                            null != a && a.length > 0 && (h = '<i class="icon iconfont icon-bianji2" title="' + r.rangeItemHasPassword + '"></i>'),
                            u.html(e + h).attr("title", e),
                            c.find(".luckysheet-protection-rangeItem-range").html(t).attr("title", t)
                        }
                        $("#luckysheet-protection-rangeItem-dialog").hide(),
                        $("#luckysheet-modal-dialog-mask").hide()
                    } else
                        alert(r.rangeItemErrorRange);
                else
                    alert(r.rangeItemErrorRangeNull)
            } else
                alert(r.rangeItemErrorTitleNull)
        }
        )),
        $(document).off("click.luckysheetProtection.validationConfirm").on("click.luckysheetProtection.validationConfirm", "#luckysheet-protection-sheet-validation-confirm", (function(e) {
            var t = $("#luckysheet-protection-sheet-validation")
              , a = validationAuthority;
            if (null == a)
                return restoreProtectionConfig(validationAuthority),
                t.hide(),
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-modal-dialog-slider-protection").show(),
                void luckysheetsizeauto();
            var n = t.find("input").val();
            if (null != n && 0 != n.length) {
                if (null != a.algorithmName && "None" != a.algorithmName)
                    if (null != a.saltValue && a.saltValue.length > 0) {
                        var o = CryptoApi.getHasher(a.algorithmName);
                        n = CryptoApi.hmac(a.saltValue, n, o)
                    } else
                        n = CryptoApi.hash(a.algorithmName, n);
                n == a.password ? (restoreProtectionConfig(validationAuthority),
                t.hide(),
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-modal-dialog-slider-protection").show(),
                luckysheetsizeauto(),
                firstInputSheetProtectionPassword = !1) : alert(r.checkPasswordWrongalert)
            } else
                alert(r.checkPasswordNullalert)
        }
        )),
        $("#luckysheet-protection-check-selectLockedCells").change((function() {
            var e = $("#luckysheet-protection-check-selectLockedCells")
              , t = $("#luckysheet-protection-check-selectunLockedCells")
              , r = e.is(":checked");
            t.is(":checked");
            r && t.prop("checked", !0)
        }
        )),
        $("#luckysheet-protection-check-selectunLockedCells").change((function() {
            var e = $("#luckysheet-protection-check-selectLockedCells")
              , t = $("#luckysheet-protection-check-selectunLockedCells");
            e.is(":checked");
            t.is(":checked") || e.prop("checked", !1)
        }
        )),
        $(document).off("click.luckysheetProtection.dvRange").on("click.luckysheetProtection.dvRange", "#protection-allowRangeAdd-range .fa-table", (function(e) {
            $("#luckysheet-protection-rangeItem-dialog").hide();
            var t = $(this).siblings("input").val().trim();
            dataVerificationCtrl.rangeDialog("0", t),
            dataVerificationCtrl.selectRange = [];
            var r = dataVerificationCtrl.getRangeByTxt(t);
            if (r.length > 0)
                for (var a = 0; a < r.length; a++) {
                    var n = r[a].row[0]
                      , o = r[a].row[1]
                      , l = r[a].column[0]
                      , i = r[a].column[1]
                      , s = Store.visibledatarow[o]
                      , c = n - 1 == -1 ? 0 : Store.visibledatarow[n - 1]
                      , u = Store.visibledatacolumn[i]
                      , h = l - 1 == -1 ? 0 : Store.visibledatacolumn[l - 1];
                    dataVerificationCtrl.selectRange.push({
                        left: h,
                        width: u - h - 1,
                        top: c,
                        height: s - c - 1,
                        left_move: h,
                        width_move: u - h - 1,
                        top_move: c,
                        height_move: s - c - 1,
                        row: [n, o],
                        column: [l, i],
                        row_focus: n,
                        column_focus: l
                    })
                }
            selectionCopyShow(dataVerificationCtrl.selectRange)
        }
        )),
        $(document).off("click.luckysheetProtection.dvRange2").on("click.luckysheetProtection.dvRange2", "#luckysheet-protection-rangeItem-dialog .show-box-item-dropdown .range .fa-table", (function(e) {
            $("#luckysheet-protection-rangeItem-dialog").hide();
            var t = $(this).siblings("input").val().trim();
            dataVerificationCtrl.rangeDialog("1", t),
            dataVerificationCtrl.selectRange = [];
            var r = dataVerificationCtrl.getRangeByTxt(t);
            if (r.length > 0)
                for (var a = 0; a < r.length; a++) {
                    var n = r[a].row[0]
                      , o = r[a].row[1]
                      , l = r[a].column[0]
                      , i = r[a].column[1]
                      , s = Store.visibledatarow[o]
                      , c = n - 1 == -1 ? 0 : Store.visibledatarow[n - 1]
                      , u = Store.visibledatacolumn[i]
                      , h = l - 1 == -1 ? 0 : Store.visibledatacolumn[l - 1];
                    dataVerificationCtrl.selectRange.push({
                        left: h,
                        width: u - h - 1,
                        top: c,
                        height: s - c - 1,
                        left_move: h,
                        width_move: u - h - 1,
                        top_move: c,
                        height_move: s - c - 1,
                        row: [n, o],
                        column: [l, i],
                        row_focus: n,
                        column_focus: l
                    })
                }
            selectionCopyShow(dataVerificationCtrl.selectRange)
        }
        )),
        $(document).off("click.luckysheetProtection.dvRangeConfirm").on("click.luckysheetProtection.dvRangeConfirm", "#luckysheet-dataVerificationRange-dialog-confirm", (function(e) {
            var t = $(this).parents("#luckysheet-dataVerificationRange-dialog").find("input").val()
              , r = $("#protection-allowRangeAdd-range input")
              , a = r.val();
            "," == a.substr(a.length - 1, 1) ? r.val(a + t) : r.val(t),
            $("#luckysheet-dataVerificationRange-dialog").hide(),
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-protection-rangeItem-dialog").show();
            selectionCopyShow([])
        }
        )),
        $(document).off("click.luckysheetProtection.dvRangeClose").on("click.dvRangeClose", "#luckysheet-dataVerificationRange-dialog-close", (function(e) {
            $("#luckysheet-dataVerificationRange-dialog").hide(),
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-protection-rangeItem-dialog").show();
            selectionCopyShow([])
        }
        )),
        $(document).on("click.luckysheetProtection.luckysheetProtection", "#luckysheet-dataVerificationRange-dialog .luckysheet-modal-dialog-title-close", (function(e) {
            $("#luckysheet-dataVerificationRange-dialog").hide(),
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-protection-rangeItem-dialog").show();
            selectionCopyShow([])
        }
        ))
    }
    function initialProtectionRangeModal(e) {
        if (!isInitialProtectionAddRang) {
            isInitialProtectionAddRang = !0;
            var t = locale()
              , r = t.protection
              , a = t.button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-protection-rangeItem-dialog",
                addclass: "luckysheet-protection-rangeItem-dialog",
                title: r.allowRangeTitle,
                content: '\n            <div class="luckysheet-protection-rangeItem-content">\n                <div class="luckysheet-slider-protection-row">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-3x">\n                        '.concat(r.allowRangeAddTitle, '\n                    </div>\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-7x" style="left:30%">\n                        <input class="luckysheet-protection-rangeItemiInput" id="protection-allowRangeAdd-title"  placeHolder="').concat(r.allowRangeAddtitleDefault, '">\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-3x">\n                        ').concat(r.allowRangeAddSqrf, '\n                    </div>\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-7x" style="left:30%">\n                        <div id="protection-allowRangeAdd-range" class="range">\n                            <input class="formulaInputFocus" spellcheck="false" placeHolder="').concat(r.selectCellRangeHolder, '">\n                            <i class="fa fa-table" aria-hidden="true" title="').concat(r.selectCellRange, '"></i>\n                        </div>\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-3x">\n                        ').concat(r.allowRangeAddTitlePassword, '\n                    </div>\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-7x" style="left:30%">\n                        <input class="luckysheet-protection-rangeItemiInput" id="protection-allowRangeAdd-password"  placeHolder="').concat(r.enterPassword, '">\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-3x">\n                        ').concat(r.allowRangeAddTitleHint, '\n                    </div>\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-7x" style="left:30%">\n                        <textarea class="luckysheet-protection-rangeItemTextarea" id="protection-allowRangeAdd-hint"  placeHolder="').concat(r.allowRangeAddTitleHintTitle, '"></textarea>\n                    </div>\n                </div>\n            </div>\n        '),
                botton: '<button id="luckysheet-protection-rangeItem-confirm" class="btn btn-primary">'.concat(a.insert, '</button>\n                    <button class="btn btn-default luckysheet-model-close-btn">').concat(a.cancel, "</button>"),
                style: "z-index:100003"
            }))
        }
    }
    function initialProtectionRIghtBar(e) {
        for (var t = locale(), r = t.protection, a = t.button, n = "", o = 0; o < authorityItemArr.length; o++) {
            var l = authorityItemArr[o];
            n += '\n            <div class="luckysheet-slider-protection-row" style="height:18px;">\n                <div class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                <label for="luckysheet-protection-check-'.concat(l, '"><input id="luckysheet-protection-check-').concat(l, '" name="luckysheet-protection-check-').concat(l, '" type="checkbox">').concat(r[l], "</label>\n                </div>\n            </div>\n        ")
        }
        var i = '\n    <div id="luckysheet-modal-dialog-slider-protection" class="luckysheet-modal-dialog-slider luckysheet-modal-dialog-slider-pivot" style="display:none;">\n        <div class="luckysheet-modal-dialog-slider-title"> <span>'.concat(r.protectiontTitle, '</span> <span id="luckysheet-modal-dialog-protection-close" title="').concat(a.close, '"><i class="fa fa-times" aria-hidden="true"></i></span> </div>\n        <div class="luckysheet-modal-dialog-slider-content">\n            <div class="luckysheet-slider-protection-config" style="top:10px;height:115px">\n                <div class="luckysheet-slider-protection-row">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                    <label for="protection-swichProtectionState"><input id="protection-swichProtectionState" name="protection-swichProtectionState" type="checkbox">').concat(r.swichProtectionTip, '</label>\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row" style="height:23px;">\n                    <div class="luckysheet-slider-protection-column" style="width:98%;">\n                        <input class="luckysheet-protection-input" id="protection-password"  placeHolder="').concat(r.enterPassword, '">\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row" style="height:47px;margin-top:4px;">\n                    <div class="luckysheet-slider-protection-column" style="width:98%;">\n                        <textarea class="luckysheet-protection-textarea" id="protection-hint"  placeHolder="').concat(r.enterHintTitle, '"></textarea>\n                    </div>\n                </div>\n            </div>\n            <div class="luckysheet-slider-protection-config" style="top:130px;height:290px;border-top:1px solid #c5c5c5">\n                <div class="luckysheet-slider-protection-row" style="height:20px;">\n                    ').concat(r.authorityTitle, "\n                </div>\n                ").concat(n, '\n            </div>\n            <div class="luckysheet-slider-protection-config" style="top:440px;bottom:45px;border-top:1px solid #c5c5c5">\n                <div class="luckysheet-slider-protection-row" style="height:25px;">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-7x" style="left:0px;line-height: 25px;">\n                        ').concat(r.allowRangeTitle, '\n                    </div>\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-3x" style="left:70%;">\n                        <div class="luckysheet-slider-protection-ok luckysheet-slider-protection-addRange" id="luckysheet-slider-protection-addRange">\n                            ').concat(r.allowRangeAdd, '\n                        </div>\n                    </div>\n                </div>\n\n                <div id="luckysheet-protection-rangeItem-container" class="luckysheet-slider-protection-row" style="top:25px;bottom:0px;position:absolute">\n                   \n                </div>\n            </div>\n            <div class="luckysheet-slider-protection-config" style="bottom:0px;height:45px">\n                <div class="luckysheet-slider-protection-column luckysheet-protection-column-5x" style="left:0px;">\n                    <div class="luckysheet-slider-protection-ok" id="luckysheet-slider-protection-ok">\n                        ').concat(a.confirm, '\n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-column luckysheet-protection-column-5x" style="left:50%;">\n                    <div class="luckysheet-slider-protection-cancel" id="luckysheet-slider-protection-cancel">\n                        ').concat(a.cancel, "\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n    ");
        $("body").append(i),
        $("body").append(replaceHtml$1(modelHTML, {
            id: "luckysheet-protection-sheet-validation",
            addclass: "luckysheet-protection-sheet-validation",
            title: r.validationTitle,
            content: '\n            <div class="luckysheet-slider-protection-row">\n                <div class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                    '.concat(r.validationTips, '\n                </div>\n            </div>\n            <div class="luckysheet-slider-protection-row" style="margin-top:20px">\n                <div class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                    <input type="password" class="luckysheet-protection-rangeItemiInput" placeHolder="').concat(r.validationInputHint, '">\n                </div>\n            </div>\n        '),
            botton: '<button id="luckysheet-protection-sheet-validation-confirm" class="btn btn-primary">'.concat(a.confirm, '</button>\n                    <button class="btn btn-default luckysheet-model-close-btn">').concat(a.cancel, "</button>"),
            style: "z-index:100003"
        }))
    }
    function restoreProtectionConfig(e) {
        null == e && (e = {});
        for (var t = 0; t < authorityItemArr.length; t++) {
            var r = authorityItemArr[t]
              , a = "luckysheet-protection-check-" + r
              , n = e[r];
            null == n && (n = 0),
            null == n && r in {
                selectLockedCells: 1,
                selectunLockedCells: 1
            } && (n = 1),
            $("#" + a).prop("checked", 1 == n)
        }
        null != e.password && e.password.length > 0 ? "None" == e.algorithmName || null == e.algorithmName ? $("#protection-password").val(e.password) : $("#protection-password").val("••••••••") : $("#protection-password").val("");
        var o = e.sheet;
        null == e.sheet && (o = 0),
        $("#protection-swichProtectionState").prop("checked", 1 == o);
        var l = e.hintText;
        null == l && (l = ""),
        $("#protection-hint").val(l),
        rangeItemListCache = [],
        $("#luckysheet-protection-rangeItem-container").empty();
        var i = e.allowRangeList;
        if (null != i && i.length > 0)
            for (var s = 0; s < i.length; s++) {
                var c = i[s];
                addRangeItem(c),
                rangeItemListCache.push(c)
            }
    }
    function openProtectionModal(e) {
        if (isInitialProtection || (initialProtectionRIghtBar(),
        initialEvent(),
        isInitialProtection = !0),
        updatingSheetFile = e,
        null != e && null != e.config && null != e.config.authority) {
            var t = e.config.authority;
            if (firstInputSheetProtectionPassword && 1 == t.sheet && null != t.password && t.password.length > 0)
                return validationAuthority = t,
                $("#luckysheet-protection-sheet-validation input").val(""),
                void openSelfModel("luckysheet-protection-sheet-validation");
            restoreProtectionConfig(t)
        } else
            $("#luckysheet-protection-check-selectLockedCells").prop("checked", !0),
            $("#luckysheet-protection-check-selectunLockedCells").prop("checked", !0);
        $("#luckysheet-modal-dialog-slider-protection").show(),
        luckysheetsizeauto()
    }
    function closeProtectionModal() {
        $("#luckysheet-protection-rangeItem-dialog").hide(),
        $("#luckysheet-modal-dialog-slider-protection").hide(),
        luckysheetsizeauto()
    }
    function checkProtectionLockedSqref(e, t, r, a) {
        var n, o = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], l = !1, i = r.allowRangeList;
        if (null != i && i.length > 0)
            for (var s = !1, c = 0; c < i.length; c++) {
                var u = i[c]
                  , h = u.sqref
                  , d = dataVerificationCtrl.getRangeByTxt(h);
                if (d.length > 0)
                    for (var f = 0; f < d.length; f++) {
                        var m = d[f].row[0]
                          , p = d[f].row[1]
                          , g = d[f].column[0]
                          , y = d[f].column[1];
                        if (e >= m && e <= p && t >= g && t <= y) {
                            s = !0;
                            break
                        }
                    }
                if (s) {
                    var v = u.password;
                    if (null != v && v.length > 0 && !(h in inputRangeProtectionPassword))
                        return o && (openRangePasswordModal(u),
                        $("#luckysheet-selection-copy .luckysheet-selection-copy").hide()),
                        !1;
                    l = !0;
                    break
                }
            }
        !l && o && (n = null != r.hintText && r.hintText.length > 0 ? r.hintText : a.defaultSheetHintText,
        tooltip.info("", n),
        $("#luckysheet-selection-copy .luckysheet-selection-copy").hide());
        return l
    }
    function openRangePasswordModal(e) {
        var t = locale()
          , r = t.protection
          , a = t.button;
        initialRangePasswordHtml || $("body").append(replaceHtml$1(modelHTML, {
            id: "luckysheet-protection-range-validation",
            addclass: "luckysheet-protection-sheet-validation",
            title: r.validationTitle,
            content: '\n                <div class="luckysheet-slider-protection-row">\n                    <div id="luckysheet-protection-range-validation-hint" class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                        \n                    </div>\n                </div>\n                <div class="luckysheet-slider-protection-row" style="margin-top:20px">\n                    <div class="luckysheet-slider-protection-column luckysheet-protection-column-10x">\n                        <input type="password" class="luckysheet-protection-rangeItemiInput" placeHolder="'.concat(r.validationInputHint, '">\n                    </div>\n                </div>\n            '),
            botton: '<button id="luckysheet-protection-range-validation-confirm" class="btn btn-primary">'.concat(a.confirm, '</button>\n                        <button class="btn btn-default luckysheet-model-close-btn">').concat(a.cancel, "</button>"),
            style: "z-index:100003"
        })),
        initialRangePasswordHtml = !0,
        openSelfModel("luckysheet-protection-range-validation");
        var n = $("#luckysheet-protection-range-validation-hint");
        null != e.hintText && e.hintText.length > 0 ? n.html(e.hintText) : n.html(r.defaultRangeHintText);
        var o = $("#luckysheet-protection-range-validation")
          , l = o.find("input");
        l.val(""),
        $("#luckysheet-protection-range-validation-confirm").off("click").on("click", (function() {
            var t = l.val();
            if (null != t && 0 != t.length) {
                if (null != e.algorithmName && "None" != e.algorithmName)
                    if (null != e.saltValue && e.saltValue.length > 0) {
                        var a = CryptoApi.getHasher(e.algorithmName);
                        t = CryptoApi.hmac(e.saltValue, t, a)
                    } else
                        t = CryptoApi.hash(e.algorithmName, t);
                t == e.password ? (inputRangeProtectionPassword[e.sqref] = 1,
                o.hide(),
                $("#luckysheet-modal-dialog-mask").hide(),
                alert(r.checkPasswordSucceedalert)) : alert(r.checkPasswordWrongalert)
            } else
                alert(r.checkPasswordNullalert)
        }
        ))
    }
    function checkProtectionNotEnable(e) {
        var t = sheetmanage.getSheetByIndex(e);
        if (null == t)
            return !0;
        if (null == t.config || null == t.config.authority)
            return !0;
        var r = t.config.authority;
        if (null == r || null == r.sheet || 0 == r.sheet)
            return !0;
        var a, n = locale().protection;
        return a = null != r.hintText && r.hintText.length > 0 ? r.hintText : n.defaultSheetHintText,
        tooltip.info("", a),
        !1
    }
    function checkProtectionLocked(e, t, r) {
        var a = sheetmanage.getSheetByIndex(r);
        if (null == a)
            return !0;
        if (null == a.config || null == a.config.authority)
            return !0;
        var n = a.data[e][t]
          , o = a.config.authority;
        return null == o || null == o.sheet || 0 == o.sheet || (null != n && null != n.lo && 1 != n.lo || checkProtectionLockedSqref(e, t, o, locale().protection))
    }
    function checkProtectionCellHidden(e, t, r) {
        var a = sheetmanage.getSheetByIndex(r);
        if (null == a)
            return !0;
        if (null == a.config || null == a.config.authority)
            return !0;
        var n = a.data[e][t]
          , o = a.config.authority;
        return null == o || null == o.sheet || 0 == o.sheet || (null == n || null == n.hi || 0 == n.hi)
    }
    function checkProtectionLockedRangeList(e, t) {
        var r = sheetmanage.getSheetByIndex(t);
        if (null == r)
            return !0;
        if (null == r.config || null == r.config.authority)
            return !0;
        var a = r.config.authority;
        if (null == a || null == a.sheet || 0 == a.sheet)
            return !0;
        if (null == e || 0 == e.length)
            return !0;
        for (var n = locale().protection, o = 0; o < e.length; o++)
            for (var l = e[o].row[0], i = e[o].row[1], s = e[o].column[0], c = e[o].column[1], u = l; u <= i; u++)
                for (var h = s; h <= c; h++) {
                    if (0 == checkProtectionLockedSqref(u, h, a, n))
                        return !1
                }
        return !0
    }
    function checkProtectionSelectLockedOrUnLockedCells(e, t, r) {
        var a = locale().protection
          , n = sheetmanage.getSheetByIndex(r);
        if (null == n)
            return !0;
        if (null == n.config || null == n.config.authority)
            return !0;
        var o = n.data[e][t]
          , l = n.config.authority;
        return null == l || null == l.sheet || 0 == l.sheet || (null != o && null != o.lo && 1 != o.lo || checkProtectionLockedSqref(e, t, l, a, !1) ? 1 == l.selectunLockedCells || null == l.selectunLockedCells : 1 == l.selectLockedCells || null == l.selectLockedCells)
    }
    function checkProtectionAllSelected(e) {
        locale().protection;
        var t = sheetmanage.getSheetByIndex(e);
        if (null == t)
            return !0;
        if (null == t.config || null == t.config.authority)
            return !0;
        var r = t.config.authority;
        if (null == r || null == r.sheet || 0 == r.sheet)
            return !0;
        var a = !1;
        1 != r.selectunLockedCells && null != r.selectunLockedCells || (a = !0);
        var n = !1;
        return 1 != r.selectLockedCells && null != r.selectLockedCells || (n = !0),
        !(!a || !n)
    }
    function checkProtectionFormatCells(e) {
        var t = sheetmanage.getSheetByIndex(e);
        if (null == t)
            return !0;
        if (null == t.config || null == t.config.authority)
            return !0;
        var r = t.config.authority;
        if (null == r || null == r.sheet || 0 == r.sheet)
            return !0;
        if (1 == r.formatCells || null == r.formatCells)
            return !0;
        var a, n = locale().protection;
        return a = null != r.hintText && r.hintText.length > 0 ? r.hintText : n.defaultSheetHintText,
        tooltip.info("", a),
        !1
    }
    function checkProtectionAuthorityNormal(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "formatColumns"
          , r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]
          , a = sheetmanage.getSheetByIndex(e);
        if (null == a)
            return !0;
        if (null == a.config || null == a.config.authority)
            return !0;
        var n = a.config.authority;
        if (null == n || null == n.sheet || 0 == n.sheet)
            return !0;
        if (1 == n[t] || null == n[t])
            return !0;
        if (r) {
            var o, l = locale(), i = l.protection;
            o = null != n.hintText && n.hintText.length > 0 ? n.hintText : i.defaultSheetHintText,
            tooltip.info("", o)
        }
        return !1
    }
    function orderbydata(e, t, r) {
        null == r && (r = !0);
        return r ? e.sort((function(e, r) {
            var a = e[t]
              , n = r[t];
            return "object" == getObjType(e[t]) && (a = e[t].v),
            "object" == getObjType(r[t]) && (n = r[t].v),
            isRealNull(a) ? 1 : isRealNull(n) ? -1 : isdatetime(a) && isdatetime(n) ? diff(a, n) : isRealNum(a) && isRealNum(n) ? numeral(a).value() - numeral(n).value() : isRealNum(a) || isRealNum(n) ? isRealNum(a) ? isRealNum(n) ? void 0 : -1 : 1 : a.localeCompare(n, "zh")
        }
        )) : e.sort((function(e, r) {
            var a = e[t]
              , n = r[t];
            return "object" == getObjType(e[t]) && (a = e[t].v),
            "object" == getObjType(r[t]) && (n = r[t].v),
            isRealNull(a) ? 1 : isRealNull(n) ? -1 : isdatetime(a) && isdatetime(n) ? diff(n, a) : isRealNum(a) && isRealNum(n) ? numeral(n).value() - numeral(a).value() : isRealNum(a) || isRealNum(n) ? isRealNum(a) ? isRealNum(n) ? void 0 : 1 : -1 : n.localeCompare(a, "zh")
        }
        ))
    }
    function orderbydata1D(e, t) {
        null == t && (t = !0);
        return t ? e.sort((function(e, t) {
            var r = e
              , a = t;
            return "object" == getObjType(e) && (r = e.v),
            "object" == getObjType(t) && (a = t.v),
            null == r && (r = ""),
            null == a && (a = ""),
            isdatetime(r) && isdatetime(a) ? diff(r, a) : isRealNum(r) && isRealNum(a) ? numeral(r).value() - numeral(a).value() : isRealNum(r) || isRealNum(a) ? isRealNum(r) ? isRealNum(a) ? void 0 : -1 : 1 : r.localeCompare(a, "zh")
        }
        )) : e.sort((function(e, t) {
            var r = e
              , a = t;
            return "object" == getObjType(e) && (r = e.v),
            "object" == getObjType(t) && (a = t.v),
            null == r && (r = ""),
            null == a && (a = ""),
            isdatetime(r) && isdatetime(a) ? diff(a, r) : isRealNum(r) && isRealNum(a) ? numeral(a).value() - numeral(r).value() : isRealNum(r) || isRealNum(a) ? isRealNum(r) ? isRealNum(a) ? void 0 : 1 : -1 : a.localeCompare(r, "zh")
        }
        ))
    }
    function sortSelection(e) {
        if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "sort"))
            if (Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert("不能对多重选择区域执行此操作，请选择单个区域，然后再试") : tooltip.info("不能对多重选择区域执行此操作，请选择单个区域，然后再试", "");
            else {
                null == e && (e = !0);
                for (var t, r, a = editor.deepCopyFlowData(Store.flowdata), n = Store.luckysheet_select_save[0].row[0], o = Store.luckysheet_select_save[0].row[1], l = Store.luckysheet_select_save[0].column[0], i = Store.luckysheet_select_save[0].column[1], s = n; s <= o; s++)
                    if (null != a[s] && null != a[s][l]) {
                        var c = a[s][l];
                        if (null != c.mc || isRealNull(c.v))
                            continue;
                        if (null == t && /[\u4e00-\u9fa5]+/g.test(c.v)) {
                            t = s + 1,
                            r = s + 1;
                            continue
                        }
                        null == t && (t = s),
                        r = s
                    }
                if (!(null == t || t > o)) {
                    for (var u = !1, h = [], d = t; d <= r; d++) {
                        for (var f = [], m = l; m <= i; m++) {
                            if (null != a[d][m] && null != a[d][m].mc) {
                                u = !0;
                                break
                            }
                            f.push(a[d][m])
                        }
                        h.push(f)
                    }
                    if (u)
                        isEditMode() ? alert("选区有合并单元格，无法执行此操作！") : tooltip.info("选区有合并单元格，无法执行此操作！", "");
                    else {
                        h = orderbydata(h, 0, e);
                        for (var p = t; p <= r; p++)
                            for (var g = l; g <= i; g++)
                                a[p][g] = h[p - t][g - l];
                        var y = {};
                        if (null != Store.config.rowlen) {
                            var v = $.extend(!0, {}, Store.config);
                            y = {
                                cfg: v = rowlenByRange(a, t, r, v),
                                RowlChange: !0
                            }
                        }
                        jfrefreshgrid(a, [{
                            row: [t, r],
                            column: [l, i]
                        }], y)
                    }
                }
            }
    }
    function sortColumnSeletion(e, t) {
        if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "sort")) {
            null == t && (t = !0);
            for (var r, a, n = editor.deepCopyFlowData(Store.flowdata), o = n.length - 1, l = n[0].length - 1, i = 0; i <= o; i++)
                null != n[i][e] && null != n[i][e].mc || (null == n[i][e] || isRealNull(n[i][e].v) || !/[\u4e00-\u9fa5]+/g.test(n[i][e].v) || null != r ? (null == r && (r = i),
                null == n[i][e] || isRealNull(n[i][e].v) || (a = i)) : (r = i + 1,
                a = i + 1));
            if (!(null == r || r > o)) {
                for (var s = !1, c = [], u = r; u <= a; u++) {
                    for (var h = [], d = 0; d <= l; d++) {
                        if (null != n[u][d] && null != n[u][d].mc) {
                            s = !0;
                            break
                        }
                        h.push(n[u][d])
                    }
                    c.push(h)
                }
                if (s)
                    isEditMode() ? alert("列排序会扩展至整个表格选区，选区有合并单元格，无法执行此操作，请选择功能栏排序功能！") : tooltip.info("列排序会扩展至整个表格选区，选区有合并单元格，无法执行此操作，请选择功能栏排序功能！", "");
                else {
                    c = orderbydata(c, e, t);
                    for (var f = r; f <= a; f++)
                        for (var m = 0; m <= l; m++)
                            n[f][m] = c[f - r][m - 0];
                    var p = {};
                    if (null != Store.config.rowlen) {
                        var g = $.extend(!0, {}, Store.config);
                        p = {
                            cfg: g = rowlenByRange(n, r, a, g),
                            RowlChange: !0
                        }
                    }
                    jfrefreshgrid(n, [{
                        row: [r, a],
                        column: [0, l]
                    }], p)
                }
            }
        }
    }
    var luckysheetArray = {
        transpose: function(e) {
            var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
              , r = [];
            if (0 == e.length)
                return [];
            if (0 == e[0].length)
                return [];
            for (var a = 0; a < e[0].length; a++) {
                for (var n = [], o = 0; o < e.length; o++) {
                    var l = "";
                    null != e[o] && null != e[o][a] && (l = t ? getcellvalue(o, a, e) : e[o][a]),
                    n.push(l)
                }
                r.push(n)
            }
            return r
        },
        minusClear: function(e, t) {
            if (t.row[0] > e.row[1] || t.row[1] < e.row[0] || t.column[0] > e.column[1] || t.column[1] < e.column[0])
                return null;
            if (t.row[0] == e.row[0] && t.row[1] < e.row[1] && t.column[0] > e.column[0] && t.column[1] < e.column[1])
                return [];
            var r = []
              , a = null
              , n = [e.column[0], e.column[1]];
            t.row[1] > e.row[0] && t.row[1] < e.row[1] ? a = [t.row[1] + 1, e.row[1]] : t.row[0] > e.row[0] && t.row[0] < e.row[1] && (a = [e.row[0], t.row[0] - 1]),
            null != a && r.push({
                row: a,
                column: n
            });
            var o = [e.row[0], e.row[1]]
              , l = null;
            return t.column[1] > e.column[0] && t.column[1] < e.column[1] ? l = [t.column[1] + 1, e.column[1]] : t.column[0] > e.column[0] && t.column[0] < e.column[1] && (l = [e.column[0], t.column[0] - 1]),
            null != l && r.push({
                row: o,
                column: l
            }),
            r
        }
    }
      , analysis = {
        STDEVP: function(e, t) {
            for (var r = 0, a = 0; a < t.length; a++) {
                var n = t[a];
                r += Math.pow(n - e, 2)
            }
            return numFormat$1(Math.sqrt(r / t.length))
        },
        STDEV: function(e, t) {
            for (var r = 0, a = 0; a < t.length; a++) {
                var n = t[a];
                r += Math.pow(n - e, 2)
            }
            return numFormat$1(Math.sqrt(r / (t.length - 1)))
        },
        VARP: function(e, t) {
            for (var r = 0, a = 0; a < t.length; a++) {
                var n = t[a];
                r += Math.pow(n - e, 2)
            }
            return numFormat$1(r / t.length)
        },
        let: function(e, t) {
            for (var r = 0, a = 0; a < t.length; a++) {
                var n = t[a];
                r += Math.pow(n - e, 2)
            }
            return numFormat$1(r / (t.length - 1))
        }
    }
      , pivotTable = {
        pivotDatas: null,
        pivotSheetIndex: 0,
        pivotDataSheetIndex: 0,
        celldata: null,
        origindata: null,
        getCellData: function getCellData(cursheetindex, datasheetindex, data_select_save) {
            var _this = this, sheetIndex;
            sheetIndex = null != cursheetindex ? cursheetindex : Store.currentSheetIndex;
            var realIndex = getSheetIndex(sheetIndex);
            "object" != getObjType(Store.luckysheetfile[realIndex].pivotTable) && (Store.luckysheetfile[realIndex].pivotTable = eval("(" + Store.luckysheetfile[realIndex].pivotTable + ")")),
            null != Store.luckysheetfile[realIndex].pivotTable ? (_this.column = Store.luckysheetfile[realIndex].pivotTable.column,
            _this.row = Store.luckysheetfile[realIndex].pivotTable.row,
            _this.values = Store.luckysheetfile[realIndex].pivotTable.values,
            _this.filter = Store.luckysheetfile[realIndex].pivotTable.filter,
            _this.showType = Store.luckysheetfile[realIndex].pivotTable.showType,
            _this.filterparm = Store.luckysheetfile[realIndex].pivotTable.filterparm,
            null != Store.luckysheetfile[realIndex].pivotTable.drawPivotTable ? _this.drawPivotTable = Store.luckysheetfile[realIndex].pivotTable.drawPivotTable : _this.drawPivotTable = !0,
            null != Store.luckysheetfile[realIndex].pivotTable.pivotTableBoundary ? _this.pivotTableBoundary = Store.luckysheetfile[realIndex].pivotTable.pivotTableBoundary : _this.pivotTableBoundary = [12, 6],
            _this.pivot_select_save = null != data_select_save ? data_select_save : Store.luckysheetfile[realIndex].pivotTable.pivot_select_save,
            _this.pivotDataSheetIndex = null != datasheetindex ? datasheetindex : Store.luckysheetfile[realIndex].pivotTable.pivotDataSheetIndex) : (_this.column = null,
            _this.row = null,
            _this.values = null,
            _this.filter = null,
            _this.showType = null,
            _this.filterparm = null,
            _this.drawPivotTable = !0,
            _this.pivotTableBoundary = [12, 6],
            _this.pivot_select_save = null != data_select_save ? data_select_save : Store.luckysheet_select_save,
            _this.pivotDataSheetIndex = null != datasheetindex ? datasheetindex : sheetIndex);
            var pivotrealIndex = getSheetIndex(_this.pivotDataSheetIndex)
              , otherfile = Store.luckysheetfile[pivotrealIndex];
            null == otherfile.data && (otherfile.data = sheetmanage.buildGridData(otherfile)),
            _this.origindata = getdatabyselectionD(otherfile.data, _this.pivot_select_save);
            var rowhidden = {};
            if (null != _this.filterparm)
                for (var f in _this.filterparm)
                    for (var h in _this.filterparm[f])
                        null != h.rowhidden && (rowhidden = $.extend(!0, rowhidden, h.rowhidden));
            _this.rowhidden = rowhidden,
            _this.pivotSheetIndex = sheetIndex;
            for (var newdata = [], i = 0; i < _this.origindata.length; i++)
                null != _this.rowhidden && null != _this.rowhidden[i] || newdata.push([].concat(_this.origindata[i]));
            _this.celldata = newdata,
            _this.pivot_data_type = {};
            for (var c = 0; c < _this.celldata[1].length; c++) {
                var type = isdatatype(_this.celldata[1][c]);
                _this.pivot_data_type[c.toString()] = type
            }
        },
        pivot_data_type: {},
        pivot_select_save: null,
        column: null,
        row: null,
        values: null,
        filter: null,
        showType: null,
        rowhidden: null,
        selected: null,
        caljs: null,
        initial: !0,
        filterparm: null,
        luckysheet_pivotTable_select_state: !1,
        jgridCurrentPivotInput: null,
        movestate: !1,
        moveitemposition: [],
        movesave: {},
        showvaluecolrow: function() {
            $("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").length >= 2 ? ($("#luckysheetpivottablevaluecolrowshow").show(),
            "column" == this.showType ? ($("#luckysheetpivottablevaluecolrow").prop("checked", !0),
            $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").addClass("ui-state-active"),
            $("#luckysheetpivottablevaluecolrow1").prop("checked", !1),
            $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").removeClass("ui-state-active")) : ($("#luckysheetpivottablevaluecolrow1").prop("checked", !0),
            $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").addClass("ui-state-active"),
            $("#luckysheetpivottablevaluecolrow").prop("checked", !1),
            $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").removeClass("ui-state-active"))) : $("#luckysheetpivottablevaluecolrowshow").hide()
        },
        resetOrderby: function(e) {
            var t = $("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").index(e);
            $("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                $(this).data("orderby") == t && $(this).data("orderby", "self")
            }
            ))
        },
        luckysheetsliderlistclearfilter: function(e) {
            var t = e.parent()
              , r = t.data("index")
              , a = {}
              , n = this.origindata;
            t.data("rowhidden", "").find(".luckysheet-slider-list-item-filtered").hide(),
            this.setDatatojsfile("selected", {}, r),
            this.setDatatojsfile("rowhidden", null, r);
            for (var o = [], l = 0; l < n.length; l++)
                null == a[l] && o.push([].concat(n[l]));
            this.celldata = o,
            this.refreshPivotTable(),
            $("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide()
        },
        luckysheetsliderlistitemfilter: function(e) {
            var t = locale().filter
              , r = e.parent()
              , a = r.offset()
              , n = $("#luckysheet-pivotTableFilter-menu")
              , o = $(window).height()
              , l = ($(window).width(),
            r.data("index"))
              , i = r.data("rowhidden");
            null == i || "" == i ? i = {} : "string" == getObjType(i) && (i = JSON.parse(i)),
            $("body .luckysheet-cols-menu").hide(),
            $("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide(),
            $("#luckysheet-pivotTableFilter-byvalue-input").val(""),
            $("#luckysheet-pivotTableFilter-bycondition").next().hide(),
            $("#luckysheet-pivotTableFilter-byvalue").next().show(),
            n.data("index", l),
            $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").hide().find("input").val(),
            $("#luckysheet-pivotTableFilter-selected span").data("type", "0").data("type", null).text(t.filiterInputNone);
            var s = r.data("byconditiontype");
            if ($("#luckysheet-pivotTableFilter-selected span").data("value", r.data("byconditionvalue")).data("type", s).text(r.data("byconditiontext")),
            "2" == s) {
                var c = $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input2").show().find("input");
                c.eq(0).val(r.data("byconditionvalue1")),
                c.eq(1).val(r.data("byconditionvalue2"))
            } else
                "1" == s && $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").eq(0).show().find("input").val(r.data("byconditionvalue1"));
            $("#luckysheet-pivotTableFilter-byvalue-select").empty().html('<div style="width:100%;text-align:center;position:relative;top:45%;font-size: 14px;"> <div class="luckysheetLoaderGif"> </div> <span>' + t.filiterMoreDataTip + "</span></div>");
            var u = {};
            $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").not(r.get(0)).each((function() {
                var e = $(this).data("rowhidden");
                if (null == e || "" == e)
                    return !0;
                for (var t in "string" == getObjType(e) && (e = JSON.parse(e)),
                e)
                    u[t] = 0
            }
            ));
            var h = this.origindata;
            setTimeout((function() {
                for (var e = {}, r = {}, n = {}, s = {}, c = 1; c < h.length; c++)
                    if (!(c in u) && null != h[c]) {
                        var d = h[c][l];
                        if (null != d && null != d.ct && "d" == d.ct.t) {
                            var f = update("YYYY-MM-DD", d.v)
                              , m = f.split("-")[0]
                              , p = f.split("-")[1]
                              , g = f.split("-")[2];
                            m in e || (e[m] = {}),
                            p in e[m] || (e[m][p] = {}),
                            g in e[m][p] || (e[m][p][g] = 0),
                            e[m][p][g]++,
                            c in i && (r[m] = 0,
                            r[p] = 0,
                            r[g] = 0)
                        } else {
                            var y = void 0
                              , v = void 0;
                            null == d || isRealNull(d.v) ? (y = null,
                            v = null) : (y = d.v,
                            v = d.m),
                            y in n || (n[y] = {}),
                            v in n[y] || (n[y][v] = 0),
                            n[y][v]++,
                            c in i && (s[y + "#$$$#" + v] = 0)
                        }
                    }
                var A = [];
                if (JSON.stringify(e).length > 2)
                    for (var b in e) {
                        var k = 0
                          , w = "";
                        for (var x in e[b]) {
                            var S = 0
                              , _ = "";
                            for (var C in e[b][x]) {
                                var T = e[b][x][C];
                                S += T;
                                var E = void 0;
                                E = Number(x) < 10 ? "0" + Number(x) : x;
                                var I = void 0;
                                I = Number(C) < 10 ? "0" + Number(C) : C,
                                _ += b in r && x in r && C in r ? '<div class="day luckysheet-mousedown-cancel cf" data-check="false" title="' + b + "-" + E + "-" + I + '"><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + C + '</label><span class="count luckysheet-mousedown-cancel">( ' + T + " )</span></div>" : '<div class="day luckysheet-mousedown-cancel cf" data-check="true" title="' + b + "-" + E + "-" + I + '"><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + C + '</label><span class="count luckysheet-mousedown-cancel">( ' + T + " )</span></div>"
                            }
                            k += S;
                            var R = void 0;
                            R = Number(x) < 10 ? "0" + Number(x) : x,
                            w += b in r && x in r ? '<div class="monthBox luckysheet-mousedown-cancel"><div class="month luckysheet-mousedown-cancel cf" data-check="false" title="' + b + "-" + R + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + x + t.filiterMonthText + '</label><span class="count luckysheet-mousedown-cancel">( ' + S + ' )</span></div><div class="dayList luckysheet-mousedown-cancel">' + _ + "</div></div>" : '<div class="monthBox luckysheet-mousedown-cancel"><div class="month luckysheet-mousedown-cancel cf" data-check="true" title="' + b + "-" + R + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + x + t.filiterMonthText + '</label><span class="count luckysheet-mousedown-cancel">( ' + S + ' )</span></div><div class="dayList luckysheet-mousedown-cancel">' + _ + "</div></div>"
                        }
                        var B = void 0;
                        B = b in r ? '<div class="yearBox luckysheet-mousedown-cancel"><div class="year luckysheet-mousedown-cancel cf" data-check="false" title="' + b + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + b + t.filiterYearText + '</label><span class="count luckysheet-mousedown-cancel">( ' + k + ' )</span></div><div class="monthList luckysheet-mousedown-cancel">' + w + "</div></div>" : '<div class="yearBox luckysheet-mousedown-cancel"><div class="year luckysheet-mousedown-cancel cf" data-check="true" title="' + b + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + b + t.filiterYearText + '</label><span class="count luckysheet-mousedown-cancel">( ' + k + ' )</span></div><div class="monthList luckysheet-mousedown-cancel">' + w + "</div></div>",
                        A.unshift(B)
                    }
                if (JSON.stringify(n).length > 2) {
                    var N = Object.keys(n);
                    N = orderbydata1D(N, !0);
                    for (var F = 0; F < N.length; F++) {
                        var P = N[F];
                        for (var L in n[P]) {
                            var O = void 0;
                            O = P + "#$$$#" + L == "null#$$$#null" ? t.valueBlank : L;
                            var D = void 0;
                            D = P + "#$$$#" + L in s ? '<div class="textBox luckysheet-mousedown-cancel cf" data-check="false" data-filter="' + P + "#$$$#" + L + '" title="' + L + '"><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + O + '</label><span class="luckysheet-mousedown-cancel count">( ' + n[P][L] + " )</span></div>" : '<div class="textBox luckysheet-mousedown-cancel cf" data-check="true" data-filter="' + P + "#$$$#" + L + '" title="' + L + '"><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + O + '</label><span class="luckysheet-mousedown-cancel count">( ' + n[P][L] + " )</span></div>",
                            A.push(D)
                        }
                    }
                }
                $("#luckysheet-pivotTableFilter-byvalue-select").html("<div class='ListBox luckysheet-mousedown-cancel' style='max-height:" + (o - a.top - 350) + "px;overflow-y:auto;overflow-x:hidden;'>" + A.join("") + "</div>")
            }
            ), 1),
            showrightclickmenu(n, a.left - 250, a.top)
        },
        getSumTypeName: function(e) {
            var t = ""
              , r = locale().pivotTable;
            return "SUM" == e ? t = r.valueStatisticsSUM : "COUNT" == e ? t = r.valueStatisticsCOUNT : "COUNTA" == e ? t = r.valueStatisticsCOUNTA : "COUNTUNIQUE" == e ? t = r.valueStatisticsCOUNTUNIQUE : "AVERAGE" == e ? t = r.valueStatisticsAVERAGE : "MAX" == e ? t = r.valueStatisticsMAX : "MIN" == e ? t = r.valueStatisticsMIN : "MEDIAN" == e ? t = r.valueStatisticsMEDIAN : "PRODUCT" == e ? t = r.valueStatisticsPRODUCT : "STDEV" == e ? t = r.valueStatisticsSTDEV : "STDEVP" == e ? t = r.valueStatisticsSTDEVP : "let" == e ? t = r.valueStatisticslet : "VARP" == e && (t = r.valueStatisticsVARP),
            t
        },
        setDatatojsfile: function(e, t, r) {
            var a = getSheetIndex(this.pivotSheetIndex);
            null == Store.luckysheetfile[a].pivotTable && (Store.luckysheetfile[a].pivotTable = {}),
            null == r ? (Store.luckysheetfile[a].pivotTable[e] = t,
            this[e] = t) : (null == Store.luckysheetfile[a].pivotTable.filterparm && (Store.luckysheetfile[a].pivotTable.filterparm = {}),
            null == Store.luckysheetfile[a].pivotTable.filterparm[r.toString()] && (Store.luckysheetfile[a].pivotTable.filterparm[r.toString()] = {}),
            Store.luckysheetfile[a].pivotTable.filterparm[r.toString()][e] = t,
            null == this.filterparm && (this.filterparm = {}),
            null == this.filterparm[r.toString()] && (this.filterparm[r.toString()] = {}),
            this.filterparm[r.toString()][e] = t)
        },
        createPivotTable: function(e) {
            if (!isEditMode() && !1 !== Store.allowEdit) {
                var t = Store.currentSheetIndex
                  , r = locale().pivotTable;
                if (isEditMode())
                    alert(r.errorNotAllowEdit);
                else if (Store.luckysheet_select_save.length > 1)
                    tooltip.info("", r.errorNotAllowMulti);
                else if (0 != Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] != Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] != Store.luckysheet_select_save[0].column[1]) {
                    var a = $.extend(!0, {}, Store.luckysheet_select_save[0]);
                    sheetmanage.addNewSheet(e, !0),
                    this.getCellData(Store.currentSheetIndex, t, a),
                    this.setDatatojsfile("pivot_select_save", a),
                    this.setDatatojsfile("pivotDataSheetIndex", t),
                    this.initialPivotManage()
                } else
                    tooltip.info("", r.errorSelectRange)
            }
        },
        changePivotTable: function(e) {
            var t = locale().pivotTable
              , r = Store.luckysheetfile[getSheetIndex(e)].pivotTable.pivotDataSheetIndex;
            null != getSheetIndex(r) ? (this.getCellData(e),
            this.initialPivotManage(!0)) : tooltip.info(t.errorIsDamage, "")
        },
        refreshPivotTable: function() {
            var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]
              , t = this
              , r = {};
            r.pivotTable = m,
            r.data = editor.deepCopyFlowData(Store.flowdata),
            t.storePivotTableParam();
            var a = t.dataHandler(t.column, t.row, t.values, t.showType, t.celldata);
            t.setDatatojsfile("pivotDatas", a);
            var n = $.extend(!0, [], sheetmanage.nulldata)
              , o = n
              , l = 0
              , i = 0;
            if (0 == a.length)
                t.setDatatojsfile("drawPivotTable", !0),
                t.setDatatojsfile("pivotTableBoundary", [12, 6]);
            else {
                t.setDatatojsfile("drawPivotTable", !1),
                t.setDatatojsfile("pivotTableBoundary", [a.length, a[0].length]);
                var s = a.length
                  , c = a[0].length;
                o = datagridgrowth(n, (l = s - n.length) + 20, (i = c - n[0].length) + 10, !0);
                for (var u = 0; u < s; u++) {
                    for (var h = [].concat(o[u]), d = 0; d < c; d++) {
                        var f = "";
                        null != a[u] && null != a[u][d] && (f = getcellvalue(u, d, a)),
                        h[d] = f
                    }
                    o[u] = h
                }
            }
            r.type = "pivotTable_change",
            r.curdata = $.extend(!0, [], o),
            r.sheetIndex = Store.currentSheetIndex;
            var m = t.getPivotTableData();
            r.pivotTablecur = m,
            Store.clearjfundo && (Store.jfundo = [],
            Store.jfredo.push(r)),
            cleargridelement(),
            Store.clearjfundo = !1,
            l > 0 || i > 0 ? jfrefreshgridall(o[0].length, o.length, o, null, Store.luckysheet_select_save, "datachangeAll", void 0, void 0, e) : (jfrefreshgrid(o, Store.luckysheet_select_save, {}, null, e),
            selectHightlightShow()),
            Store.clearjfundo = !0
        },
        drawPivotTable: !0,
        pivotTableBoundary: [12, 6],
        pivotclick: function(e, t, r) {
            null == r && (r = Store.currentSheetIndex);
            var a = Store.luckysheetfile[getSheetIndex(r)];
            if (a.isPivotTable && null != getSheetIndex(a.pivotTable.pivotDataSheetIndex)) {
                var n = $("#luckysheet-modal-dialog-slider-pivot")
                  , o = this.isPivotRange(e, t);
                if (o && n.is(":hidden")) {
                    if (!checkProtectionAuthorityNormal(r, "usePivotTablereports", !1))
                        return;
                    n.show(),
                    luckysheetsizeauto(),
                    $("#luckysheet-sta-content").css("padding-right", 260)
                } else
                    !o && n.is(":visible") && (n.hide(),
                    luckysheetsizeauto(),
                    $("#luckysheet-sta-content").css("padding-right", 10))
            }
        },
        isPivotRange: function(e, t) {
            if (Store.luckysheetcurrentisPivotTable)
                return e < this.pivotTableBoundary[0] && t < this.pivotTableBoundary[1]
        },
        storePivotTableParam: function() {
            var e = []
              , t = []
              , r = []
              , a = [];
            $("#luckysheet-modal-dialog-config-filter .luckysheet-modal-dialog-slider-config-item").each((function() {
                var e = {};
                e.index = $(this).data("index"),
                e.name = $(this).data("name"),
                e.fullname = $(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text(),
                r.push(e)
            }
            )),
            $("#luckysheet-modal-dialog-config-row .luckysheet-modal-dialog-slider-config-item").each((function() {
                var e = {};
                e.index = $(this).data("index"),
                e.name = $(this).data("name"),
                e.fullname = $(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text(),
                e.order = $(this).data("order"),
                e.orderby = $(this).data("orderby"),
                e.stastic = $(this).data("stastic"),
                t.push(e)
            }
            )),
            $("#luckysheet-modal-dialog-config-column .luckysheet-modal-dialog-slider-config-item").each((function() {
                var t = {};
                t.index = $(this).data("index"),
                t.name = $(this).data("name"),
                t.fullname = $(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text(),
                t.order = $(this).data("order"),
                t.orderby = $(this).data("orderby"),
                t.stastic = $(this).data("stastic"),
                e.push(t)
            }
            )),
            $("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").each((function() {
                var e = {};
                e.index = $(this).data("index"),
                e.name = $(this).data("name"),
                e.fullname = $(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text(),
                e.sumtype = $(this).data("sumtype"),
                e.nameindex = $(this).data("nameindex"),
                a.push(e)
            }
            )),
            this.setDatatojsfile("column", e),
            this.setDatatojsfile("row", t),
            this.setDatatojsfile("filter", r),
            this.setDatatojsfile("values", a);
            var n = $("#luckysheetpivottablevaluecolrow:checked, #luckysheetpivottablevaluecolrow1:checked").val();
            this.setDatatojsfile("showType", "0" == n ? "row" : "column");
            var o = this.getPivotTableData();
            delete o.pivotDatas,
            server.saveParam("all", this.pivotSheetIndex, o, {
                k: "pivotTable"
            })
        },
        getPivotTableData: function getPivotTableData(dataindex) {
            null == dataindex && (dataindex = this.pivotSheetIndex);
            var index = getSheetIndex(dataindex)
              , pivotTable = Store.luckysheetfile[index].pivotTable;
            return pivotTable = "object" == getObjType(pivotTable) ? $.extend(!0, {}, Store.luckysheetfile[index].pivotTable) : eval("(" + pivotTable + ")"),
            pivotTable
        },
        addValuesToTitle: function(e, t) {
            var r = e.length * t.length
              , a = e[0].length + 1
              , n = [];
            if (0 == e.length && t.length > 0) {
                for (var o = 0; o < t.length; o++)
                    n.push(t[o].fullname);
                return n
            }
            if (0 == t.length && e.length > 0)
                return e;
            for (var l = 0; l < r; l++) {
                n[l] = new Array(a);
                for (var i = 0; i < a - 1; i++)
                    n[l][i] = e[Math.floor(l / t.length)][i];
                n[l][a - 1] = t[l % t.length].fullname
            }
            return n
        },
        initialPivotManage: function(e) {
            var t = this
              , r = locale()
              , a = r.pivotTable
              , n = r.button
              , o = r.filter;
            if (t.initial) {
                t.initial = !1,
                $("body").append(luckysheetPivotTableHTML()),
                $("#luckysheet-modal-dialog-slider-close").click((function() {
                    $("#luckysheet-modal-dialog-slider-pivot").hide(),
                    luckysheetsizeauto()
                }
                )),
                $("body").append(replaceHtml$1(modelHTML, {
                    id: "luckysheet-data-pivotTable-selection",
                    addclass: "luckysheet-data-pivotTable-selection",
                    title: a.titleSelectionDataRange,
                    content: '<input id="luckysheet-pivotTable-range-selection-input" class="luckysheet-datavisual-range-container" style="font-size: 14px;padding:5px;max-width:none;" spellcheck="false" aria-label="' + a.titleDataRange + '" placeholder="' + a.titleDataRange + '">',
                    botton: '<button id="luckysheet-pivotTable-selection-confirm" class="btn btn-primary">' + n.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + n.cancel + "</button>"
                })),
                $("body").append(replaceHtml$1(filtermenuHTML(), {
                    menuid: "pivotTableFilter"
                })),
                $("body").append(replaceHtml$1(filtersubmenuHTML(), {
                    menuid: "pivotTableFilter"
                })),
                $("body").append(pivottableconfigHTML()),
                $("body").append(pivottablesumHTML()),
                $("#luckysheet-pivotTableFilter-orderby-asc").remove(),
                $("#luckysheet-pivotTableFilter-orderby-desc").next().remove(),
                $("#luckysheet-pivotTableFilter-orderby-desc").remove(),
                $("#luckysheet-pivotTableFilter-orderby-color").next().remove(),
                $("#luckysheet-pivotTableFilter-orderby-color").remove(),
                $("#luckysheetpivottablevaluecolrow, #luckysheetpivottablevaluecolrow1").checkboxradio({
                    icon: !1
                }).change((function() {
                    t.refreshPivotTable()
                }
                ));
                var l = null;
                $("#luckysheet-pivotTableFilter-menu").mouseover((function() {
                    clearTimeout(l),
                    l = setTimeout((function() {
                        $("#luckysheet-pivotTableFilter-submenu").hide()
                    }
                    ), 500)
                }
                )),
                $(document).off("click.ptFilterCheckbox1").on("click.ptFilterCheckbox1", "#luckysheet-pivotTableFilter-byvalue-select .textBox", (function() {
                    "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
                    $(this).find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
                    $(this).find("input[type='checkbox']").prop("checked", !0))
                }
                )),
                $(document).off("click.ptFilterCheckbox2").on("click.ptFilterCheckbox2", "#luckysheet-pivotTableFilter-byvalue-select .year", (function() {
                    "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
                    $(this).parents(".yearBox").find(".month").attr("data-check", "false"),
                    $(this).parents(".yearBox").find(".day").attr("data-check", "false"),
                    $(this).parents(".yearBox").find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
                    $(this).parents(".yearBox").find(".month").attr("data-check", "true"),
                    $(this).parents(".yearBox").find(".day").attr("data-check", "true"),
                    $(this).parents(".yearBox").find("input[type='checkbox']").prop("checked", !0))
                }
                )),
                $(document).off("click.ptFilterCheckbox3").on("click.ptFilterCheckbox3", "#luckysheet-pivotTableFilter-byvalue-select .month", (function() {
                    "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
                    $(this).parents(".monthBox").find(".day").attr("data-check", "false"),
                    $(this).parents(".monthBox").find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
                    $(this).parents(".monthBox").find(".day").attr("data-check", "true"),
                    $(this).parents(".monthBox").find("input[type='checkbox']").prop("checked", !0));
                    var e = !0;
                    $(this).parents(".yearBox").find(".day").each((function(t, r) {
                        "true" == $(r).attr("data-check") || (e = !1)
                    }
                    )),
                    e ? ($(this).parents(".yearBox").find(".year").attr("data-check", "true"),
                    $(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".yearBox").find(".year").attr("data-check", "false"),
                    $(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))
                }
                )),
                $(document).off("click.ptFilterCheckbox4").on("click.ptFilterCheckbox4", "#luckysheet-pivotTableFilter-byvalue-select .day", (function() {
                    "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
                    $(this).find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
                    $(this).find("input[type='checkbox']").prop("checked", !0));
                    var e = !0;
                    $(this).parents(".monthBox").find(".day").each((function(t, r) {
                        "true" == $(r).attr("data-check") || (e = !1)
                    }
                    )),
                    e ? ($(this).parents(".monthBox").find(".month").attr("data-check", "true"),
                    $(this).parents(".monthBox").find(".month input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".monthBox").find(".month").attr("data-check", "false"),
                    $(this).parents(".monthBox").find(".month input[type='checkbox']").removeAttr("checked"));
                    var t = !0;
                    $(this).parents(".yearBox").find(".day").each((function(e, r) {
                        "true" == $(r).attr("data-check") || (t = !1)
                    }
                    )),
                    t ? ($(this).parents(".yearBox").find(".year").attr("data-check", "true"),
                    $(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".yearBox").find(".year").attr("data-check", "false"),
                    $(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))
                }
                )),
                $(document).off("click.ptFilterYearDropdown").on("click.ptFilterYearDropdown", "#luckysheet-pivotTableFilter-byvalue-select .yearBox .fa-caret-right", (function() {
                    var e = $(this).parents(".luckysheet-mousedown-cancel");
                    e.hasClass("year") && $(this).parents(".yearBox").find(".monthList").slideToggle(),
                    e.hasClass("month") && $(this).parents(".monthBox").find(".dayList").slideToggle()
                }
                )),
                $("#luckysheet-pivotTableFilter-byvalue-btn-all").click((function() {
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").prop("checked", !0),
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check", "true")
                }
                )),
                $("#luckysheet-pivotTableFilter-byvalue-btn-contra").click((function() {
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each((function(e, t) {
                        $(t).is(":checked") ? ($(t).removeAttr("checked"),
                        $(t).parents(".luckysheet-mousedown-cancel").attr("data-check", "false")) : ($(t).prop("checked", !0),
                        $(t).parents(".luckysheet-mousedown-cancel").attr("data-check", "true"))
                    }
                    )),
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox .monthBox").each((function(e, t) {
                        var r = !0;
                        $(t).find(".day input[type='checkbox']").each((function(e, t) {
                            $(t).is(":checked") || (r = !1)
                        }
                        )),
                        r ? ($(t).find(".month input[type='checkbox']").prop("checked", !0),
                        $(t).attr("data-check", "true")) : ($(t).find(".month input[type='checkbox']").removeAttr("checked"),
                        $(t).attr("data-check", "false"))
                    }
                    )),
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox .yearBox").each((function(e, t) {
                        var r = !0;
                        $(t).find(".day input[type='checkbox']").each((function(e, t) {
                            $(t).is(":checked") || (r = !1)
                        }
                        )),
                        r ? ($(t).find(".year input[type='checkbox']").prop("checked", !0),
                        $(t).attr("data-check", "true")) : ($(t).find(".year input[type='checkbox']").removeAttr("checked"),
                        $(t).attr("data-check", "false"))
                    }
                    ))
                }
                )),
                $("#luckysheet-pivotTableFilter-byvalue-btn-clear").click((function() {
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").removeAttr("checked"),
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check", "false")
                }
                )),
                $("#luckysheet-pivotTableFilter-byvalue-input").on("input propertychange", (function() {
                    var e = $(this).val().toString();
                    ($("#luckysheet-pivotTableFilter-byvalue-select .ListBox .luckysheet-mousedown-cancel").show(),
                    "" != e) && $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each((function(t, r) {
                        var a = $(r).parents(".luckysheet-mousedown-cancel");
                        if (a.hasClass("day")) {
                            var n = $(r).siblings("label").text().toString()
                              , o = $(r).parents(".monthBox").find(".month label").text().toString();
                            if (-1 == ($(r).parents(".yearBox").find(".year label").text().toString() + "-" + o + "-" + n).indexOf(e))
                                $(r).parents(".day").hide(),
                                0 == $(r).parents(".dayList").find(".day:visible").length && $(r).parents(".monthBox").find(".month").hide(),
                                0 == $(r).parents(".monthList").find(".day:visible").length && $(r).parents(".yearBox").find(".year").hide()
                        }
                        a.hasClass("textBox") && (-1 == $(r).siblings("label").text().toString().indexOf(e) && $(r).parents(".textBox").hide())
                    }
                    ))
                }
                )),
                $("#luckysheet-pivotTableFilter-bycondition, #luckysheet-pivotTableFilter-byvalue").click((function() {
                    var e = $(this);
                    e.next().slideToggle(200),
                    setTimeout((function() {
                        "luckysheet-pivotTableFilter-bycondition" == e.attr("id") && $("#luckysheet-pivotTableFilter-bycondition").next().is(":visible") && $("#luckysheet-pivotTableFilter-selected span").text() != o.filiterInputNone && $("#luckysheet-pivotTableFilter-byvalue").next().slideUp(200),
                        e.is($("#luckysheet-pivotTableFilter-bycondition")) && $("#luckysheet-pivotTableFilter-bycondition").next().is(":hidden") && $("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden") && $("#luckysheet-pivotTableFilter-byvalue").next().slideDown(200)
                    }
                    ), 300)
                }
                )),
                $("#luckysheet-pivotTableFilter-cancel").click((function() {
                    $("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide()
                }
                )),
                $("#luckysheet-pivotTableFilter-selected").click((function() {
                    var e = $(this).offset()
                      , t = $("#luckysheet-pivotTableFilter-submenu");
                    t.hide();
                    var r = $(window).height()
                      , a = $(window).width()
                      , n = t.width()
                      , o = (t.height(),
                    e.top)
                      , i = e.left
                      , s = r - e.top - 20;
                    e.left + n > a && (i = e.left - n),
                    e.top > r / 2 && ((o = r - e.top) < 0 && (o = 0),
                    s = e.top - 20),
                    t.css({
                        top: o,
                        left: i,
                        height: s
                    }).show(),
                    clearTimeout(l)
                }
                )),
                $("#luckysheet-pivotTableFilter-submenu").mouseover((function() {
                    clearTimeout(l)
                }
                )).find(".luckysheet-cols-menuitem").click((function(e) {
                    $("#luckysheet-pivotTableFilter-selected span").html($(this).find(".luckysheet-cols-menuitem-content").text()).data("value", $(this).data("value")),
                    $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").hide(),
                    "2" == $(this).data("type") ? ($("#luckysheet-pivotTableFilter-selected span").data("type", "2"),
                    $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input2").show()) : "0" == $(this).data("type") ? $("#luckysheet-pivotTableFilter-selected span").data("type", "0") : ($("#luckysheet-pivotTableFilter-selected span").data("type", "1"),
                    $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").eq(0).show(),
                    "dateequal" == $(this).attr("data-value") || "datelessthan" == $(this).attr("data-value") || "datemorethan" == $(this).attr("data-value") ? $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input input").prop("type", "date") : $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input input").prop("type", "text")),
                    $("#luckysheet-pivotTableFilter-byvalue").next().slideUp(),
                    $("#luckysheet-pivotTableFilter-submenu").hide()
                }
                )),
                $("#luckysheet-modal-dialog-pivotTable-list").on("click", " .luckysheet-slider-list-item-filter", (function(e) {
                    return t.luckysheetsliderlistitemfilter($(this)),
                    e.stopPropagation(),
                    !1
                }
                )),
                $("#luckysheet-modal-dialog-pivotTable-list").on("click", " .luckysheet-slider-list-item-filtered", (function(e) {
                    return t.luckysheetsliderlistclearfilter($(this).next()),
                    e.stopPropagation(),
                    !1
                }
                )),
                $("#luckysheet-dialog-pivotTable-range-seleted").click((function() {
                    $("#luckysheet-modal-dialog-slider-pivot").hide(),
                    luckysheetsizeauto();
                    var e = $("#luckysheet-data-pivotTable-selection")
                      , r = e.outerHeight()
                      , a = e.outerWidth()
                      , n = $(window).width()
                      , o = $(window).height()
                      , l = $(document).scrollLeft()
                      , i = $(document).scrollTop();
                    $("#luckysheet-data-pivotTable-selection").css({
                        left: (n + l - a) / 2,
                        top: (o + i - r) / 4
                    }).show(),
                    t.jgridCurrentPivotInput = $("#luckysheet-dialog-pivotTable-range").html(),
                    $("#luckysheet-pivotTable-range-selection-input").val(t.jgridCurrentPivotInput),
                    t.luckysheet_pivotTable_select_state = !0
                }
                )),
                $("#luckysheet-pivotTableFilter-initial").click((function() {
                    $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-slider-list-item-filtered").hide(),
                    $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").data("rowhidden", ""),
                    $("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide(),
                    $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").hide().find("input").val(),
                    $("#luckysheet-pivotTableFilter-selected span").data("type", "0").data("type", null).text(o.filiterInputNone),
                    t.setDatatojsfile("filterparm", null),
                    t.celldata = t.origindata,
                    t.refreshPivotTable()
                }
                )),
                $("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").on("click", ".luckysheet-modal-dialog-slider-config-item-icon", (function(e) {
                    var t = $(e.target).closest(".luckysheet-modal-dialog-slider-config-item")
                      , r = t.data("index")
                      , a = t.offset()
                      , n = t.data("order")
                      , o = t.data("orderby")
                      , l = t.data("stastic");
                    null == n && (n = "default");
                    var i = '<option value="self">' + t.find(".luckysheet-modal-dialog-slider-config-item-txt").data("name") + "</option>";
                    return $("#luckysheet-modal-dialog-config-value .luckysheet-modal-dialog-slider-config-item").each((function(e) {
                        i += '<option value="' + e + '">' + $(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text() + "</option>"
                    }
                    )),
                    $("#luckysheet-pivotTable-config-option-orderby").empty().html(i),
                    null == o && (o = "self"),
                    null == l && (l = "1"),
                    $("#luckysheet-pivotTable-config-option-order").val(n).data("index", r),
                    $("#luckysheet-pivotTable-config-option-orderby").val(o).data("index", r),
                    $("#luckysheet-pivotTable-config-option-stastic").val(l).data("index", r),
                    mouseclickposition($("#luckysheet-pivotTable-config-option"), a.left + t.outerWidth(), a.top - 13, "rightbottom"),
                    e.stopPropagation(),
                    !1
                }
                )),
                $("#luckysheet-pivotTable-config-option-order,#luckysheet-pivotTable-config-option-orderby,#luckysheet-pivotTable-config-option-stastic").change((function() {
                    var e = $(this)
                      , r = e.data("index");
                    $("#luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                        $(this).data("index") == r && $(this).data(e.attr("id").replace("luckysheet-pivotTable-config-option-", ""), e.val())
                    }
                    )),
                    t.refreshPivotTable()
                }
                )),
                $("#luckysheet-modal-dialog-config-value").on("click", ".luckysheet-modal-dialog-slider-config-item-icon", (function(e) {
                    var r = $(e.target).closest(".luckysheet-modal-dialog-slider-config-item")
                      , a = r.data("index")
                      , n = r.offset()
                      , o = r.data("sumtype")
                      , l = t.pivot_data_type[a.toString()];
                    null == o && (o = "num" == l ? "SUM" : "COUNTA");
                    var i = $("#luckysheet-pivotTable-config-option-sumtype");
                    return i.find(".luckysheet-submenu-arrow").hide(),
                    i.find(".luckysheet-cols-menuitem[sumtype='" + o + "'] .luckysheet-submenu-arrow").css("display", "inline"),
                    i.data("item", r),
                    mouseclickposition(i, n.left + r.outerWidth(), n.top - 13, "rightbottom"),
                    e.stopPropagation(),
                    !1
                }
                )),
                $("#luckysheet-pivotTable-config-option-sumtype .luckysheet-cols-menuitem").click((function() {
                    var e = $("#luckysheet-pivotTable-config-option-sumtype").data("item")
                      , r = $(this).attr("sumtype");
                    e.data("sumtype", $(this).attr("sumtype"));
                    var a = t.getSumTypeName(r) + ":" + e.data("name");
                    e.attr("title", a).find(".luckysheet-modal-dialog-slider-config-item-txt").html(a),
                    $("#luckysheet-pivotTable-config-option-sumtype").hide(),
                    t.refreshPivotTable()
                }
                )),
                $("#luckysheet-modal-dialog-config-filter").on("click", ".luckysheet-modal-dialog-slider-config-item-icon", (function(e) {
                    var r = $(e.target).closest(".luckysheet-modal-dialog-slider-config-item").data("index");
                    return t.luckysheetsliderlistitemfilter($("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(r).find(".luckysheet-slider-list-item-filter")),
                    e.stopPropagation(),
                    !1
                }
                )),
                $("#luckysheet-pivotTableFilter-confirm").click((function() {
                    var e = $("#luckysheet-pivotTableFilter-menu").data("index")
                      , r = {};
                    $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").each((function() {
                        var t = $(this)
                          , a = t.data("rowhidden");
                        if (t.data("index") != e) {
                            if (null == a || "" == a)
                                return !0;
                            for (var n in "string" == getObjType(a) && (a = JSON.parse(a)),
                            a)
                                r[n] = 0
                        }
                    }
                    ));
                    var a = t.origindata
                      , n = {}
                      , l = {}
                      , i = {};
                    if ($("#luckysheet-pivotTableFilter-bycondition").next().is(":visible") && $("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden") && "null" != $("#luckysheet-pivotTableFilter-selected span").data("value")) {
                        var s = $("#luckysheet-pivotTableFilter-selected span")
                          , c = s.data("type")
                          , u = s.data("value");
                        if (i.value = u,
                        i.text = s.text(),
                        "0" == c)
                            i.type = "0";
                        else if ("2" == c) {
                            var h = $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input2 input");
                            i.type = "2",
                            i.value1 = h.eq(0).val(),
                            i.value2 = h.eq(1).val()
                        } else
                            i.type = "1",
                            i.value1 = $("#luckysheet-pivotTableFilter-menu .luckysheet-pivotTableFilter-selected-input").eq(0).find("input").val();
                        for (var d = 1; d < a.length; d++)
                            if (!(d in r) && null != a[d]) {
                                var f = a[d][e];
                                if ("cellnull" == u)
                                    null == f || isRealNull(f.v) || (l[d] = 0);
                                else if ("cellnonull" == u)
                                    (null == f || isRealNull(f.v)) && (l[d] = 0);
                                else if ("textinclude" == u) {
                                    var m = i.value1;
                                    (null == f || isRealNull(f.v) || -1 == f.m.indexOf(m)) && (l[d] = 0)
                                } else if ("textnotinclude" == u) {
                                    var p = i.value1;
                                    null == f || isRealNull(f.v) || f.m.indexOf(p) > -1 && (l[d] = 0)
                                } else if ("textstart" == u) {
                                    var g = i.value1
                                      , y = g.length;
                                    (null == f || isRealNull(f.v) || f.m.substr(0, y) != g) && (l[d] = 0)
                                } else if ("textend" == u) {
                                    var v = i.value1
                                      , A = v.length;
                                    (null == f || isRealNull(f.v) || A > f.m.length || f.m.substr(f.m.length - A, A) != v) && (l[d] = 0)
                                } else if ("textequal" == u) {
                                    var b = i.value1;
                                    (null == f || isRealNull(f.v) || f.m != b) && (l[d] = 0)
                                } else if ("dateequal" == u) {
                                    var k = genarate(i.value1)[2];
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "d" == f.ct.t ? parseInt(f.v) != k && (l[d] = 0) : l[d] = 0
                                } else if ("datelessthan" == u) {
                                    var w = genarate(i.value1)[2];
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "d" == f.ct.t ? parseInt(f.v) >= w && (l[d] = 0) : l[d] = 0
                                } else if ("datemorethan" == u) {
                                    var x = genarate(i.value1)[2];
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "d" == f.ct.t ? parseInt(f.v) <= x && (l[d] = 0) : l[d] = 0
                                } else if ("morethan" == u) {
                                    var S = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v <= S && (l[d] = 0) : l[d] = 0
                                } else if ("moreequalthan" == u) {
                                    var _ = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v < _ && (l[d] = 0) : l[d] = 0
                                } else if ("lessthan" == u) {
                                    var C = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v >= C && (l[d] = 0) : l[d] = 0
                                } else if ("lessequalthan" == u) {
                                    var T = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v > T && (l[d] = 0) : l[d] = 0
                                } else if ("equal" == u) {
                                    var E = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v != E && (l[d] = 0) : l[d] = 0
                                } else if ("noequal" == u) {
                                    var I = parseFloat(i.value1);
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v == I && (l[d] = 0) : l[d] = 0
                                } else if ("include" == u) {
                                    var R = parseFloat(i.value1)
                                      , B = parseFloat(i.value2)
                                      , N = void 0
                                      , F = void 0;
                                    R < B ? (N = R,
                                    F = B) : (F = R,
                                    N = B),
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? (f.v < N || f.v > F) && (l[d] = 0) : l[d] = 0
                                } else if ("noinclude" == u) {
                                    var P = parseFloat(i.value1)
                                      , L = parseFloat(i.value2)
                                      , O = void 0
                                      , D = void 0;
                                    P < L ? (O = P,
                                    D = L) : (D = P,
                                    O = L),
                                    null == f || isRealNull(f.v) ? l[d] = 0 : null != f.ct && "n" == f.ct.t ? f.v >= O && f.v <= D && (l[d] = 0) : l[d] = 0
                                }
                            }
                    } else {
                        $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']").each((function(e, t) {
                            if ($(t).is(":visible") && $(t).is(":checked"))
                                return !0;
                            if ($(t).closest(".day").length > 0) {
                                var r = $(t).siblings("label").text();
                                Number(r) < 10 && (r = "0" + r);
                                var a = $(t).closest(".monthBox").find(".month label").text().replace(o.filiterMonthText, "");
                                Number(a) < 10 && (a = "0" + a);
                                var l = $(t).closest(".yearBox").find(".year label").text().replace(o.filiterYearText, "")
                                  , i = o.filterDateFormatTip + "#$$$#" + l + "-" + a + "-" + r;
                                n[i] = "1"
                            }
                            if ($(t).closest(".textBox").length > 0) {
                                var s = $(t).closest(".textBox").data("filter");
                                n[s] = "1"
                            }
                        }
                        ));
                        for (var M = 1; M < a.length; M++)
                            if (!(M in r) && null != a[M]) {
                                var U = a[M][e]
                                  , H = void 0;
                                if (null == U || isRealNull(U.v))
                                    H = "null#$$$#null";
                                else if (null != U.ct && "d" == U.ct.t) {
                                    var q = update("YYYY-MM-DD", U.v);
                                    H = o.filterDateFormatTip + "#$$$#" + q
                                } else
                                    H = U.v + "#$$$#" + U.m;
                                H in n && (l[M] = 0)
                            }
                    }
                    var z = $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(e);
                    $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']:visible:checked").length < $("#luckysheet-pivotTableFilter-byvalue-select .ListBox input[type='checkbox']:visible").length || $("#luckysheet-pivotTableFilter-byvalue-input").val().length > 0 || $("#luckysheet-pivotTableFilter-bycondition").next().is(":visible") && $("#luckysheet-pivotTableFilter-byvalue").next().is(":hidden") && "null" != $("#luckysheet-pivotTableFilter-selected span").data("value") ? (z.data("rowhidden", JSON.stringify(l)).find(".luckysheet-slider-list-item-filtered").show(),
                    t.setDatatojsfile("rowhidden", l, e),
                    null != i && (z.data("byconditionvalue", i.value).data("byconditiontype", i.type).data("byconditiontext", i.text),
                    null != i.value1 && z.data("byconditionvalue1", i.value1),
                    null != i.value2 && z.data("byconditionvalue2", i.value2),
                    t.setDatatojsfile("caljs", i, e))) : (z.data("rowhidden", "").find(".luckysheet-slider-list-item-filtered").hide(),
                    t.setDatatojsfile("rowhidden", null, e));
                    for (var j = [], V = 0; V < a.length; V++)
                        V in l || V in r || j.push([].concat(a[V]));
                    t.celldata = j,
                    t.refreshPivotTable(),
                    $("#luckysheet-pivotTableFilter-menu, #luckysheet-pivotTableFilter-submenu").hide(),
                    cleargridelement()
                }
                )),
                $("#luckysheet-data-pivotTable-selection .luckysheet-model-close-btn, #luckysheet-data-pivotTable-selection .luckysheet-modal-dialog-title-close").click((function() {
                    $("#luckysheet-modal-dialog-slider-pivot").show(),
                    luckysheetsizeauto(),
                    $("#luckysheet-cell-main .luckysheet-pivotTable-selection-set div").show(),
                    $("#luckysheet-data-pivotTable-selection").hide(),
                    sheetmanage.changeSheetExec(t.pivotSheetIndex),
                    t.luckysheet_pivotTable_select_state = !1,
                    cleargridelement()
                }
                )),
                $("#luckysheet-pivotTable-selection-confirm").click((function() {
                    var e = $("#luckysheet-pivotTable-range-selection-input")
                      , r = e.val();
                    if (0 == $.trim(r).length || $.trim(r).toUpperCase() == t.jgridCurrentPivotInput.toUpperCase())
                        return e.val(t.jgridCurrentPivotInput),
                        void $("#luckysheet-data-pivotTable-selection .luckysheet-model-close-btn").click();
                    var n = r.split("!")
                      , o = ""
                      , l = ""
                      , i = -1;
                    if (n.length > 1) {
                        for (var s in o = n[0],
                        l = n[1],
                        Store.luckysheetfile)
                            if (o == Store.luckysheetfile[s].name) {
                                i = Store.luckysheetfile[s].index;
                                break
                            }
                        -1 == i && (i = 0)
                    } else {
                        var c = getSheetIndex(Store.currentSheetIndex);
                        o = Store.luckysheetfile[c].name,
                        i = Store.luckysheetfile[c].index,
                        l = n[0]
                    }
                    if (Store.luckysheetfile[getSheetIndex(i)].isPivotTable)
                        return isEditMode() ? alert(a.errorNotAllowPivotData) : tooltip.info("", a.errorNotAllowPivotData),
                        void e.val(t.jgridCurrentPivotInput);
                    if (-1 == l.indexOf(":"))
                        return isEditMode() ? alert(a.errorSelectionRange) : tooltip.info("", a.errorSelectionRange),
                        void e.val(t.jgridCurrentPivotInput);
                    l = l.split(":");
                    var u = []
                      , h = [];
                    return u[0] = parseInt(l[0].replace(/[^0-9]/g, "")) - 1,
                    u[1] = parseInt(l[1].replace(/[^0-9]/g, "")) - 1,
                    u[0] > u[1] ? (isEditMode() ? alert(a.errorSelectionRange) : tooltip.info("", a.errorSelectionRange),
                    void e.val(t.jgridCurrentPivotInput)) : (h[0] = ABCatNum(l[0].replace(/[^A-Za-z]/g, "")),
                    h[1] = ABCatNum(l[1].replace(/[^A-Za-z]/g, "")),
                    h[0] > h[1] ? (isEditMode() ? alert(a.errorSelectionRange) : tooltip.info(a.errorSelectionRange),
                    void e.val(t.jgridCurrentPivotInput)) : (sheetmanage.changeSheetExec(t.pivotSheetIndex),
                    t.setDatatojsfile("pivot_select_save", {
                        row: u,
                        column: h
                    }),
                    t.setDatatojsfile("pivotDataSheetIndex", i),
                    t.getCellData(t.pivotSheetIndex, i, {
                        row: u,
                        column: h
                    }),
                    t.initialPivotManage(),
                    $("#luckysheet-dialog-pivotTable-range").html(r),
                    $("#luckysheet-modal-dialog-slider-pivot").show(),
                    $("#luckysheet-data-pivotTable-selection").hide(),
                    t.luckysheet_pivotTable_select_state = !1,
                    t.refreshPivotTable(),
                    luckysheetsizeauto(),
                    void cleargridelement()))
                }
                )),
                $("#luckysheet-modal-dialog-slider-pivot").on("mousedown", ".luckysheet-slider-list-item-name, .luckysheet-modal-dialog-slider-config-item-txt", (function(e) {
                    var r = $(e.target);
                    t.movestate = !0,
                    t.movesave.obj = r.parent(),
                    t.movesave.name = r.data("name"),
                    t.movesave.containerid = r.parent().parent().attr("id"),
                    t.movesave.index = r.data("index"),
                    0 == $("#luckysheet-modal-dialog-slider-pivot-move").length && $("body").append('<div id="luckysheet-modal-dialog-slider-pivot-move">' + t.movesave.name + "</div>"),
                    t.movesave.width = $("#luckysheet-modal-dialog-slider-pivot-move").outerWidth(),
                    t.movesave.height = $("#luckysheet-modal-dialog-slider-pivot-move").outerHeight(),
                    $("#luckysheet-modal-dialog-pivotTable-list, #luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").css("cursor", "default")
                }
                )),
                $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").mousemove((function(e) {
                    if (t.movestate) {
                        0 == t.moveitemposition.length && (t.moveitemposition = [0],
                        $(this).find(".luckysheet-modal-dialog-slider-config-item").each((function(e) {
                            var r = $(this).outerHeight();
                            t.moveitemposition.push(t.moveitemposition[e] + r + 2)
                        }
                        )),
                        $(this).append('<div id="luckysheet-modal-dialog-config-order-help" style="position:absolute;height:3px;width:100%;background:#007ACC;z-index:1;pointer-events: none;user-select:none;"></div>')),
                        $("#luckysheet-modal-dialog-slider-pivot-move").css({
                            background: "#FD8585",
                            color: "#fff",
                            border: "1px solid #FD7070"
                        });
                        event.pageX;
                        var r = event.pageY
                          , a = $(this)
                          , n = r - a.offset().top + a.scrollTop()
                          , o = t.moveitemposition
                          , l = luckysheet_searcharray(o, n);
                        -1 == l ? $("#luckysheet-modal-dialog-config-order-help").css({
                            top: o[o.length - 1]
                        }) : n - o[l - 1] > (o[l] - o[l - 1]) / 2 ? $("#luckysheet-modal-dialog-config-order-help").css({
                            top: o[l]
                        }) : $("#luckysheet-modal-dialog-config-order-help").css({
                            top: o[l - 1]
                        })
                    }
                }
                )).mouseleave((function() {
                    t.movestate && ($("#luckysheet-modal-dialog-slider-pivot-move").css({
                        background: "#fff",
                        color: "#000",
                        border: "1px dotted #000"
                    }),
                    t.moveitemposition = [],
                    $("#luckysheet-modal-dialog-config-order-help").remove())
                }
                )).mouseup((function(e) {
                    if (t.movestate) {
                        var r, n = $(this);
                        if (t.movesave.containerid == n.attr("id"))
                            r = t.movesave.obj.clone();
                        else {
                            var o = t.movesave.name
                              , l = ""
                              , i = "";
                            if ("luckysheet-modal-dialog-config-value" == n.attr("id"))
                                "num" == t.pivot_data_type[t.movesave.index.toString()] ? (o = a.valueStatisticsSUM + ":" + o,
                                l = "data-sumtype='SUM'",
                                i = "data-nameindex='0'") : (o = a.valueStatisticsCOUNTA + ":" + o,
                                l = "data-sumtype='COUNTA'",
                                i = "data-nameindex='0'"),
                                $("#luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                                    if ($(this).find(".luckysheet-modal-dialog-slider-config-item-txt").text() == o) {
                                        var e = parseFloat($(this).data("nameindex")) + 1;
                                        return o += e.toString(),
                                        $(this).data("nameindex", e),
                                        !1
                                    }
                                }
                                ));
                            r = '<div title="' + o + '" class="luckysheet-modal-dialog-slider-config-item" ' + i + " " + l + ' data-index="' + t.movesave.index + '" data-name="' + t.movesave.name + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" ' + i + " " + l + ' data-index="' + t.movesave.index + '" data-name="' + t.movesave.name + '">' + o + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>'
                        }
                        event.pageX;
                        var s = event.pageY
                          , c = $(this)
                          , u = s - c.offset().top + c.scrollTop()
                          , h = t.moveitemposition
                          , d = luckysheet_searcharray(h, u);
                        ("luckysheet-modal-dialog-pivotTable-list" == t.movesave.containerid || "luckysheet-modal-dialog-config-value" == t.movesave.containerid && t.movesave.containerid != n.attr("id")) && $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                            $(this).data("index") == t.movesave.index && $(this).remove()
                        }
                        )),
                        -1 == d ? 0 == n.find(".luckysheet-modal-dialog-slider-config-item").length ? n.append(r) : n.find(".luckysheet-modal-dialog-slider-config-item").last().after(r) : u - h[d - 1] > (h[d] - h[d - 1]) / 2 ? n.find(".luckysheet-modal-dialog-slider-config-item").eq(d - 1).after(r) : n.find(".luckysheet-modal-dialog-slider-config-item").eq(d - 1).before(r),
                        "luckysheet-modal-dialog-pivotTable-list" == t.movesave.containerid || "luckysheet-modal-dialog-config-value" == t.movesave.containerid && t.movesave.containerid != n.attr("id") || t.movesave.obj.remove(),
                        $("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each((function() {
                            var e = $(this).find(".luckysheet-slider-list-item-selected");
                            $(this).data("index") == t.movesave.index && 0 == e.find("i").length && e.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                        }
                        )),
                        t.refreshPivotTable(),
                        $("#luckysheet-modal-dialog-slider-pivot-move").remove(),
                        t.movestate = !1,
                        $("#luckysheet-modal-dialog-pivotTable-list, #luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").css("cursor", "default"),
                        t.moveitemposition = [],
                        $("#luckysheet-modal-dialog-config-order-help").remove(),
                        t.showvaluecolrow(),
                        e.stopPropagation()
                    }
                }
                )),
                $("#luckysheet-modal-dialog-pivotTable-list").on("click", ".luckysheet-slider-list-item-selected", (function() {
                    var e, r = $(this), a = r.parent(), n = a.data("index"), o = a.data("name");
                    if (0 == r.find("i").length)
                        if (r.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>'),
                        "num" == t.pivot_data_type[n.toString()])
                            e = '<div title="' + o + '" class="luckysheet-modal-dialog-slider-config-item" data-nameindex="0" data-sumtype="SUM" data-index="' + n + '" data-name="' + o + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" data-nameindex="0" data-sumtype="SUM" data-index="' + n + '" data-name="' + o + '">求和:' + o + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>',
                            $("#luckysheet-modal-dialog-config-value").append(e);
                        else {
                            e = '<div title="' + o + '" class="luckysheet-modal-dialog-slider-config-item" data-index="' + n + '" data-name="' + o + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" data-index="' + n + '" data-name="' + o + '">' + o + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>';
                            var l = $("#luckysheet-modal-dialog-config-column")
                              , i = $("#luckysheet-modal-dialog-config-row")
                              , s = l.find(".luckysheet-modal-dialog-slider-config-item")
                              , c = i.find(".luckysheet-modal-dialog-slider-config-item");
                            s.length < 2 ? l.append(e) : c.length < 2 ? i.append(e) : l.append(e)
                        }
                    else
                        r.find("i").remove(),
                        $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                            $(this).data("index") == n && ("luckysheet-modal-dialog-config-value" == $(this).parent().attr("id") && t.resetOrderby($(this)),
                            $(this).remove())
                        }
                        ));
                    t.refreshPivotTable(),
                    t.showvaluecolrow()
                }
                )),
                $("#luckysheet-dialog-pivotTable-clearitem").click((function() {
                    $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                        $(this).remove()
                    }
                    )),
                    $("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each((function() {
                        $(this).find(".luckysheet-slider-list-item-selected").find("i").remove()
                    }
                    )),
                    t.refreshPivotTable(),
                    t.showvaluecolrow()
                }
                ))
            }
            null == e && (e = !1),
            t.celldata.length <= 1 && t.celldata[0].length <= 1 && (isEditMode() ? alert(a.errorIncreaseRange) : tooltip.info("", a.errorIncreaseRange));
            for (var i = "", s = 1, c = {}, u = 1, h = 0; h < t.celldata[0].length; h++) {
                var d = void 0;
                null != (d = t.celldata[0][h] && t.celldata[0][h].m ? t.celldata[0][h].m : getcellvalue(0, h, t.celldata)) && (d = d.toString()),
                null != d && 0 != $.trim(d.toString()).length || (d = a.titleColumn + " " + u),
                u++,
                d in c && (d += s++)in c && (d += s++)in c && (d += s++),
                c[d] = 1;
                var f = ""
                  , m = "";
                if (e && null != t.filterparm && null != t.filterparm[h.toString()]) {
                    var p = t.filterparm[h.toString()];
                    if (null != p.rowhidden && (f += "data-rowhidden='" + JSON.stringify(p.rowhidden) + "'"),
                    null != p.selected && (f += "data-selected='" + JSON.stringify(p.selected) + "'"),
                    null != p.caljs) {
                        var g = p.caljs;
                        null != g.value && (f += "data-byconditionvalue='" + g.value + "'"),
                        null != g.type && (f += "data-byconditiontype='" + g.type + "'"),
                        null != g.text && (f += "data-byconditiontext='" + g.text + "'"),
                        null != g.value1 && (f += "data-byconditionvalue1='" + g.value1 + "'"),
                        null != g.value2 && (f += "data-byconditionvalue2='" + g.value2 + "'")
                    }
                }
                f.length > 0 && (m = "display:block;"),
                i += '<div class="luckysheet-modal-dialog-slider-list-item" ' + f + ' data-index="' + h + '" data-name="' + d + '"><div title="' + a.titleAddColumn + '" class="luckysheet-slider-list-item-selected"><div></div></div><div title="' + a.titleMoveColumn + '" class="luckysheet-slider-list-item-name" ' + f + ' data-index="' + h + '" data-name="' + d + '">' + d + '</div><div title="' + a.titleClearColumnFilter + '" class="luckysheet-slider-list-item-filtered" style="' + m + '"><i class="fa fa-filter luckysheet-mousedown-cancel" aria-hidden="true"></i><i class="fa fa-times" aria-hidden="true"></i></div><div title="' + a.titleFilterColumn + '" class="luckysheet-slider-list-item-filter"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>'
            }
            if ($("#luckysheet-modal-dialog-pivotTable-list").html(i),
            $("#luckysheetpivottablevaluecolrowshow").hide(),
            $("#luckysheetpivottablevaluecolrow").prop("checked", !0),
            $("#luckysheetpivottablevaluecolrow1").prop("checked", !1),
            $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").empty(),
            e) {
                if (null != t.filter && t.filter.length > 0)
                    for (var y = 0; y < t.filter.length; y++) {
                        var v = t.filter[y]
                          , A = '<div title="' + name + '" class="luckysheet-modal-dialog-slider-config-item" data-index="' + v.index + '" data-name="' + v.name + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" data-index="' + v.index + '" data-name="' + v.name + '">' + v.name + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>';
                        $("#luckysheet-modal-dialog-config-filter").append(A);
                        var b = $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(v.index).find(".luckysheet-slider-list-item-selected");
                        0 == b.find("i").length && b.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                    }
                if (null != t.row && t.row.length > 0)
                    for (var k = 0; k < t.row.length; k++) {
                        var w = t.row[k]
                          , x = "";
                        null != w.order && (x += "data-order = '" + w.order + "'"),
                        null != w.orderby && (x += "data-orderby = '" + w.orderby + "'"),
                        null != w.order && (x += "data-stastic = '" + w.stastic + "'");
                        var S = '<div title="' + name + '" class="luckysheet-modal-dialog-slider-config-item" ' + x + ' data-index="' + w.index + '" data-name="' + w.name + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" ' + x + ' data-index="' + w.index + '" data-name="' + w.name + '">' + w.name + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>';
                        $("#luckysheet-modal-dialog-config-row").append(S);
                        var _ = $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(w.index).find(".luckysheet-slider-list-item-selected");
                        0 == _.find("i").length && _.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                    }
                if (null != t.column && t.column.length > 0)
                    for (var C = 0; C < t.column.length; C++) {
                        var T = t.column[C]
                          , E = "";
                        null != T.order && (E += "data-order = '" + T.order + "'"),
                        null != T.orderby && (E += "data-orderby = '" + T.orderby + "'"),
                        null != T.order && (E += "data-stastic = '" + T.stastic + "'");
                        var I = '<div title="' + name + '" class="luckysheet-modal-dialog-slider-config-item" ' + E + ' data-index="' + T.index + '" data-name="' + T.name + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" ' + E + ' data-index="' + T.index + '" data-name="' + T.name + '">' + T.name + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>';
                        $("#luckysheet-modal-dialog-config-column").append(I);
                        var R = $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(T.index).find(".luckysheet-slider-list-item-selected");
                        0 == R.find("i").length && R.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                    }
                if (null != t.values && t.values.length > 0) {
                    for (var B = 0; B < t.values.length; B++) {
                        var N = t.values[B]
                          , F = "";
                        null != N.sumtype && (F += "data-sumtype = '" + N.sumtype + "'"),
                        null != N.nameindex && (F += "data-nameindex = '" + N.nameindex + "'");
                        var P = '<div title="' + name + '" class="luckysheet-modal-dialog-slider-config-item" ' + F + ' data-index="' + N.index + '" data-name="' + N.name + '"><div class="luckysheet-modal-dialog-slider-config-item-txt" ' + F + ' data-index="' + N.index + '" data-name="' + N.name + '">' + t.getSumTypeName(N.sumtype) + ":" + N.name + '</div><div class="luckysheet-modal-dialog-slider-config-item-icon"><i class="fa fa-sort-desc" aria-hidden="true"></i></div></div>';
                        $("#luckysheet-modal-dialog-config-value").append(P);
                        var L = $("#luckysheet-modal-dialog-pivotTable-list .luckysheet-modal-dialog-slider-list-item").eq(N.index).find(".luckysheet-slider-list-item-selected");
                        0 == L.find("i").length && L.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                    }
                    t.values.length >= 2 && ($("#luckysheetpivottablevaluecolrowshow").show(),
                    "column" == t.showType ? ($("#luckysheetpivottablevaluecolrow").prop("checked", !0),
                    $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").addClass("ui-state-active"),
                    $("#luckysheetpivottablevaluecolrow1").prop("checked", !1),
                    $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").removeClass("ui-state-active")) : ($("#luckysheetpivottablevaluecolrow1").prop("checked", !0),
                    $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow1']").addClass("ui-state-active"),
                    $("#luckysheetpivottablevaluecolrow").prop("checked", !1),
                    $("#luckysheetpivottablevaluecolrowshow label[for='luckysheetpivottablevaluecolrow']").removeClass("ui-state-active")))
                }
            }
            $("#luckysheet-dialog-pivotTable-range").html(getRangetxt(t.pivotDataSheetIndex, t.pivot_select_save)),
            $("#luckysheet-modal-dialog-slider-pivot").show(),
            luckysheetsizeauto(!1)
        },
        getComposeArray: function(e) {
            if (0 == e.length)
                return [];
            for (var t = [], r = 0; r < e.length; r++) {
                for (var a = "", n = 0; n <= r; n++)
                    e[n] && e[n].m ? a += e[n].m : a += getcellvalue(n, null, e);
                t.push(a)
            }
            return t
        },
        getnameArray: function(e, t) {
            if (0 == e.length)
                return [];
            if (0 == t.length)
                return [];
            for (var r = [], a = 0; a < t.length; a++) {
                var n = void 0;
                n = e[t[a].index] && e[t[a].index].m ? e[t[a].index].m : getcellvalue(t[a].index, null, e),
                r.push(n)
            }
            return r
        },
        getTitleFromGroup: function(e, t, r) {
            var a = this.orderbygroup(e, t, r);
            return this.generategrouparraymain(a, t)
        },
        orderbygroup: function(e, t, r) {
            var a = [];
            if (0 == e.length)
                return [];
            for (var n = null, o = (a = e).length, l = a.length, i = 0; 0 != o; )
                if (o--,
                null != (n = a[i++]).children && n.children.length > 0) {
                    n.children = this.orderbygroupchildren(n.children, t[n.index].orderby, t[n.index].order, r);
                    for (var s = 0; s < n.children.length; s++)
                        a.push(n.children[s]),
                        o++
                }
            return e.splice(0, l)
        },
        orderbygroupchildren: function(e, t, r, a) {
            if (0 == e.length)
                return [];
            var n = !1;
            null != r && "asc" != r || (n = !0);
            var o = locale().filter;
            return n ? e.sort((function(e, r) {
                var n = null
                  , l = null;
                if ("self" == t || null == t) {
                    if (n = null == e.name ? o.valueBlank : e.name.toString(),
                    l = null == r.name ? o.valueBlank : r.name.toString(),
                    isdatetime(n) && isdatetime(l))
                        return diff(n, l)
                } else
                    n = parseFloat(a[e.orderby].result),
                    l = parseFloat(a[r.orderby].result);
                return isNaN(n) || isNaN(l) ? isNaN(n) && isNaN(l) ? n.localeCompare(l) : isNaN(n) ? 1 : isNaN(l) ? -1 : void 0 : numeral(n).value() - numeral(l).value()
            }
            )) : e.sort((function(e, r) {
                var n = null
                  , l = null;
                if ("self" == t || null == t) {
                    if (n = null == e.name ? o.valueBlank : e.name.toString(),
                    l = null == r.name ? o.valueBlank : r.name.toString(),
                    isdatetime(n) && isdatetime(l))
                        return diff(n, l)
                } else
                    n = parseFloat(a[e.orderby].result),
                    l = parseFloat(a[r.orderby].result);
                return isNaN(n) || isNaN(l) ? isNaN(n) && isNaN(l) ? l.localeCompare(n) : isNaN(n) ? -1 : isNaN(l) ? 1 : void 0 : numeral(l).value() - numeral(n).value()
            }
            ))
        },
        generategroupaddstatic: function(e, t) {
            for (var r = [], a = locale().pivotTable, n = 0; n < e[0].length; n++)
                0 == n ? t == a.valueSum ? r.push(t) : r.push({
                    name: t,
                    issum: !0
                }) : r.push("");
            return r
        },
        generategrouparraymain: function(e, t) {
            for (var r = [], a = 0; a < e.length; a++) {
                var n = e[a].name
                  , o = this.generategrouparray(e[a].children, t, 1);
                "1" != t[0].stastic && null != t[0].stastic || o.push(this.generategroupaddstatic(o, n)),
                r = r.concat(o)
            }
            return r
        },
        generategrouparray: function(e, t, r) {
            for (var a = [], n = 0; n < e.length; n++) {
                var o = e[n].name
                  , l = void 0;
                if (0 == e[n].children || 0 == e[n].children.length)
                    l = [o],
                    a.push(l);
                else {
                    l = this.generategrouparray(e[n].children, t, r + 1);
                    for (var i = 0; i < l.length; i++)
                        l[i].unshift(o);
                    "1" != t[r].stastic && null != t[r].stastic || l.push(this.generategroupaddstatic(l, o)),
                    a = a.concat(l)
                }
            }
            return a
        },
        addStatisticsData: function(e, t, r, a) {
            if (null == e[r] && (e[r] = {
                data: [],
                count: 0,
                max: -1 / 0,
                min: 1 / 0,
                counta: 0,
                countunique: 0,
                countuniquedata: {},
                sum: 0,
                digitaldata: [],
                sumtype: t.sumtype,
                index: t.index,
                name: t.fullname,
                acc: 0
            }),
            !0 === isdatatypemulti(a).num) {
                var n = numFormat$1(a);
                e[r].digitaldata.push(n),
                e[r].count += 1,
                e[r].sum += n,
                n > e[r].max && (e[r].max = n),
                n < e[r].min && (e[r].min = n);
                var o = numfloatlen(n);
                o > e[r].acc && (e[r].acc = o)
            }
            "" != a && (e[r].data.push(a),
            e[r].counta += 1,
            a in e[r].countuniquedata || (e[r].countuniquedata[a] = 1,
            e[r].countunique += 1))
        },
        dataHandler: function dataHandler(column, row, values, showType, celldata) {
            var _this = this
              , _locale = locale()
              , locale_filter = _locale.filter
              , locale_pivotTable = _locale.pivotTable;
            if (null == showType && (showType = "column"),
            0 == column.length && 0 == row.length && 0 == values.length || 0 == celldata.length)
                return _this.pivotDatas = [],
                [];
            for (var dataposition = {}, data = celldata, datarowtitle = [], datarowtitlegroup = [], datarowposition = {}, datacoltitle = [], datacoltitlegroup = [], datacolposition = {}, i = 1; i < data.length; i++) {
                var d = data[i]
                  , rowtitle = []
                  , rowtitlename = []
                  , coltitle = []
                  , coltitlename = [];
                rowtitlename = _this.getnameArray(d, row),
                coltitlename = _this.getnameArray(d, column),
                rowtitle = _this.getComposeArray(rowtitlename),
                coltitle = _this.getComposeArray(coltitlename),
                rowtitle.length > 0 && rowtitle.unshift(locale_pivotTable.valueSum),
                coltitle.length > 0 && coltitle.unshift(locale_pivotTable.valueSum);
                for (var curentLevelobj_row = datarowposition, curentLevelarr_row = datarowtitlegroup, r = 0; r < rowtitle.length; r++) {
                    var item = rowtitle[r]
                      , _name6 = 0 == r ? locale_pivotTable.valueSum : rowtitlename[r - 1];
                    if (null != curentLevelobj_row[r.toString()] && null != curentLevelobj_row[r.toString()][item])
                        curentLevelarr_row = curentLevelarr_row[curentLevelobj_row[r.toString()][item]].children;
                    else {
                        var orderby = 0 == r ? "self" : "self" == row[r - 1].orderby || null == row[r - 1].orderby ? item : "column" == showType ? item + values[parseInt(row[r - 1].orderby)].fullname : item + locale_pivotTable.valueSum;
                        null == _name6 && (_name6 = locale_filter.valueBlank),
                        curentLevelarr_row.push({
                            name: _name6,
                            fullname: item,
                            index: r,
                            orderby: orderby,
                            children: []
                        }),
                        null == curentLevelobj_row[r.toString()] && (curentLevelobj_row[r.toString()] = {}),
                        null == curentLevelobj_row[r.toString()][item] && (curentLevelobj_row[r.toString()][item] = curentLevelarr_row.length - 1),
                        curentLevelarr_row = curentLevelarr_row[curentLevelarr_row.length - 1].children
                    }
                }
                for (var curentLevelobj_col = datacolposition, curentLevelarr_col = datacoltitlegroup, _r2 = 0; _r2 < coltitle.length; _r2++) {
                    var _item4 = coltitle[_r2]
                      , _name7 = 0 == _r2 ? locale_pivotTable.valueSum : coltitlename[_r2 - 1];
                    if (null != curentLevelobj_col[_r2.toString()] && null != curentLevelobj_col[_r2.toString()][_item4])
                        curentLevelarr_col = curentLevelarr_col[curentLevelobj_col[_r2.toString()][_item4]].children;
                    else {
                        var _orderby = 0 == _r2 ? "self" : "self" == column[_r2 - 1].orderby || null == column[_r2 - 1].orderby ? _item4 : "column" == showType ? locale_pivotTable.valueSum + _item4 : values[parseInt(column[_r2 - 1].orderby)].fullname + _item4;
                        null == _name7 && (_name7 = locale_filter.valueBlank),
                        curentLevelarr_col.push({
                            name: _name7,
                            fullname: _item4,
                            index: _r2,
                            orderby: _orderby,
                            children: []
                        }),
                        null == curentLevelobj_col[_r2.toString()] && (curentLevelobj_col[_r2.toString()] = {}),
                        null == curentLevelobj_col[_r2.toString()][_item4] && (curentLevelobj_col[_r2.toString()][_item4] = curentLevelarr_col.length - 1),
                        curentLevelarr_col = curentLevelarr_col[curentLevelarr_col.length - 1].children
                    }
                }
                for (var v = 0; v < values.length; v++) {
                    var d_value = getcellvalue(values[v].index, null, d)
                      , coltitle_c = [].concat(coltitle)
                      , rowtitle_c = [].concat(rowtitle);
                    "column" == showType ? coltitle_c.length > 0 ? (coltitle_c.push(""),
                    coltitle_c = coltitle_c.join(values[v].fullname + "|||").split("|||").slice(0, coltitle_c.length - 1)) : coltitle_c.push(values[v].fullname) : rowtitle_c.length > 0 ? (rowtitle_c.push(""),
                    rowtitle_c = rowtitle_c.join(values[v].fullname + "|||").split("|||").slice(0, rowtitle_c.length - 1)) : rowtitle_c.push(values[v].fullname),
                    0 == coltitle_c.length && coltitle_c.push(""),
                    0 == rowtitle_c.length && rowtitle_c.push("");
                    for (var _r3 = 0; _r3 < rowtitle_c.length; _r3++)
                        for (var c = 0; c < coltitle_c.length; c++) {
                            var indicator = rowtitle_c[_r3] + coltitle_c[c];
                            _this.addStatisticsData(dataposition, values[v], indicator, d_value)
                        }
                }
            }
            for (var _indicator in dataposition) {
                var json = dataposition[_indicator];
                if ("SUM" == json.sumtype)
                    json.result = json.sum;
                else if ("COUNT" == json.sumtype)
                    json.result = json.count;
                else if ("COUNTA" == json.sumtype)
                    json.result = json.counta;
                else if ("COUNTUNIQUE" == json.sumtype)
                    json.result = json.countunique;
                else if ("AVERAGE" == json.sumtype)
                    json.result = numFormat$1(json.sum / json.count);
                else if ("MAX" == json.sumtype)
                    json.result = json.max;
                else if ("MIN" == json.sumtype)
                    json.result = json.min;
                else if ("MEDIAN" == json.sumtype) {
                    var numArr = json.digitaldata.sort((function(e, t) {
                        return e - t
                    }
                    ))
                      , numLen = numArr.length
                      , numindex = parseInt(numLen / 2);
                    json.result = numLen % 2 == 0 ? (numArr[numindex - 1] + numArr[numindex]) / 2 : numArr[numindex]
                } else if ("PRODUCT" == json.sumtype)
                    json.result = eval(json.digitaldata.join("*"));
                else if ("STDEV" == json.sumtype) {
                    var mean = json.sum / json.count;
                    json.result = analysis.STDEV(mean, json.digitaldata)
                } else if ("STDEVP" == json.sumtype) {
                    var _mean = json.sum / json.count;
                    json.result = analysis.STDEVP(_mean, json.digitaldata)
                } else if ("let" == json.sumtype) {
                    var _mean2 = json.sum / json.count;
                    json.result = analysis.let(_mean2, json.digitaldata)
                } else if ("VARP" == json.sumtype) {
                    var _mean3 = json.sum / json.count;
                    json.result = analysis.VARP(_mean3, json.digitaldata)
                }
                var newAcc = numfloatlen(json.result);
                newAcc > json.acc && (json.acc = newAcc),
                json.result = numFormat$1(json.result, json.acc)
            }
            if (datarowtitle = _this.getTitleFromGroup(datarowtitlegroup, row, dataposition),
            datacoltitle = _this.getTitleFromGroup(datacoltitlegroup, column, dataposition),
            "column" == showType)
                if (datacoltitle.length > 0 && datacoltitle[0].length > 0)
                    datacoltitle = _this.addValuesToTitle(datacoltitle, values);
                else
                    for (var _v3 = 0; _v3 < values.length; _v3++)
                        datacoltitle.push([values[_v3].fullname]);
            else if (datarowtitle.length > 0 && datarowtitle[0].length > 0)
                datarowtitle = _this.addValuesToTitle(datarowtitle, values);
            else
                for (var _v4 = 0; _v4 < values.length; _v4++)
                    datarowtitle.push([values[_v4].fullname]);
            var datacoltitle_index = datacoltitle;
            datacoltitle = luckysheetArray.transpose(datacoltitle, !1);
            for (var valuenslen = 0 == values.length ? 0 : 1, rowLen = (0 == datacoltitle.length ? valuenslen : datacoltitle.length) + (0 == datarowtitle.length ? valuenslen : datarowtitle.length), colLen = (0 == datacoltitle.length ? valuenslen : datacoltitle[0].length) + (0 == datarowtitle.length ? valuenslen : datarowtitle[0].length), rowOver = datacoltitle.length, colOver = 0 == datarowtitle.length ? 0 : datarowtitle[0].length, retdata = [], _r4 = 0; _r4 < rowLen; _r4++) {
                retdata[_r4] = new Array(colLen);
                for (var _c = 0; _c < colLen; _c++) {
                    var drt = datarowtitle[_r4 - rowOver];
                    if (_r4 < rowOver && _c < colOver)
                        retdata[_r4][_c] = "";
                    else if (_r4 < rowOver && _c >= colOver)
                        null != datacoltitle[_r4] ? "object" == getObjType(datacoltitle[_r4][_c - colOver]) ? retdata[_r4][_c] = datacoltitle[_r4][_c - colOver].name + locale_pivotTable.valueSum : retdata[_r4][_c] = datacoltitle[_r4][_c - colOver] : retdata[_r4][_c] = "";
                    else if (_r4 >= rowOver && _c < colOver)
                        null != drt ? "object" == getObjType(drt[_c]) ? retdata[_r4][_c] = drt[_c].name + locale_pivotTable.valueSum : retdata[_r4][_c] = drt[_c] : retdata[_r4][_c] = "";
                    else {
                        var prefix = "";
                        if (null != drt)
                            if (drt instanceof Array && 1 != drt.length)
                                for (var x = 0; x < drt.length; x++)
                                    "object" == getObjType(drt[x]) ? prefix += drt[x].name : prefix += drt[x];
                            else
                                prefix = drt instanceof Array ? drt[0] : drt;
                        var suffix = ""
                          , dct = datacoltitle_index[_c - colOver];
                        if (null != dct)
                            if (dct instanceof Array && 1 != dct.length)
                                for (var _x = 0; _x < dct.length; _x++)
                                    "object" == getObjType(dct[_x]) ? suffix += dct[_x].name : suffix += dct[_x];
                            else
                                suffix = dct instanceof Array ? dct[0] : dct;
                        var _indicator2 = prefix;
                        "" != prefix && "" != suffix ? _indicator2 = prefix + suffix : "" == prefix && (_indicator2 = suffix),
                        null == dataposition[_indicator2] ? retdata[_r4][_c] = "" : retdata[_r4][_c] = dataposition[_indicator2].result
                    }
                }
            }
            if (1 == values.length && column.length > 0 && row.length > 0)
                retdata[0][0] = values[0].fullname,
                retdata.splice(column.length, 1);
            else if (1 == values.length && column.length > 0) {
                for (var titleRow = retdata.splice(column.length, 1), newRetdata = [], _r5 = 0; _r5 < retdata.length; _r5++) {
                    var _row = [];
                    _r5 == retdata.length - 1 ? _row.push(titleRow[0][0]) : _row.push("");
                    for (var _c2 = 0; _c2 < retdata[_r5].length - 1; _c2++)
                        _row.push(retdata[_r5][_c2]);
                    newRetdata.push(_row)
                }
                retdata = newRetdata
            }
            return _this.pivotDatas = retdata,
            retdata
        },
        drillDown: function(e, t) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "usePivotTablereports")) {
                this.pivotDatas[e][t];
                for (var r = $.extend(!0, [], sheetmanage.nulldata), a = locale(), n = a.filter, o = a.pivotTable, l = 1, i = 0; i < this.celldata[0].length; i++) {
                    var s = void 0;
                    null != (s = this.celldata[0][i] && this.celldata[0][i].m ? this.celldata[0][i].m : getcellvalue(0, i, this.celldata)) && (s = s.toString()),
                    null != s && 0 != $.trim(s.toString()).length || (s = o.titleColumn + " " + l),
                    l++,
                    r[0][i] = s
                }
                var c = {};
                if (null != this.row && this.row.length > 0)
                    for (var u = 0; u < this.row.length; u++)
                        c[this.row[u].index] = this.pivotDatas[e][u];
                if (null != this.column && this.column.length > 0)
                    for (var h = 0; h < this.column.length; h++)
                        c[this.column[h].index] = this.pivotDatas[h][t];
                for (var d = [], f = 1; f < this.celldata.length; f++) {
                    var m = !0;
                    for (var p in c) {
                        var g = void 0;
                        if ((g = null != (g = this.celldata[f][p] && this.celldata[f][p].m ? this.celldata[f][p].m : getcellvalue(f, p, this.celldata)) ? g.toString() : n.valueBlank) != c[p]) {
                            m = !1;
                            break
                        }
                    }
                    m && d.push(f)
                }
                for (var y = 0; y < d.length; y++)
                    for (var v = 0; v < this.celldata[0].length; v++) {
                        var A = void 0;
                        A = null != (A = this.celldata[d[y]][v] && this.celldata[d[y]][v].m ? this.celldata[d[y]][v].m : getcellvalue(d[y], v, this.celldata)) ? A.toString() : "",
                        r[y + 1][v] = A
                    }
                Store.luckysheet_select_save = [{
                    row: [0, d.length],
                    column: [0, this.celldata[0].length - 1]
                }],
                Store.clearjfundo = !1,
                jfrefreshgrid(r, Store.luckysheet_select_save),
                selectHightlightShow(),
                Store.clearjfundo = !0
            }
        }
    };
    function luckysheetMoveEndCell(e, t, r, a, n) {
        null == r && (r = !0),
        e || (e = "down"),
        t || (t = "cell"),
        null == n && (n = !1);
        var o = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
          , l = null == o.row ? 0 : o.row[0]
          , i = null == o.column ? 0 : o.column[0]
          , s = null == o.row ? 0 : o.row[0]
          , c = null == o.column ? 0 : o.column[0]
          , u = null == o.row ? 0 : o.row[1]
          , h = null == o.column ? 0 : o.column[1];
        if (luckysheetformula.fucntionboxshow(l, i),
        "range" == t) {
            var d = Store.luckysheet_shiftpositon.row[0]
              , f = Store.luckysheet_shiftpositon.column[0]
              , m = Store.luckysheet_shiftpositon.row[1]
              , p = Store.luckysheet_shiftpositon.column[1];
            "down" == e || "up" == e ? m < u ? l = null == o.row ? 0 : o.row[1] : d > s ? l = null == o.row ? 0 : o.row[0] : m == u && d == s && (l = "down" == e ? null == o.row ? 0 : o.row[1] : null == o.row ? 0 : o.row[0]) : "right" != e && "left" != e || (p < h ? i = null == o.column ? 0 : o.column[1] : f > c ? i = null == o.column ? 0 : o.column[0] : p == h && f == c && (i = "right" == e ? null == o.column ? 0 : o.column[1] : null == o.column ? 0 : o.column[0]))
        }
        var g = Store.flowdata.length
          , y = Store.flowdata[0].length
          , v = Store.flowdata
          , A = ""
          , b = 0;
        if ("up" == e) {
            if (0 == l)
                return;
            for (var k = [], w = null, x = 0, S = null, _ = c; _ <= h; _++) {
                k = [],
                x = 0;
                for (var C = l - 1; C >= 0; C--) {
                    var T = v[C][_];
                    if ("object" == getObjType(T) && isRealNull(T.v) || isRealNull(T) ? k.push(!1) : k.push(!0),
                    k.length > 1) {
                        if (1 == k[x] && 0 == k[x - 1]) {
                            w = C;
                            break
                        }
                        if (0 == k[x] && 1 == k[x - 1]) {
                            w = C + 1;
                            break
                        }
                    }
                    x++
                }
                null == w && (w = 0),
                (null == S || w < S) && (S = w)
            }
            A = "down",
            b = S - l
        } else if ("down" == e) {
            if (l == g - 1)
                return;
            for (var E = [], I = null, R = 0, B = null, N = c; N <= h; N++) {
                E = [],
                R = 0;
                for (var F = l + 1; F < v.length; F++) {
                    var P = v[F][N];
                    if ("object" == getObjType(P) && isRealNull(P.v) || isRealNull(P) ? E.push(!1) : E.push(!0),
                    E.length > 1) {
                        if (1 == E[R] && 0 == E[R - 1]) {
                            I = F;
                            break
                        }
                        if (0 == E[R] && 1 == E[R - 1]) {
                            I = F - 1;
                            break
                        }
                    }
                    R++
                }
                null == I && (I = v.length - 1),
                (null == B || I > B) && (B = I)
            }
            A = "down",
            b = B - l
        } else if ("left" == e) {
            if (0 == i)
                return;
            for (var $ = [], L = null, O = 0, D = null, M = s; M <= u; M++) {
                $ = [],
                O = 0;
                for (var U = i - 1; U >= 0; U--) {
                    var H = v[M][U];
                    if ("object" == getObjType(H) && isRealNull(H.v) || isRealNull(H) ? $.push(!1) : $.push(!0),
                    $.length > 1) {
                        if (1 == $[O] && 0 == $[O - 1]) {
                            L = U;
                            break
                        }
                        if (0 == $[O] && 1 == $[O - 1]) {
                            L = U + 1;
                            break
                        }
                    }
                    O++
                }
                null == L && (L = 0),
                (null == D || L < D) && (D = L)
            }
            A = "right",
            b = D - i
        } else if ("right" == e) {
            if (i == y - 1)
                return;
            for (var q = [], z = null, j = 0, V = null, Q = s; Q <= u; Q++) {
                q = [],
                j = 0;
                for (var G = i + 1; G < v[0].length; G++) {
                    var K = v[Q][G];
                    if ("object" == getObjType(K) && isRealNull(K.v) || isRealNull(K) ? q.push(!1) : q.push(!0),
                    q.length > 1) {
                        if (1 == q[j] && 0 == q[j - 1]) {
                            z = G;
                            break
                        }
                        if (0 == q[j] && 1 == q[j - 1]) {
                            z = G - 1;
                            break
                        }
                    }
                    j++
                }
                null == z && (z = v[0].length - 1),
                (null == V || z > V) && (V = z)
            }
            A = "right",
            b = V - i
        }
        if ("range" == t && ("up" == e ? p_endR < u && b + l < p_endR && (b = p_endR - l) : "down" == e ? d > s && b + l > d && (b = d - l) : "left" == e ? p_endC < h && b + i < p_endC && (b = p_endC - i) : "right" == e && f > c && b + i > f && (b = f - i),
        null != a && Math.abs(b) > Math.abs(a) && (b = a)),
        n)
            return b;
        "cell" == t ? luckysheetMoveHighlightCell(A, b, "rangeOfSelect", r) : "range" == t && luckysheetMoveHighlightRange(A, b, "rangeOfSelect", r)
    }
    function luckysheetMoveHighlightCell(e, t, r, a) {
        null == a && (a = !0);
        var n, o, l, i, s, c, u, h, d = Store.flowdata.length, f = Store.flowdata[0].length;
        if ("rangeOfSelect" == r) {
            var m, p, g = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
            m = null == g.row_focus ? g.row[0] : g.row_focus,
            p = null == g.column_focus ? g.column[0] : g.column_focus;
            var y = menuButton.mergeborer(Store.flowdata, m, p);
            if (y) {
                var v = y.row[2]
                  , A = y.row[3]
                  , b = y.column[2]
                  , k = y.column[3];
                t > 0 ? "down" == e ? (m = A,
                p = b) : "right" == e && (m = v,
                p = k) : (m = v,
                p = b)
            }
            var w = null == g.moveXY ? m : g.moveXY.x
              , x = null == g.moveXY ? p : g.moveXY.y;
            "down" == e ? w = m += t : "right" == e && (x = p += t),
            m >= d && (w = m = d - 1),
            m < 0 && (w = m = 0),
            p >= f && (x = p = f - 1),
            p < 0 && (x = p = 0);
            var S = menuButton.mergeborer(Store.flowdata, m, p);
            S ? (n = S.row[1],
            o = S.row[0],
            l = S.row[2],
            i = S.row[3],
            s = S.column[1],
            c = S.column[0],
            u = S.column[2],
            h = S.column[3]) : (n = Store.visibledatarow[w],
            o = w - 1 == -1 ? 0 : Store.visibledatarow[w - 1],
            l = w,
            i = w,
            s = Store.visibledatacolumn[x],
            c = x - 1 == -1 ? 0 : Store.visibledatacolumn[x - 1],
            u = x,
            h = x),
            g.row = [l, i],
            g.column = [u, h],
            g.row_focus = l,
            g.column_focus = u,
            g.moveXY = {
                x: w,
                y: x
            },
            selectHightlightShow(),
            pivotTable.pivotclick(l, u),
            luckysheetformula.fucntionboxshow(l, u)
        } else if ("rangeOfFormula" == r) {
            var _, C, T = luckysheetformula.func_selectedrange;
            _ = null == T.row_focus ? T.row[0] : T.row_focus,
            C = null == T.column_focus ? T.column[0] : T.column_focus;
            var E = menuButton.mergeborer(Store.flowdata, _, C);
            if (E) {
                var I = E.row[2]
                  , R = E.row[3]
                  , B = E.column[2]
                  , N = E.column[3];
                t > 0 ? "down" == e ? (_ = R,
                C = B) : "right" == e && (_ = I,
                C = N) : (_ = I,
                C = B)
            }
            var F = null == T.moveXY ? _ : T.moveXY.x
              , P = null == T.moveXY ? C : T.moveXY.y;
            "down" == e ? F = _ += t : "right" == e && (P = C += t),
            _ >= d && (F = _ = d - 1),
            _ < 0 && (F = _ = 0),
            C >= f && (P = C = f - 1),
            C < 0 && (P = C = 0);
            var L = menuButton.mergeborer(Store.flowdata, _, C);
            L ? (n = L.row[1],
            o = L.row[0],
            l = L.row[2],
            i = L.row[3],
            s = L.column[1],
            c = L.column[0],
            u = L.column[2],
            h = L.column[3]) : (n = Store.visibledatarow[F],
            o = F - 1 == -1 ? 0 : Store.visibledatarow[F - 1],
            l = F,
            i = F,
            s = Store.visibledatacolumn[P],
            c = P - 1 == -1 ? 0 : Store.visibledatacolumn[P - 1],
            u = P,
            h = P),
            luckysheetformula.func_selectedrange = {
                left: c,
                width: s - c - 1,
                top: o,
                height: n - o - 1,
                left_move: c,
                width_move: s - c - 1,
                top_move: o,
                height_move: n - o - 1,
                row: [l, i],
                column: [u, h],
                row_focus: l,
                column_focus: u,
                moveXY: {
                    x: F,
                    y: P
                }
            },
            $("#luckysheet-formula-functionrange-select").css({
                left: c,
                width: s - c - 1,
                top: o,
                height: n - o - 1
            }).show(),
            luckysheetformula.rangeSetValue({
                row: [l, i],
                column: [u, h]
            })
        }
        var O = $("#luckysheet-cell-main").scrollLeft()
          , D = $("#luckysheet-cell-main").scrollTop()
          , M = $("#luckysheet-cell-main").height()
          , U = $("#luckysheet-cell-main").width()
          , H = 0
          , q = 0;
        s - O - U + 20 > 0 ? (H = s - U + 20,
        a && $("#luckysheet-scrollbar-x").scrollLeft(H)) : c - O - 20 < 0 && (H = c - 20,
        a && $("#luckysheet-scrollbar-x").scrollLeft(H)),
        n - D - M + 20 > 0 ? (q = n - M + 20,
        a && $("#luckysheet-scrollbar-y").scrollTop(q)) : o - D - 20 < 0 && (q = o - 20,
        a && $("#luckysheet-scrollbar-y").scrollTop(q)),
        clearTimeout(Store.countfuncTimeout),
        countfunc()
    }
    function luckysheetMoveHighlightCell2(e, t, r) {
        var a, n, o, l;
        if (r || (r = !0),
        "rangeOfSelect" == t) {
            var i = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , s = i.row_focus
              , c = i.column_focus
              , u = !1
              , h = {};
            if (null != Store.config.merge && s + "_" + c in Store.config.merge && (u = !0,
            h = Store.config.merge[s + "_" + c]),
            "down" == e) {
                if (s == Store.flowdata.length - 1)
                    return;
                s = getNextIndex("down", c, u ? h.r + h.rs - 1 : s, Store.flowdata.length - 1)
            } else if ("up" == e) {
                if (0 == s)
                    return;
                s = getNextIndex("up", c, 0, u ? h.r : s)
            } else if ("right" == e) {
                if (c == Store.flowdata[0].length - 1)
                    return;
                c = getNextIndex("right", s, u ? h.c + h.cs - 1 : c, Store.flowdata[0].length - 1)
            } else if ("left" == e) {
                if (0 == c)
                    return;
                c = getNextIndex("left", s, 0, u ? h.c : c)
            }
            var d = [s, s]
              , f = [c, c];
            a = Store.visibledatarow[s],
            n = s - 1 == -1 ? 0 : Store.visibledatarow[s - 1],
            o = Store.visibledatacolumn[c],
            l = c - 1 == -1 ? 0 : Store.visibledatacolumn[c - 1];
            var m = menuButton.mergeMoveMain(f, d, i, n, a - n - 1, l, o - l - 1);
            null != m && (f = m[0],
            d = m[1]),
            Store.luckysheet_select_save = [{
                row: d,
                column: f
            }],
            selectHightlightShow(),
            pivotTable.pivotclick(s, c),
            luckysheetformula.fucntionboxshow(s, c)
        } else if ("rangeOfFormula" == t) {
            var p = luckysheetformula.func_selectedrange
              , g = p.row_focus
              , y = p.column_focus
              , v = !1
              , A = {};
            if (null != Store.config.merge && g + "_" + y in Store.config.merge && (v = !0,
            A = Store.config.merge[g + "_" + y]),
            "down" == e) {
                if (g == Store.flowdata.length - 1)
                    return;
                g = getNextIndex("down", y, v ? A.r + A.rs - 1 : g, Store.flowdata.length - 1)
            } else if ("up" == e) {
                if (0 == g)
                    return;
                g = getNextIndex("up", y, 0, v ? A.r : g)
            } else if ("right" == e) {
                if (y == Store.flowdata[0].length - 1)
                    return;
                y = getNextIndex("right", g, v ? A.c + A.cs - 1 : y, Store.flowdata[0].length - 1)
            } else if ("left" == e) {
                if (0 == y)
                    return;
                y = getNextIndex("left", g, 0, v ? A.c : y)
            }
            var b = [g, g]
              , k = [y, y];
            a = Store.visibledatarow[g],
            n = g - 1 == -1 ? 0 : Store.visibledatarow[g - 1],
            o = Store.visibledatacolumn[y];
            var w = n
              , x = a - n - 1
              , S = l = y - 1 == -1 ? 0 : Store.visibledatacolumn[y - 1]
              , _ = o - l - 1
              , C = menuButton.mergeMoveMain(k, b, p, w, x, S, _);
            null != C && (k = C[0],
            b = C[1],
            w = C[2],
            x = C[3],
            S = C[4],
            _ = C[5]),
            luckysheetformula.func_selectedrange = {
                left: S,
                width: _,
                top: w,
                height: x,
                left_move: S,
                width_move: _,
                top_move: w,
                height_move: x,
                row: b,
                column: k,
                row_focus: g,
                column_focus: y
            },
            $("#luckysheet-formula-functionrange-select").css({
                left: S,
                width: _,
                top: w,
                height: x
            }).show(),
            luckysheetformula.rangeSetValue({
                row: b,
                column: k
            })
        }
        var T = $("#luckysheet-cell-main").scrollLeft()
          , E = $("#luckysheet-cell-main").scrollTop()
          , I = $("#luckysheet-cell-main").height()
          , R = $("#luckysheet-cell-main").width()
          , B = 0
          , N = 0;
        o - T - R + 20 > 0 ? (B = o - R + 20,
        r && $("#luckysheet-scrollbar-x").scrollLeft(B)) : l - T - 20 < 0 && (B = l - 20,
        r && $("#luckysheet-scrollbar-x").scrollLeft(B)),
        a - E - I + 20 > 0 ? (N = a - I + 20,
        r && $("#luckysheet-scrollbar-y").scrollTop(N)) : n - E - 20 < 0 && (N = n - 20,
        r && $("#luckysheet-scrollbar-y").scrollTop(N)),
        clearTimeout(Store.countfuncTimeout),
        countfunc()
    }
    function luckysheetMoveHighlightRange(e, t, r, a) {
        var n, o, l, i;
        if (null == a && (a = !0),
        "rangeOfSelect" == r) {
            var s = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , c = s.row[0]
              , u = s.row[1]
              , h = s.column[0]
              , d = s.column[1]
              , f = s.row_focus
              , m = s.column_focus
              , p = Store.flowdata.length
              , g = Store.flowdata[0].length;
            if ("down" == e) {
                if (rowHasMerge(f, h, d)) {
                    var y = getRowMerge(f, h, d)
                      , v = y[0]
                      , A = y[1];
                    v > c && A == u ? (t > 0 && rowHasMerge(c, h, d) && (c = getRowMerge(c, h, d)[1]),
                    c += t) : A < u && v == c ? (t < 0 && rowHasMerge(u, h, d) && (u = getRowMerge(u, h, d)[0]),
                    u += t) : t > 0 ? u += t : c += t
                } else
                    f > c && f == u ? (t > 0 && rowHasMerge(c, h, d) && (c = getRowMerge(c, h, d)[1]),
                    c += t) : f < u && f == c ? (t < 0 && rowHasMerge(u, h, d) && (u = getRowMerge(u, h, d)[0]),
                    u += t) : f == c && f == u && (t > 0 ? u += t : c += t);
                u >= p && (u = p - 1),
                u < 0 && (u = 0),
                c >= p && (c = p - 1),
                c < 0 && (c = 0)
            } else {
                if (colHasMerge(m, c, u)) {
                    var b = getColMerge(m, c, u)
                      , k = b[0]
                      , w = b[1];
                    k > h && w == d ? (t > 0 && colHasMerge(h, c, u) && (h = getColMerge(h, c, u)[1]),
                    h += t) : w < d && k == h ? (t < 0 && colHasMerge(d, c, u) && (d = getColMerge(d, c, u)[0]),
                    d += t) : t > 0 ? d += t : h += t
                } else
                    m > h && m == d ? (t > 0 && colHasMerge(h, c, u) && (h = getColMerge(h, c, u)[1]),
                    h += t) : m < d && m == h ? (t < 0 && colHasMerge(d, c, u) && (d = getColMerge(d, c, u)[0]),
                    d += t) : m == h && m == d && (t > 0 ? d += t : h += t);
                d >= g && (d = g - 1),
                d < 0 && (d = 0),
                h >= g && (h = g - 1),
                h < 0 && (h = 0)
            }
            var x = [c, u]
              , S = [h, d];
            n = Store.visibledatarow[u],
            o = c - 1 == -1 ? 0 : Store.visibledatarow[c - 1],
            l = Store.visibledatacolumn[d],
            i = h - 1 == -1 ? 0 : Store.visibledatacolumn[h - 1];
            var _ = menuButton.mergeMoveMain(S, x, s, o, n - o - 1, i, l - i - 1);
            null != _ && (S = _[0],
            x = _[1]),
            s.row = x,
            s.column = S,
            selectHightlightShow()
        } else if ("rangeOfFormula" == r) {
            var C = luckysheetformula.func_selectedrange
              , T = C.row[0]
              , E = C.row[1]
              , I = C.column[0]
              , R = C.column[1]
              , B = C.row_focus
              , N = C.column_focus
              , F = Store.flowdata.length
              , P = Store.flowdata[0].length;
            if ("down" == e) {
                if (rowHasMerge(B, I, R)) {
                    var L = getRowMerge(B, I, R)
                      , O = L[0]
                      , D = L[1];
                    O > T && D == E ? (t > 0 && rowHasMerge(T, I, R) && (T = getRowMerge(T, I, R)[1]),
                    T += t) : D < E && O == T ? (t < 0 && rowHasMerge(E, I, R) && (E = getRowMerge(E, I, R)[0]),
                    E += t) : t > 0 ? E += t : T += t
                } else
                    B > T && B == E ? (t > 0 && rowHasMerge(T, I, R) && (T = getRowMerge(T, I, R)[1]),
                    T += t) : B < E && B == T ? (t < 0 && rowHasMerge(E, I, R) && (E = getRowMerge(E, I, R)[0]),
                    E += t) : B == T && B == E && (t > 0 ? E += t : T += t);
                E >= F && (E = F - 1),
                E < 0 && (E = 0),
                T >= F && (T = F - 1),
                T < 0 && (T = 0)
            } else {
                if (colHasMerge(N, T, E)) {
                    var M = getColMerge(N, T, E)
                      , U = M[0]
                      , H = M[1];
                    U > I && H == R ? (t > 0 && colHasMerge(I, T, E) && (I = getColMerge(I, T, E)[1]),
                    I += t) : H < R && U == I ? (t < 0 && colHasMerge(R, T, E) && (R = getColMerge(R, T, E)[0]),
                    R += t) : t > 0 ? R += t : I += t
                } else
                    N > I && N == R ? (t > 0 && colHasMerge(I, T, E) && (I = getColMerge(I, T, E)[1]),
                    I += t) : N < R && N == I ? (t < 0 && colHasMerge(R, T, E) && (R = getColMerge(R, T, E)[0]),
                    R += t) : N == I && N == R && (t > 0 ? R += t : I += t);
                R >= P && (R = P - 1),
                R < 0 && (R = 0),
                I >= P && (I = P - 1),
                I < 0 && (I = 0)
            }
            var q = [T, E]
              , z = [I, R];
            n = Store.visibledatarow[E],
            o = T - 1 == -1 ? 0 : Store.visibledatarow[T - 1],
            l = Store.visibledatacolumn[R];
            var j = o
              , V = n - o - 1
              , Q = i = I - 1 == -1 ? 0 : Store.visibledatacolumn[I - 1]
              , G = l - i - 1
              , K = menuButton.mergeMoveMain(z, q, C, j, V, Q, G);
            null != K && (z = K[0],
            q = K[1],
            j = K[2],
            V = K[3],
            Q = K[4],
            G = K[5]),
            luckysheetformula.func_selectedrange = {
                left: Q,
                width: G,
                top: j,
                height: V,
                left_move: Q,
                width_move: G,
                top_move: j,
                height_move: V,
                row: q,
                column: z,
                row_focus: B,
                column_focus: N
            },
            $("#luckysheet-formula-functionrange-select").css({
                left: Q,
                width: G,
                top: j,
                height: V
            }).show(),
            luckysheetformula.rangeSetValue({
                row: q,
                column: z
            })
        }
        var W = $("#luckysheet-cell-main").scrollLeft()
          , Y = $("#luckysheet-cell-main").scrollTop()
          , X = $("#luckysheet-cell-main").height()
          , J = $("#luckysheet-cell-main").width()
          , Z = 0
          , ee = 0;
        l - W - J + 20 > 0 ? (Z = l - J + 20,
        a && $("#luckysheet-scrollbar-x").scrollLeft(Z)) : i - W - 20 < 0 && (Z = i - 20,
        a && $("#luckysheet-scrollbar-x").scrollLeft(Z)),
        n - Y - X + 20 > 0 ? (ee = n - X + 20,
        a && $("#luckysheet-scrollbar-y").scrollTop(ee)) : o - Y - 20 < 0 && (ee = o - 20,
        a && $("#luckysheet-scrollbar-y").scrollTop(ee)),
        clearTimeout(Store.countfuncTimeout),
        countfunc()
    }
    function luckysheetMoveHighlightRange2(e, t, r) {
        var a, n, o, l;
        if (r || (r = !0),
        "rangeOfSelect" == t) {
            var i = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , s = i.row_focus
              , c = i.column_focus
              , u = i.row[0]
              , h = i.row[1]
              , d = i.column[0]
              , f = i.column[1];
            if ("down" == e) {
                if (h == Store.flowdata.length - 1)
                    return;
                if (rowHasMerge(s, d, f)) {
                    var m = getRowMerge(s, d, f)
                      , p = m[0]
                      , g = m[1];
                    p > u && g == h ? u = getNextIndex("down", c, u, h) : h = getNextIndex("down", c, h, Store.flowdata.length - 1)
                } else
                    s > u && s == h ? u = getNextIndex("down", c, u, h) : h = getNextIndex("down", c, h, Store.flowdata.length - 1)
            } else if ("up" == e) {
                if (0 == u)
                    return;
                if (rowHasMerge(s, d, f)) {
                    var y = getRowMerge(s, d, f)
                      , v = y[0];
                    y[1] < h && v == u ? h = getNextIndex("up", c, u, h) : u = getNextIndex("up", c, 0, u)
                } else
                    s < h && s == u ? h = getNextIndex("up", c, u, h) : u = getNextIndex("up", c, 0, u)
            } else if ("right" == e) {
                if (f == Store.flowdata[0].length - 1)
                    return;
                if (colHasMerge(c, u, h)) {
                    var A = getColMerge(c, u, h)
                      , b = A[0]
                      , k = A[1];
                    b > d && k == f ? d = getNextIndex("right", s, d, f) : f = getNextIndex("right", s, f, Store.flowdata[0].length - 1)
                } else
                    c > d && c == f ? d = getNextIndex("right", s, d, f) : f = getNextIndex("right", s, f, Store.flowdata[0].length - 1)
            } else if ("left" == e) {
                if (0 == d)
                    return;
                if (colHasMerge(c, u, h)) {
                    var w = getColMerge(c, u, h)
                      , x = w[0];
                    w[1] < f && x == d ? f = getNextIndex("left", s, d, f) : d = getNextIndex("left", s, 0, d)
                } else
                    c < f && c == d ? f = getNextIndex("left", s, d, f) : d = getNextIndex("left", s, 0, d)
            }
            var S = [u, h]
              , _ = [d, f];
            a = Store.visibledatarow[h],
            n = u - 1 == -1 ? 0 : Store.visibledatarow[u - 1],
            o = Store.visibledatacolumn[f],
            l = d - 1 == -1 ? 0 : Store.visibledatacolumn[d - 1];
            var C = menuButton.mergeMoveMain(_, S, i, n, a - n - 1, l, o - l - 1);
            null != C && (_ = C[0],
            S = C[1]),
            i.row = S,
            i.column = _,
            selectHightlightShow()
        } else if ("rangeOfFormula" == t) {
            var T = luckysheetformula.func_selectedrange
              , E = T.row_focus
              , I = T.column_focus
              , R = T.row[0]
              , B = T.row[1]
              , N = T.column[0]
              , F = T.column[1];
            if ("down" == e) {
                if (B == Store.flowdata.length - 1)
                    return;
                if (rowHasMerge(E, N, F)) {
                    var P = getRowMerge(E, N, F)
                      , L = P[0]
                      , O = P[1];
                    L > R && O == B ? R = getNextIndex("down", I, R, B) : B = getNextIndex("down", I, B, Store.flowdata.length - 1)
                } else
                    E > R && E == B ? R = getNextIndex("down", I, R, B) : B = getNextIndex("down", I, B, Store.flowdata.length - 1)
            } else if ("up" == e) {
                if (0 == R)
                    return;
                if (rowHasMerge(E, N, F)) {
                    var D = getRowMerge(E, N, F)
                      , M = D[0];
                    D[1] < B && M == R ? B = getNextIndex("up", I, R, B) : R = getNextIndex("up", I, 0, R)
                } else
                    E < B && E == R ? B = getNextIndex("up", I, R, B) : R = getNextIndex("up", I, 0, R)
            } else if ("right" == e) {
                if (F == Store.flowdata[0].length - 1)
                    return;
                if (colHasMerge(I, R, B)) {
                    var U = getColMerge(I, R, B)
                      , H = U[0]
                      , q = U[1];
                    H > N && q == F ? N = getNextIndex("right", E, N, F) : F = getNextIndex("right", E, F, Store.flowdata[0].length - 1)
                } else
                    I > N && I == F ? N = getNextIndex("right", E, N, F) : F = getNextIndex("right", E, F, Store.flowdata[0].length - 1)
            } else if ("left" == e) {
                if (0 == N)
                    return;
                if (colHasMerge(I, R, B)) {
                    var z = getColMerge(I, R, B)
                      , j = z[0];
                    z[1] < F && j == N ? F = getNextIndex("left", E, N, F) : N = getNextIndex("left", E, 0, N)
                } else
                    I < F && I == N ? F = getNextIndex("left", E, N, F) : N = getNextIndex("left", E, 0, N)
            }
            var V = [R, B]
              , Q = [N, F];
            a = Store.visibledatarow[B],
            n = R - 1 == -1 ? 0 : Store.visibledatarow[R - 1],
            o = Store.visibledatacolumn[F];
            var G = n
              , K = a - n - 1
              , W = l = N - 1 == -1 ? 0 : Store.visibledatacolumn[N - 1]
              , Y = o - l - 1
              , X = menuButton.mergeMoveMain(Q, V, T, G, K, W, Y);
            null != X && (Q = X[0],
            V = X[1],
            G = X[2],
            K = X[3],
            W = X[4],
            Y = X[5]),
            luckysheetformula.func_selectedrange = {
                left: W,
                width: Y,
                top: G,
                height: K,
                left_move: W,
                width_move: Y,
                top_move: G,
                height_move: K,
                row: V,
                column: Q,
                row_focus: E,
                column_focus: I
            },
            $("#luckysheet-formula-functionrange-select").css({
                left: W,
                width: Y,
                top: G,
                height: K
            }).show(),
            luckysheetformula.rangeSetValue({
                row: V,
                column: Q
            })
        }
        var J = $("#luckysheet-cell-main").scrollLeft()
          , Z = $("#luckysheet-cell-main").scrollTop()
          , ee = $("#luckysheet-cell-main").height()
          , te = $("#luckysheet-cell-main").width()
          , re = 0
          , ae = 0;
        o - J - te + 20 > 0 ? (re = o - te + 20,
        r && $("#luckysheet-scrollbar-x").scrollLeft(re)) : l - J - 20 < 0 && (re = l - 20,
        r && $("#luckysheet-scrollbar-x").scrollLeft(re)),
        a - Z - ee + 20 > 0 ? (ae = a - ee + 20,
        r && $("#luckysheet-scrollbar-y").scrollTop(ae)) : n - Z - 20 < 0 && (ae = n - 20,
        r && $("#luckysheet-scrollbar-y").scrollTop(ae)),
        clearTimeout(Store.countfuncTimeout),
        countfunc()
    }
    function rowHasMerge(e, t, r) {
        for (var a = !1, n = t; n <= r; n++) {
            var o = Store.flowdata[e][n];
            if ("object" == getObjType(o) && "mc"in o) {
                a = !0;
                break
            }
        }
        return a
    }
    function colHasMerge(e, t, r) {
        for (var a = !1, n = t; n <= r; n++) {
            var o = Store.flowdata[n][e];
            if ("object" == getObjType(o) && "mc"in o) {
                a = !0;
                break
            }
        }
        return a
    }
    function getRowMerge(e, t, r) {
        var a = Store.flowdata.length - 1
          , n = null;
        if (e > 0)
            for (var o = e; o >= 0; o--) {
                for (var l = t; l <= r; l++) {
                    var i = Store.flowdata[o][l];
                    if ("object" == getObjType(i) && "mc"in i) {
                        var s = Store.config.merge[i.mc.r + "_" + i.mc.c];
                        (null == n || s.r < n) && (n = s.r)
                    }
                }
                if (!(rowHasMerge(n - 1, t, r) && n > 0))
                    break;
                o = n - 1
            }
        else
            n = 0;
        var c = null;
        if (e < a)
            for (var u = e; u <= a; u++) {
                for (var h = t; h <= r; h++) {
                    var d = Store.flowdata[u][h];
                    if ("object" == getObjType(d) && "mc"in d) {
                        var f = Store.config.merge[d.mc.r + "_" + d.mc.c];
                        (null == c || f.r + f.rs - 1 > c) && (c = f.r + f.rs - 1)
                    }
                }
                if (!(rowHasMerge(c + 1, t, r) && c < a))
                    break;
                u = c + 1
            }
        else
            c = a;
        return [n, c]
    }
    function getColMerge(e, t, r) {
        var a = Store.flowdata[0].length - 1
          , n = null;
        if (e > 0)
            for (var o = e; o >= 0; o--) {
                for (var l = t; l <= r; l++) {
                    var i = Store.flowdata[l][o];
                    if ("object" == getObjType(i) && "mc"in i) {
                        var s = Store.config.merge[i.mc.r + "_" + i.mc.c];
                        (null == n || s.c < n) && (n = s.c)
                    }
                }
                if (!(colHasMerge(n - 1, t, r) && n > 0))
                    break;
                o = n - 1
            }
        else
            n = 0;
        var c = null;
        if (e < a)
            for (var u = e; u <= a; u++) {
                for (var h = t; h <= r; h++) {
                    var d = Store.flowdata[h][u];
                    if ("object" == getObjType(d) && "mc"in d) {
                        var f = Store.config.merge[d.mc.r + "_" + d.mc.c];
                        (null == c || f.c + f.cs - 1 > c) && (c = f.c + f.cs - 1)
                    }
                }
                if (!(colHasMerge(c + 1, t, r) && c < a))
                    break;
                u = c + 1
            }
        else
            c = a;
        return [n, c]
    }
    function getNextIndex(e, t, r, a) {
        var n, o = null;
        if ("down" == e) {
            var l = Store.flowdata[r][t];
            n = !("object" != getObjType(l) || !isRealNull(l.v)) || !!isRealNull(l),
            console.log(n, "stNull");
            for (var i = [], s = 0, c = r + 1; c <= a; c++) {
                var u = Store.flowdata[c][t];
                if ("object" == getObjType(u) && isRealNull(u.v) || isRealNull(u) ? i.push(!0) : i.push(!1),
                1 == i.length && 1 == n && 0 == i[s]) {
                    o = r + s + 1;
                    break
                }
                if (i.length > 1) {
                    if (n && 0 == i[s]) {
                        o = r + s + 1;
                        break
                    }
                    if (!n) {
                        if (0 == i[s] && 1 == i[s - 1]) {
                            o = r + s + 1;
                            break
                        }
                        if (1 == i[s] && 0 == i[s - 1]) {
                            o = r + s;
                            break
                        }
                    }
                }
                c == a && (o = a),
                s++
            }
        } else if ("up" == e) {
            var h = Store.flowdata[a][t];
            n = !("object" != getObjType(h) || !isRealNull(h.v)) || !!isRealNull(h);
            for (var d = [], f = 0, m = a - 1; m >= r; m--) {
                var p = Store.flowdata[m][t];
                if ("object" == getObjType(p) && isRealNull(p.v) || isRealNull(p) ? d.push(!0) : d.push(!1),
                1 == d.length && n && 0 == d[f]) {
                    o = a - (f + 1);
                    break
                }
                if (d.length > 1) {
                    if (n && 0 == d[f]) {
                        o = a - (f + 1);
                        break
                    }
                    if (!n) {
                        if (0 == d[f] && 1 == d[f - 1]) {
                            o = a - (f + 1);
                            break
                        }
                        if (1 == d[f] && 0 == d[f - 1]) {
                            o = a - f;
                            break
                        }
                    }
                }
                m == r && (o = r),
                f++
            }
        } else if ("right" == e) {
            var g = Store.flowdata[t][r];
            n = !("object" != getObjType(g) || !isRealNull(g.v)) || !!isRealNull(g);
            for (var y = [], v = 0, A = r + 1; A <= a; A++) {
                var b = Store.flowdata[t][A];
                if ("object" == getObjType(b) && isRealNull(b.v) || isRealNull(b) ? y.push(!0) : y.push(!1),
                1 == y.length && n && 0 == y[v]) {
                    o = r + v + 1;
                    break
                }
                if (y.length > 1) {
                    if (n && 0 == y[v]) {
                        o = r + v + 1;
                        break
                    }
                    if (!n) {
                        if (0 == y[v] && 1 == y[v - 1]) {
                            o = r + v + 1;
                            break
                        }
                        if (1 == y[v] && 0 == y[v - 1]) {
                            o = r + v;
                            break
                        }
                    }
                }
                A == a && (o = a),
                v++
            }
        } else if ("left" == e) {
            var k = Store.flowdata[t][a];
            n = !("object" != getObjType(k) || !isRealNull(k.v)) || !!isRealNull(k);
            for (var w = [], x = 0, S = a - 1; S >= r; S--) {
                var _ = Store.flowdata[t][S];
                if ("object" == getObjType(_) && isRealNull(_.v) || isRealNull(_) ? w.push(!0) : w.push(!1),
                1 == w.length && n && 0 == w[x]) {
                    o = a - (x + 1);
                    break
                }
                if (w.length > 1) {
                    if (n && 0 == w[x]) {
                        o = a - (x + 1);
                        break
                    }
                    if (!n) {
                        if (0 == w[x] && 1 == w[x - 1]) {
                            o = a - (x + 1);
                            break
                        }
                        if (1 == w[x] && 0 == w[x - 1]) {
                            o = a - x;
                            break
                        }
                    }
                }
                S == r && (o = r),
                x++
            }
        }
        return o
    }
    var alternateformat = {
        rangefocus: !1,
        modelfocusIndex: null,
        FixedModelColor: [{
            head: {
                fc: "#000",
                bc: "#bfbdbe"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f8f3f7"
            },
            foot: {
                fc: "#000",
                bc: "#dde2de"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#4bd4e7"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#eaf7ff"
            },
            foot: {
                fc: "#000",
                bc: "#aae9f8"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#5ed593"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#e5fbee"
            },
            foot: {
                fc: "#000",
                bc: "#a5efcc"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#f6cb4b"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fff9e7"
            },
            foot: {
                fc: "#000",
                bc: "#ffebac"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#f96420"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#ffe5d9"
            },
            foot: {
                fc: "#000",
                bc: "#ffcfba"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#5599fc"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#ecf2fe"
            },
            foot: {
                fc: "#000",
                bc: "#afcbfa"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#22a69b"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#dff2f8"
            },
            foot: {
                fc: "#000",
                bc: "#8dd4d0"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#7a939a"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f0eff7"
            },
            foot: {
                fc: "#000",
                bc: "#bdcad0"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#d7a270"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fdf3f1"
            },
            foot: {
                fc: "#000",
                bc: "#ead2b6"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#89c54b"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f1f7e9"
            },
            foot: {
                fc: "#000",
                bc: "#c5e3a7"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#8f88f0"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f0e5ff"
            },
            foot: {
                fc: "#000",
                bc: "#c6c4f6"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#fd1664"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#feddee"
            },
            foot: {
                fc: "#000",
                bc: "#f98ab5"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#da96d3"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fce8fb"
            },
            foot: {
                fc: "#000",
                bc: "#f2caee"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#b49191"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f5ebe8"
            },
            foot: {
                fc: "#000",
                bc: "#d8c3c3"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#91b493"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f0fbf0"
            },
            foot: {
                fc: "#000",
                bc: "#b4cfb6"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#b4a891"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f8f6f1"
            },
            foot: {
                fc: "#000",
                bc: "#d3cab8"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#91abb4"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#eff7fa"
            },
            foot: {
                fc: "#000",
                bc: "#b7cbd3"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#b7ba82"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fafbeb"
            },
            foot: {
                fc: "#000",
                bc: "#dadcb4"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#df3e3e"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fde9e9"
            },
            foot: {
                fc: "#000",
                bc: "#f89292"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#f2711c"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#fef0d7"
            },
            foot: {
                fc: "#000",
                bc: "#fbb335"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#b5cc18"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f9fbd4"
            },
            foot: {
                fc: "#000",
                bc: "#e2ed2a"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#00b5ad"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#ccfaf9"
            },
            foot: {
                fc: "#000",
                bc: "#00e4df"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#2185d0"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#d8f3fc"
            },
            foot: {
                fc: "#000",
                bc: "#3cc4f0"
            }
        }, {
            head: {
                fc: "#000",
                bc: "#a5673f"
            },
            one: {
                fc: "#000",
                bc: "#ffffff"
            },
            two: {
                fc: "#000",
                bc: "#f6ede5"
            },
            foot: {
                fc: "#000",
                bc: "#d3a47c"
            }
        }],
        getModelBox: function(e, t) {
            $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-modelList").empty(),
            $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-modelCustom").empty();
            for (var r = "", a = 0; a < this.FixedModelColor.length; a++) {
                var n = this.FixedModelColor[a]
                  , o = void 0
                  , l = void 0
                  , i = void 0
                  , s = void 0;
                e && t ? (o = n.head,
                l = n.one,
                i = n.two,
                s = n.foot) : e ? (o = n.head,
                l = n.one,
                i = n.two,
                s = n.one) : t ? (o = n.one,
                l = n.two,
                i = n.one,
                s = n.foot) : (o = n.one,
                l = n.two,
                i = n.one,
                s = n.two),
                r += '<div class="modelbox"><div class="box"><span style="color:' + o.fc + ";background-color:" + o.bc + '"> — </span><span style="color:' + l.fc + ";background-color:" + l.bc + '"> — </span><span style="color:' + i.fc + ";background-color:" + i.bc + '"> — </span><span style="color:' + s.fc + ";background-color:" + s.bc + '"> — </span></div></div>'
            }
            $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-modelList").append(r);
            var c = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save_modelCustom;
            if (null != c && c.length > 0) {
                for (var u = "", h = 0; h < c.length; h++) {
                    var d = c[h]
                      , f = void 0
                      , m = void 0
                      , p = void 0
                      , g = void 0;
                    e && t ? (f = d.head,
                    m = d.one,
                    p = d.two,
                    g = d.foot) : e ? (f = d.head,
                    m = d.one,
                    p = d.two,
                    g = d.one) : t ? (f = d.one,
                    m = d.two,
                    p = d.one,
                    g = d.foot) : (f = d.one,
                    m = d.two,
                    p = d.one,
                    g = d.two),
                    u += '<div class="modelbox"><div class="box"><span style="color:' + f.fc + ";background-color:" + f.bc + '"> — </span><span style="color:' + m.fc + ";background-color:" + m.bc + '"> — </span><span style="color:' + p.fc + ";background-color:" + p.bc + '"> — </span><span style="color:' + g.fc + ";background-color:" + g.bc + '"> — </span></div></div>'
                }
                $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-modelCustom").append(u)
            }
        },
        init: function() {
            var e = this;
            $("#luckysheet-modal-dialog-slider-alternateformat").remove(),
            $("body").append(luckysheetAlternateformatHtml()),
            luckysheetsizeauto(),
            $("#luckysheet-modal-dialog-slider-alternateformat .luckysheet-model-close-btn").click((function() {
                $("#luckysheet-modal-dialog-slider-alternateformat").hide(),
                luckysheetsizeauto()
            }
            )),
            $(document).off("focus.AFrangeInput").on("focus.AFrangeInput", "#luckysheet-alternateformat-range input", (function() {
                e.rangefocus = !0
            }
            )),
            $(document).off("blur.AFrangeInput").on("blur.AFrangeInput", "#luckysheet-alternateformat-range input", (function() {
                e.rangefocus = !1
            }
            )),
            $(document).off("keydown.AFrangeInput").on("keydown.AFrangeInput", "#luckysheet-alternateformat-range input", (function(t) {
                $(this).val().trim();
                13 == t.keyCode && e.update()
            }
            )),
            $(document).off("click.AFrangeIcon").on("click.AFrangeIcon", "#luckysheet-alternateformat-range .fa-table", (function() {
                $("#luckysheet-modal-dialog-slider-alternateformat").hide(),
                luckysheetsizeauto();
                var t = $(this).parents("#luckysheet-alternateformat-range").find("input").val().trim();
                e.rangeDialog(t)
            }
            )),
            $(document).off("click.AFrDCf").on("click.AFrDCf", "#luckysheet-alternateformat-rangeDialog-confirm", (function() {
                var t = $(this).parents("#luckysheet-alternateformat-rangeDialog").find("input").val().trim();
                $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-range input").val(t),
                $(this).parents("#luckysheet-alternateformat-rangeDialog").hide(),
                $("#luckysheet-modal-dialog-slider-alternateformat").show(),
                luckysheetsizeauto(),
                e.update()
            }
            )),
            $(document).off("click.AFrDCl").on("click.AFrDCl", "#luckysheet-alternateformat-rangeDialog-close", (function() {
                $(this).parents("#luckysheet-alternateformat-rangeDialog").hide(),
                $("#luckysheet-modal-dialog-slider-alternateformat").show(),
                luckysheetsizeauto()
            }
            )),
            $(document).off("click.AFrDTitle").on("click.AFrDTitle", "#luckysheet-alternateformat-rangeDialog .luckysheet-modal-dialog-title-close", (function() {
                $(this).parents("#luckysheet-alternateformat-rangeDialog").hide(),
                $("#luckysheet-modal-dialog-slider-alternateformat").show(),
                luckysheetsizeauto()
            }
            )),
            $(document).off("change.AFrowHeader").on("change.AFrowHeader", "#luckysheet-alternateformat-rowHeader", (function() {
                var t, r;
                t = !!$(this).is(":checked"),
                r = !!$("#luckysheet-alternateformat-rowFooter").is(":checked"),
                e.checkboxChange(t, r),
                e.modelboxOn(),
                e.update()
            }
            )),
            $(document).off("change.AFrowFooter").on("change.AFrowFooter", "#luckysheet-alternateformat-rowFooter", (function() {
                var t, r;
                t = !!$("#luckysheet-alternateformat-rowHeader").is(":checked"),
                r = !!$(this).is(":checked"),
                e.checkboxChange(t, r),
                e.modelboxOn(),
                e.update()
            }
            )),
            $(document).off("click.AFmodelbox").on("click.AFmodelbox", "#luckysheet-modal-dialog-slider-alternateformat .modelbox", (function() {
                var t = $(this).index()
                  , r = $(this).parents(".cf").attr("id");
                if ("luckysheet-alternateformat-modelList" == r)
                    e.modelfocusIndex = t;
                else if ("luckysheet-alternateformat-modelCustom" == r) {
                    var a = e.FixedModelColor.length;
                    e.modelfocusIndex = t + a
                }
                e.modelboxOn(),
                e.update()
            }
            )),
            $(document).off("click.AFselectColor").on("click.AFselectColor", "#luckysheet-modal-dialog-slider-alternateformat .luckysheet-color-menu-button-indicator", (function() {
                var t, r, a, n = $(this).closest(".toningbox");
                $(this).find(".luckysheet-icon-img").hasClass("luckysheet-icon-text-color") ? (t = "fc",
                r = n.find(".toningShow").data("fc")) : $(this).find(".luckysheet-icon-img").hasClass("luckysheet-icon-cell-color") && (t = "bc",
                r = n.find(".toningShow").data("bc")),
                n.hasClass("header") ? a = "0" : n.hasClass("ctOne") ? a = "1" : n.hasClass("ctTwo") ? a = "2" : n.hasClass("footer") && (a = "3"),
                e.colorSelectDialog(r, t, a)
            }
            )),
            $(document).off("click.AFselectColorConfirm").on("click.AFselectColorConfirm", "#luckysheet-alternateformat-colorSelect-dialog-confirm", (function() {
                var t = $(this).parents("#luckysheet-alternateformat-colorSelect-dialog")
                  , r = locale().alternatingColors;
                $("#luckysheet-modal-dialog-mask").hide(),
                t.hide();
                var a, n = t.find(".currenColor span").attr("title");
                t.find(".luckysheet-modal-dialog-title-text").text() == r.selectionTextColor ? a = "fc" : t.find(".luckysheet-modal-dialog-title-text").text() == r.selectionCellColor && (a = "bc");
                var o, l, i = t.find(".currenColor").attr("data-source");
                "0" == i ? ("fc" == a && ($("#luckysheet-alternateformat-modelToning .header .toningShow").css("color", n),
                $("#luckysheet-alternateformat-modelToning .header .toningShow").data("fc", n),
                $("#luckysheet-alternateformat-modelToning .header .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n)),
                "bc" == a && ($("#luckysheet-alternateformat-modelToning .header .toningShow").css("background-color", n),
                $("#luckysheet-alternateformat-modelToning .header .toningShow").data("bc", n),
                $("#luckysheet-alternateformat-modelToning .header .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n))) : "1" == i ? ("fc" == a && ($("#luckysheet-alternateformat-modelToning .ctOne .toningShow").css("color", n),
                $("#luckysheet-alternateformat-modelToning .ctOne .toningShow").data("fc", n),
                $("#luckysheet-alternateformat-modelToning .ctOne .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n)),
                "bc" == a && ($("#luckysheet-alternateformat-modelToning .ctOne .toningShow").css("background-color", n),
                $("#luckysheet-alternateformat-modelToning .ctOne .toningShow").data("bc", n),
                $("#luckysheet-alternateformat-modelToning .ctOne .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n))) : "2" == i ? ("fc" == a && ($("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").css("color", n),
                $("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").data("fc", n),
                $("#luckysheet-alternateformat-modelToning .ctTwo .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n)),
                "bc" == a && ($("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").css("background-color", n),
                $("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").data("bc", n),
                $("#luckysheet-alternateformat-modelToning .ctTwo .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n))) : "3" == i && ("fc" == a && ($("#luckysheet-alternateformat-modelToning .footer .toningShow").css("color", n),
                $("#luckysheet-alternateformat-modelToning .footer .toningShow").data("fc", n),
                $("#luckysheet-alternateformat-modelToning .footer .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n)),
                "bc" == a && ($("#luckysheet-alternateformat-modelToning .footer .toningShow").css("background-color", n),
                $("#luckysheet-alternateformat-modelToning .footer .toningShow").data("bc", n),
                $("#luckysheet-alternateformat-modelToning .footer .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", n))),
                o = !!$("#luckysheet-alternateformat-rowHeader").is(":checked"),
                l = !!$("#luckysheet-alternateformat-rowFooter").is(":checked");
                var s, c, u = e.modelfocusIndex, h = e.FixedModelColor.length;
                if (u < h)
                    s = $.extend(!0, {}, e.getFormatByIndex());
                else {
                    var d = (c = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]).luckysheet_alternateformat_save_modelCustom;
                    s = $.extend(!0, {}, d[u - h])
                }
                "0" == i ? "fc" == a ? s.head.fc = n : "bc" == a && (s.head.bc = n) : "1" == i ? "fc" == a ? s.one.fc = n : "bc" == a && (s.one.bc = n) : "2" == i ? "fc" == a ? s.two.fc = n : "bc" == a && (s.two.bc = n) : "3" == i && ("fc" == a && (s.foot.fc = n),
                "bc" == a && (s.foot.bc = n)),
                e.modelfocusIndex < h ? (e.addCustomModel(s),
                e.modelfocusIndex = e.getIndexByFormat(s)) : (c.luckysheet_alternateformat_save_modelCustom[u - h] = s,
                server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, c.luckysheet_alternateformat_save_modelCustom, {
                    k: "luckysheet_alternateformat_save_modelCustom"
                })),
                e.getModelBox(o, l),
                e.modelboxOn(),
                e.update()
            }
            )),
            $(document).off("click.AFremove").on("click.AFremove", "#luckysheet-alternateformat-remove", (function() {
                var t = $(this).data("index")
                  , r = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save
                  , a = $.extend(!0, [], r);
                r.length > 1 ? r.splice(t, 1) : r = [];
                var n = $.extend(!0, [], r);
                e.ref(a, n),
                server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, r, {
                    k: "luckysheet_alternateformat_save"
                }),
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-modal-dialog-slider-alternateformat").hide(),
                luckysheetsizeauto()
            }
            ))
        },
        perfect: function() {
            var e = $.extend(!0, {}, Store.luckysheet_select_save[0])
              , t = this.rangeIsExists(e)[1]
              , r = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save[t])
              , a = r.cellrange;
            $("#luckysheet-alternateformat-range input").val(getRangetxt(Store.currentSheetIndex, {
                row: a.row,
                column: a.column
            }, Store.currentSheetIndex)),
            Store.luckysheet_select_save = [{
                row: a.row,
                column: a.column
            }],
            selectHightlightShow();
            var n = r.hasRowHeader
              , o = r.hasRowFooter
              , l = r.format;
            this.modelfocusIndex = this.getIndexByFormat(l),
            null == this.modelfocusIndex && (this.addCustomModel(l),
            this.modelfocusIndex = this.getIndexByFormat(l)),
            this.checkboxChange(n, o),
            this.modelboxOn(),
            $("#luckysheet-alternateformat-remove").data("index", t)
        },
        checkboxChange: function(e, t) {
            e ? ($("#luckysheet-alternateformat-rowHeader").prop("checked", !0),
            $("#luckysheet-alternateformat-modelToning .header").show()) : ($("#luckysheet-alternateformat-rowHeader").removeAttr("checked"),
            $("#luckysheet-alternateformat-modelToning .header").hide()),
            t ? ($("#luckysheet-alternateformat-rowFooter").prop("checked", !0),
            $("#luckysheet-alternateformat-modelToning .footer").show()) : ($("#luckysheet-alternateformat-rowFooter").removeAttr("checked"),
            $("#luckysheet-alternateformat-modelToning .footer").hide()),
            this.getModelBox(e, t)
        },
        modelboxOn: function() {
            $("#luckysheet-modal-dialog-slider-alternateformat .modelbox").removeClass("on");
            var e = this.modelfocusIndex
              , t = this.FixedModelColor.length;
            e < t ? $("#luckysheet-alternateformat-modelList .modelbox").eq(e).addClass("on") : $("#luckysheet-alternateformat-modelCustom .modelbox").eq(e - t).addClass("on"),
            this.modelToningColor()
        },
        modelToningColor: function() {
            var e = this.getFormatByIndex();
            $("#luckysheet-alternateformat-modelToning .header .toningShow").css({
                color: e.head.fc,
                "background-color": e.head.bc
            }),
            $("#luckysheet-alternateformat-modelToning .header .toningShow").data("fc", e.head.fc).data("bc", e.head.bc),
            $("#luckysheet-alternateformat-modelToning .header .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.head.fc),
            $("#luckysheet-alternateformat-modelToning .header .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.head.bc),
            $("#luckysheet-alternateformat-modelToning .ctOne .toningShow").css({
                color: e.one.fc,
                "background-color": e.one.bc
            }),
            $("#luckysheet-alternateformat-modelToning .ctOne .toningShow").data("fc", e.one.fc).data("bc", e.one.bc),
            $("#luckysheet-alternateformat-modelToning .ctOne .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.one.fc),
            $("#luckysheet-alternateformat-modelToning .ctOne .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.one.bc),
            $("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").css({
                color: e.two.fc,
                "background-color": e.two.bc
            }),
            $("#luckysheet-alternateformat-modelToning .ctTwo .toningShow").data("fc", e.two.fc).data("bc", e.two.bc),
            $("#luckysheet-alternateformat-modelToning .ctTwo .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.two.fc),
            $("#luckysheet-alternateformat-modelToning .ctTwo .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.two.bc),
            $("#luckysheet-alternateformat-modelToning .footer .toningShow").css({
                color: e.foot.fc,
                "background-color": e.foot.bc
            }),
            $("#luckysheet-alternateformat-modelToning .footer .toningShow").data("fc", e.foot.fc).data("bc", e.foot.bc),
            $("#luckysheet-alternateformat-modelToning .footer .luckysheet-icon-text-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.foot.fc),
            $("#luckysheet-alternateformat-modelToning .footer .luckysheet-icon-cell-color").parents(".luckysheet-color-menu-button-indicator").css("border-bottom-color", e.foot.bc)
        },
        addCustomModel: function(e) {
            var t = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
            null == t.luckysheet_alternateformat_save_modelCustom && (t.luckysheet_alternateformat_save_modelCustom = []),
            t.luckysheet_alternateformat_save_modelCustom.push(e),
            server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, t.luckysheet_alternateformat_save_modelCustom, {
                k: "luckysheet_alternateformat_save_modelCustom"
            })
        },
        colorSelectDialog: function(e, t, r) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-alternateformat-colorSelect-dialog").remove();
            var a, n = locale(), o = n.alternatingColors, l = n.button, i = n.toolbar;
            "fc" == t ? a = o.selectionTextColor : "bc" == t && (a = o.selectionCellColor),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-alternateformat-colorSelect-dialog",
                addclass: "luckysheet-alternateformat-colorSelect-dialog",
                title: a,
                content: "<div class='currenColor' data-source='" + r + "'>" + o.currentColor + "：<span title='" + e + "' style='background-color:" + e + "'></span></div><div class='colorshowbox'></div>",
                botton: '<button id="luckysheet-alternateformat-colorSelect-dialog-confirm" class="btn btn-primary">' + l.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + l.cancel + "</button>",
                style: "z-index:100003"
            }));
            var s = $("#luckysheet-alternateformat-colorSelect-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , c = s.outerHeight()
              , u = s.outerWidth()
              , h = $(window).width()
              , d = $(window).height()
              , f = $(document).scrollLeft()
              , m = $(document).scrollTop();
            $("#luckysheet-alternateformat-colorSelect-dialog").css({
                left: (h + f - u) / 2,
                top: (d + m - c) / 3
            }).show(),
            $("#luckysheet-alternateformat-colorSelect-dialog").find(".colorshowbox").spectrum({
                showPalette: !0,
                showPaletteOnly: !0,
                preferredFormat: "hex",
                clickoutFiresChange: !1,
                showInitial: !0,
                showInput: !0,
                flat: !0,
                hideAfterPaletteSelect: !0,
                showSelectionPalette: !0,
                showButtons: !1,
                maxPaletteSize: 8,
                maxSelectionSize: 8,
                color: e,
                cancelText: l.cancel,
                chooseText: i.confirmColor,
                togglePaletteMoreText: i.customColor,
                togglePaletteLessText: i.collapse,
                togglePaletteOnly: !0,
                clearText: i.clearText,
                noColorSelectedText: i.noColorSelectedText,
                localStorageKey: "spectrum.textcolor" + server.gridKey,
                palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                move: function(e) {
                    e = null != e ? e.toHexString() : "#000",
                    $("#luckysheet-alternateformat-colorSelect-dialog .currenColor span").css("background-color", e).attr("title", e)
                }
            })
        },
        rangeDialog: function(e) {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-alternateformat-rangeDialog").remove();
            var t = locale()
              , r = t.alternatingColors
              , a = t.button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-alternateformat-rangeDialog",
                addclass: "luckysheet-alternateformat-rangeDialog",
                title: r.selectRange,
                content: '<input readonly="readonly" placeholder="' + r.tipSelectRange + '" value="' + e + '"/>',
                botton: '<button id="luckysheet-alternateformat-rangeDialog-confirm" class="btn btn-primary">' + a.confirm + '</button><button id="luckysheet-alternateformat-rangeDialog-close" class="btn btn-default">' + a.cancel + "</button>",
                style: "z-index:100003"
            }));
            var n = $("#luckysheet-alternateformat-rangeDialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-alternateformat-rangeDialog").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show()
        },
        rangeIsExists: function(e, t) {
            var r = !1
              , a = null
              , n = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save);
            if (null != t && null != t && (n.length > 1 ? n.splice(t, 1) : n = []),
            n.length > 0) {
                for (var o = [], l = 0; l < n.length; l++) {
                    var i = {
                        index: l,
                        map: this.getRangeMap(n[l].cellrange.row, n[l].cellrange.column)
                    };
                    o.push(i)
                }
                var s = this.getRangeMap(e.row, e.column);
                for (var c in s) {
                    if (r)
                        break;
                    for (var u = 0; u < o.length; u++)
                        if (c in o[u].map) {
                            r = !0,
                            a = o[u].index;
                            break
                        }
                }
            }
            return [r, a]
        },
        getRangeMap: function(e, t) {
            for (var r = {}, a = e[0], n = e[1], o = t[0], l = t[1], i = a; i <= n; i++)
                for (var s = o; s <= l; s++)
                    r[i + "_" + s] = 0;
            return r
        },
        getIndexByFormat: function(e) {
            for (var t = null, r = this.FixedModelColor, a = 0; a < r.length; a++) {
                var n = r[a];
                if (e.head.fc == n.head.fc && e.head.bc == n.head.bc && e.one.fc == n.one.fc && e.one.bc == n.one.bc && e.two.fc == n.two.fc && e.two.bc == n.two.bc && e.foot.fc == n.foot.fc && e.foot.bc == n.foot.bc) {
                    t = a;
                    break
                }
            }
            var o = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save_modelCustom;
            if (null != o && o.length > 0)
                for (var l = 0; l < o.length; l++) {
                    var i = o[l];
                    if (e.head.fc == i.head.fc && e.head.bc == i.head.bc && e.one.fc == i.one.fc && e.one.bc == i.one.bc && e.two.fc == i.two.fc && e.two.bc == i.two.bc && e.foot.fc == i.foot.fc && e.foot.bc == i.foot.bc) {
                        t = r.length + l;
                        break
                    }
                }
            return t
        },
        getFormatByIndex: function() {
            var e = this.modelfocusIndex
              , t = this.FixedModelColor.length;
            return e < t ? this.FixedModelColor[e] : Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save_modelCustom[e - t]
        },
        new: function(e) {
            var t = this.getFormatByIndex()
              , r = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save;
            null == r && (r = []);
            var a = $.extend(!0, [], r)
              , n = {
                cellrange: {
                    row: e.row,
                    column: e.column
                },
                format: t,
                hasRowHeader: !0,
                hasRowFooter: !1
            };
            r.push(n);
            var o = $.extend(!0, [], r);
            this.ref(a, o),
            server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, r, {
                k: "luckysheet_alternateformat_save"
            })
        },
        update: function() {
            var e = locale().alternatingColors
              , t = $("#luckysheet-alternateformat-remove").data("index")
              , r = $("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-range input").val().trim();
            if (luckysheetformula.iscelldata(r)) {
                var a = luckysheetformula.getcellrange(r);
                if (this.rangeIsExists(a, t)[0])
                    isEditMode() ? alert(e.errorExistColors) : tooltip.info(e.errorExistColors, "");
                else {
                    var n, o;
                    n = !!$("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-rowHeader").is(":checked"),
                    o = !!$("#luckysheet-modal-dialog-slider-alternateformat #luckysheet-alternateformat-rowFooter").is(":checked");
                    var l = this.getFormatByIndex()
                      , i = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save;
                    null == i && (i = []);
                    var s = $.extend(!0, [], i)
                      , c = {
                        cellrange: {
                            row: a.row,
                            column: a.column
                        },
                        format: l,
                        hasRowHeader: n,
                        hasRowFooter: o
                    };
                    i[t] = c;
                    var u = $.extend(!0, [], i);
                    this.ref(s, u),
                    server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, i, {
                        k: "luckysheet_alternateformat_save"
                    })
                }
            } else
                isEditMode() ? alert(e.errorNoRange) : tooltip.info(e.errorNoRange, "")
        },
        checksAF: function(e, t, r) {
            return e + "_" + t in r ? r[e + "_" + t] : null
        },
        getComputeMap: function() {
            var e = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_alternateformat_save;
            return this.compute(e)
        },
        compute: function(e) {
            var t = {};
            if (null != e && e.length > 0)
                for (var r = 0; r < e.length; r++) {
                    var a = e[r].cellrange
                      , n = e[r].format
                      , o = e[r].hasRowHeader
                      , l = e[r].hasRowFooter
                      , i = a.row[0]
                      , s = a.row[1]
                      , c = a.column[0]
                      , u = a.column[1];
                    if (o && l) {
                        for (var h = c; h <= u; h++)
                            t[i + "_" + h] = [n.head.fc, n.head.bc];
                        if (s - i > 1)
                            for (var d = i + 1; d < s; d++) {
                                var f = void 0
                                  , m = void 0;
                                (d - i) % 2 != 0 ? (f = n.one.fc,
                                m = n.one.bc) : (f = n.two.fc,
                                m = n.two.bc);
                                for (var p = c; p <= u; p++)
                                    t[d + "_" + p] = [f, m]
                            }
                        if (s > i)
                            for (var g = c; g <= u; g++)
                                t[s + "_" + g] = [n.foot.fc, n.foot.bc]
                    } else if (o) {
                        for (var y = c; y <= u; y++)
                            t[i + "_" + y] = [n.head.fc, n.head.bc];
                        if (s > i)
                            for (var v = i + 1; v <= s; v++) {
                                var A = void 0
                                  , b = void 0;
                                (v - i) % 2 != 0 ? (A = n.one.fc,
                                b = n.one.bc) : (A = n.two.fc,
                                b = n.two.bc);
                                for (var k = c; k <= u; k++)
                                    t[v + "_" + k] = [A, b]
                            }
                    } else if (l) {
                        if (s > i)
                            for (var w = i; w < s; w++) {
                                var x = void 0
                                  , S = void 0;
                                (w - i) % 2 == 0 ? (x = n.one.fc,
                                S = n.one.bc) : (x = n.two.fc,
                                S = n.two.bc);
                                for (var _ = c; _ <= u; _++)
                                    t[w + "_" + _] = [x, S]
                            }
                        for (var C = c; C <= u; C++)
                            t[s + "_" + C] = [n.foot.fc, n.foot.bc]
                    } else
                        for (var T = i; T <= s; T++) {
                            var E = void 0
                              , I = void 0;
                            (T - i) % 2 == 0 ? (E = n.one.fc,
                            I = n.one.bc) : (E = n.two.fc,
                            I = n.two.bc);
                            for (var R = c; R <= u; R++)
                                t[T + "_" + R] = [E, I]
                        }
                }
            return t
        },
        ref: function(e, t) {
            if (Store.clearjfundo) {
                Store.jfundo = [];
                var r = {
                    type: "updateAF"
                };
                r.sheetIndex = Store.currentSheetIndex,
                r.data = {
                    historyRules: e,
                    currentRules: t
                },
                Store.jfredo.push(r)
            }
            var a = getSheetIndex(Store.currentSheetIndex);
            Store.luckysheetfile[a].luckysheet_alternateformat_save = t,
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        }
    }
      , json = {
        parseJsonParm: function parseJsonParm(obj) {
            if (null == obj)
                return {};
            if ("string" != getObjType(obj))
                return obj;
            try {
                var _json = eval("(" + obj + ")");
                return _json
            } catch (e) {
                return {}
            }
        },
        hasKey: function(e) {
            var t = this.parseJsonParm(e);
            for (var r in t)
                return !0;
            return !1
        }
    };
    function labelFilterOptionState(e, t, r, a, n, o, l, i, s, c) {
        if (t ? (e.addClass("luckysheet-filter-options-active").data("rowhidden", JSON.stringify(r)).data("caljs", JSON.stringify(a)).html('<i class="fa fa-filter luckysheet-mousedown-cancel" aria-hidden="true"></i>'),
        null != a && (e.data("byconditionvalue", a.value).data("byconditiontype", a.type).data("byconditiontext", a.text),
        null != a.value1 && e.data("byconditionvalue1", a.value1),
        null != a.value2 && e.data("byconditionvalue2", a.value2))) : (e.removeClass("luckysheet-filter-options-active").data("rowhidden", "").data("caljs", "").html('<i class="fa fa-caret-down luckysheet-mousedown-cancel" aria-hidden="true"></i>'),
        e.data("byconditionvalue", "null").data("byconditiontype", "0").data("byconditiontext", "无").data("byconditionvalue1", "").data("byconditionvalue2", "")),
        n) {
            var u = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
            if (null == u.filter && (u.filter = {}),
            t) {
                var h = {
                    caljs: a,
                    rowhidden: r,
                    optionstate: t,
                    str: o,
                    edr: l,
                    cindex: i,
                    stc: s,
                    edc: c
                };
                u.filter[i - s] = h
            } else
                delete u.filter[i - s];
            server.saveParam("all", Store.currentSheetIndex, u.filter, {
                k: "filter"
            })
        }
    }
    function orderbydatafiler(e, t, r, a, n, o) {
        for (var l = editor.deepCopyFlowData(Store.flowdata), i = !1, s = [], c = e += 1; c <= r; c++) {
            for (var u = [], h = t; h <= a; h++) {
                if (null != l[c][h] && null != l[c][h].mc) {
                    i = !0;
                    break
                }
                u.push(l[c][h])
            }
            s.push(u)
        }
        if (i) {
            var d = locale().filter;
            isEditMode() ? alert(d.mergeError) : tooltip.info(d.mergeError, "")
        } else {
            s = orderbydata(s, n - t, o);
            for (var f = e; f <= r; f++)
                for (var m = t; m <= a; m++)
                    l[f][m] = s[f - e][m - t];
            var p = {};
            if (null != Store.config.rowlen) {
                var g = $.extend(!0, {}, Store.config);
                p = {
                    cfg: g = rowlenByRange(l, e, r, g),
                    RowlChange: !0
                }
            }
            jfrefreshgrid(l, [{
                row: [e, r],
                column: [t, a]
            }], p)
        }
    }
    function createFilter() {
        if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "filter"))
            if (Store.luckysheet_select_save.length > 1) {
                $("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
                $("#" + Store.container).attr("tabindex", 0).focus();
                var e = locale().splitText;
                isEditMode() ? alert(e.tipNoMulti) : tooltip.info(e.tipNoMulti, "")
            } else if (!Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].isPivotTable) {
                $("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex + ", #luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove();
                var t = Store.luckysheet_select_save[0];
                if (t.row[0] == t.row[1] && t.column[0] == t.column[1]) {
                    for (var r, a, n = t.row[1], o = 0; o < Store.flowdata[n].length; o++) {
                        var l = Store.flowdata[n][o];
                        if (null == l || isRealNull(l.v)) {
                            if (null != r) {
                                a = o - 1;
                                break
                            }
                        } else
                            null == r && (r = o)
                    }
                    null == a && (a = Store.flowdata[n].length - 1),
                    Store.luckysheet_select_save = [{
                        row: [n, n],
                        column: [r, a]
                    }],
                    selectHightlightShow(),
                    Store.luckysheet_shiftpositon = $.extend(!0, {}, t),
                    luckysheetMoveEndCell("down", "range")
                } else
                    t.row[1] - t.row[0] < 2 && (Store.luckysheet_shiftpositon = $.extend(!0, {}, t),
                    luckysheetMoveEndCell("down", "range"));
                Store.luckysheet_filter_save = $.extend(!0, {}, Store.luckysheet_select_save[0]),
                createFilterOptions(Store.luckysheet_filter_save),
                server.saveParam("all", Store.currentSheetIndex, Store.luckysheet_filter_save, {
                    k: "filter_select"
                }),
                Store.filterchage && Store.jfredo.push({
                    type: "filtershow",
                    data: [],
                    curdata: [],
                    sheetIndex: Store.currentSheetIndex,
                    filter_save: Store.luckysheet_filter_save
                })
            }
    }
    function createFilterOptions(e, t) {
        if ($("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex).remove(),
        $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove(),
        null != e && "{}" != JSON.stringify(e)) {
            var r = e.row[0]
              , a = e.row[1]
              , n = e.column[0]
              , o = e.column[1]
              , l = Store.visibledatarow[a]
              , i = r - 1 == -1 ? 0 : Store.visibledatarow[r - 1]
              , s = Store.visibledatacolumn[o]
              , c = n - 1 == -1 ? 0 : Store.visibledatacolumn[n - 1]
              , u = '<div id="luckysheet-filter-selected-sheet' + Store.currentSheetIndex + '" class="luckysheet-cell-selected luckysheet-filter-selected"  style="left:' + c + "px;width:" + (s - c - 1) + "px;top:" + i + "px;height:" + (l - i - 1) + 'px;display:block;border-color:#897BFF;z-index:20;background:none;"></div>';
            $("#luckysheet-cell-main").append(u);
            for (var h = "", d = n; d <= o; d++)
                if (null == t || null == t[d - n])
                    h += '<div data-rowhidden="" data-str="' + r + '" data-edr="' + a + '" data-cindex="' + d + '" data-stc="' + n + '" data-edc="' + o + '" class="luckysheet-filter-options" style="left:' + (Store.visibledatacolumn[d] - 20) + "px;top:" + i + 'px;display:block;"><i class="fa fa-caret-down" aria-hidden="true"></i></div>';
                else {
                    var f = void 0;
                    if (null != t[d - n].caljs) {
                        var m = void 0;
                        m = null != t[d - n].caljs.value1 ? 'data-byconditionvalue1="' + t[d - n].caljs.value1 + '" ' : "";
                        var p = void 0;
                        p = null != t[d - n].caljs.value2 ? 'data-byconditionvalue2="' + t[d - n].caljs.value2 + '" ' : "",
                        f = 'data-caljs="' + JSON.stringify(t[d - n].caljs) + '" data-byconditionvalue="' + t[d - n].caljs.value + '" data-byconditiontype="' + t[d - n].caljs.type + '" data-byconditiontext="' + t[d - n].caljs.text + '" ' + m + p
                    } else
                        f = "";
                    h += '<div data-rowhidden="' + JSON.stringify(t[d - n].rowhidden).replace(/\"/g, "'") + '" ' + f + ' data-str="' + r + '" data-edr="' + a + '" data-cindex="' + d + '" data-stc="' + n + '" data-edc="' + o + '" class="luckysheet-filter-options luckysheet-filter-options-active" style="left:' + (Store.visibledatacolumn[d] - 20) + "px;top:" + i + 'px;display:block;"><i class="fa fa-filter luckysheet-mousedown-cancel" aria-hidden="true"></i></div>'
                }
            $("#luckysheet-cell-main").append('<div id="luckysheet-filter-options-sheet' + Store.currentSheetIndex + '" class="luckysheet-filter-options-c">' + h + "</div>"),
            $("#luckysheet-rightclick-menu").hide(),
            $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
            $("#luckysheet-cell-main").scrollTop() > e.top_move && $("#luckysheet-scrollbar-y").scrollTop(e.top_move),
            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].filter_select = e
        }
    }
    function initialFilterHandler() {
        var e = null
          , t = locale()
          , r = t.filter
          , a = t.button;
        $("#luckysheetfilter").click(createFilter);
        var n = null
          , o = null;
        $(".luckysheet-cols-menu .luckysheet-cols-submenu").hover((function() {
            var e = $(this)
              , t = e.attr("id")
              , r = $("#" + t + "_sub")
              , a = e.parent()
              , n = $(window).width()
              , l = $(window).height()
              , i = a.width()
              , s = r.height() + 25
              , c = r.width() + 5
              , u = e.offset()
              , h = u.top
              , d = u.left + i;
            d + c > n && (d = u.left - c),
            h + s > l && (h = l - s),
            r.css({
                top: h,
                left: d
            }).show(),
            o = e
        }
        ), (function() {
            var e = $(this).attr("id")
              , t = $("#" + e + "_sub");
            n = setTimeout((function() {
                t.hide()
            }
            ), 200)
        }
        )),
        $(".luckysheet-rightgclick-menu-sub").hover((function() {
            o.addClass("luckysheet-cols-menuitem-hover"),
            clearTimeout(n)
        }
        ), (function() {
            o.removeClass("luckysheet-cols-menuitem-hover"),
            $(this).hide()
        }
        )),
        $("#luckysheet-filter-menu").mouseover((function() {
            clearTimeout(e),
            e = setTimeout((function() {
                $("#luckysheet-filter-submenu").hide()
            }
            ), 500)
        }
        )),
        $("#luckysheet-filter-submenu").mouseover((function() {
            clearTimeout(e)
        }
        )).find(".luckysheet-cols-menuitem").click((function(e) {
            $("#luckysheet-filter-selected span").html($(this).find(".luckysheet-cols-menuitem-content").text()).data("value", $(this).data("value")),
            $("#luckysheet-filter-menu .luckysheet-filter-selected-input").hide();
            var t = $(this).data("type")
              , r = $(this).attr("data-value");
            "2" == t ? ($("#luckysheet-filter-selected span").data("type", "2"),
            $("#luckysheet-filter-menu .luckysheet-filter-selected-input2").show(),
            $("#luckysheet-filter-menu .luckysheet-filter-selected-input input").prop("type", "number")) : "0" == t ? $("#luckysheet-filter-selected span").data("type", "0") : ($("#luckysheet-filter-selected span").data("type", "1"),
            $("#luckysheet-filter-menu .luckysheet-filter-selected-input").eq(0).show(),
            "dateequal" == r || "datelessthan" == r || "datemorethan" == r ? $("#luckysheet-filter-menu .luckysheet-filter-selected-input input").prop("type", "date") : "morethan" == r || "moreequalthan" == r || "lessthan" == r || "lessequalthan" == r || "equal" == r || "noequal" == r ? $("#luckysheet-filter-menu .luckysheet-filter-selected-input input").prop("type", "number") : $("#luckysheet-filter-menu .luckysheet-filter-selected-input input").prop("type", "text")),
            $("#luckysheet-filter-byvalue").next().slideUp(),
            $("#luckysheet-filter-submenu").hide()
        }
        )),
        $("#luckysheet-filter-bycondition, #luckysheet-filter-byvalue").click((function() {
            var e = $(this);
            e.next().slideToggle(200),
            setTimeout((function() {
                "luckysheet-filter-bycondition" == e.attr("id") && $("#luckysheet-filter-bycondition").next().is(":visible") && $("#luckysheet-filter-selected span").text() != r.filiterInputNone && $("#luckysheet-filter-byvalue").next().slideUp(200),
                e.is($("#luckysheet-filter-bycondition")) && $("#luckysheet-filter-bycondition").next().is(":hidden") && $("#luckysheet-filter-byvalue").next().is(":hidden") && $("#luckysheet-filter-byvalue").next().slideDown(200)
            }
            ), 300)
        }
        )),
        $("#luckysheet-filter-selected").click((function() {
            var t = $(this).offset()
              , r = $("#luckysheet-filter-submenu");
            r.hide();
            var a = $(window).height()
              , n = $(window).width()
              , o = r.width()
              , l = (r.height(),
            t.top)
              , i = t.left
              , s = a - t.top - 20;
            t.left + o > n && (i = t.left - o),
            t.top > a / 2 && ((l = a - t.top) < 0 && (l = 0),
            s = t.top - 20),
            r.css({
                top: l,
                left: i,
                height: s
            }).show(),
            clearTimeout(e)
        }
        )),
        $("#luckysheet-cell-main").on("click", ".luckysheet-filter-options", (function(e) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "filter")) {
                var t = $(e.currentTarget)
                  , a = t.offset()
                  , n = $("#luckysheet-filter-menu")
                  , o = $(window).height()
                  , l = ($(window).width(),
                t.data("str"))
                  , i = t.data("edr")
                  , s = t.data("cindex")
                  , c = t.data("stc")
                  , u = t.data("edc")
                  , h = "" == t.data("rowhidden") ? {} : JSON.parse(t.data("rowhidden").replace(/\'/g, '"'));
                $("body .luckysheet-cols-menu").hide(),
                $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
                $("#luckysheet-filter-byvalue-input").val(""),
                $("#luckysheet-filter-bycondition").next().hide(),
                $("#luckysheet-filter-byvalue").next().show(),
                n.data("str", l),
                n.data("edr", i),
                n.data("cindex", s),
                n.data("stc", c),
                n.data("edc", u),
                $("#luckysheet-filter-menu .luckysheet-filter-selected-input").hide().find("input").val(),
                $("#luckysheet-filter-selected span").data("type", "0").data("type", null).text(r.filiterInputNone);
                var d = t.data("byconditiontype");
                if ($("#luckysheet-filter-selected span").data("value", t.data("byconditionvalue")).data("type", d).text(t.data("byconditiontext")),
                "2" == d) {
                    var f = $("#luckysheet-filter-menu .luckysheet-filter-selected-input2").show().find("input");
                    f.eq(0).val(t.data("byconditionvalue1")),
                    f.eq(1).val(t.data("byconditionvalue2"))
                } else
                    "1" == d && $("#luckysheet-filter-menu .luckysheet-filter-selected-input").eq(0).show().find("input").val(t.data("byconditionvalue1"));
                $("#luckysheet-filter-orderby-asc").off("click").on("click", (function() {
                    orderbydatafiler(l, c, i, u, s, !0)
                }
                )),
                $("#luckysheet-filter-orderby-desc").off("click").on("click", (function() {
                    orderbydatafiler(l, c, i, u, s, !1)
                }
                )),
                $("#luckysheet-filter-byvalue-select").empty().html('<div style="width:100%;text-align:center;position:relative;top:45%;font-size:14px;"><div class="luckysheetLoaderGif"></div><span>' + r.filiterMoreDataTip + "</span></div>");
                var m = {};
                return $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").not(this).each((function() {
                    var e = $(this).data("rowhidden");
                    if ("" == e)
                        return !0;
                    for (var t in e = JSON.parse(e.replace(/\'/g, '"')))
                        m[t] = 0
                }
                )),
                setTimeout((function() {
                    for (var e = {}, t = {}, n = {}, c = {}, u = l + 1; u <= i; u++)
                        if (!(u in m) && null != Store.flowdata[u]) {
                            var d = Store.flowdata[u][s];
                            if (null == d || isRealNull(d.v) || null == d.ct || "d" != d.ct.t) {
                                var f = void 0
                                  , p = void 0;
                                null == d || isRealNull(d.v) ? (f = null,
                                p = null) : (f = d.v,
                                p = d.m),
                                f in n || (n[f] = {}),
                                p in n[f] || (n[f][p] = 0),
                                n[f][p]++,
                                u in h && (c[f + "#$$$#" + p] = 0)
                            } else {
                                var g = update("YYYY-MM-DD", d.v)
                                  , y = g.split("-")[0]
                                  , v = g.split("-")[1]
                                  , A = g.split("-")[2];
                                y in e || (e[y] = {}),
                                v in e[y] || (e[y][v] = {}),
                                A in e[y][v] || (e[y][v][A] = 0),
                                e[y][v][A]++,
                                u in h && (t[y] = 0,
                                t[v] = 0,
                                t[A] = 0)
                            }
                        }
                    var b = [];
                    if (JSON.stringify(e).length > 2)
                        for (var k in e) {
                            var w = 0
                              , x = "";
                            for (var S in e[k]) {
                                var _ = 0
                                  , C = "";
                                for (var T in e[k][S]) {
                                    var E = e[k][S][T];
                                    _ += E;
                                    var I = void 0;
                                    I = Number(S) < 10 ? "0" + Number(S) : S;
                                    var R = void 0;
                                    R = Number(T) < 10 ? "0" + Number(T) : T,
                                    C += k in t && S in t && T in t ? '<div class="day luckysheet-mousedown-cancel cf" data-check="false" title="' + k + "-" + I + "-" + R + '"><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + T + '</label><span class="count luckysheet-mousedown-cancel">( ' + E + " )</span></div>" : '<div class="day luckysheet-mousedown-cancel cf" data-check="true" title="' + k + "-" + I + "-" + R + '"><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + T + '</label><span class="count luckysheet-mousedown-cancel">( ' + E + " )</span></div>"
                                }
                                w += _;
                                var B = void 0;
                                B = Number(S) < 10 ? "0" + Number(S) : S,
                                x += k in t && S in t ? '<div class="monthBox luckysheet-mousedown-cancel"><div class="month luckysheet-mousedown-cancel cf" data-check="false" title="' + k + "-" + B + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + S + r.filiterMonthText + '</label><span class="count luckysheet-mousedown-cancel">( ' + _ + ' )</span></div><div class="dayList luckysheet-mousedown-cancel">' + C + "</div></div>" : '<div class="monthBox luckysheet-mousedown-cancel"><div class="month luckysheet-mousedown-cancel cf" data-check="true" title="' + k + "-" + B + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + S + r.filiterMonthText + '</label><span class="count luckysheet-mousedown-cancel">( ' + _ + ' )</span></div><div class="dayList luckysheet-mousedown-cancel">' + C + "</div></div>"
                            }
                            var N = void 0;
                            N = k in t ? '<div class="yearBox luckysheet-mousedown-cancel"><div class="year luckysheet-mousedown-cancel cf" data-check="false" title="' + k + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + k + r.filiterYearText + '</label><span class="count luckysheet-mousedown-cancel">( ' + w + ' )</span></div><div class="monthList luckysheet-mousedown-cancel">' + x + "</div></div>" : '<div class="yearBox luckysheet-mousedown-cancel"><div class="year luckysheet-mousedown-cancel cf" data-check="true" title="' + k + '"><i class="fa fa-caret-right luckysheet-mousedown-cancel" aria-hidden="true"></i><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + k + r.filiterYearText + '</label><span class="count luckysheet-mousedown-cancel">( ' + w + ' )</span></div><div class="monthList luckysheet-mousedown-cancel">' + x + "</div></div>",
                            b.unshift(N)
                        }
                    if (JSON.stringify(n).length > 2) {
                        var F = Object.keys(n);
                        F = orderbydata1D(F, !0);
                        for (var P = 0; P < F.length; P++) {
                            var L = F[P];
                            for (var O in n[L]) {
                                var D = void 0;
                                D = L + "#$$$#" + O == "null#$$$#null" ? r.valueBlank : O;
                                var M = void 0;
                                M = L + "#$$$#" + O in c ? '<div class="textBox luckysheet-mousedown-cancel cf" data-check="false" data-filter="' + L + "#$$$#" + O + '" title="' + D + '"><input class="luckysheet-mousedown-cancel" type="checkbox"/><label class="luckysheet-mousedown-cancel">' + D + '</label><span class="luckysheet-mousedown-cancel count">( ' + n[L][O] + " )</span></div>" : '<div class="textBox luckysheet-mousedown-cancel cf" data-check="true" data-filter="' + L + "#$$$#" + O + '" title="' + D + '"><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/><label class="luckysheet-mousedown-cancel">' + D + '</label><span class="luckysheet-mousedown-cancel count">( ' + n[L][O] + " )</span></div>",
                                b.push(M)
                            }
                        }
                    }
                    $("#luckysheet-filter-byvalue-select").html("<div class='ListBox luckysheet-mousedown-cancel' style='min-height: 100px; max-height: " + (o - a.top - 350) + "px; overflow-y: auto; overflow-x: hidden;'><table cellspacing='0' style='width:100%;' class='luckysheet-mousedown-cancel'>" + b.join("") + "</table></div>")
                }
                ), 1),
                showrightclickmenu(n, a.left, a.top + 20),
                e.stopPropagation(),
                !1
            }
        }
        )),
        $("#luckysheet-filter-orderby-color").hover((function() {
            for (var e = $("#luckysheet-filter-menu"), t = e.data("str"), n = e.data("edr"), o = e.data("cindex"), l = (e.data("stc"),
            e.data("edc"),
            {}), i = {}, s = alternateformat.getComputeMap(), c = conditionformat.getComputeMap(), u = t + 1; u <= n; u++) {
                var h = Store.flowdata[u][o]
                  , d = menuButton.checkstatus(Store.flowdata, u, o, "bg");
                null == d && (d = "#ffffff");
                var f = alternateformat.checksAF(u, o, s);
                null != f && (d = f[1]);
                var m = conditionformat.checksCF(u, o, c);
                null != m && null != m.cellColor && (d = m.cellColor),
                d.indexOf("rgb") > -1 && (d = rgbTohex(d)),
                4 == d.length && (d = d.substr(0, 1) + d.substr(1, 1).repeat(2) + d.substr(2, 1).repeat(2) + d.substr(3, 1).repeat(2));
                var p = menuButton.checkstatus(Store.flowdata, u, o, "fc");
                null != f && (p = f[0]),
                null != m && null != m.textColor && (p = m.textColor),
                p.indexOf("rgb") > -1 && (p = rgbTohex(p)),
                4 == p.length && (p = p.substr(0, 1) + p.substr(1, 1).repeat(2) + p.substr(2, 1).repeat(2) + p.substr(3, 1).repeat(2)),
                null != Store.config && null != Store.config.rowhidden && u in Store.config.rowhidden ? (l[d] = 1,
                null == h || isRealNull(h.v) || (i[p] = 1)) : (l[d] = 0,
                null == h || isRealNull(h.v) || (i[p] = 0))
            }
            var g = "";
            if (JSON.stringify(l).length > 2 && Object.keys(l).length > 1) {
                var y = "";
                for (var v in l)
                    0 == l[v] ? y += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + v + '" title="' + v + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/></div>' : y += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + v + '" title="' + v + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox"/></div>';
                g = '<div id="filterBgColor" class="box luckysheet-mousedown-cancel"><div class="title luckysheet-mousedown-cancel">' + r.filiterByColorTip + '</div><div style="max-height:128px;overflow:auto;" class="luckysheet-mousedown-cancel">' + y + "</div></div>"
            }
            var A, b = "";
            if (JSON.stringify(i).length > 2 && Object.keys(i).length > 1) {
                var k = "";
                for (var w in i)
                    0 == i[w] ? k += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + w + '" title="' + w + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/></div>' : k += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + w + '" title="' + w + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox"/></div>';
                b = '<div id="filterFcColor" class="box luckysheet-mousedown-cancel"><div class="title luckysheet-mousedown-cancel">' + r.filiterByTextColorTip + '</div><div style="max-height:128px;overflow:auto;" class="luckysheet-mousedown-cancel">' + k + "</div></div>"
            }
            A = "" == g && "" == b ? '<div class="luckysheet-mousedown-cancel" style="padding: 10px 30px;text-align: center;">' + r.filterContainerOneColorTip + "</div>" : g + b + '<div class="luckysheet-mousedown-cancel"><button id="luckysheet-filter-orderby-color-confirm" class="btn btn-primary luckysheet-mousedown-cancel" style="margin: 5px 20px;width: 70px;">' + a.confirm + "</button></div>",
            $("#luckysheet-filter-orderby-color-submenu").remove(),
            $("body").append('<div id="luckysheet-filter-orderby-color-submenu" class="luckysheet-cols-menu luckysheet-mousedown-cancel">' + A + "</div>");
            var x = $("#luckysheet-filter-orderby-color-submenu").end()
              , S = $(this).parent()
              , _ = $(window).width()
              , C = $(window).height()
              , T = S.width()
              , E = x.height() + 25
              , I = x.width() + 5
              , R = $(this).offset()
              , B = R.top
              , N = R.left + T;
            N + I > _ && (N = R.left - I),
            B + E > C && (B = C - E),
            $("#luckysheet-filter-orderby-color-submenu").css({
                top: B,
                left: N
            }).show()
        }
        ), (function() {
            n = setTimeout((function() {
                $("#luckysheet-filter-orderby-color-submenu").hide()
            }
            ), 200)
        }
        )),
        $(document).on("mouseover mouseleave", "#luckysheet-filter-orderby-color-submenu", (function(e) {
            "mouseover" === e.type ? clearTimeout(n) : $(this).hide()
        }
        )),
        $(document).on("click", "#luckysheet-filter-orderby-color-submenu .item label", (function() {
            $(this).siblings("input[type='checkbox']").click()
        }
        )),
        $(document).off("click.orderbyColorConfirm").on("click.orderbyColorConfirm", "#luckysheet-filter-orderby-color-submenu #luckysheet-filter-orderby-color-confirm", (function() {
            var e, t, r = {}, a = {};
            $("#luckysheet-filter-orderby-color-submenu .item").each((function(e, t) {
                if ($(t).find("input[type='checkbox']").is(":checked")) {
                    var n = $(this).find("label").attr("title")
                      , o = $(this).closest(".box").attr("id");
                    "filterBgColor" == o ? r[n] = 0 : "filterFcColor" == o && (a[n] = 0)
                }
            }
            )),
            e = $("#luckysheet-filter-orderby-color-submenu #filterBgColor").length > 0,
            t = $("#luckysheet-filter-orderby-color-submenu #filterFcColor").length > 0;
            var n = $("#luckysheet-filter-menu")
              , o = n.data("str")
              , l = n.data("edr")
              , i = n.data("cindex")
              , s = n.data("stc")
              , c = n.data("edc")
              , u = {};
            $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").not($("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(i - s).get(0)).each((function() {
                var e = $(this).data("rowhidden");
                if ("" == e)
                    return !0;
                for (var t in e = JSON.parse(e))
                    u[t] = 0
            }
            ));
            for (var h = {}, d = {}, f = alternateformat.getComputeMap(), m = conditionformat.getComputeMap(), p = o + 1; p <= l; p++)
                if (!(p in u) && null != Store.flowdata[p]) {
                    var g = Store.flowdata[p][i]
                      , y = menuButton.checkstatus(Store.flowdata, p, i, "bg")
                      , v = alternateformat.checksAF(p, i, f);
                    null != v && (y = v[1]);
                    var A = conditionformat.checksCF(p, i, m);
                    null != A && null != A.cellColor && (y = A.cellColor),
                    (y = null == y ? "#ffffff" : y).indexOf("rgb") > -1 && (y = rgbTohex(y)),
                    4 == y.length && (y = y.substr(0, 1) + y.substr(1, 1).repeat(2) + y.substr(2, 1).repeat(2) + y.substr(3, 1).repeat(2));
                    var b = menuButton.checkstatus(Store.flowdata, p, i, "fc");
                    null != v && (b = v[0]),
                    null != A && null != A.textColor && (b = A.textColor),
                    b.indexOf("rgb") > -1 && (b = rgbTohex(b)),
                    4 == b.length && (b = b.substr(0, 1) + b.substr(1, 1).repeat(2) + b.substr(2, 1).repeat(2) + b.substr(3, 1).repeat(2)),
                    e && t ? y in r || b in a && null != g && !isRealNull(g.v) || (h[p] = 0) : e ? y in r || (h[p] = 0) : t && (b in a && null != g && !isRealNull(g.v) || (h[p] = 0))
                }
            var k = $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(i - s)
              , w = Object.keys(h).length > 0
              , x = $.extend(!0, u, h)
              , S = json.parseJsonParm(k.data("rowhidden"));
            labelFilterOptionState(k, w, h, d, !0, o, l, i, s, c);
            var _ = $.extend(!0, {}, Store.config);
            if (_.rowhidden = x,
            Store.clearjfundo) {
                var C = {
                    type: "datachangeAll_filter"
                };
                C.sheetIndex = Store.currentSheetIndex,
                C.config = $.extend(!0, {}, Store.config),
                C.curconfig = _,
                C.optionstate = w,
                C.optionsindex = i - s,
                C.rowhidden = $.extend(!0, {}, h),
                C.rowhidenPre = $.extend(!0, {}, S),
                null != d && (C.caljs = d),
                Store.jfundo = [],
                Store.jfredo.push(C)
            }
            Store.config = _,
            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
            server.saveParam("cg", Store.currentSheetIndex, _.rowhidden, {
                k: "rowhidden"
            }),
            jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
            $("#luckysheet-filter-menu, #luckysheet-filter-submenu, #luckysheet-filter-orderby-color-submenu").hide(),
            cleargridelement()
        }
        )),
        $(document).off("click.filterCheckbox1").on("click.filterCheckbox1", "#luckysheet-filter-byvalue-select .textBox", (function() {
            "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
            $(this).find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
            $(this).find("input[type='checkbox']").prop("checked", !0))
        }
        )),
        $(document).off("click.filterCheckbox2").on("click.filterCheckbox2", "#luckysheet-filter-byvalue-select .year", (function() {
            "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
            $(this).parents(".yearBox").find(".month").attr("data-check", "false"),
            $(this).parents(".yearBox").find(".day").attr("data-check", "false"),
            $(this).parents(".yearBox").find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
            $(this).parents(".yearBox").find(".month").attr("data-check", "true"),
            $(this).parents(".yearBox").find(".day").attr("data-check", "true"),
            $(this).parents(".yearBox").find("input[type='checkbox']").prop("checked", !0))
        }
        )),
        $(document).off("click.filterCheckbox3").on("click.filterCheckbox3", "#luckysheet-filter-byvalue-select .month", (function() {
            "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
            $(this).parents(".monthBox").find(".day").attr("data-check", "false"),
            $(this).parents(".monthBox").find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
            $(this).parents(".monthBox").find(".day").attr("data-check", "true"),
            $(this).parents(".monthBox").find("input[type='checkbox']").prop("checked", !0));
            var e = !0;
            $(this).parents(".yearBox").find(".day").each((function(t, r) {
                "true" == $(r).attr("data-check") || (e = !1)
            }
            )),
            e ? ($(this).parents(".yearBox").find(".year").attr("data-check", "true"),
            $(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".yearBox").find(".year").attr("data-check", "false"),
            $(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))
        }
        )),
        $(document).off("click.filterCheckbox4").on("click.filterCheckbox4", "#luckysheet-filter-byvalue-select .day", (function() {
            "true" == $(this).attr("data-check") ? ($(this).attr("data-check", "false"),
            $(this).find("input[type='checkbox']").removeAttr("checked")) : ($(this).attr("data-check", "true"),
            $(this).find("input[type='checkbox']").prop("checked", !0));
            var e = !0;
            $(this).parents(".monthBox").find(".day").each((function(t, r) {
                "true" == $(r).attr("data-check") || (e = !1)
            }
            )),
            e ? ($(this).parents(".monthBox").find(".month").attr("data-check", "true"),
            $(this).parents(".monthBox").find(".month input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".monthBox").find(".month").attr("data-check", "false"),
            $(this).parents(".monthBox").find(".month input[type='checkbox']").removeAttr("checked"));
            var t = !0;
            $(this).parents(".yearBox").find(".day").each((function(e, r) {
                "true" == $(r).attr("data-check") || (t = !1)
            }
            )),
            t ? ($(this).parents(".yearBox").find(".year").attr("data-check", "true"),
            $(this).parents(".yearBox").find(".year input[type='checkbox']").prop("checked", !0)) : ($(this).parents(".yearBox").find(".year").attr("data-check", "false"),
            $(this).parents(".yearBox").find(".year input[type='checkbox']").removeAttr("checked"))
        }
        )),
        $(document).off("click.filterYearDropdown").on("click.filterYearDropdown", "#luckysheet-filter-byvalue-select .yearBox .fa-caret-right", (function(e) {
            var t = $(this).parents(".luckysheet-mousedown-cancel");
            t.hasClass("year") && $(this).parents(".yearBox").find(".monthList").slideToggle(),
            t.hasClass("month") && $(this).parents(".monthBox").find(".dayList").slideToggle(),
            e.stopPropagation()
        }
        )),
        $("#luckysheet-filter-byvalue-btn-all").click((function() {
            $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").prop("checked", !0),
            $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check", "true")
        }
        )),
        $("#luckysheet-filter-byvalue-btn-clear").click((function() {
            $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").removeAttr("checked"),
            $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").parents(".luckysheet-mousedown-cancel").attr("data-check", "false")
        }
        )),
        $("#luckysheet-filter-byvalue-btn-contra").click((function() {
            $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").each((function(e, t) {
                $(t).is(":checked") ? ($(t).removeAttr("checked"),
                $(t).parents(".luckysheet-mousedown-cancel").attr("data-check", "false")) : ($(t).prop("checked", !0),
                $(t).parents(".luckysheet-mousedown-cancel").attr("data-check", "true"))
            }
            )),
            $("#luckysheet-filter-byvalue-select .ListBox .monthBox").each((function(e, t) {
                var r = !0;
                $(t).find(".day input[type='checkbox']").each((function(e, t) {
                    $(t).is(":checked") || (r = !1)
                }
                )),
                r ? ($(t).find(".month input[type='checkbox']").prop("checked", !0),
                $(t).attr("data-check", "true")) : ($(t).find(".month input[type='checkbox']").removeAttr("checked"),
                $(t).attr("data-check", "false"))
            }
            )),
            $("#luckysheet-filter-byvalue-select .ListBox .yearBox").each((function(e, t) {
                var r = !0;
                $(t).find(".day input[type='checkbox']").each((function(e, t) {
                    $(t).is(":checked") || (r = !1)
                }
                )),
                r ? ($(t).find(".year input[type='checkbox']").prop("checked", !0),
                $(t).attr("data-check", "true")) : ($(t).find(".year input[type='checkbox']").removeAttr("checked"),
                $(t).attr("data-check", "false"))
            }
            ))
        }
        )),
        $("#luckysheet-filter-initial").click((function() {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "filter")) {
                $("#luckysheet-filter-menu .luckysheet-filter-selected-input").hide().find("input").val(),
                $("#luckysheet-filter-selected span").data("type", "0").data("type", null).text(r.conditionNone);
                var e = {
                    type: "datachangeAll_filter_clear"
                };
                e.sheetIndex = Store.currentSheetIndex,
                e.config = $.extend(!0, {}, Store.config),
                Store.config.rowhidden = {},
                e.curconfig = $.extend(!0, {}, Store.config),
                e.filter_save = $.extend(!0, {}, Store.luckysheet_filter_save);
                var t = [];
                $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function() {
                    var e = $(this)
                      , r = e.hasClass("luckysheet-filter-options-active")
                      , a = json.parseJsonParm(e.data("rowhidden"))
                      , n = json.parseJsonParm(e.data("caljs"));
                    t.push({
                        optionstate: r,
                        rowhidden: a,
                        caljs: n,
                        str: e.data("str"),
                        edr: e.data("edr"),
                        cindex: e.data("cindex"),
                        stc: e.data("stc"),
                        edc: e.data("edc")
                    })
                }
                )),
                e.optiongroups = t,
                Store.jfundo = [],
                Store.jfredo.push(e),
                $("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex + ", #luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove(),
                $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].filter = null,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].filter_select = null,
                server.saveParam("fsc", Store.currentSheetIndex, null),
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, {}, {
                    k: "rowhidden"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
            }
        }
        )),
        $("#luckysheet-filter-byvalue-input").on("input propertychange", (function() {
            var e = $(this).val().toString();
            $("#luckysheet-filter-byvalue-select .ListBox .luckysheet-mousedown-cancel").show(),
            "" != e && $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").each((function(t, r) {
                if ($(r).closest(".day").length > 0) {
                    var a = $(r).siblings("label").text().toString()
                      , n = $(r).closest(".monthBox").find(".month label").text().toString();
                    if (-1 == ($(r).closest(".yearBox").find(".year label").text().toString() + "-" + n + "-" + a).indexOf(e))
                        $(r).closest(".day").hide(),
                        0 == $(r).closest(".dayList").find(".day:visible").length && $(r).closest(".monthBox").find(".month").hide(),
                        0 == $(r).closest(".monthList").find(".day:visible").length && $(r).closest(".yearBox").find(".year").hide()
                }
                $(r).closest(".textBox").length > 0 && (-1 == $(r).siblings("label").text().toString().indexOf(e) && $(r).parents(".textBox").hide())
            }
            ))
        }
        )),
        $("#luckysheet-filter-cancel").click((function() {
            $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide()
        }
        )),
        $("#luckysheet-filter-confirm").click((function() {
            var e = $("#luckysheet-filter-menu")
              , t = e.data("str")
              , a = e.data("edr")
              , n = e.data("cindex")
              , o = e.data("stc")
              , l = e.data("edc")
              , i = {};
            $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").not($("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(n - o).get(0)).each((function() {
                var e = $(this).data("rowhidden");
                if ("" == e)
                    return !0;
                for (var t in e = JSON.parse(e.replace(/\'/g, '"')))
                    i[t] = 0
            }
            ));
            var s = {}
              , c = {}
              , u = {};
            if ($("#luckysheet-filter-bycondition").next().is(":visible") && $("#luckysheet-filter-byvalue").next().is(":hidden") && "null" != $("#luckysheet-filter-selected span").data("value")) {
                var h = $("#luckysheet-filter-selected span")
                  , d = h.data("type")
                  , f = h.data("value");
                if (u.value = f,
                u.text = h.text(),
                "0" == d)
                    u.type = "0";
                else if ("2" == d) {
                    var m = $("#luckysheet-filter-menu .luckysheet-filter-selected-input2 input");
                    u.type = "2",
                    u.value1 = m.eq(0).val(),
                    u.value2 = m.eq(1).val()
                } else
                    u.type = "1",
                    u.value1 = $("#luckysheet-filter-menu .luckysheet-filter-selected-input").eq(0).find("input").val();
                for (var p = t + 1; p <= a; p++)
                    if (!(p in i) && null != Store.flowdata[p]) {
                        var g = Store.flowdata[p][n];
                        if ("cellnull" == f)
                            null == g || isRealNull(g.v) || (c[p] = 0);
                        else if ("cellnonull" == f)
                            (null == g || isRealNull(g.v)) && (c[p] = 0);
                        else if ("textinclude" == f) {
                            var y = u.value1;
                            (null == g || isRealNull(g.v) || -1 == g.m.indexOf(y)) && (c[p] = 0)
                        } else if ("textnotinclude" == f) {
                            var v = u.value1;
                            null == g || isRealNull(g.v) || g.m.indexOf(v) > -1 && (c[p] = 0)
                        } else if ("textstart" == f) {
                            var A = u.value1
                              , b = A.length;
                            (null == g || isRealNull(g.v) || g.m.substr(0, b) != A) && (c[p] = 0)
                        } else if ("textend" == f) {
                            var k = u.value1
                              , w = k.length;
                            (null == g || isRealNull(g.v) || w > g.m.length || g.m.substr(g.m.length - w, w) != k) && (c[p] = 0)
                        } else if ("textequal" == f) {
                            var x = u.value1;
                            (null == g || isRealNull(g.v) || g.m != x) && (c[p] = 0)
                        } else if ("dateequal" == f) {
                            var S = genarate(u.value1)[2];
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "d" == g.ct.t ? parseInt(g.v) != S && (c[p] = 0) : c[p] = 0
                        } else if ("datelessthan" == f) {
                            var _ = genarate(u.value1)[2];
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "d" == g.ct.t ? parseInt(g.v) >= _ && (c[p] = 0) : c[p] = 0
                        } else if ("datemorethan" == f) {
                            var C = genarate(u.value1)[2];
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "d" == g.ct.t ? parseInt(g.v) <= C && (c[p] = 0) : c[p] = 0
                        } else if ("morethan" == f) {
                            var T = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v <= T && (c[p] = 0) : c[p] = 0
                        } else if ("moreequalthan" == f) {
                            var E = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v < E && (c[p] = 0) : c[p] = 0
                        } else if ("lessthan" == f) {
                            var I = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v >= I && (c[p] = 0) : c[p] = 0
                        } else if ("lessequalthan" == f) {
                            var R = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v > R && (c[p] = 0) : c[p] = 0
                        } else if ("equal" == f) {
                            var B = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v != B && (c[p] = 0) : c[p] = 0
                        } else if ("noequal" == f) {
                            var N = parseFloat(u.value1);
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v == N && (c[p] = 0) : c[p] = 0
                        } else if ("include" == f) {
                            var F = parseFloat(u.value1)
                              , P = parseFloat(u.value2)
                              , L = void 0
                              , O = void 0;
                            F < P ? (L = F,
                            O = P) : (O = F,
                            L = P),
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? (g.v < L || g.v > O) && (c[p] = 0) : c[p] = 0
                        } else if ("noinclude" == f) {
                            var D = parseFloat(u.value1)
                              , M = parseFloat(u.value2)
                              , U = void 0
                              , H = void 0;
                            D < M ? (U = D,
                            H = M) : (H = D,
                            U = M),
                            null == g || isRealNull(g.v) ? c[p] = 0 : null != g.ct && "n" == g.ct.t ? g.v >= U && g.v <= H && (c[p] = 0) : c[p] = 0
                        }
                    }
            } else {
                $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']").each((function(e, t) {
                    if ($(t).is(":visible") && $(t).is(":checked"))
                        return !0;
                    if ($(t).closest(".day").length > 0) {
                        var a = $(t).siblings("label").text();
                        Number(a) < 10 && (a = "0" + Number(a));
                        var n = $(t).closest(".monthBox").find(".month label").text().replace(r.filiterMonthText, "");
                        Number(n) < 10 && (n = "0" + Number(n));
                        var o = $(t).closest(".yearBox").find(".year label").text().replace(r.filiterYearText, "")
                          , l = r.filterDateFormatTip + "#$$$#" + o + "-" + n + "-" + a;
                        s[l] = "1"
                    }
                    if ($(t).closest(".textBox").length > 0) {
                        var i = $(t).closest(".textBox").data("filter");
                        s[i] = "1"
                    }
                }
                ));
                for (var q = t + 1; q <= a; q++)
                    if (!(q in i) && null != Store.flowdata[q]) {
                        var z = Store.flowdata[q][n]
                          , j = void 0;
                        if (null == z || isRealNull(z.v))
                            j = "null#$$$#null";
                        else if (null != z.ct && "d" == z.ct.t) {
                            var V = update("YYYY-MM-DD", z.v);
                            j = r.filterDateFormatTip + "#$$$#" + V
                        } else
                            j = z.v + "#$$$#" + z.m;
                        j in s && (c[q] = 0)
                    }
            }
            var Q = $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(n - o)
              , G = $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']:visible:checked").length < $("#luckysheet-filter-byvalue-select .ListBox input[type='checkbox']:visible").length || $("#luckysheet-filter-byvalue-input").val().length > 0 || $("#luckysheet-filter-bycondition").next().is(":visible") && $("#luckysheet-filter-byvalue").next().is(":hidden") && "null" != $("#luckysheet-filter-selected span").data("value")
              , K = $.extend(!0, i, c)
              , W = json.parseJsonParm(Q.data("rowhidden"));
            labelFilterOptionState(Q, G, c, u, !0, t, a, n, o, l);
            var Y = $.extend(!0, {}, Store.config);
            if (Y.rowhidden = K,
            Store.clearjfundo) {
                var X = {
                    type: "datachangeAll_filter"
                };
                X.sheetIndex = Store.currentSheetIndex,
                X.config = $.extend(!0, {}, Store.config),
                X.curconfig = Y,
                X.optionstate = G,
                X.optionsindex = n - o,
                X.rowhidden = $.extend(!0, {}, c),
                X.rowhidenPre = $.extend(!0, {}, W),
                null != u && (X.caljs = u),
                Store.jfundo = [],
                Store.jfredo.push(X)
            }
            Store.config = Y,
            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
            server.saveParam("cg", Store.currentSheetIndex, Y.rowhidden, {
                k: "rowhidden"
            }),
            jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
            $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
            cleargridelement()
        }
        ))
    }
    var server = {
        gridKey: null,
        loadUrl: null,
        updateUrl: null,
        updateImageUrl: null,
        title: null,
        loadSheetUrl: null,
        allowUpdate: !1,
        historyParam: function(e, t, r) {
            var a = r.row[0]
              , n = r.row[1]
              , o = r.column[0]
              , l = r.column[1];
            if (a == n && o == l) {
                var i = e[a][o];
                this.saveParam("v", t, i, {
                    r: a,
                    c: o
                })
            } else
                for (var s = n - a + 1, c = l - o + 1, u = Math.floor(1e3 / c), h = Math.ceil(s / u), d = 0; d < h; d++) {
                    var f = a + u * d
                      , m = void 0;
                    m = d == h - 1 ? n : a + u * (d + 1) - 1;
                    for (var p = [], g = f; g <= m; g++) {
                        for (var y = [], v = o; v <= l; v++)
                            null == e[g] ? y.push(null) : y.push(e[g][v]);
                        p.push(y)
                    }
                    this.saveParam("rv", t, p, {
                        range: {
                            row: [f, m],
                            column: [o, l]
                        }
                    }),
                    d == h - 1 && this.saveParam("rv_end", t, null)
                }
        },
        saveParam: function(e, t, r, a) {
            if (this.allowUpdate) {
                null == r && (r = null);
                var n = {};
                n.t = e,
                n.i = t,
                n.v = r,
                "rv" == e ? n.range = a.range : "v" == e || "fu" == e || "fm" == e ? (n.r = a.r,
                n.c = a.c) : "fc" == e ? (n.op = a.op,
                n.pos = a.pos) : "drc" == e || "arc" == e || "h" == e || "wh" == e ? n.rc = a.rc : "c" == e ? (n.cid = a.cid,
                n.op = a.op) : "f" == e ? (n.op = a.op,
                n.pos = a.pos) : "s" == e || ("sh" == e ? (n.op = a.op,
                null != a.cur && (n.cur = a.cur)) : ("cg" == e || "all" == e) && (n.k = a.k));
                var o = pako.gzip(encodeURIComponent(JSON.stringify(n)), {
                    to: "string"
                });
                null != this.websocket && this.websocket.send(o)
            }
        },
        websocket: null,
        wxErrorCount: 0,
        openWebSocket: function openWebSocket() {
            var _this = this;
            "WebSocket"in window ? (_this.websocket = new WebSocket(_this.updateUrl + "?t=111&g=" + encodeURIComponent(_this.gridKey)),
            _this.websocket.onopen = function() {
                console.info("WebSocket连接成功"),
                hideloading(),
                _this.wxErrorCount = 0,
                setInterval((function() {
                    _this.websocket.send("rub")
                }
                ), 6e4)
            }
            ,
            _this.websocket.onmessage = function(result) {
                var data = eval("(" + result.data + ")");
                console.info(data);
                var type = data.type;
                if (1 == type)
                    ;
                else if (2 == type) {
                    var _item = JSON.parse(data.data);
                    _this.wsUpdateMsg(_item)
                } else if (3 == type) {
                    var id = data.id
                      , username = data.username
                      , _item2 = JSON.parse(data.data)
                      , _type = _item2.t
                      , index = _item2.i
                      , value = _item2.v;
                    if ("array" != getObjType(value) && (value = JSON.parse(value)),
                    index == Store.currentSheetIndex) {
                        var r = value[value.length - 1].row[0]
                          , c = value[value.length - 1].column[0];
                        _this.multipleRangeShow(id, username, r, c)
                    }
                } else if (4 == type)
                    for (var items = JSON.parse(data.data), i = 0; i < items.length; i++)
                        _this.wsUpdateMsg(item[i])
            }
            ,
            _this.websocket.onerror = function() {
                _this.wxErrorCount++,
                _this.wxErrorCount > 3 ? showloading("WebSocket连接发生错误, 请刷新页面！") : (showloading("WebSocket连接发生错误, 请耐心等待！"),
                _this.openWebSocket())
            }
            ,
            _this.websocket.onclose = function() {
                console.info("WebSocket连接关闭"),
                alert("服务器通信发生错误，请刷新页面后再试，如若不行请联系管理员！")
            }
            ) : alert("当前浏览器 Not Support WebSocket")
        },
        wsUpdateMsg: function wsUpdateMsg(item) {
            var type = item.t
              , index = item.i
              , value = item.v
              , file = Store.luckysheetfile[getSheetIndex(index)];
            if (null != file)
                if ("v" == type) {
                    if (null == file.data || 0 == file.data.length)
                        return;
                    var r = item.r
                      , c = item.c;
                    file.data[r][c] = value,
                    index == Store.currentSheetIndex && (Store.flowdata = file.data,
                    null != value && null != value.ps ? luckysheetPostil.buildPs(r, c, value.ps) : luckysheetPostil.buildPs(r, c, null),
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1))
                } else if ("rv" == type) {
                    if (null == file.data || 0 == file.data.length)
                        return;
                    for (var r1 = item.range.row[0], r2 = item.range.row[1], c1 = item.range.column[0], c2 = item.range.column[1], _r = r1; _r <= r2; _r++)
                        for (var _c = c1; _c <= c2; _c++)
                            file.data[_r][_c] = value[_r - r1][_c - c1];
                    if (index == Store.currentSheetIndex) {
                        Store.flowdata = file.data;
                        for (var _r2 = r1; _r2 <= r2; _r2++)
                            for (var _c2 = c1; _c2 <= c2; _c2++)
                                null != value[_r2 - r1][_c2 - c1] && null != value[_r2 - r1][_c2 - c1].ps ? luckysheetPostil.buildPs(_r2, _c2, value[_r2 - r1][_c2 - c1].ps) : luckysheetPostil.buildPs(_r2, _c2, null);
                        setTimeout((function() {
                            luckysheetrefreshgrid()
                        }
                        ), 1)
                    }
                } else if ("cg" == type) {
                    var k = item.k;
                    if ("borderInfo" == k)
                        file.config.borderInfo = value;
                    else
                        for (var key in k in file.config || (file.config[k] = {}),
                        value)
                            file.config[k][key] = value[key];
                    index == Store.currentSheetIndex && (Store.config = file.config,
                    "rowlen" != k && "columnlen" != k && "rowhidden" != k || jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1))
                } else if ("all" == type) {
                    var _k = item.k;
                    if (file[_k] = value,
                    "name" == _k)
                        $("#luckysheet-sheet-container-c #luckysheet-sheets-item" + index).find("span.luckysheet-sheets-item-name").html(value);
                    else if ("color" == _k) {
                        var currentSheetItem = $("#luckysheet-sheet-container-c #luckysheet-sheets-item" + index);
                        currentSheetItem.find(".luckysheet-sheets-item-color").remove(),
                        null == value && "" == value || currentSheetItem.append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + value + ';"></div>')
                    } else if ("pivotTable" == _k)
                        ;
                    else if ("frozen" == _k) {
                        if (luckysheetFreezen.frozenTofreezen(),
                        index == Store.currentSheetIndex) {
                            var _locale = locale()
                              , locale_freezen = _locale.freezen;
                            null == file.freezen.horizontal ? ($("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> ' + locale_freezen.freezenRow),
                            luckysheetFreezen.freezenhorizontaldata = null,
                            $("#luckysheet-freezebar-horizontal").hide()) : luckysheetFreezen.createFreezenHorizontal(file.freezen.horizontal.freezenhorizontaldata, file.freezen.horizontal.top),
                            null == file.freezen.vertical ? ($("#luckysheet-freezen-btn-vertical").html('<i class="fa fa-indent"></i> ' + locale_freezen.freezenColumn),
                            luckysheetFreezen.freezenverticaldata = null,
                            $("#luckysheet-freezebar-vertical").hide()) : luckysheetFreezen.createFreezenVertical(file.freezen.vertical.freezenverticaldata, file.freezen.vertical.left),
                            luckysheetFreezen.createAssistCanvas()
                        }
                    } else
                        "filter_select" == _k ? index == Store.currentSheetIndex && createFilterOptions(value) : "filter" == _k ? index == Store.currentSheetIndex && createFilterOptions(file.filter_select, value) : "luckysheet_conditionformat_save" == _k || "luckysheet_alternateformat_save" == _k ? index == Store.currentSheetIndex && setTimeout((function() {
                            luckysheetrefreshgrid()
                        }
                        ), 1) : "config" == _k ? index == Store.currentSheetIndex && (Store.config = value,
                        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)) : "dynamicArray" == _k && index == Store.currentSheetIndex && setTimeout((function() {
                            luckysheetrefreshgrid()
                        }
                        ), 1)
                } else if ("fc" == type) {
                    var op = item.op
                      , pos = item.pos;
                    "object" != getObjType(value) && (value = eval("(" + value + ")"));
                    var _r3 = value.r
                      , _c3 = value.c
                      , calcChain = null == file.calcChain ? [] : file.calcChain;
                    if ("add" == op)
                        calcChain.push(value);
                    else if ("del" == op)
                        for (var a = 0; a < calcChain.length; a++)
                            _r3 == calcChain[a].r && _c3 == calcChain[a].c && index == calcChain[a].index && calcChain.splice(a, 1);
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1)
                } else if ("drc" == type) {
                    if (null == file.data || 0 == file.data.length)
                        return;
                    var rc = item.rc
                      , st_i = value.index
                      , len = value.len
                      , mc = value.mc
                      , borderInfo = value.borderInfo
                      , data = file.data;
                    if ("r" == rc) {
                        file.row -= len,
                        data.splice(st_i, len);
                        for (var row = [], _c4 = 0; _c4 < data[0].length; _c4++)
                            row.push(null);
                        for (var _r4 = 0; _r4 < len; _r4++)
                            data.push(row)
                    } else {
                        file.column -= len;
                        for (var addcol = [], _r5 = 0; _r5 < len; _r5++)
                            addcol.push(null);
                        for (var i = 0; i < data.length; i++)
                            data[i].splice(st_i, len),
                            data[i] = data[i].concat(addcol)
                    }
                    for (var x in mc) {
                        var _r6 = mc[x].r
                          , _c5 = mc[x].c;
                        data[_r6][_c5].mc = mc[x]
                    }
                    file.config.merge = mc,
                    file.config.borderInfo = borderInfo,
                    index == Store.currentSheetIndex && (Store.flowdata = data,
                    Store.config.merge = mc,
                    Store.config.borderInfo = borderInfo,
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1))
                } else if ("arc" == type) {
                    if (null == file.data || 0 == file.data.length)
                        return;
                    var _rc = item.rc
                      , _st_i = value.index
                      , _len = value.len
                      , addData = value.data
                      , _mc = value.mc
                      , _borderInfo = value.borderInfo
                      , _data = file.data;
                    if ("r" == _rc) {
                        file.row += _len;
                        for (var arr = [], _i = 0; _i < _len; _i++)
                            arr.push(JSON.stringify(addData[_i]));
                        eval("data.splice(" + _st_i + ", 0, " + arr.join(",") + ")")
                    } else {
                        file.column += _len;
                        for (var _i2 = 0; _i2 < _data.length; _i2++)
                            _data[_i2].splice(_st_i, 0, addData[_i2])
                    }
                    for (var _x in _mc) {
                        var _r7 = _mc[_x].r
                          , _c6 = _mc[_x].c;
                        _data[_r7][_c6].mc = _mc[_x]
                    }
                    file.config.merge = _mc,
                    file.config.borderInfo = _borderInfo,
                    index == Store.currentSheetIndex && (Store.flowdata = _data,
                    Store.config.merge = _mc,
                    Store.config.borderInfo = _borderInfo,
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1))
                } else if ("f" == type) {
                    var _op = item.op
                      , _pos = item.pos
                      , filter = file.filter;
                    null == filter && (filter = {}),
                    "upOrAdd" == _op ? filter[_pos] = value : "del" == _op && delete filter[_pos],
                    index == Store.currentSheetIndex && createFilterOptions(file.filter_select, filter)
                } else if ("fsc" == type)
                    file.filter = null,
                    file.filter_select = null,
                    index == Store.currentSheetIndex && ($("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex + ", #luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove(),
                    $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide());
                else if ("fsr" == type)
                    file.filter = value.filter,
                    file.filter_select = value.filter_select,
                    index == Store.currentSheetIndex && createFilterOptions(file.filter_select, file.filter);
                else if ("sha" == type) {
                    Store.luckysheetfile.push(value);
                    var colorset = "";
                    null != value.color && (colorset = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + value.color + ';"></div>'),
                    $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                        index: value.index,
                        active: "",
                        name: value.name,
                        style: "",
                        colorset: colorset
                    })),
                    $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + value.index + '" class="luckysheet-datavisual-selection-set"></div>')
                } else if ("shc" == type) {
                    var copyindex = value.copyindex
                      , name = value.name
                      , copyarrindex = getSheetIndex(copyindex)
                      , copyjson = $.extend(!0, {}, Store.luckysheetfile[copyarrindex]);
                    copyjson.index = index,
                    copyjson.name = name,
                    Store.luckysheetfile.splice(copyarrindex + 1, 0, copyjson);
                    var copyobject = $("#luckysheet-sheets-item" + copyindex);
                    $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                        index: copyjson.index,
                        active: "",
                        name: copyjson.name,
                        style: "",
                        colorset: ""
                    })),
                    $("#luckysheet-sheets-item" + copyjson.index).insertAfter(copyobject),
                    $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + copyjson.index + '" class="luckysheet-datavisual-selection-set"></div>')
                } else if ("shd" == type) {
                    for (var _i3 = 0; _i3 < Store.luckysheetfile.length; _i3++)
                        if (Store.luckysheetfile[_i3].index == value.deleIndex) {
                            server.sheetDeleSave.push(Store.luckysheetfile[_i3]),
                            Store.luckysheetfile.splice(_i3, 1);
                            break
                        }
                    $("#luckysheet-sheets-item" + value.deleIndex).remove(),
                    $("#luckysheet-datavisual-selection-set-" + value.deleIndex).remove()
                } else if ("shr" == type)
                    for (var _x2 in value)
                        Store.luckysheetfile[getSheetIndex(_x2)].order = value[_x2];
                else if ("shre" == type) {
                    for (var _i4 = 0; _i4 < server.sheetDeleSave.length; _i4++)
                        if (server.sheetDeleSave[_i4].index == value.reIndex) {
                            var datav = server.sheetDeleSave[_i4];
                            Store.luckysheetfile.push(datav);
                            var _colorset = "";
                            null != value.color && (_colorset = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + datav.color + ';"></div>'),
                            $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                                index: datav.index,
                                active: "",
                                name: datav.name,
                                style: "",
                                colorset: _colorset
                            })),
                            $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + datav.index + '" class="luckysheet-datavisual-selection-set"></div>');
                            break
                        }
                } else if ("sh" == type) {
                    var _op2 = item.op
                      , cur = item.cur;
                    "hide" == _op2 ? (file.hide = 1,
                    $("#luckysheet-sheets-item" + index).hide(),
                    index == Store.currentSheetIndex && ($("#luckysheet-sheets-item" + cur).addClass("luckysheet-sheets-item-active"),
                    sheetmanage.changeSheetExec(cur))) : "show" == _op2 && (file.hide = 0,
                    $("#luckysheet-sheets-item" + index).show())
                } else if ("c" == type) {
                    var _op3 = item.op
                      , cid = item.cid;
                    if ("add" == _op3)
                        file.chart.push(value),
                        luckysheet.insertChartTosheet(value.sheetIndex, value.dataSheetIndex, value.option, value.chartType, value.selfOption, value.defaultOption, value.row, value.column, value.chart_selection_color, value.chart_id, value.chart_selection_id, value.chartStyle, value.rangeConfigCheck, value.rangeRowCheck, value.rangeColCheck, value.chartMarkConfig, value.chartTitleConfig, value.winWidth, value.winHeight, value.scrollLeft1, value.scrollTop1, value.chartTheme, value.myWidth, value.myHeight, value.myLeft, value.myTop, value.myindexrank1, !0);
                    else if ("xy" == _op3 || "wh" == _op3 || "update" == _op3)
                        for (var _i5 = 0; _i5 < file.chart.length; _i5++) {
                            var chartjson = file.chart[_i5];
                            if (chartjson.chart_id == cid) {
                                for (var _item3 in chartjson)
                                    for (var vitem in value)
                                        _item3 == vitem && (chartjson[_item3] = value[vitem]);
                                return void sheetmanage.saveChart(chartjson)
                            }
                        }
                    else if ("del" == _op3)
                        for (var _i6 = 0; _i6 < file.chart.length; _i6++) {
                            var _chartjson = file.chart[_i6];
                            if (_chartjson.chart_id == cid)
                                return file.chart.splice(_i6, 1),
                                $("#" + cid).remove(),
                                void sheetmanage.delChart($("#" + cid).attr("chart_id"), $("#" + cid).attr("sheetIndex"))
                        }
                } else
                    "na" == type && $("#luckysheet_info_detail_input").val(value).css("width", 10 * getByteLen(value))
        },
        multipleIndex: 0,
        multipleRangeShow: function(e, t, r, a) {
            var n = Store.visibledatarow[r]
              , o = r - 1 == -1 ? 0 : Store.visibledatarow[r - 1]
              , l = Store.visibledatacolumn[a]
              , i = a - 1 == -1 ? 0 : Store.visibledatacolumn[a - 1]
              , s = menuButton.mergeborer(Store.flowdata, r, a);
            if (s && (n = s.row[1],
            o = s.row[0],
            l = s.column[1],
            i = s.column[0]),
            $("#luckysheet-multipleRange-show-" + e).length > 0)
                $("#luckysheet-multipleRange-show-" + e).css({
                    position: "absolute",
                    left: i - 1,
                    width: l - i - 1,
                    top: o - 1,
                    height: n - o - 1
                });
            else {
                var c = '<div id="luckysheet-multipleRange-show-' + e + '" data-color="' + luckyColor[this.multipleIndex] + '" title="' + t + '" style="position: absolute;left: ' + (i - 1) + "px;width: " + (l - i - 1) + "px;top: " + (o - 1) + "px;height: " + (n - o - 1) + "px;border: 1px solid " + luckyColor[this.multipleIndex] + ';z-index: 15;"><div style="width: 100%;height: 100%;position: absolute;top: 0;right: 0;bottom: 0;left: 0;opacity: 0.03;background-color: ' + luckyColor[this.multipleIndex] + '"></div></div>';
                $(c).appendTo($("#luckysheet-cell-main #luckysheet-multipleRange-show")),
                this.multipleIndex++
            }
        },
        sheetDeleSave: [],
        submitInterval: 1e3,
        imagesubmitInterval: 5e3,
        submitdatalimit: 50,
        submitcompresslimit: 1e3,
        checksubmit: function(e) {
            var t = this;
            t.submitTimeout(),
            clearTimeout(t.imageRequestTimeout),
            t.imageRequestTimeout = setTimeout((function() {
                t.imageRequest()
            }
            ), t.imagesubmitInterval)
        },
        submitTimeout: function() {
            var e = this;
            clearTimeout(e.requestTimeOut),
            !e.requestLock && null != e.requestlast && e.requestlast.clone().add(1, "seconds").isBefore(moment()) && e.request(),
            e.requestTimeOut = setTimeout((function() {
                e.submitTimeout()
            }
            ), e.submitInterval)
        },
        requestLock: !1,
        requestlast: null,
        firstchange: !0,
        requestTimeOut: null,
        request: function request() {
            var _this = this
              , key = this.gridKey;
            _this.cachelocaldata((function(cahce_key, params) {
                if (0 != params.length) {
                    console.log(params),
                    params = encodeURIComponent(JSON.stringify(params));
                    var compressBeginLen = params.length
                      , iscommpress = !1;
                    _this.requestLock = !0,
                    console.log("request"),
                    "" != _this.updateUrl && $.post(_this.updateUrl, {
                        compress: iscommpress,
                        gridKey: _this.gridKey,
                        data: params
                    }, (function(data) {
                        var re = eval("(" + data + ")");
                        re.status ? ($("#luckysheet_info_detail_export").html("最近存档时间:" + moment().format("M-D H:m:s")),
                        $("#luckysheet_info_detail_save").html("同步成功"),
                        $("#luckysheet_info_detail_save_as").html("同步成功"),
                        _this.clearcachelocaldata()) : ($("#luckysheet_info_detail_save").html("<span style='color:#ff2121'>同步失败</span>"),
                        _this.restorecachelocaldata()),
                        _this.requestlast = moment(),
                        _this.requestLock = !1
                    }
                    ))
                }
            }
            ))
        },
        imageRequestLast: null,
        imageRequestLock: !1,
        imageRequestTimeout: null,
        imageRequest: function imageRequest() {
            var _this = this;
            html2canvas($("#" + container).find(".luckysheet-grid-window").get(0), {
                onrendered: function onrendered(canvas) {
                    var old = $(canvas).appendTo("body");
                    old.hide();
                    var newwidth = old.width()
                      , newheight = old.height()
                      , imageData = old.get(0).getContext("2d").getImageData(0, 0, newwidth, newheight)
                      , cutW = newwidth
                      , cutH = newheight;
                    .54 * cutW > cutH ? cutW = cutH / .54 : cutH = .54 * cutW;
                    var newCanvas = $("<canvas>").attr("width", cutW).attr("height", cutH)[0];
                    newCanvas.getContext("2d").putImageData(imageData, 0, 0),
                    old.attr("width", 350),
                    old.attr("height", 189),
                    old.get(0).getContext("2d").drawImage(newCanvas, 0, 0, 350, 189);
                    var base64 = old.get(0).toDataURL("image/jpeg", .9)
                      , curindex = luckysheet.sheetmanage.getCurSheetnoset();
                    _this.imageRequestLock = !0;
                    var data1 = encodeURIComponent(JSON.stringify({
                        t: "thumb",
                        img: base64,
                        curindex: curindex
                    }));
                    old.remove(),
                    "" != _this.updateImageUrl && $.post(_this.updateImageUrl, {
                        compress: !1,
                        gridKey: _this.gridKey,
                        data: data1
                    }, (function(data) {
                        var re = eval("(" + data + ")");
                        re.status ? imageRequestLast = moment() : $("#luckysheet_info_detail_save").html("<span style='color:#ff2121'>网络不稳定</span>"),
                        _this.imageRequestLock = !0
                    }
                    ))
                }
            })
        },
        localdata: [],
        matchOpt: function(e, t) {
            for (var r in e) {
                if ("t" == r && e.t in {
                    drc: 1,
                    arc: 1,
                    sha: 1,
                    shc: 1,
                    shd: 1
                })
                    return !1;
                if ("v" != r) {
                    if (!(r in t))
                        return !1;
                    if (t[r] != e[r])
                        return !1
                }
            }
            return !0
        },
        deleteRepeatOpt: function(e, t) {
            var r = e;
            if (t instanceof Array)
                for (var a = 0; a < t.length; a++)
                    for (var n = t[a], o = 0; o < r.length; o++) {
                        var l = e[a];
                        this.matchOpt(n, l) && delete r[o]
                    }
            else
                for (var i = 0; i < r.length; i++) {
                    var s = r[i];
                    this.matchOpt(t, s) && delete r[i]
                }
            for (var c = [], u = 0; u < r.length; u++)
                null != r[u] && c.push(r[u]);
            return c
        },
        setlocaldata: function(e, t) {
            this.gridKey;
            var r = this;
            r.getlocaldata((function(a) {
                null == a && (a = []),
                e instanceof Array ? a = a.concat(e) : a.push(e),
                r.localdata = a,
                t(r.localdata)
            }
            ))
        },
        getlocaldata: function(e) {
            this.gridKey;
            e(this.localdata)
        },
        clearlocaldata: function(e) {
            this.gridKey;
            this.localdata = [],
            e()
        },
        cachelocaldata: function(e) {
            var t = this.gridKey + "__qkcache"
              , r = this.localdata
              , a = r.length;
            if (a > 1) {
                var n = [];
                n[0] = r[0];
                for (var o = 1; o < a; o++) {
                    for (var l = r[o], i = !0, s = 0; s < n.length; s++) {
                        var c = n[s];
                        if (this.matchOpt(l, c)) {
                            n.splice(s, 1, l),
                            i = !1;
                            break
                        }
                    }
                    i && (n = n.concat(l))
                }
                r = n
            }
            null != r && 0 != r.length && this.clearlocaldata((function() {
                localforage.setItem(t, r).then((function() {
                    e(t, r)
                }
                ))
            }
            ))
        },
        clearcachelocaldata: function(e) {
            var t = this.gridKey + "__qkcache";
            localforage.removeItem(t, (function(t, r) {
                e && "function" == typeof e && e()
            }
            ))
        },
        restorecachelocaldata: function(e) {
            var t = this.gridKey + "__qkcache"
              , r = this;
            localforage.getItem(t).then((function(t) {
                var a = t;
                r.getlocaldata((function(t) {
                    null == t && (t = []);
                    var n = a.concat(t);
                    r.localdata = n,
                    e instanceof Function && e(r.localdata)
                }
                ))
            }
            ))
        }
    };
    function dynamicArrayCompute(e) {
        var t = {};
        if ("array" == getObjType(e))
            for (var r = 0; r < e.length; r++) {
                var a = e[r].r
                  , n = e[r].c
                  , o = e[r].f;
                if (null != Store.flowdata[a][n] && null != Store.flowdata[a][n].f && Store.flowdata[a][n].f == o) {
                    a + "_" + n in t && (t = dynamicArraySpillEditCompute(t, a, n));
                    var l = e[r].data
                      , i = l.length
                      , s = 1;
                    if ("array" == getObjType(l[0]) && (s = l[0].length),
                    dynamicArrayRangeIsAllNull({
                        row: [a, a + i - 1],
                        column: [n, n + s - 1]
                    }, Store.flowdata))
                        for (var c = 0; c < i; c++)
                            for (var u = 0; u < s; u++) {
                                var h = a + c
                                  , d = n + u;
                                "array" == getObjType(l[0]) ? t[h + "_" + d] = {
                                    v: l[c][u],
                                    r: a,
                                    c: n
                                } : t[h + "_" + d] = {
                                    v: l[c],
                                    r: a,
                                    c: n
                                }
                            }
                    else
                        t[a + "_" + n] = {
                            v: "#SPILL!",
                            r: a,
                            c: n
                        }
                }
            }
        return t
    }
    function dynamicArraySpillEditCompute(e, t, r) {
        var a = e[t + "_" + r].r
          , n = e[t + "_" + r].c;
        for (var o in e)
            o == a + "_" + n ? e[o].v = "#SPILL!" : e[o].r == a && e[o].c == n && delete e[o];
        return e
    }
    function dynamicArrayRangeIsAllNull(e, t) {
        for (var r = e.row[0], a = e.row[1], n = e.column[0], o = e.column[1], l = !0, i = r; i <= a; i++)
            for (var s = n; s <= o; s++)
                if ((i != r || s != n) && null != t[i][s] && null != t[i][s].v && "" != t[i][s].v.toString()) {
                    l = !1;
                    break
                }
        return l
    }
    function dynamicArrayHightShow(e, t) {
        var r = null == Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray ? [] : Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray
          , a = dynamicArrayCompute(r);
        if (e + "_" + t in a && "#SPILL!" != a[e + "_" + t].v) {
            for (var n, o, l = a[e + "_" + t].r, i = a[e + "_" + t].c, s = Store.flowdata[l][i].f, c = 0; c < r.length; c++)
                r[c].f == s && (n = r[c].data.length,
                o = "array" == getObjType(r[c].data[0]) ? r[c].data[0].length : 1);
            var u = l + n - 1
              , h = i + o - 1
              , d = Store.visibledatarow[u]
              , f = l - 1 == -1 ? 0 : Store.visibledatarow[l - 1]
              , m = Store.visibledatacolumn[h]
              , p = i - 1 == -1 ? 0 : Store.visibledatacolumn[i - 1];
            $("#luckysheet-dynamicArray-hightShow").css({
                left: p,
                width: m - p - 1,
                top: f,
                height: d - f - 1,
                display: "block"
            })
        } else
            $("#luckysheet-dynamicArray-hightShow").hide()
    }
    function getdatabyselection(e, t) {
        if (null == e && (e = Store.luckysheet_select_save[0]),
        null == e.row || 0 == e.row.length)
            return [];
        var r, a;
        null != t && t != Store.currentSheetIndex ? (r = Store.luckysheetfile[getSheetIndex(t)].data,
        a = Store.luckysheetfile[getSheetIndex(t)].config) : (r = editor.deepCopyFlowData(Store.flowdata),
        a = Store.config);
        for (var n = [], o = e.row[0]; o <= e.row[1]; o++)
            if (null != r[o] && (null == a.rowhidden || null == a.rowhidden[o])) {
                for (var l = [], i = e.column[0]; i <= e.column[1]; i++)
                    l.push(r[o][i]);
                n.push(l)
            }
        return n
    }
    function getdatabyselectionD(e, t) {
        if (null == t || null == t.row || 0 == t.row.length)
            return [];
        var r = dynamicArrayCompute(Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray)
          , a = [];
        if (null == e)
            return a;
        for (var n = t.row[0]; n <= t.row[1]; n++)
            if (null != e[n]) {
                for (var o = [], l = t.column[0]; l <= t.column[1]; l++) {
                    var i = void 0;
                    i = n + "_" + l in r ? r[n + "_" + l] : e[n][l],
                    o.push(i)
                }
                a.push(o)
            }
        return a
    }
    function getdatabyselectionNoCopy(e) {
        if (null == e || null == e.row || 0 == e.row.length)
            return [];
        for (var t = [], r = e.row[0]; r <= e.row[1]; r++) {
            var a = [];
            if (null == Store.config.rowhidden || null == Store.config.rowhidden[r]) {
                for (var n = e.column[0]; n <= e.column[1]; n++) {
                    var o = "";
                    null != Store.flowdata[r] && null != Store.flowdata[r][n] && (o = Store.flowdata[r][n]),
                    a.push(o)
                }
                t.push(a)
            }
        }
        return t
    }
    function getcellvalue(e, t, r, a) {
        var n;
        if (null == a && (a = "v"),
        null == r && (r = Store.flowdata),
        null != e && null != t)
            n = r[e][t];
        else if (null != e)
            n = r[e];
        else {
            if (null == t)
                return r;
            n = r[0].map((function(e, t) {
                return r.map((function(e) {
                    return e[t]
                }
                ))
            }
            ))[t]
        }
        var o = n;
        return "object" == getObjType(n) && (o = n[a],
        "f" == a && null != o ? o = luckysheetformula.functionHTMLGenerate(o) : "f" == a ? o = n.v : n && n.ct && "d" == n.ct.t && (o = n.m)),
        null == o && (o = null),
        o
    }
    function datagridgrowth(e, t, r, a) {
        if (t <= 0 && r <= 0)
            return e;
        t <= 0 && (t = 0),
        r <= 0 && (r = 0);
        var n = 0;
        0 == e.length ? (e = [],
        n = 0) : n = e[0].length;
        for (var o = [], l = 0; l < r; l++)
            o.push(null);
        for (var i = [], s = 0; s < n + r; s++)
            i.push(null);
        for (var c = 0; c < e.length; c++)
            e[c] = [].concat(e[c].concat(o));
        for (var u = 0; u < t; u++)
            e.push([].concat(i));
        return a && (server.saveParam("all", Store.currentSheetIndex, e.length, {
            k: "row"
        }),
        server.saveParam("all", Store.currentSheetIndex, e[0].length, {
            k: "column"
        })),
        e
    }
    function getcellFormula(e, t, r, a) {
        var n;
        return null == (n = null != a ? a[e][t] : getOrigincell(e, t, r)) ? null : n.f
    }
    function getOrigincell(e, t, r) {
        if (null != e && null != t) {
            var a;
            if (null == r)
                a = Store.flowdata;
            else
                a = sheetmanage.getSheetByIndex(r).data;
            if (null != a)
                return a[e][t]
        }
    }
    function getRealCellValue(e, t) {
        var r = getcellvalue(e, t, null, "m");
        if (null == r && null == (r = getcellvalue(e, t))) {
            var a = getcellvalue(e, t, null, "ct");
            isInlineStringCT(a) && (r = a.s)
        }
        return r
    }
    function getInlineStringNoStyle(e, t) {
        var r = getcellvalue(e, t, null, "ct");
        if (isInlineStringCT(r)) {
            for (var a = r.s, n = "", o = 0; o < a.length; o++) {
                var l = a[o];
                null != l.v && (n += l.v)
            }
            return n
        }
        return ""
    }
    function getInlineStringStyle(e, t, r) {
        var a = getcellvalue(e, t, r, "ct");
        null == r && (r = Store.flowdata);
        r[e][t];
        if (isInlineStringCT(a)) {
            for (var n = a.s, o = "", l = 0; l < n.length; l++) {
                var i = n[l];
                if (null != i.v)
                    o += "<span index='" + l + "' style='" + getFontStyleByCell(i) + "'>" + i.v + "</span>"
            }
            return o
        }
        return ""
    }
    function getFontStyleByCell(e, t, r) {
        var a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3];
        if (null != e) {
            var n = ""
              , o = locale()
              , l = o.fontarray;
            for (var i in e) {
                var s = e[i];
                if (a && (s = checkstatusByCell(e, i)),
                "bl" == i && "0" != s && (n += "font-weight: bold;"),
                "it" == i && "0" != s && (n += "font-style:italic;"),
                "ff" == i) {
                    n += "font-family: " + (isNaN(parseInt(s)) ? s : l[parseInt(s)]) + ";"
                }
                if ("fs" == i && "10" != s && (n += "font-size: " + s + "pt;"),
                ("fc" == i && "#000000" != s || null != t || null != r && null != r.textColor) && (null != r && null != r.textColor ? n += "color: " + r.textColor + ";" : n += null != t ? "color: " + t[0] + ";" : "color: " + s + ";"),
                "cl" == i && "0" != s && (n += "text-decoration: line-through;"),
                "un" == i && ("1" == s || "3" == s)) {
                    var c = e._color;
                    null == c && (c = e.fc);
                    var u = e._fontSize;
                    null == u && (u = e.fs),
                    n += "border-bottom: " + Math.floor(u / 9) + "px solid " + c + ";"
                }
            }
            return n
        }
    }
    function checkstatusByCell(e, t) {
        var r = e;
        return t in {
            bl: 1,
            it: 1,
            ff: 1,
            cl: 1,
            un: 1
        } || "fs" == t && isInlineStringCell(e) ? (null == r || null == (r = r[t])) && (r = "0") : "fc" == t ? null == r ? r = "#000000" : (null == (r = r[t]) && (r = "#000000"),
        r.indexOf("rgba") > -1 && (r = rgbTohex(r))) : "bg" == t ? null == r || null == (r = r[t]) ? r = null : r.toString().indexOf("rgba") > -1 && (r = rgbTohex(r)) : "bs" == t.substr(0, 2) ? (null == r || null == (r = r[t])) && (r = "none") : "bc" == t.substr(0, 2) ? (null == r || null == (r = r[t])) && (r = "#000000") : "ht" == t ? ((null == r || null == (r = r[t])) && (r = "1"),
        -1 == ["0", "1", "2"].indexOf(r.toString()) && (r = "1")) : "vt" == t ? ((null == r || null == (r = r[t])) && (r = "2"),
        -1 == ["0", "1", "2"].indexOf(r.toString()) && (r = "2")) : "ct" == t ? (null == r || null == (r = r[t])) && (r = null) : "fs" == t ? (null == r || null == (r = r[t])) && (r = "10") : "tb" == t || "tr" == t ? (null == r || null == (r = r[t])) && (r = "0") : "rt" == t && (null == r || null == (r = r[t])) && (r = null),
        r
    }
    function textTrim(e) {
        return null == e || 0 == e.length ? e : e.replace(/^\s+|\s+$/gm, "")
    }
    var editor = {
        deepCopyFlowDataState: !1,
        deepCopyFlowDataCache: "",
        deepCopyFlowDataWorker: null,
        deepCopyFlowData: function(e) {
            return this.deepCopyFlowDataState ? (null != this.deepCopyFlowDataWorker && this.deepCopyFlowDataWorker.terminate(),
            this.deepCopyFlowDataCache) : (null == e && (e = Store.flowdata),
            $.extend(!0, [], e))
        },
        webWorkerFlowDataCache: function(e) {
            var t = this;
            try {
                null != t.deepCopyFlowDataWorker && t.deepCopyFlowDataWorker.terminate();
                var r;
                if (t.deepCopyFlowDataState = !1,
                1 == browser.isIE()) {
                    (r = new Worker("./plugins/Worker-helper.js")).postMessage("self.onmessage=function(e){postMessage(e.data);}")
                } else
                    r = new Worker("data:text/javascript;chartset=US-ASCII,onmessage = function (e) { postMessage(e.data); };");
                t.deepCopyFlowDataWorker = r,
                r.postMessage(e),
                r.onmessage = function(e) {
                    t.deepCopyFlowDataCache = e.data,
                    t.deepCopyFlowDataState = !0
                }
            } catch (r) {
                t.deepCopyFlowDataCache = $.extend(!0, [], e)
            }
        },
        controlHandler: function(e, t) {
            var r = this.deepCopyFlowData(Store.flowdata)
              , a = t || Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , n = null == a.row ? 0 : a.row[0]
              , o = null == a.column ? 0 : a.column[0]
              , l = e.length
              , i = e[0].length
              , s = n + l - r.length
              , c = o + i - r[0].length;
            (s > 0 || c > 0) && (r = datagridgrowth([].concat(r), s, c, !0));
            for (var u = 0; u < l; u++) {
                for (var h = [].concat(r[u + n]), d = 0; d < i; d++) {
                    var f = "";
                    null != e[u] && null != e[u][d] && (f = e[u][d]),
                    h[d + o] = f
                }
                r[u + n] = h
            }
            s > 0 || c > 0 ? jfrefreshgridall(r[0].length, r.length, r, null, Store.luckysheet_select_save, "datachangeAll") : jfrefreshrange(r, Store.luckysheet_select_save)
        },
        clearRangeByindex: function(e, t, r, a, n) {
            for (var o = getSheetIndex(n), l = $.extend(!0, [], Store.luckysheetfile[o].data), i = e; i <= t; i++) {
                for (var s = [].concat(l[i]), c = r; c <= a; c++)
                    luckysheetformula.delFunctionGroup(i, c),
                    luckysheetformula.execFunctionGroup(i, c, ""),
                    s[c] = null;
                l[i] = s
            }
            n == Store.currentSheetIndex ? t - e + 1 > 5e3 ? jfrefreshgrid(l, [{
                row: [e, t],
                column: [r, a]
            }]) : jfrefreshrange(l, {
                row: [e, t],
                column: [r, a]
            }) : Store.luckysheetfile[o].data = l
        },
        controlHandlerD: function(e) {
            var t = this.deepCopyFlowData(Store.flowdata)
              , r = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , a = r.row[0]
              , n = r.row[1]
              , o = r.column[0]
              , l = r.column[1]
              , i = e.length
              , s = e[0].length
              , c = a + i - t.length
              , u = o + s - t[0].length;
            (c > 0 || u > 0) && (t = datagridgrowth([].concat(t), c, u, !0));
            for (var h = a; h <= n; h++)
                for (var d = o; d <= l; d++)
                    t[h][d] = null;
            for (var f = 0; f < i; f++)
                for (var m = 0; m < s; m++)
                    t[a + f][o + m] = e[f][m];
            jfrefreshgrid(t, [{
                row: [a, n],
                column: [o, l]
            }, {
                row: [a, a + i - 1],
                column: [o, o + s - 1]
            }])
        }
    }
      , createClass = function() {
        var e, t;
        return e = function() {
            this.init.apply(this, arguments)
        }
        ,
        arguments.length > 1 ? (arguments[0] ? (e.prototype = $.extend(new arguments[0], arguments[arguments.length - 1]),
        e._super = arguments[0].prototype) : e.prototype = arguments[arguments.length - 1],
        arguments.length > 2 && ((t = Array.prototype.slice.call(arguments, 1, -1)).unshift(e.prototype),
        $.extend.apply($, t))) : e.prototype = arguments[0],
        e.prototype.cls = e,
        e
    }
      , SPFormat = createClass({
        fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g,
        precre: /(\w+)\.(\d+)/,
        init: function(e, t) {
            this.format = e,
            this.fclass = t
        },
        render: function(e, t, r) {
            var a, n, o, l, i, s = this, c = e;
            return this.format.replace(this.fre, (function() {
                return n = arguments[1],
                o = arguments[3],
                (a = s.precre.exec(n)) ? (i = a[2],
                n = a[1]) : i = !1,
                void 0 === (l = c[n]) ? "" : o && t && t[o] ? t[o].get ? t[o].get(l) || l : t[o][l] || l : (isNumber(l) && (l = r.get("numberFormatter") ? r.get("numberFormatter")(l) : formatNumber(l, i, r.get("numberDigitGroupCount"), r.get("numberDigitGroupSep"), r.get("numberDecimalMark"))),
                l)
            }
            ))
        }
    });
    $.spformat = function(e, t) {
        return new SPFormat(e,t)
    }
    ;
    var clipval = function(e, t, r) {
        return e < t ? t : e > r ? r : e
    }
      , quartile = function(e, t) {
        var r;
        return 2 === t ? (r = Math.floor(e.length / 2),
        e.length % 2 ? e[r] : (e[r - 1] + e[r]) / 2) : e.length % 2 ? (r = (e.length * t + t) / 4) % 1 ? (e[Math.floor(r)] + e[Math.floor(r) - 1]) / 2 : e[r - 1] : (r = (e.length * t + 2) / 4) % 1 ? (e[Math.floor(r)] + e[Math.floor(r) - 1]) / 2 : e[r - 1]
    }
      , normalizeValue = function(e) {
        var t;
        switch (e) {
        case "undefined":
            e = void 0;
            break;
        case "null":
            e = null;
            break;
        case "true":
            e = !0;
            break;
        case "false":
            e = !1;
            break;
        default:
            e == (t = parseFloat(e)) && (e = t)
        }
        return e
    }
      , normalizeValues = function(e) {
        var t, r = [];
        for (t = e.length; t--; )
            r[t] = normalizeValue(e[t]);
        return r
    }
      , all = function(e, t, r) {
        var a;
        for (a = t.length; a--; )
            if ((!r || null !== t[a]) && t[a] !== e)
                return !1;
        return !0
    }
      , remove = function(e, t) {
        var r, a, n = [];
        for (r = 0,
        a = e.length; r < a; r++)
            e[r] !== t && n.push(e[r]);
        return n
    }
      , isNumber = function(e) {
        return !isNaN(parseFloat(e)) && isFinite(e)
    }
      , formatNumber = function(e, t, r, a, n) {
        var o, l;
        for (e = (!1 === t ? parseFloat(e).toString() : e.toFixed(t)).split(""),
        (o = (o = $.inArray(".", e)) < 0 ? e.length : o) < e.length && (e[o] = n),
        l = o - r; l > 0; l -= r)
            e.splice(l, 0, a);
        return e.join("")
    }
      , RangeMap = createClass({
        init: function(e) {
            var t, r, a = [];
            for (t in e)
                e.hasOwnProperty(t) && "string" == typeof t && t.indexOf(":") > -1 && ((r = t.split(":"))[0] = 0 === r[0].length ? -1 / 0 : parseFloat(r[0]),
                r[1] = 0 === r[1].length ? 1 / 0 : parseFloat(r[1]),
                r[2] = e[t],
                a.push(r));
            this.map = e,
            this.rangelist = a || !1
        },
        get: function(e) {
            var t, r, a, n = this.rangelist;
            if (void 0 !== (a = this.map[e]))
                return a;
            if (n)
                for (t = n.length; t--; )
                    if ((r = n[t])[0] <= e && r[1] >= e)
                        return r[2]
        }
    });
    $.range_map = function(e) {
        return new RangeMap(e)
    }
    ;
    var luckysheetSparkline = {
        defaultOption: {
            common: {
                type: "line",
                lineColor: "#2ec7c9",
                fillColor: "#CCF3F4",
                defaultPixelsPerValue: 3,
                width: "auto",
                height: "auto",
                composite: !1,
                tagValuesAttribute: "values",
                tagOptionsPrefix: "spark",
                enableTagOptions: !1,
                enableHighlight: !0,
                highlightLighten: 1.4,
                tooltipSkipNull: !0,
                tooltipPrefix: "",
                tooltipSuffix: "",
                disableHiddenCheck: !1,
                numberFormatter: !1,
                numberDigitGroupCount: 3,
                numberDigitGroupSep: ",",
                numberDecimalMark: ".",
                disableTooltips: !0,
                disableInteraction: !0,
                offsetX: 0,
                offsetY: 0
            },
            line: {
                spotColor: 0,
                highlightSpotColor: "#5f5",
                highlightLineColor: "#f22",
                spotRadius: 1.5,
                minSpotColor: 0,
                maxSpotColor: 0,
                lineWidth: 1,
                normalRangeMin: void 0,
                normalRangeMax: void 0,
                normalRangeColor: "#ccc",
                drawNormalOnTop: !0,
                chartRangeMin: void 0,
                chartRangeMax: void 0,
                chartRangeMinX: void 0,
                chartRangeMaxX: void 0
            },
            bar: {
                barColor: "#fc5c5c",
                negBarColor: "#97b552",
                stackedBarColor: ["#2ec7c9", "#fc5c5c", "#5ab1ef", "#ffb980", "#d87a80", "#8d98b3", "#e5cf0d", "#97b552", "#95706d", "#dc69aa", "#07a2a4", "#9a7fd1", "#588dd5", "#f5994e", "#c05050", "#59678c", "#c9ab00", "#7eb00a", "#6f5553", "#c14089"],
                zeroColor: void 0,
                nullColor: void 0,
                zeroAxis: !0,
                barWidth: 4,
                barSpacing: 1,
                chartRangeMax: void 0,
                chartRangeMin: void 0,
                chartRangeClip: !1,
                colorMap: void 0
            },
            column: {
                barColor: "#fc5c5c",
                negBarColor: "#97b552",
                stackedBarColor: ["#2ec7c9", "#fc5c5c", "#5ab1ef", "#ffb980", "#d87a80", "#8d98b3", "#e5cf0d", "#97b552", "#95706d", "#dc69aa", "#07a2a4", "#9a7fd1", "#588dd5", "#f5994e", "#c05050", "#59678c", "#c9ab00", "#7eb00a", "#6f5553", "#c14089"],
                zeroColor: void 0,
                nullColor: void 0,
                zeroAxis: !0,
                barWidth: 4,
                barSpacing: 1,
                chartRangeMax: void 0,
                chartRangeMin: void 0,
                chartRangeClip: !1,
                colorMap: void 0
            },
            tristate: {
                barWidth: 4,
                barSpacing: 1,
                posBarColor: "#fc5c5c",
                negBarColor: "#97b552",
                zeroBarColor: "#999",
                colorMap: {}
            },
            discrete: {
                lineHeight: "auto",
                thresholdColor: "#fc5c5c",
                thresholdValue: 0,
                chartRangeMax: void 0,
                chartRangeMin: void 0,
                chartRangeClip: !1
            },
            bullet: {
                targetColor: "#f33",
                targetWidth: 3,
                performanceColor: "#33f",
                rangeColors: ["#d3dafe", "#a8b6ff", "#7f94ff", "#6D87FF", "#5876FF", "#4465FF", "#2F54FF", "#1A43FF", "#0532FF"],
                base: void 0
            },
            pie: {
                offset: 0,
                sliceColors: ["#2ec7c9", "#fc5c5c", "#5ab1ef", "#ffb980", "#d87a80", "#8d98b3", "#e5cf0d", "#97b552", "#95706d", "#dc69aa", "#07a2a4", "#9a7fd1", "#588dd5", "#f5994e", "#c05050", "#59678c", "#c9ab00", "#7eb00a", "#6f5553", "#c14089"],
                borderWidth: 0,
                borderColor: "#000"
            },
            box: {
                raw: !1,
                boxLineColor: "#000",
                boxFillColor: "#cdf",
                whiskerColor: "#000",
                outlierLineColor: "#5E5E5E",
                outlierFillColor: "#fff",
                medianColor: "#f00",
                showOutliers: !0,
                outlierIQR: 1.5,
                spotRadius: 1.5,
                target: void 0,
                targetColor: "#4a2",
                chartRangeMax: void 0,
                chartRangeMin: void 0
            }
        },
        line: {
            type: "line",
            init: function(e, t, r, a, n) {
                this.vertices = [],
                this.regionMap = [],
                this.xvalues = [],
                this.yvalues = [],
                this.yminmax = [],
                this.hightlightSpotId = null,
                this.lastShapeId = null
            },
            getRegion: function(e, t, r) {
                var a, n = this.regionMap;
                for (a = n.length; a--; )
                    if (null !== n[a] && t >= n[a][0] && t <= n[a][1])
                        return n[a][2]
            },
            getCurrentRegionFields: function() {
                var e = this.currentRegion;
                return {
                    isNull: null === this.yvalues[e],
                    x: this.xvalues[e],
                    y: this.yvalues[e],
                    color: this.options.get("lineColor"),
                    fillColor: this.options.get("fillColor"),
                    offset: e
                }
            },
            renderHighlight: function() {
                var e, t, r = this.currentRegion, a = this.target, n = this.vertices[r], o = this.options, l = o.get("spotRadius"), i = o.get("highlightSpotColor"), s = o.get("highlightLineColor");
                n && (l && i && (e = a.drawCircle(n[0], n[1], l, void 0, i),
                this.highlightSpotId = e.id,
                a.insertAfterShape(this.lastShapeId, e)),
                s && (t = a.drawLine(n[0], this.canvasTop, n[0], this.canvasTop + this.canvasHeight, s),
                this.highlightLineId = t.id,
                a.insertAfterShape(this.lastShapeId, t)))
            },
            removeHighlight: function() {
                var e = this.target;
                this.highlightSpotId && (e.removeShapeId(this.highlightSpotId),
                this.highlightSpotId = null),
                this.highlightLineId && (e.removeShapeId(this.highlightLineId),
                this.highlightLineId = null)
            },
            scanValues: function() {
                var e, t, r, a, n, o = this.values, l = o.length, i = this.xvalues, s = this.yvalues, c = this.yminmax;
                for (e = 0; e < l; e++)
                    t = o[e],
                    r = "string" == typeof o[e],
                    a = "object" === _typeof(o[e]) && o[e]instanceof Array,
                    n = r && o[e].split(":"),
                    r && 2 === n.length ? (i.push(Number(n[0])),
                    s.push(Number(n[1])),
                    c.push(Number(n[1]))) : a ? (i.push(t[0]),
                    s.push(t[1]),
                    c.push(t[1])) : (i.push(e),
                    null === o[e] || "null" === o[e] ? s.push(null) : (s.push(Number(t)),
                    c.push(Number(t))));
                this.options.get("xvalues") && (i = this.options.get("xvalues")),
                this.maxy = this.maxyorg = Math.max.apply(Math, c),
                this.miny = this.minyorg = Math.min.apply(Math, c),
                this.maxx = Math.max.apply(Math, i),
                this.minx = Math.min.apply(Math, i),
                this.xvalues = i,
                this.yvalues = s,
                this.yminmax = c
            },
            processRangeOptions: function() {
                var e = this.options
                  , t = e.get("normalRangeMin")
                  , r = e.get("normalRangeMax");
                void 0 !== t && (t < this.miny && (this.miny = t),
                r > this.maxy && (this.maxy = r)),
                void 0 !== e.get("chartRangeMin") && (e.get("chartRangeClip") || e.get("chartRangeMin") < this.miny) && (this.miny = e.get("chartRangeMin")),
                void 0 !== e.get("chartRangeMax") && (e.get("chartRangeClip") || e.get("chartRangeMax") > this.maxy) && (this.maxy = e.get("chartRangeMax")),
                void 0 !== e.get("chartRangeMinX") && (e.get("chartRangeClipX") || e.get("chartRangeMinX") < this.minx) && (this.minx = e.get("chartRangeMinX")),
                void 0 !== e.get("chartRangeMaxX") && (e.get("chartRangeClipX") || e.get("chartRangeMaxX") > this.maxx) && (this.maxx = e.get("chartRangeMaxX"))
            },
            drawNormalRange: function(e, t, r, a, n) {
                var o = this.options.get("normalRangeMin")
                  , l = this.options.get("normalRangeMax")
                  , i = t + Math.round(r - r * ((l - this.miny) / n))
                  , s = Math.round(r * (l - o) / n);
                0 == s && o == l && (s = 1),
                this.target.drawRect(e, i, a, s, void 0, this.options.get("normalRangeColor")).append()
            },
            render: function(e, t) {
                this.vertices = [],
                this.regionMap = [],
                this.xvalues = [],
                this.yvalues = [],
                this.yminmax = [],
                this.hightlightSpotId = null,
                this.lastShapeId = null,
                this.values = t;
                var r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _, C = this.options, T = this.target, E = e.mergedOptions.width, I = e.mergedOptions.height, R = this.vertices, B = C.get("spotRadius"), N = this.regionMap;
                if (this.scanValues(),
                this.processRangeOptions(),
                x = this.xvalues,
                S = this.yvalues,
                this.yminmax.length && !(this.yvalues.length < 2)) {
                    for (o = l = 0,
                    r = this.maxx - this.minx == 0 ? 1 : this.maxx - this.minx,
                    a = this.maxy - this.miny == 0 ? 1 : this.maxy - this.miny,
                    n = this.yvalues.length - 1,
                    B && (E < 4 * B || I < 4 * B) && (B = 0),
                    B && (((k = C.get("highlightSpotColor") && !C.get("disableInteraction")) || C.get("minSpotColor") || C.get("spotColor") && S[n] === this.miny) && (I -= Math.ceil(B)),
                    (k || C.get("maxSpotColor") || C.get("spotColor") && S[n] === this.maxy) && (I -= Math.ceil(B),
                    o += Math.ceil(B)),
                    (k || (C.get("minSpotColor") || C.get("maxSpotColor")) && (S[0] === this.miny || S[0] === this.maxy)) && (l += Math.ceil(B),
                    E -= Math.ceil(B)),
                    (k || C.get("spotColor") || C.get("minSpotColor") || C.get("maxSpotColor") && (S[n] === this.miny || S[n] === this.maxy)) && (E -= Math.ceil(B))),
                    I--,
                    void 0 === C.get("normalRangeMin") || C.get("drawNormalOnTop") || this.drawNormalRange(l, o, I, E, a),
                    c = [s = []],
                    m = p = null,
                    g = S.length,
                    _ = 0; _ < g; _++)
                        u = x[_],
                        d = x[_ + 1],
                        h = S[_],
                        p = (f = l + Math.round((u - this.minx) * (E / r))) + ((_ < g - 1 ? l + Math.round((d - this.minx) * (E / r)) : E) - f) / 2,
                        N[_] = [m || 0, p, _],
                        m = p,
                        null === h ? _ && (null !== S[_ - 1] && (s = [],
                        c.push(s)),
                        R.push(null)) : (h < this.miny && (h = this.miny),
                        h > this.maxy && (h = this.maxy),
                        s.length || s.push([f, o + I]),
                        i = [f, o + Math.round(I - I * ((h - this.miny) / a))],
                        s.push(i),
                        R.push(i));
                    for (y = [],
                    v = [],
                    A = c.length,
                    _ = 0; _ < A; _++)
                        (s = c[_]).length && (C.get("fillColor") && (s.push([s[s.length - 1][0], o + I]),
                        v.push(s.slice(0)),
                        s.pop()),
                        s.length > 2 && (s[0] = [s[0][0], s[1][1]]),
                        y.push(s));
                    for (A = v.length,
                    _ = 0; _ < A; _++)
                        T.drawShape(v[_], C.get("fillColor"), C.get("fillColor")).append();
                    for (A = y.length,
                    _ = 0; _ < A; _++)
                        T.drawShape(y[_], C.get("lineColor"), void 0, C.get("lineWidth")).append();
                    if (void 0 !== C.get("normalRangeMin") && C.get("drawNormalOnTop") && this.drawNormalRange(l, o, I, E, a),
                    B && C.get("valueSpots"))
                        for (void 0 === (b = C.get("valueSpots")).get && (b = new RangeMap(b)),
                        _ = 0; _ < g; _++)
                            (w = b.get(S[_])) && T.drawCircle(l + Math.round((x[_] - this.minx) * (E / r)), o + Math.round(I - I * ((S[_] - this.miny) / a)), B, void 0, w).append();
                    B && C.get("spotColor") && null !== S[n] && T.drawCircle(l + Math.round((x[x.length - 1] - this.minx) * (E / r)), o + Math.round(I - I * ((S[n] - this.miny) / a)), B, void 0, C.get("spotColor")).append(),
                    this.maxy !== this.minyorg && (B && C.get("minSpotColor") && (u = x[$.inArray(this.minyorg, S)],
                    T.drawCircle(l + Math.round((u - this.minx) * (E / r)), o + Math.round(I - I * ((this.minyorg - this.miny) / a)), B, void 0, C.get("minSpotColor")).append()),
                    B && C.get("maxSpotColor") && (u = x[$.inArray(this.maxyorg, S)],
                    T.drawCircle(l + Math.round((u - this.minx) * (E / r)), o + Math.round(I - I * ((this.maxyorg - this.miny) / a)), B, void 0, C.get("maxSpotColor")).append()))
                }
            }
        },
        bar: {
            type: "bar",
            init: function(e, t) {
                var r = this.options
                  , a = e.mergedOptions.height;
                e.mergedOptions.width;
                this.canvasWidth = e.mergedOptions.height,
                this.canvasHeight = e.mergedOptions.width;
                parseInt(r.get("barWidth"), 10);
                var n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _ = parseInt(r.get("barSpacing"), 10), C = r.get("chartRangeMin"), T = r.get("chartRangeMax"), E = r.get("chartRangeClip"), I = 1 / 0, R = -1 / 0;
                for (this.values = t,
                c = 0,
                u = t.length; c < u; c++)
                    ((n = "string" == typeof (x = t[c]) && x.indexOf(":") > -1) || $.isArray(x)) && (v = !0,
                    n && (x = t[c] = normalizeValues(x.split(":"))),
                    x = remove(x, null),
                    (o = Math.min.apply(Math, x)) < I && (I = o),
                    (l = Math.max.apply(Math, x)) > R && (R = l));
                this.stacked = v,
                this.regionShapes = {},
                this.barWidth = Math.floor(a / t.length) - _,
                this.barSpacing = _,
                this.totalBarWidth = this.barWidth + _,
                this.width = a,
                E && (g = void 0 === C ? -1 / 0 : C,
                y = void 0 === T ? 1 / 0 : T),
                s = [],
                i = v ? [] : s;
                var B = []
                  , N = [];
                for (c = 0,
                u = t.length; c < u; c++)
                    if (v)
                        for (A = t[c],
                        t[c] = w = [],
                        B[c] = 0,
                        i[c] = N[c] = 0,
                        b = 0,
                        k = A.length; b < k; b++)
                            null !== (x = w[b] = E ? clipval(A[b], g, y) : A[b]) && (x > 0 && (B[c] += x),
                            I < 0 && R > 0 ? x < 0 ? N[c] += Math.abs(x) : i[c] += x : i[c] += Math.abs(x),
                            s.push(x));
                    else
                        x = E ? clipval(t[c], g, y) : t[c],
                        null !== (x = t[c] = normalizeValue(x)) && s.push(x);
                this.max = p = Math.max.apply(Math, s),
                this.min = m = Math.min.apply(Math, s),
                this.stackMax = R = v ? Math.max.apply(Math, B) : p,
                this.stackMin = I = v ? Math.min.apply(Math, s) : m,
                void 0 !== r.get("chartRangeMin") && (r.get("chartRangeClip") || r.get("chartRangeMin") < m) && (m = r.get("chartRangeMin")),
                void 0 !== r.get("chartRangeMax") && (r.get("chartRangeClip") || r.get("chartRangeMax") > p) && (p = r.get("chartRangeMax")),
                this.zeroAxis = d = r.get("zeroAxis", !0),
                f = m <= 0 && p >= 0 && d ? 0 : 0 == d ? m : m > 0 ? 0 : p,
                this.xaxisOffset = f,
                h = v ? Math.max.apply(Math, i) + Math.max.apply(Math, N) : p - f,
                this.canvasHeightEf = d && m < 0 ? this.canvasHeight - 2 : this.canvasHeight - 1,
                this.isNeg = !1,
                m < f ? (S = Math.floor(this.canvasHeight / 2),
                this.isNeg = !0,
                S !== Math.ceil(S) && (this.canvasHeightEf -= 2,
                S = Math.ceil(S))) : S = 0,
                this.yoffset = S,
                $.isArray(r.get("colorMap")) ? (this.colorMapByIndex = r.get("colorMap"),
                this.colorMapByValue = null) : (this.colorMapByIndex = null,
                this.colorMapByValue = r.get("colorMap"),
                this.colorMapByValue && void 0 === this.colorMapByValue.get && (this.colorMapByValue = new RangeMap(this.colorMapByValue))),
                this.range = h
            },
            getRegion: function(e, t, r) {
                var a = Math.floor(t / this.totalBarWidth);
                return a < 0 || a >= this.values.length ? void 0 : a
            },
            getCurrentRegionFields: function() {
                var e, t, r = this.currentRegion, a = ensureArray(this.values[r]), n = [];
                for (t = a.length; t--; )
                    e = a[t],
                    n.push({
                        isNull: null === e,
                        value: e,
                        color: this.calcColor(t, e, r),
                        offset: r
                    });
                return n
            },
            calcColor: function(e, t, r) {
                var a, n, o = this.colorMapByIndex, l = this.colorMapByValue, i = this.options;
                return a = this.stacked ? i.get("stackedBarColor") : t < 0 ? i.get("negBarColor") : i.get("barColor"),
                0 === t && void 0 !== i.get("zeroColor") && (a = i.get("zeroColor")),
                l && (n = l.get(t)) ? a = n : o && o.length > r && (a = o[r]),
                $.isArray(a) ? a[e % a.length] : a
            },
            renderRegion: function(e, t) {
                var r, a, n, o, l, i, s, c, u, h, d = this.values[e], f = this.options, m = this.xaxisOffset, p = [], g = this.range, y = this.stacked, v = this.target, A = e * this.totalBarWidth, b = this.canvasHeightEf, k = this.yoffset;
                if (s = (d = $.isArray(d) ? d : [d]).length,
                c = d[0],
                o = all(null, d),
                h = all(m, d, !0),
                o)
                    return f.get("nullColor") ? (n = t ? f.get("nullColor") : this.calcHighlightColor(f.get("nullColor"), f),
                    r = k > 0 ? k - 1 : k,
                    v.drawRect(r, A, 0, this.barWidth - 1, n, n)) : void 0;
                for (l = k,
                this.isNeg && (b = Math.floor(b / 2)),
                i = 0; i < s; i++) {
                    if (c = d[i],
                    y && c === m) {
                        if (!h || u)
                            continue;
                        u = !0
                    }
                    a = g > 0 ? Math.floor(b * (Math.abs(c - m) / g)) : b,
                    c < m || c === m && 0 === k ? (r = l - a,
                    l += a) : y ? (r = k,
                    k += a) : (r = k,
                    k -= a),
                    n = this.calcColor(i, c, e),
                    t && (n = this.calcHighlightColor(n, f)),
                    p.push(v.drawRect(r, A, a - 1, this.barWidth - 1, n, n))
                }
                return 1 === p.length ? p[0] : p
            }
        },
        column: {
            type: "column",
            init: function(e, t) {
                var r = this.options
                  , a = e.mergedOptions.width;
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height;
                parseInt(r.get("barWidth"), 10);
                var n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _ = parseInt(r.get("barSpacing"), 10), C = r.get("chartRangeMin"), T = r.get("chartRangeMax"), E = r.get("chartRangeClip"), I = 1 / 0, R = -1 / 0;
                for (this.values = t,
                c = 0,
                u = t.length; c < u; c++)
                    ((n = "string" == typeof (x = t[c]) && x.indexOf(":") > -1) || $.isArray(x)) && (v = !0,
                    n && (x = t[c] = normalizeValues(x.split(":"))),
                    x = remove(x, null),
                    (o = Math.min.apply(Math, x)) < I && (I = o),
                    (l = Math.max.apply(Math, x)) > R && (R = l));
                this.stacked = v,
                this.regionShapes = {},
                this.barWidth = Math.floor(a / t.length) - _,
                this.barSpacing = _,
                this.totalBarWidth = this.barWidth + _,
                this.width = a,
                E && (g = void 0 === C ? -1 / 0 : C,
                y = void 0 === T ? 1 / 0 : T),
                s = [],
                i = v ? [] : s;
                var B = []
                  , N = [];
                for (c = 0,
                u = t.length; c < u; c++)
                    if (v)
                        for (A = t[c],
                        t[c] = w = [],
                        B[c] = 0,
                        i[c] = N[c] = 0,
                        b = 0,
                        k = A.length; b < k; b++)
                            null !== (x = w[b] = E ? clipval(A[b], g, y) : A[b]) && (x > 0 && (B[c] += x),
                            I < 0 && R > 0 ? x < 0 ? N[c] += Math.abs(x) : i[c] += x : i[c] += Math.abs(x),
                            s.push(x));
                    else
                        x = E ? clipval(t[c], g, y) : t[c],
                        null !== (x = t[c] = normalizeValue(x)) && s.push(x);
                this.max = p = Math.max.apply(Math, s),
                this.min = m = Math.min.apply(Math, s),
                this.stackMax = R = v ? Math.max.apply(Math, B) : p,
                this.stackMin = I = v ? Math.min.apply(Math, s) : m,
                void 0 !== r.get("chartRangeMin") && (r.get("chartRangeClip") || r.get("chartRangeMin") < m) && (m = r.get("chartRangeMin")),
                void 0 !== r.get("chartRangeMax") && (r.get("chartRangeClip") || r.get("chartRangeMax") > p) && (p = r.get("chartRangeMax")),
                this.zeroAxis = d = r.get("zeroAxis", !0),
                f = m <= 0 && p >= 0 && d ? 0 : 0 == d ? m : m > 0 ? 0 : p,
                this.xaxisOffset = f,
                h = v ? Math.max.apply(Math, i) + Math.max.apply(Math, N) : p - f,
                this.canvasHeightEf = d && m < 0 ? this.canvasHeight - 2 : this.canvasHeight - 1,
                this.isNeg = !1,
                m < f ? (S = Math.floor(this.canvasHeight / 2),
                this.isNeg = !0,
                S !== Math.ceil(S) && (this.canvasHeightEf -= 2,
                S = Math.ceil(S))) : S = this.canvasHeight,
                this.yoffset = S,
                $.isArray(r.get("colorMap")) ? (this.colorMapByIndex = r.get("colorMap"),
                this.colorMapByValue = null) : (this.colorMapByIndex = null,
                this.colorMapByValue = r.get("colorMap"),
                this.colorMapByValue && void 0 === this.colorMapByValue.get && (this.colorMapByValue = new RangeMap(this.colorMapByValue))),
                this.range = h
            },
            getRegion: function(e, t, r) {
                var a = Math.floor(t / this.totalBarWidth);
                return a < 0 || a >= this.values.length ? void 0 : a
            },
            getCurrentRegionFields: function() {
                var e, t, r = this.currentRegion, a = ensureArray(this.values[r]), n = [];
                for (t = a.length; t--; )
                    e = a[t],
                    n.push({
                        isNull: null === e,
                        value: e,
                        color: this.calcColor(t, e, r),
                        offset: r
                    });
                return n
            },
            calcColor: function(e, t, r) {
                var a, n, o = this.colorMapByIndex, l = this.colorMapByValue, i = this.options;
                return a = this.stacked ? i.get("stackedBarColor") : t < 0 ? i.get("negBarColor") : i.get("barColor"),
                0 === t && void 0 !== i.get("zeroColor") && (a = i.get("zeroColor")),
                l && (n = l.get(t)) ? a = n : o && o.length > r && (a = o[r]),
                $.isArray(a) ? a[e % a.length] : a
            },
            renderRegion: function(e, t) {
                var r, a, n, o, l, i, s, c, u, h, d = this.values[e], f = this.options, m = this.xaxisOffset, p = [], g = this.range, y = this.stacked, v = this.target, A = e * this.totalBarWidth, b = this.canvasHeightEf, k = this.yoffset;
                if (s = (d = $.isArray(d) ? d : [d]).length,
                c = d[0],
                o = all(null, d),
                h = all(m, d, !0),
                o)
                    return f.get("nullColor") ? (n = t ? f.get("nullColor") : this.calcHighlightColor(f.get("nullColor"), f),
                    r = k > 0 ? k - 1 : k,
                    v.drawRect(A, r, this.barWidth - 1, 0, n, n)) : void 0;
                for (l = k,
                this.isNeg && (b = Math.floor(b / 2)),
                i = 0; i < s; i++) {
                    if (c = d[i],
                    y && c === m) {
                        if (!h || u)
                            continue;
                        u = !0
                    }
                    a = g > 0 ? Math.floor(b * (Math.abs(c - m) / g)) : b,
                    c < m || c === m && 0 === k ? (r = l,
                    l += a) : (r = k - a,
                    k -= a),
                    n = this.calcColor(i, c, e),
                    t && (n = this.calcHighlightColor(n, f)),
                    p.push(v.drawRect(A, r, this.barWidth - 1, a - 1, n, n))
                }
                return 1 === p.length ? p[0] : p
            }
        },
        tristate: {
            type: "tristate",
            init: function(e, t) {
                var r = this.options;
                e.mergedOptions.width,
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height;
                var a = parseInt(r.get("barWidth"), 10)
                  , n = parseInt(r.get("barSpacing"), 10);
                this.regionShapes = {},
                this.barWidth = a,
                this.barSpacing = n,
                this.totalBarWidth = a + n,
                this.values = $.map(t, Number),
                this.width = t.length * a + (t.length - 1) * n,
                $.isArray(r.get("colorMap")) ? (this.colorMapByIndex = r.get("colorMap"),
                this.colorMapByValue = null) : (this.colorMapByIndex = null,
                this.colorMapByValue = r.get("colorMap"),
                this.colorMapByValue && void 0 === this.colorMapByValue.get && (this.colorMapByValue = new RangeMap(this.colorMapByValue)))
            },
            getRegion: function(e, t, r) {
                return Math.floor(t / this.totalBarWidth)
            },
            getCurrentRegionFields: function() {
                var e = this.currentRegion;
                return {
                    isNull: void 0 === this.values[e],
                    value: this.values[e],
                    color: this.calcColor(this.values[e], e),
                    offset: e
                }
            },
            calcColor: function(e, t) {
                var r, a = this.values, n = this.options, o = this.colorMapByIndex, l = this.colorMapByValue;
                return l && (r = l.get(e)) ? r : o && o.length > t ? o[t] : a[t] < 0 ? n.get("negBarColor") : a[t] > 0 ? n.get("posBarColor") : n.get("zeroBarColor")
            },
            renderRegion: function(e, t) {
                var r, a, n, o, l, i, s = this.values, c = this.options, u = this.target;
                if (r = this.canvasHeight,
                n = Math.round(r / 2),
                o = e * this.totalBarWidth,
                s[e] < 0 ? (l = n,
                a = n - 1) : s[e] > 0 ? (l = 0,
                a = n - 1) : (l = n - 1,
                a = 2),
                null !== (i = this.calcColor(s[e], e)))
                    return t && (i = this.calcHighlightColor(i, c)),
                    u.drawRect(o, l, this.barWidth - 1, a - 1, i, i)
            }
        },
        discrete: {
            type: "discrete",
            init: function(e, t) {
                var r = this.options
                  , a = e.mergedOptions.width;
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height,
                this.regionShapes = {},
                this.values = t = $.map(t, Number),
                this.min = Math.min.apply(Math, t),
                this.max = Math.max.apply(Math, t),
                this.range = this.max - this.min,
                this.width = a,
                this.interval = Math.floor(a / t.length),
                this.itemWidth = a / t.length,
                void 0 !== r.get("chartRangeMin") && (r.get("chartRangeClip") || r.get("chartRangeMin") < this.min) && (this.min = r.get("chartRangeMin")),
                void 0 !== r.get("chartRangeMax") && (r.get("chartRangeClip") || r.get("chartRangeMax") > this.max) && (this.max = r.get("chartRangeMax")),
                this.target && (this.lineHeight = "auto" === r.get("lineHeight") ? Math.round(.3 * this.canvasHeight) : r.get("lineHeight"))
            },
            getRegion: function(e, t, r) {
                return Math.floor(t / this.itemWidth)
            },
            getCurrentRegionFields: function() {
                var e = this.currentRegion;
                return {
                    isNull: void 0 === this.values[e],
                    value: this.values[e],
                    offset: e
                }
            },
            renderRegion: function(e, t) {
                var r, a, n, o, l = this.values, i = this.options, s = this.min, c = this.max, u = this.range, h = this.interval, d = (this.target,
                this.canvasHeight), f = this.lineHeight, m = d - f;
                return a = clipval(l[e], s, c),
                o = e * h,
                r = Math.round(m - m * ((a - s) / u)),
                n = i.get("thresholdColor") && a < i.get("thresholdValue") ? i.get("thresholdColor") : i.get("lineColor"),
                t && (n = this.calcHighlightColor(n, i)),
                this.target.drawRect(o, r, h <= 2 ? 1 : h - 2, f, n, n)
            }
        },
        bullet: {
            type: "bullet",
            init: function(e, t) {
                var r, a, n, o = this.options, l = e.mergedOptions.width;
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height,
                this.values = t = normalizeValues(t),
                (n = t.slice())[0] = null === n[0] ? n[2] : n[0],
                n[1] = null === t[1] ? n[2] : n[1],
                r = Math.min.apply(Math, t),
                a = Math.max.apply(Math, t),
                r = void 0 === o.get("base") ? r < 0 ? r : 0 : o.get("base"),
                this.min = r,
                this.max = a,
                this.range = a - r,
                this.shapes = {},
                this.valueShapes = {},
                this.regiondata = {},
                this.width = l,
                t.length || (this.disabled = !0)
            },
            getRegion: function(e, t, r) {
                var a = this.target.getShapeAt(e, t, r);
                return void 0 !== a && void 0 !== this.shapes[a] ? this.shapes[a] : void 0
            },
            getCurrentRegionFields: function() {
                var e = this.currentRegion;
                return {
                    fieldkey: e.substr(0, 1),
                    value: this.values[e.substr(1)],
                    region: e
                }
            },
            changeHighlight: function(e) {
                var t, r = this.currentRegion, a = this.valueShapes[r];
                switch (delete this.shapes[a],
                r.substr(0, 1)) {
                case "r":
                    t = this.renderRange(r.substr(1), e);
                    break;
                case "p":
                    t = this.renderPerformance(e);
                    break;
                case "t":
                    t = this.renderTarget(e)
                }
                this.valueShapes[r] = t.id,
                this.shapes[t.id] = r,
                this.target.replaceWithShape(a, t)
            },
            renderRange: function(e, t) {
                var r = this.values[e]
                  , a = Math.round(this.canvasWidth * ((r - this.min) / this.range))
                  , n = this.options.get("rangeColors")[e - 2];
                return t && (n = this.calcHighlightColor(n, this.options)),
                this.target.drawRect(0, 0, a - 1, this.canvasHeight - 1, n, n)
            },
            renderPerformance: function(e) {
                var t = this.values[1]
                  , r = Math.round(this.canvasWidth * ((t - this.min) / this.range))
                  , a = this.options.get("performanceColor");
                return e && (a = this.calcHighlightColor(a, this.options)),
                this.target.drawRect(0, Math.round(.3 * this.canvasHeight), r - 1, Math.round(.4 * this.canvasHeight) - 1, a, a)
            },
            renderTarget: function(e) {
                var t = this.values[0]
                  , r = Math.round(this.canvasWidth * ((t - this.min) / this.range) - this.options.get("targetWidth") / 2)
                  , a = Math.round(.1 * this.canvasHeight)
                  , n = this.canvasHeight - 2 * a
                  , o = this.options.get("targetColor");
                return e && (o = this.calcHighlightColor(o, this.options)),
                this.target.drawRect(r, a, this.options.get("targetWidth") - 1, n - 1, o, o)
            },
            render: function(e, t) {
                this.init(e, t);
                var r, a, n = this.values.length;
                this.target;
                for (r = 2; r < n; r++)
                    a = this.renderRange(r).append(),
                    this.shapes[a.id] = "r" + r,
                    this.valueShapes["r" + r] = a.id;
                null !== this.values[1] && (a = this.renderPerformance().append(),
                this.shapes[a.id] = "p1",
                this.valueShapes.p1 = a.id),
                null !== this.values[0] && (a = this.renderTarget().append(),
                this.shapes[a.id] = "t0",
                this.valueShapes.t0 = a.id)
            }
        },
        pie: {
            type: "pie",
            init: function(e, t) {
                var r = this.options;
                e.mergedOptions.width,
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height;
                var a, n = 0;
                if (this.shapes = {},
                this.valueShapes = {},
                this.values = t = $.map(t, Number),
                "auto" === r.get("width") && (this.width = this.height),
                t.length > 0)
                    for (a = t.length; a--; )
                        n += t[a];
                this.total = n,
                this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2)
            },
            getRegion: function(e, t, r) {
                var a = this.target.getShapeAt(e, t, r);
                return void 0 !== a && void 0 !== this.shapes[a] ? this.shapes[a] : void 0
            },
            getCurrentRegionFields: function() {
                var e = this.currentRegion;
                return {
                    isNull: void 0 === this.values[e],
                    value: this.values[e],
                    percent: this.values[e] / this.total * 100,
                    color: this.options.get("sliceColors")[e % this.options.get("sliceColors").length],
                    offset: e
                }
            },
            changeHighlight: function(e) {
                var t = this.currentRegion
                  , r = this.renderSlice(t, e)
                  , a = this.valueShapes[t];
                delete this.shapes[a],
                this.target.replaceWithShape(a, r),
                this.valueShapes[t] = r.id,
                this.shapes[r.id] = t
            },
            renderSlice: function(e, t) {
                var r, a, n, o, l, i = this.target, s = this.options, c = this.radius, u = s.get("borderWidth"), h = s.get("offset"), d = 2 * Math.PI, f = this.values, m = this.total, p = h ? 2 * Math.PI * (h / 360) : 0;
                for (o = f.length,
                n = 0; n < o; n++) {
                    if (r = p,
                    a = p,
                    m > 0 && (a = p + d * (f[n] / m)),
                    e === n)
                        return l = s.get("sliceColors")[n % s.get("sliceColors").length],
                        t && (l = this.calcHighlightColor(l, s)),
                        i.drawPieSlice(c, c, c - u, r, a, void 0, l);
                    p = a
                }
            },
            render: function(e, t) {
                this.init(e, t);
                var r, a, n = this.target, o = this.values, l = this.options, i = this.radius, s = l.get("borderWidth");
                for (s && n.drawCircle(i, i, Math.floor(i - s / 2), l.get("borderColor"), void 0, s).append(),
                a = o.length; a--; )
                    o[a] && (r = this.renderSlice(a).append(),
                    this.valueShapes[a] = r.id,
                    this.shapes[r.id] = a)
            }
        },
        box: {
            type: "box",
            init: function(e, t) {
                var r = this.options
                  , a = e.mergedOptions.width;
                e.mergedOptions.height;
                this.canvasWidth = e.mergedOptions.width,
                this.canvasHeight = e.mergedOptions.height,
                this.values = $.map(t, Number),
                this.width = "auto" === r.get("width") ? "4.0em" : a,
                this.values.length || (this.disabled = 1)
            },
            getRegion: function() {
                return 1
            },
            getCurrentRegionFields: function() {
                var e = [{
                    field: "lq",
                    value: this.quartiles[0]
                }, {
                    field: "med",
                    value: this.quartiles[1]
                }, {
                    field: "uq",
                    value: this.quartiles[2]
                }];
                return void 0 !== this.loutlier && e.push({
                    field: "lo",
                    value: this.loutlier
                }),
                void 0 !== this.routlier && e.push({
                    field: "ro",
                    value: this.routlier
                }),
                void 0 !== this.lwhisker && e.push({
                    field: "lw",
                    value: this.lwhisker
                }),
                void 0 !== this.rwhisker && e.push({
                    field: "rw",
                    value: this.rwhisker
                }),
                e
            },
            render: function(e, t) {
                this.init(e, t);
                var r, a, n, o, l, i, s, c, u, h, d, f = this.target, m = this.values, p = m.length, g = this.options, y = this.canvasWidth, v = this.canvasHeight, A = void 0 === g.get("chartRangeMin") ? Math.min.apply(Math, m) : g.get("chartRangeMin"), b = void 0 === g.get("chartRangeMax") ? Math.max.apply(Math, m) : g.get("chartRangeMax"), k = 0;
                if (g.get("raw"))
                    g.get("showOutliers") && m.length > 5 ? (a = m[0],
                    r = m[1],
                    o = m[2],
                    l = m[3],
                    i = m[4],
                    s = m[5],
                    c = m[6]) : (r = m[0],
                    o = m[1],
                    l = m[2],
                    i = m[3],
                    s = m[4]);
                else if (m.sort((function(e, t) {
                    return e - t
                }
                )),
                o = quartile(m, 1),
                l = quartile(m, 2),
                n = (i = quartile(m, 3)) - o,
                g.get("showOutliers")) {
                    for (r = s = void 0,
                    u = 0; u < p; u++)
                        void 0 === r && m[u] > o - n * g.get("outlierIQR") && (r = m[u]),
                        m[u] < i + n * g.get("outlierIQR") && (s = m[u]);
                    a = m[0],
                    c = m[p - 1]
                } else
                    r = m[0],
                    s = m[p - 1];
                this.quartiles = [o, l, i],
                this.lwhisker = r,
                this.rwhisker = s,
                this.loutlier = a,
                this.routlier = c,
                d = y / (b - A + 1),
                g.get("showOutliers") && (k = Math.ceil(g.get("spotRadius")),
                d = (y -= 2 * Math.ceil(g.get("spotRadius"))) / (b - A + 1),
                a < r && f.drawCircle((a - A) * d + k, v / 2, g.get("spotRadius"), g.get("outlierLineColor"), g.get("outlierFillColor")).append(),
                c > s && f.drawCircle((c - A) * d + k, v / 2, g.get("spotRadius"), g.get("outlierLineColor"), g.get("outlierFillColor")).append()),
                f.drawRect(Math.round((o - A) * d + k), Math.round(.1 * v), Math.round((i - o) * d), Math.round(.8 * v), g.get("boxLineColor"), g.get("boxFillColor")).append(),
                f.drawLine(Math.round((r - A) * d + k), Math.round(v / 2), Math.round((o - A) * d + k), Math.round(v / 2), g.get("lineColor")).append(),
                f.drawLine(Math.round((r - A) * d + k), Math.round(v / 4), Math.round((r - A) * d + k), Math.round(v - v / 4), g.get("whiskerColor")).append(),
                f.drawLine(Math.round((s - A) * d + k), Math.round(v / 2), Math.round((i - A) * d + k), Math.round(v / 2), g.get("lineColor")).append(),
                f.drawLine(Math.round((s - A) * d + k), Math.round(v / 4), Math.round((s - A) * d + k), Math.round(v - v / 4), g.get("whiskerColor")).append(),
                f.drawLine(Math.round((l - A) * d + k), Math.round(.1 * v), Math.round((l - A) * d + k), Math.round(.9 * v), g.get("medianColor")).append(),
                g.get("target") && (h = Math.ceil(g.get("spotRadius")),
                f.drawLine(Math.round((g.get("target") - A) * d + k), Math.round(v / 2 - h), Math.round((g.get("target") - A) * d + k), Math.round(v / 2 + h), g.get("targetColor")).append(),
                f.drawLine(Math.round((g.get("target") - A) * d + k - h), Math.round(v / 2), Math.round((g.get("target") - A) * d + k + h), Math.round(v / 2), g.get("targetColor")).append())
            }
        },
        shapeCount: 0,
        shapes: {},
        shapeseq: [],
        lastShapeId: null,
        mergedOptions: null,
        init: function(e, t) {
            var r, a, n;
            t = t || {};
            return n = (a = this.defaultOption).common,
            r = a[t.type || n.type],
            this.shapeCount = 0,
            this.shapes = {},
            this.shapeseq = [],
            this.lastShapeId = null,
            this.mergedOptions = $.extend({}, n, r, t),
            this.mergedOptions.width = this.mergedOptions.width,
            this.mergedOptions.height = this.mergedOptions.height,
            this[this.mergedOptions.type].render(this, e),
            {
                shapes: this.shapes,
                shapeseq: this.shapeseq,
                offsetX: this.mergedOptions.offsetX,
                offsetY: this.mergedOptions.offsetY,
                pixelWidth: this.mergedOptions.width,
                pixelHeight: this.mergedOptions.height
            }
        },
        _getContext: function(e, t, r) {
            var a;
            return a = null != this.ctx ? this.ctx : $("#" + this._canvasID).get(0).getContext("2d"),
            void 0 !== e && (a.strokeStyle = e),
            a.lineWidth = void 0 === r ? 1 : r,
            void 0 !== t && (a.fillStyle = t),
            a
        },
        reset: function() {
            this._getContext().clearRect(0, 0, this.pixelWidth, this.pixelHeight),
            this.shapes = {},
            this.shapeseq = [],
            this.currentTargetShapeId = void 0
        },
        _drawShape: function(e, t, r, a, n) {
            var o, l, i = this._getContext(r, a, n);
            for (i.beginPath(),
            i.moveTo(t[0][0] + .5 + this.offsetX, t[0][1] + .5 + this.offsetY),
            o = 1,
            l = t.length; o < l; o++)
                i.lineTo(t[o][0] + .5 + this.offsetX, t[o][1] + .5 + this.offsetY);
            void 0 !== r && i.stroke(),
            void 0 !== a && i.fill(),
            void 0 !== this.targetX && void 0 !== this.targetY && i.isPointInPath(this.targetX + this.offsetX, this.targetY + this.offsetY) && (this.currentTargetShapeId = e)
        },
        _drawCircle: function(e, t, r, a, n, o, l) {
            var i = this._getContext(n, o, l);
            i.beginPath(),
            t += this.offsetX,
            r += this.offsetY,
            i.arc(t, r, a, 0, 2 * Math.PI, !1),
            void 0 !== this.targetX && void 0 !== this.targetY && i.isPointInPath(this.targetX + this.offsetX, this.targetY + this.offsetY) && (this.currentTargetShapeId = e),
            void 0 !== n && i.stroke(),
            void 0 !== o && i.fill()
        },
        _drawPieSlice: function(e, t, r, a, n, o, l, i) {
            var s = this._getContext(l, i);
            t += this.offsetX,
            r += this.offsetY,
            s.beginPath(),
            s.moveTo(t, r),
            s.arc(t, r, a, n, o, !1),
            s.lineTo(t, r),
            s.closePath(),
            void 0 !== l && s.stroke(),
            i && s.fill(),
            void 0 !== this.targetX && void 0 !== this.targetY && s.isPointInPath(this.targetX + this.offsetX, this.targetY + this.offsetY) && (this.currentTargetShapeId = e)
        },
        _drawRect: function(e, t, r, a, n, o, l) {
            return this._drawShape(e, [[t, r], [t + a, r], [t + a, r + n], [t, r + n], [t, r]], o, l)
        },
        appendShape: function(e) {
            return this.shapes[e.id] = e,
            this.shapeseq.push(e.id),
            this.lastShapeId = e.id,
            e.id
        },
        replaceWithShape: function(e, t) {
            var r, a = this.shapeseq;
            for (this.shapes[t.id] = t,
            r = a.length; r--; )
                a[r] == e && (a[r] = t.id);
            delete this.shapes[e]
        },
        replaceWithShapes: function(e, t) {
            var r, a, n, o = this.shapeseq, l = {};
            for (a = e.length; a--; )
                l[e[a]] = !0;
            for (a = o.length; a--; )
                l[r = o[a]] && (o.splice(a, 1),
                delete this.shapes[r],
                n = a);
            for (a = t.length; a--; )
                o.splice(n, 0, t[a].id),
                this.shapes[t[a].id] = t[a]
        },
        insertAfterShape: function(e, t) {
            var r, a = this.shapeseq;
            for (r = a.length; r--; )
                if (a[r] === e)
                    return a.splice(r + 1, 0, t.id),
                    void (this.shapes[t.id] = t)
        },
        removeShapeId: function(e) {
            var t, r = this.shapeseq;
            for (t = r.length; t--; )
                if (r[t] === e) {
                    r.splice(t, 1);
                    break
                }
            delete this.shapes[e]
        },
        getShapeAt: function(e, t, r) {
            return this.targetX = t,
            this.targetY = r,
            this.render(),
            this.currentTargetShapeId
        },
        _canvasID: "luckysheetTableContent",
        render: function(e, t, r, a, n, o, l, i) {
            null == l && (l = "luckysheetTableContent"),
            this._canvasID = l,
            null != i && (this.ctx = i);
            var s, c, u = e.length;
            this._getContext();
            for (this.offsetX = r,
            this.offsetY = a,
            this.pixelWidth = n,
            this.pixelHeight = o,
            c = 0; c < u; c++)
                this["_draw" + (s = t[e[c]]).type].apply(this, s.args)
        },
        drawLine: function(e, t, r, a, n, o) {
            return this.drawShape([[e, t], [r, a]], n, o)
        },
        drawShape: function(e, t, r, a) {
            return this._genShape("Shape", [e, t, r, a])
        },
        drawCircle: function(e, t, r, a, n, o) {
            return this._genShape("Circle", [e, t, r, a, n, o])
        },
        drawPieSlice: function(e, t, r, a, n, o, l) {
            return this._genShape("PieSlice", [e, t, r, a, n, o, l])
        },
        drawRect: function(e, t, r, a, n, o) {
            return this._genShape("Rect", [e, t, r, a, n, o])
        },
        _genShape: function(e, t) {
            var r = this.shapeCount++;
            t.unshift(r);
            var a = {
                id: r,
                type: e,
                args: t
            };
            return this.shapes[r] = a,
            this.shapeseq.push(r),
            this.lastShapeId = r,
            {
                append: function() {
                    return a
                },
                get: function() {
                    return r
                }
            }
        }
    }
      , barHighlightMixin = {
        changeHighlight: function(e) {
            var t, r = this.currentRegion, a = this.target, n = this.regionShapes[r];
            n && (t = this.renderRegion(r, e),
            $.isArray(t) || $.isArray(n) ? (a.replaceWithShapes(n, t),
            this.regionShapes[r] = $.map(t, (function(e) {
                return e.id
            }
            ))) : (a.replaceWithShape(n, t),
            this.regionShapes[r] = t.id))
        },
        render: function(e, t) {
            this.init(e, t);
            var r, a, n, o, l = this.values, i = (this.target,
            this.regionShapes);
            for (n = l.length; n--; )
                if (r = this.renderRegion(n))
                    if ($.isArray(r)) {
                        for (a = [],
                        o = r.length; o--; )
                            r[o].append(),
                            a.push(r[o].id);
                        i[n] = a
                    } else
                        r.append(),
                        i[n] = r.id;
                else
                    i[n] = null
        }
    }
      , _luckysheetSparkLineOptions = {
        get: function(e) {
            return luckysheetSparkline.mergedOptions[e]
        }
    }
      , _luckysheetSparkLineTarget = {
        drawLine: function(e, t, r, a, n, o) {
            return luckysheetSparkline.drawLine(e, t, r, a, n, o)
        },
        drawShape: function(e, t, r, a) {
            return luckysheetSparkline.drawShape(e, t, r, a)
        },
        drawCircle: function(e, t, r, a, n, o) {
            return luckysheetSparkline.drawCircle(e, t, r, a, n, o)
        },
        drawPieSlice: function(e, t, r, a, n, o, l) {
            return luckysheetSparkline.drawPieSlice(e, t, r, a, n, o, l)
        },
        drawRect: function(e, t, r, a, n, o) {
            return luckysheetSparkline.drawRect(e, t, r, a, n, o)
        }
    };
    for (var item$1 in luckysheetSparkline)
        item$1 in {
            line: null,
            bar: null,
            column: null,
            tristate: null,
            discrete: null,
            bullet: null,
            pie: null,
            box: null
        } && (luckysheetSparkline[item$1].options = _luckysheetSparkLineOptions,
        luckysheetSparkline[item$1].target = _luckysheetSparkLineTarget),
        item$1 in {
            bar: null,
            column: null,
            tristate: null,
            discrete: null
        } && (luckysheetSparkline[item$1].changeHighlight = barHighlightMixin.changeHighlight,
        luckysheetSparkline[item$1].render = barHighlightMixin.render);
    var imageCtrl = {
        imgItem: {
            type: "3",
            src: "",
            originWidth: null,
            originHeight: null,
            default: {
                width: null,
                height: null,
                left: null,
                top: null
            },
            crop: {
                width: null,
                height: null,
                offsetLeft: 0,
                offsetTop: 0
            },
            isFixedPos: !1,
            fixedLeft: null,
            fixedTop: null,
            border: {
                width: 0,
                radius: 0,
                style: "solid",
                color: "#000"
            }
        },
        images: null,
        currentImgId: null,
        currentWinW: null,
        currentWinH: null,
        resize: null,
        resizeXY: null,
        move: !1,
        moveXY: null,
        cropChange: null,
        cropChangeXY: null,
        cropChangeObj: null,
        copyImgItemObj: null,
        inserImg: function(e) {
            var t = this
              , r = Store.luckysheet_select_save[0].row_focus || 0
              , a = Store.luckysheet_select_save[0].column_focus || 0
              , n = 0 == a ? 0 : Store.visibledatacolumn[a - 1]
              , o = 0 == r ? 0 : Store.visibledatarow[r - 1]
              , l = new Image;
            l.onload = function() {
                var r = l.width
                  , a = l.height
                  , i = {
                    src: e,
                    left: n,
                    top: o,
                    originWidth: r,
                    originHeight: a
                };
                t.addImgItem(i)
            }
            ,
            l.src = e
        },
        generateRandomId: function(e) {
            null == e && (e = "img");
            for (var t = window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g, "").split(""), r = "", a = 0; a < 12; a++)
                r += t[Math.round(Math.random() * (t.length - 1))];
            return e + "_" + r + "_" + (new Date).getTime()
        },
        modelHtml: function(e, t) {
            var r = t.src
              , a = this.getImgItemParam(t)
              , n = a.width * Store.zoomRatio
              , o = a.height * Store.zoomRatio
              , l = a.left * Store.zoomRatio
              , i = a.top * Store.zoomRatio
              , s = a.position
              , c = t.border.width;
            return '<div id="'.concat(e, '" class="luckysheet-modal-dialog luckysheet-modal-dialog-image" style="width:').concat(n, "px;height:").concat(o, "px;padding:0;position:").concat(s, ";left:").concat(l, "px;top:").concat(i, 'px;z-index:200;">\n                    <div class="luckysheet-modal-dialog-content" style="width:100%;height:100%;overflow:hidden;position:relative;">\n                        <img src="').concat(r, '" style="position:absolute;width:').concat(t.default.width * Store.zoomRatio, "px;height:").concat(t.default.height * Store.zoomRatio, "px;left:").concat(-t.crop.offsetLeft * Store.zoomRatio, "px;top:").concat(-t.crop.offsetTop * Store.zoomRatio, 'px;" />\n                    </div>\n                    <div class="luckysheet-modal-dialog-border" style="border:').concat(c, "px ").concat(t.border.style, " ").concat(t.border.color, ";border-radius:").concat(t.border.radius * Store.zoomRatio, "px;position:absolute;left:").concat(-c, "px;right:").concat(-c, "px;top:").concat(-c, "px;bottom:").concat(-c, 'px;"></div>\n                </div>')
        },
        getSliderHtml: function() {
            var e = locale().imageText;
            return '<div id="luckysheet-modal-dialog-slider-imageCtrl" class="luckysheet-modal-dialog-slider luckysheet-modal-dialog-slider-imageCtrl" style="display:block;">\n                    <div class="luckysheet-modal-dialog-slider-title">\n                        <span>'.concat(e.imageSetting, '</span>\n                        <span class="luckysheet-model-close-btn" title="').concat(e.close, '">\n                            <i class="fa fa-times" aria-hidden="true"></i>\n                        </span>\n                    </div>\n                    <div class="luckysheet-modal-dialog-slider-content">\n                        <div class="slider-box">\n                            <div class="slider-box-title">').concat(e.conventional, '</div>\n                            <div class="slider-box-radios">\n                                <div class="radio-item">\n                                    <input type="radio" id="imgItemType1" name="imgItemType" value="1">\n                                    <label for="imgItemType1">').concat(e.moveCell1, '</label>\n                                </div>\n                                <div class="radio-item">\n                                    <input type="radio" id="imgItemType2" name="imgItemType" value="2">\n                                    <label for="imgItemType2">').concat(e.moveCell2, '</label>\n                                </div>\n                                <div class="radio-item">\n                                    <input type="radio" id="imgItemType3" name="imgItemType" value="3">\n                                    <label for="imgItemType3">').concat(e.moveCell3, '</label>\n                                </div>\n                            </div>\n                            <div class="slider-box-checkbox">\n                                <input type="checkbox" id="imgItemIsFixedPos">\n                                <label for="imgItemIsFixedPos">').concat(e.fixedPos, '</label>\n                            </div>\n                        </div>\n                        <div class="slider-box">\n                            <div class="slider-box-title">').concat(e.border, '</div>\n                            <div class="slider-box-borderConfig">\n                                <div class="border-item">\n                                    <label>').concat(e.width, '</label>\n                                    <input type="number" id="imgItemBorderWidth" min="0">\n                                </div>\n                                <div class="border-item">\n                                    <label>').concat(e.radius, '</label>\n                                    <input type="number" id="imgItemBorderRadius" min="0">\n                                </div>\n                                <div class="border-item">\n                                    <label>').concat(e.style, '</label>\n                                    <select id="imgItemBorderStyle">\n                                        <option value="solid">').concat(e.solid, '</option>\n                                        <option value="dashed">').concat(e.dashed, '</option>\n                                        <option value="dotted">').concat(e.dotted, '</option>\n                                        <option value="double">').concat(e.double, '</option>\n                                    </select>\n                                </div>\n                                <div class="border-item">\n                                    <label>').concat(e.color, '</label>\n                                    <div id="imgItemBorderColor" class="imgItemBorderColor">\n                                        <span></span>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>')
        },
        sliderHtmlShow: function() {
            $("#luckysheet-modal-dialog-slider-imageCtrl").remove();
            var e = this.getSliderHtml();
            $("body").append(e),
            luckysheetsizeauto();
            var t = this.images[this.currentImgId]
              , r = t.type;
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemType" + r).prop("checked", !0);
            var a = t.isFixedPos;
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemIsFixedPos").prop("checked", a);
            var n = t.border;
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemBorderWidth").val(n.width),
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemBorderRadius").val(n.radius),
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemBorderStyle").val(n.style),
            $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemBorderColor span").css("background-color", n.color).attr("title", n.color),
            this.init()
        },
        colorSelectDialog: function(e) {
            var t = locale()
              , r = t.button
              , a = t.toolbar
              , n = t.imageCtrl;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-imageCtrl-colorSelect-dialog").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-imageCtrl-colorSelect-dialog",
                addclass: "luckysheet-imageCtrl-colorSelect-dialog",
                title: n.borderTile,
                content: '<div class="currenColor">\n                            '.concat(n.borderCur, ':<span title="').concat(e, '" style="background-color:').concat(e, '"></span>\n                        </div>\n                        <div class="colorshowbox"></div>'),
                botton: '<button id="luckysheet-imageCtrl-colorSelect-dialog-confirm" class="btn btn-primary">'.concat(r.confirm, '</button>\n                        <button class="btn btn-default luckysheet-model-close-btn">').concat(r.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var o = $("#luckysheet-imageCtrl-colorSelect-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , l = o.outerHeight()
              , i = o.outerWidth()
              , s = $(window).width()
              , c = $(window).height()
              , u = $(document).scrollLeft()
              , h = $(document).scrollTop();
            $("#luckysheet-imageCtrl-colorSelect-dialog").css({
                left: (s + u - i) / 2,
                top: (c + h - l) / 3
            }).show(),
            $("#luckysheet-imageCtrl-colorSelect-dialog").find(".colorshowbox").spectrum({
                showPalette: !0,
                showPaletteOnly: !0,
                preferredFormat: "hex",
                clickoutFiresChange: !1,
                showInitial: !0,
                showInput: !0,
                flat: !0,
                hideAfterPaletteSelect: !0,
                showSelectionPalette: !0,
                showButtons: !1,
                maxPaletteSize: 8,
                maxSelectionSize: 8,
                color: e,
                cancelText: r.cancel,
                chooseText: a.confirmColor,
                togglePaletteMoreText: a.customColor,
                togglePaletteLessText: a.collapse,
                togglePaletteOnly: !0,
                clearText: a.clearText,
                noColorSelectedText: a.noColorSelectedText,
                localStorageKey: "spectrum.textcolor" + server.gridKey,
                palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                move: function(e) {
                    e = null != e ? e.toHexString() : "#000",
                    $("#luckysheet-imageCtrl-colorSelect-dialog .currenColor span").css("background-color", e).attr("title", e)
                }
            })
        },
        init: function() {
            var e = this;
            $("#luckysheet-modal-dialog-slider-imageCtrl .luckysheet-model-close-btn").click((function() {
                $("#luckysheet-modal-dialog-slider-imageCtrl").hide(),
                luckysheetsizeauto()
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("change.radio").on("change.radio", ".radio-item input[type=radio][name=imgItemType]", (function() {
                e.configChange("type", this.value)
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("change.checkbox").on("change.checkbox", ".slider-box-checkbox input[type=checkbox]", (function() {
                e.configChange("fixedPos", this.checked)
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("change.borderWidth").on("change.borderWidth", "#imgItemBorderWidth", (function() {
                e.configChange("border-width", this.valueAsNumber)
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("change.borderRadius").on("change.borderRadius", "#imgItemBorderRadius", (function() {
                e.configChange("border-radius", this.valueAsNumber)
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("change.borderStyle").on("change.borderStyle", "#imgItemBorderStyle", (function() {
                e.configChange("border-style", this.value)
            }
            )),
            $("#luckysheet-modal-dialog-slider-imageCtrl").off("click.color").on("click.color", "#imgItemBorderColor", (function() {
                var t = $(this).find("span").attr("title");
                e.colorSelectDialog(t)
            }
            )),
            $(document).off("click.selectColorConfirm").on("click.selectColorConfirm", "#luckysheet-imageCtrl-colorSelect-dialog-confirm", (function() {
                var t = $(this).parents("#luckysheet-imageCtrl-colorSelect-dialog");
                $("#luckysheet-modal-dialog-mask").hide(),
                t.hide();
                var r = t.find(".currenColor span").attr("title");
                $("#luckysheet-modal-dialog-slider-imageCtrl #imgItemBorderColor span").css("background-color", r).attr("title", r),
                e.configChange("border-color", r)
            }
            )),
            $("#luckysheet-image-showBoxs").off("mousedown.active").on("mousedown.active", ".luckysheet-modal-dialog-image", (function(t) {
                if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                    $(this).hide();
                    var r = $(this).attr("id");
                    null != e.currentImgId && e.currentImgId != r && e.cancelActiveImgItem(),
                    e.currentImgId = r;
                    var a = e.images[r]
                      , n = e.getImgItemParam(a)
                      , o = n.width * Store.zoomRatio
                      , l = n.height * Store.zoomRatio
                      , i = n.left * Store.zoomRatio
                      , s = n.top * Store.zoomRatio
                      , c = n.position;
                    $("#luckysheet-modal-dialog-activeImage").show().css({
                        width: o,
                        height: l,
                        left: i,
                        top: s,
                        position: c
                    }),
                    $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-content").css({
                        "background-image": "url(" + a.src + ")",
                        "background-size": a.default.width * Store.zoomRatio + "px " + a.default.height * Store.zoomRatio + "px",
                        "background-position": -a.crop.offsetLeft * Store.zoomRatio + "px " + -a.crop.offsetTop * Store.zoomRatio + "px"
                    }),
                    $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-border").css({
                        "border-width": a.border.width * Store.zoomRatio,
                        "border-style": a.border.style,
                        "border-color": a.border.color,
                        "border-radius": a.border.radius * Store.zoomRatio,
                        left: -a.border.width * Store.zoomRatio,
                        right: -a.border.width * Store.zoomRatio,
                        top: -a.border.width * Store.zoomRatio,
                        bottom: -a.border.width * Store.zoomRatio
                    }),
                    e.sliderHtmlShow(),
                    t.stopPropagation()
                }
            }
            )),
            $("#luckysheet-modal-dialog-activeImage").off("mousedown.move").on("mousedown.move", ".luckysheet-modal-dialog-content", (function(t) {
                if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                    $("#luckysheet-modal-dialog-slider-imageCtrl").is(":visible") || e.sliderHtmlShow(),
                    e.move = !0,
                    e.currentWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                    e.currentWinH = $("#luckysheet-cell-main")[0].scrollHeight;
                    var r = $("#luckysheet-modal-dialog-activeImage").offset();
                    e.moveXY = [t.pageX - r.left, t.pageY - r.top],
                    setluckysheet_scroll_status(!0),
                    t.stopPropagation()
                }
            }
            )),
            $("#luckysheet-modal-dialog-activeImage").off("mousedown.resize").on("mousedown.resize", ".luckysheet-modal-dialog-resize-item", (function(t) {
                if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                    e.currentWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                    e.currentWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                    e.resize = $(this).data("type");
                    var r = $("#luckysheet-cell-main").scrollTop()
                      , a = $("#luckysheet-cell-main").scrollLeft()
                      , n = mouseposition(t.pageX, t.pageY)
                      , o = n[0] + a
                      , l = n[1] + r
                      , i = $("#luckysheet-modal-dialog-activeImage").position()
                      , s = $("#luckysheet-modal-dialog-activeImage").width()
                      , c = $("#luckysheet-modal-dialog-activeImage").height();
                    e.resizeXY = [o, l, s, c, i.left + a, i.top + r, a, r],
                    setluckysheet_scroll_status(!0),
                    t.stopPropagation()
                }
            }
            )),
            $("#luckysheet-modal-dialog-activeImage").off("mousedown.croppingEnter").on("mousedown.croppingEnter", ".luckysheet-modal-controll-crop", (function(t) {
                e.croppingEnter(),
                t.stopPropagation()
            }
            )),
            $("#luckysheet-modal-dialog-cropping").off("mousedown.croppingExit").on("mousedown.croppingExit", ".luckysheet-modal-controll-crop", (function(t) {
                e.croppingExit(),
                t.stopPropagation()
            }
            )),
            $("#luckysheet-modal-dialog-cropping").off("mousedown.cropChange").on("mousedown.cropChange", ".resize-item", (function(t) {
                e.cropChange = $(this).data("type");
                var r = $("#luckysheet-cell-main").scrollTop()
                  , a = $("#luckysheet-cell-main").scrollLeft()
                  , n = mouseposition(t.pageX, t.pageY)
                  , o = n[0] + a
                  , l = n[1] + r;
                e.cropChangeXY = [o, l],
                setluckysheet_scroll_status(!0),
                t.stopPropagation()
            }
            )),
            $("#luckysheet-image-showBoxs").off("mousedown.restore").on("mousedown.restore", ".luckysheet-modal-controll-restore", (function(t) {
                e.restoreImgItem(),
                t.stopPropagation()
            }
            )),
            $("#luckysheet-image-showBoxs").off("mousedown.delete").on("mousedown.delete", ".luckysheet-modal-controll-del", (function(t) {
                e.removeImgItem(),
                t.stopPropagation()
            }
            ))
        },
        configChange: function(e, t) {
            var r = this.images[this.currentImgId];
            switch (e) {
            case "type":
                r.type = t;
                break;
            case "fixedPos":
                r.isFixedPos = t;
                var a = this.getImgItemParam(r)
                  , n = a.width
                  , o = a.height
                  , l = a.left
                  , i = a.top
                  , s = a.position;
                $("#luckysheet-modal-dialog-activeImage").show().css({
                    width: n,
                    height: o,
                    left: l,
                    top: i,
                    position: s
                });
                break;
            case "border-width":
                r.border.width = t,
                $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-border").css({
                    "border-width": t,
                    left: -t,
                    right: -t,
                    top: -t,
                    bottom: -t
                });
                break;
            case "border-radius":
                r.border.radius = t,
                $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-border").css("border-radius", t);
                break;
            case "border-style":
                r.border.style = t,
                $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-border").css("border-style", t);
                break;
            case "border-color":
                r.border.color = t,
                $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-border").css("border-color", t)
            }
            this.ref()
        },
        getImgItemParam: function(e) {
            var t = e.isFixedPos
              , r = e.default.width
              , a = e.default.height
              , n = e.default.left
              , o = e.default.top;
            e.crop.width == r && e.crop.height == a || (r = e.crop.width,
            a = e.crop.height,
            n += e.crop.offsetLeft,
            o += e.crop.offsetTop);
            var l = "absolute";
            return t && (l = "fixed",
            n = e.fixedLeft + e.crop.offsetLeft,
            o = e.fixedTop + e.crop.offsetTop),
            {
                width: r,
                height: a,
                left: n,
                top: o,
                position: l
            }
        },
        cancelActiveImgItem: function() {
            $("#luckysheet-modal-dialog-activeImage").hide(),
            $("#luckysheet-modal-dialog-cropping").hide(),
            $("#luckysheet-modal-dialog-slider-imageCtrl").hide();
            var e = this.images[this.currentImgId]
              , t = this.getImgItemParam(e)
              , r = t.width * Store.zoomRatio
              , a = t.height * Store.zoomRatio
              , n = t.left * Store.zoomRatio
              , o = t.top * Store.zoomRatio
              , l = t.position;
            $("#" + this.currentImgId).show().css({
                width: r,
                height: a,
                left: n,
                top: o,
                position: l
            }),
            $("#" + this.currentImgId + " img").css({
                width: e.default.width * Store.zoomRatio,
                height: e.default.height * Store.zoomRatio,
                left: -e.crop.offsetLeft * Store.zoomRatio,
                top: -e.crop.offsetTop * Store.zoomRatio
            }),
            $("#" + this.currentImgId + " .luckysheet-modal-dialog-border").css({
                "border-width": e.border.width * Store.zoomRatio,
                "border-style": e.border.style,
                "border-color": e.border.color,
                "border-radius": e.border.radius * Store.zoomRatio,
                left: -e.border.width * Store.zoomRatio,
                right: -e.border.width * Store.zoomRatio,
                top: -e.border.width * Store.zoomRatio,
                bottom: -e.border.width * Store.zoomRatio
            }),
            this.currentImgId = null
        },
        addImgItem: function(e) {
            var t, r;
            e.originHeight < e.originWidth ? (r = Math.round(e.originHeight * (400 / e.originWidth)),
            t = 400) : (t = Math.round(e.originWidth * (400 / e.originHeight)),
            r = 400),
            null == this.images && (this.images = {});
            var a = $.extend(!0, {}, this.imgItem);
            a.src = e.src,
            a.originWidth = e.originWidth,
            a.originHeight = e.originHeight,
            a.default.width = t,
            a.default.height = r,
            a.default.left = e.left,
            a.default.top = e.top,
            a.crop.width = t,
            a.crop.height = r;
            var n = $("#luckysheet-cell-main").scrollTop()
              , o = $("#luckysheet-cell-main").scrollLeft();
            a.fixedLeft = e.left - o + Store.rowHeaderWidth,
            a.fixedTop = e.top - n + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
            var l = this.generateRandomId()
              , i = this.modelHtml(l, a);
            $("#luckysheet-image-showBoxs .img-list").append(i),
            this.images[l] = a,
            this.ref(),
            this.init()
        },
        moveImgItem: function() {
            this.move = !1;
            var e = $("#luckysheet-modal-dialog-activeImage")[0]
              , t = this.images[this.currentImgId];
            t.isFixedPos ? (t.fixedLeft = e.offsetLeft - t.crop.offsetLeft,
            t.fixedTop = e.offsetTop - t.crop.offsetTop) : (t.default.left = e.offsetLeft - t.crop.offsetLeft,
            t.default.top = e.offsetTop - t.crop.offsetTop),
            this.ref()
        },
        resizeImgItem: function() {
            this.resize = null;
            var e = $("#luckysheet-modal-dialog-activeImage")[0]
              , t = this.images[this.currentImgId]
              , r = e.clientWidth / t.crop.width
              , a = e.clientHeight / t.crop.height;
            t.default.width = Math.round(t.default.width * r),
            t.default.height = Math.round(t.default.height * a),
            t.crop.width = Math.round(t.crop.width * r),
            t.crop.height = Math.round(t.crop.height * a),
            t.crop.offsetLeft = Math.round(t.crop.offsetLeft * r),
            t.crop.offsetTop = Math.round(t.crop.offsetTop * a),
            t.isFixedPos ? (t.fixedLeft = e.offsetLeft,
            t.fixedTop = e.offsetTop) : (t.default.left = e.offsetLeft - t.crop.offsetLeft,
            t.default.top = e.offsetTop - t.crop.offsetTop),
            this.ref()
        },
        croppingEnter: function() {
            if (this.cropping = !0,
            checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                $("#luckysheet-modal-dialog-activeImage").hide(),
                $("#luckysheet-modal-dialog-slider-imageCtrl").hide();
                var e = this.images[this.currentImgId]
                  , t = this.getImgItemParam(e)
                  , r = t.width
                  , a = t.height
                  , n = t.left
                  , o = t.top
                  , l = t.position;
                $("#luckysheet-modal-dialog-cropping").show().css({
                    width: r,
                    height: a,
                    left: n,
                    top: o,
                    position: l
                }),
                $("#luckysheet-modal-dialog-cropping .cropping-mask").css({
                    width: e.default.width,
                    height: e.default.height,
                    "background-image": "url(" + e.src + ")",
                    left: -e.crop.offsetLeft,
                    top: -e.crop.offsetTop
                }),
                $("#luckysheet-modal-dialog-cropping .cropping-content").css({
                    "background-image": "url(" + e.src + ")",
                    "background-size": e.default.width + "px " + e.default.height + "px",
                    "background-position": -e.crop.offsetLeft + "px " + -e.crop.offsetTop + "px"
                }),
                $("#luckysheet-modal-dialog-cropping .luckysheet-modal-dialog-border").css({
                    "border-width": e.border.width,
                    "border-style": e.border.style,
                    "border-color": e.border.color,
                    "border-radius": e.border.radius,
                    left: -e.border.width,
                    right: -e.border.width,
                    top: -e.border.width,
                    bottom: -e.border.width
                })
            }
        },
        croppingExit: function() {
            this.cropping = !1,
            $("#luckysheet-modal-dialog-cropping").hide();
            var e = this.images[this.currentImgId]
              , t = this.getImgItemParam(e)
              , r = t.width
              , a = t.height
              , n = t.left
              , o = t.top
              , l = t.position;
            $("#luckysheet-modal-dialog-activeImage").show().css({
                width: r,
                height: a,
                left: n,
                top: o,
                position: l
            }),
            $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-content").css({
                "background-image": "url(" + e.src + ")",
                "background-size": e.default.width + "px " + e.default.height + "px",
                "background-position": -e.crop.offsetLeft + "px " + -e.crop.offsetTop + "px"
            })
        },
        cropChangeImgItem: function() {
            this.cropChange = null;
            var e = this.images[this.currentImgId];
            e.crop.width = this.cropChangeObj.width,
            e.crop.height = this.cropChangeObj.height,
            e.crop.offsetLeft = this.cropChangeObj.offsetLeft,
            e.crop.offsetTop = this.cropChangeObj.offsetTop,
            this.ref()
        },
        restoreImgItem: function() {
            var e = this.images[this.currentImgId];
            e.default.width = e.originWidth,
            e.default.height = e.originHeight,
            e.crop.width = e.originWidth,
            e.crop.height = e.originHeight,
            e.crop.offsetLeft = 0,
            e.crop.offsetTop = 0;
            var t = this.getImgItemParam(e)
              , r = t.width
              , a = t.height
              , n = t.left
              , o = t.top
              , l = t.position;
            $("#luckysheet-modal-dialog-activeImage").show().css({
                width: r,
                height: a,
                left: n,
                top: o,
                position: l
            }),
            $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-content").css({
                "background-image": "url(" + e.src + ")",
                "background-size": e.default.width + "px " + e.default.height + "px",
                "background-position": -e.crop.offsetLeft + "px " + -e.crop.offsetTop + "px"
            }),
            this.ref()
        },
        removeImgItem: function() {
            $("#luckysheet-modal-dialog-activeImage").hide(),
            $("#luckysheet-modal-dialog-cropping").hide(),
            $("#luckysheet-modal-dialog-slider-imageCtrl").hide(),
            $("#" + this.currentImgId).remove(),
            delete this.images[this.currentImgId],
            this.currentImgId = null,
            this.ref()
        },
        copyImgItem: function(e) {
            this.copyImgItemObj = $.extend(!0, {}, this.images[this.currentImgId]);
            var t = window.clipboardData;
            t || (t = e.originalEvent.clipboardData);
            var r = '<table data-type="luckysheet_copy_action_image"><tr><td><td></tr></table>';
            if (t)
                return t.setData("Text", r),
                !1;
            var a = $("#luckysheet-copy-content");
            a.html(r),
            a.focus(),
            a.select(),
            document.execCommand("selectAll"),
            document.execCommand("Copy"),
            setTimeout((function() {
                $("#luckysheet-copy-content").blur()
            }
            ), 10)
        },
        pasteImgItem: function() {
            var e = Store.luckysheet_select_save[0].row_focus || 0
              , t = Store.luckysheet_select_save[0].column_focus || 0
              , r = 0 == t ? 0 : Store.visibledatacolumn[t - 1]
              , a = 0 == e ? 0 : Store.visibledatarow[e - 1]
              , n = $.extend(!0, {}, this.copyImgItemObj);
            n.default.left = r - n.crop.offsetLeft,
            n.default.top = a - n.crop.offsetTop;
            var o = $("#luckysheet-cell-main").scrollTop()
              , l = $("#luckysheet-cell-main").scrollLeft();
            n.fixedLeft = n.default.left - l + Store.rowHeaderWidth,
            n.fixedTop = n.default.top - o + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
            var i = this.generateRandomId()
              , s = this.modelHtml(i, n);
            $("#luckysheet-image-showBoxs .img-list").append(s),
            this.images[i] = n,
            this.ref(),
            this.init()
        },
        allImagesShow: function() {
            if ($("#luckysheet-modal-dialog-activeImage").hide(),
            $("#luckysheet-modal-dialog-cropping").hide(),
            $("#luckysheet-modal-dialog-slider-imageCtrl").hide(),
            $("#luckysheet-image-showBoxs .img-list").empty(),
            null != this.images)
                for (var e in this.images) {
                    var t = this.images[e]
                      , r = this.modelHtml(e, t);
                    $("#luckysheet-image-showBoxs .img-list").append(r)
                }
        },
        moveChangeSize: function(e, t, r) {
            var a = $.extend(!0, {}, this.images);
            if ("row" == e) {
                var n = Store.visibledatarow[t]
                  , o = r - (n - (t - 1 == -1 ? 0 : Store.visibledatarow[t - 1]) - 1);
                for (var l in a) {
                    var i = a[l]
                      , s = this.getImgItemParam(i)
                      , c = i.type;
                    if ("1" == c) {
                        if (s.top >= n)
                            i.default.top = s.top + o - i.crop.offsetTop;
                        else if (s.top + s.height >= n - 2)
                            if (s.top < n + o) {
                                var u = (s.height + o) / s.height;
                                i.default.height = Math.round(i.default.height * u),
                                i.crop.height = Math.round(i.crop.height * u),
                                i.crop.offsetTop = Math.round(i.crop.offsetTop * u)
                            } else {
                                var h = (s.top + s.height - n) / s.height;
                                i.default.height = Math.round(i.default.height * h),
                                i.crop.height = Math.round(i.crop.height * h),
                                i.crop.offsetTop = Math.round(i.crop.offsetTop * h),
                                i.default.top = n + o - i.crop.offsetTop
                            }
                        else if (s.top > n + o) {
                            var d = 1 / s.height;
                            i.default.height = Math.round(i.default.height * d),
                            i.crop.height = Math.round(i.crop.height * d),
                            i.crop.offsetTop = Math.round(i.crop.offsetTop * d),
                            i.default.top = n + o - i.crop.offsetTop
                        } else if (s.top + s.height > n + o) {
                            var f = (n + o - s.top) / s.height;
                            i.default.height = Math.round(i.default.height * f),
                            i.crop.height = Math.round(i.crop.height * f),
                            i.crop.offsetTop = Math.round(i.crop.offsetTop * f)
                        }
                    } else
                        "2" == c && (s.top >= n ? i.default.top = s.top + o - i.crop.offsetTop : s.top > n + o && (i.default.top = n + o - i.crop.offsetTop))
                }
            } else if ("column" == e) {
                var m = Store.visibledatacolumn[t]
                  , p = r - (m - (t - 1 == -1 ? 0 : Store.visibledatacolumn[t - 1]) - 1);
                for (var g in a) {
                    var y = a[g]
                      , v = this.getImgItemParam(y)
                      , A = y.type;
                    if ("1" == A) {
                        if (v.left >= m)
                            y.default.left = v.left + p - y.crop.offsetLeft;
                        else if (v.left + v.width >= m - 2)
                            if (v.left < m + p) {
                                var b = (v.width + p) / v.width;
                                y.default.width = Math.round(y.default.width * b),
                                y.crop.width = Math.round(y.crop.width * b),
                                y.crop.offsetLeft = Math.round(y.crop.offsetLeft * b)
                            } else {
                                var k = (v.left + v.width - m) / v.width;
                                y.default.width = Math.round(y.default.width * k),
                                y.crop.width = Math.round(y.crop.width * k),
                                y.crop.offsetLeft = Math.round(y.crop.offsetLeft * k),
                                y.default.left = m + p - y.crop.offsetLeft
                            }
                        else if (v.left > m + p) {
                            var w = 1 / v.width;
                            y.default.width = Math.round(y.default.width * w),
                            y.crop.width = Math.round(y.crop.width * w),
                            y.crop.offsetLeft = Math.round(y.crop.offsetLeft * w),
                            y.default.left = m + p - y.crop.offsetLeft
                        } else if (v.left + v.width > m + p) {
                            var x = (m + p - v.left) / v.width;
                            y.default.width = Math.round(y.default.width * x),
                            y.crop.width = Math.round(y.crop.width * x),
                            y.crop.offsetLeft = Math.round(y.crop.offsetLeft * x)
                        }
                    } else
                        "2" == A && (v.left >= m ? y.default.left = v.left + p - y.crop.offsetLeft : v.left > m + p && (y.default.left = m + p - y.crop.offsetLeft))
                }
            }
            return a
        },
        ref: function() {
            var e = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]
              , t = this.images;
            Store.clearjfundo && (Store.jfundo = [],
            Store.jfredo.push({
                type: "imageCtrl",
                sheetIndex: Store.currentSheetIndex,
                images: null == e.images ? null : $.extend(!0, {}, e.images),
                curImages: t
            })),
            e.images = $.extend(!0, {}, t),
            server.saveParam("all", Store.currentSheetIndex, e.images, {
                k: "images"
            })
        }
    }, _defaultFormula;
    function luckysheetextendtable(type, index, value, direction, sheetIndex) {
        if (sheetIndex = sheetIndex || Store.currentSheetIndex,
        ("row" != type || checkProtectionAuthorityNormal(sheetIndex, "insertRows")) && ("column" != type || checkProtectionAuthorityNormal(sheetIndex, "insertColumns"))) {
            var curOrder = getSheetIndex(sheetIndex)
              , file = Store.luckysheetfile[curOrder]
              , d = $.extend(!0, [], file.data);
            value = Math.floor(value);
            var cfg = $.extend(!0, {}, file.config);
            null == cfg.merge && (cfg.merge = {});
            var merge_new = {};
            for (var m in cfg.merge) {
                var mc = cfg.merge[m]
                  , r = mc.r
                  , c = mc.c
                  , rs = mc.rs
                  , cs = mc.cs;
                "row" == type ? index < r ? merge_new[r + value + "_" + c] = {
                    r: r + value,
                    c: c,
                    rs: rs,
                    cs: cs
                } : index == r ? "lefttop" == direction ? merge_new[r + value + "_" + c] = {
                    r: r + value,
                    c: c,
                    rs: rs,
                    cs: cs
                } : merge_new[r + "_" + c] = {
                    r: r,
                    c: c,
                    rs: rs + value,
                    cs: cs
                } : merge_new[r + "_" + c] = index < r + rs - 1 || index == r + rs - 1 && "lefttop" == direction ? {
                    r: r,
                    c: c,
                    rs: rs + value,
                    cs: cs
                } : {
                    r: r,
                    c: c,
                    rs: rs,
                    cs: cs
                } : "column" == type && (index < c ? merge_new[r + "_" + (c + value)] = {
                    r: r,
                    c: c + value,
                    rs: rs,
                    cs: cs
                } : index == c ? "lefttop" == direction ? merge_new[r + "_" + (c + value)] = {
                    r: r,
                    c: c + value,
                    rs: rs,
                    cs: cs
                } : merge_new[r + "_" + c] = {
                    r: r,
                    c: c,
                    rs: rs,
                    cs: cs + value
                } : merge_new[r + "_" + c] = index < c + cs - 1 || index == c + cs - 1 && "lefttop" == direction ? {
                    r: r,
                    c: c,
                    rs: rs,
                    cs: cs + value
                } : {
                    r: r,
                    c: c,
                    rs: rs,
                    cs: cs
                })
            }
            cfg.merge = merge_new;
            var calcChain = file.calcChain
              , newCalcChain = [];
            if (null != calcChain && calcChain.length > 0)
                for (var i = 0; i < calcChain.length; i++) {
                    var calc = $.extend(!0, {}, calcChain[i])
                      , calc_r = calc.r
                      , calc_c = calc.c
                      , calc_i = calc.index
                      , calc_funcStr = getcellFormula(calc_r, calc_c, calc_i);
                    if ("row" == type) {
                        var functionStr = "=" + luckysheetformula.functionStrChange(calc_funcStr, "add", "row", direction, index, value);
                        d[calc_r][calc_c] && d[calc_r][calc_c].f == calc_funcStr && (d[calc_r][calc_c].f = functionStr),
                        "lefttop" == direction ? calc_r >= index && (calc.r += value) : "rightbottom" == direction && calc_r > index && (calc.r += value),
                        newCalcChain.push(calc)
                    } else if ("column" == type) {
                        var _functionStr = "=" + luckysheetformula.functionStrChange(calc_funcStr, "add", "col", direction, index, value);
                        d[calc_r][calc_c] && d[calc_r][calc_c].f == calc_funcStr && (d[calc_r][calc_c].f = _functionStr),
                        "lefttop" == direction ? calc_c >= index && (calc.c += value) : "rightbottom" == direction && calc_c > index && (calc.c += value),
                        newCalcChain.push(calc)
                    }
                }
            var filter_select = file.filter_select
              , filter = file.filter
              , newFilterObj = null;
            if (null != filter_select && "{}" != JSON.stringify(filter_select)) {
                newFilterObj = {
                    filter_select: null,
                    filter: null
                };
                var f_r1 = filter_select.row[0]
                  , f_r2 = filter_select.row[1]
                  , f_c1 = filter_select.column[0]
                  , f_c2 = filter_select.column[1];
                if ("row" == type) {
                    if (f_r1 < index ? (f_r2 == index && "lefttop" == direction || f_r2 > index) && (f_r2 += value) : f_r1 == index ? "lefttop" == direction ? (f_r1 += value,
                    f_r2 += value) : "rightbottom" == direction && f_r2 > index && (f_r2 += value) : (f_r1 += value,
                    f_r2 += value),
                    null != filter)
                        for (var k in newFilterObj.filter = {},
                        filter) {
                            var f_rowhidden = filter[k].rowhidden
                              , f_rowhidden_new = {};
                            for (var n in f_rowhidden)
                                n = parseFloat(n),
                                n < index ? f_rowhidden_new[n] = 0 : n == index ? "lefttop" == direction ? f_rowhidden_new[n + value] = 0 : "rightbottom" == direction && (f_rowhidden_new[n] = 0) : f_rowhidden_new[n + value] = 0;
                            newFilterObj.filter[k] = $.extend(!0, {}, filter[k]),
                            newFilterObj.filter[k].rowhidden = f_rowhidden_new,
                            newFilterObj.filter[k].str = f_r1,
                            newFilterObj.filter[k].edr = f_r2
                        }
                } else if ("column" == type && (f_c1 < index ? (f_c2 == index && "lefttop" == direction || f_c2 > index) && (f_c2 += value) : f_c1 == index ? "lefttop" == direction ? (f_c1 += value,
                f_c2 += value) : "rightbottom" == direction && f_c2 > index && (f_c2 += value) : (f_c1 += value,
                f_c2 += value),
                null != filter))
                    for (var _k in newFilterObj.filter = {},
                    filter) {
                        var f_cindex = filter[_k].cindex;
                        (f_cindex == index && "lefttop" == direction || f_cindex > index) && (f_cindex += value),
                        newFilterObj.filter[f_cindex - f_c1] = $.extend(!0, {}, filter[_k]),
                        newFilterObj.filter[f_cindex - f_c1].cindex = f_cindex,
                        newFilterObj.filter[f_cindex - f_c1].stc = f_c1,
                        newFilterObj.filter[f_cindex - f_c1].edc = f_c2
                    }
                newFilterObj.filter_select = {
                    row: [f_r1, f_r2],
                    column: [f_c1, f_c2]
                }
            }
            if (null != newFilterObj && null != newFilterObj.filter)
                for (var _k2 in null == cfg.rowhidden && (cfg.rowhidden = {}),
                newFilterObj.filter) {
                    var _f_rowhidden = newFilterObj.filter[_k2].rowhidden;
                    for (var _n in _f_rowhidden)
                        cfg.rowhidden[_n] = 0
                }
            var CFarr = file.luckysheet_conditionformat_save
              , newCFarr = [];
            if (null != CFarr && CFarr.length > 0)
                for (var _i = 0; _i < CFarr.length; _i++) {
                    for (var cf_range = CFarr[_i].cellrange, cf_new_range = [], j = 0; j < cf_range.length; j++) {
                        var CFr1 = cf_range[j].row[0]
                          , CFr2 = cf_range[j].row[1]
                          , CFc1 = cf_range[j].column[0]
                          , CFc2 = cf_range[j].column[1];
                        "row" == type ? CFr1 < index ? (CFr2 == index && "lefttop" == direction || CFr2 > index) && (CFr2 += value) : CFr1 == index ? "lefttop" == direction ? (CFr1 += value,
                        CFr2 += value) : "rightbottom" == direction && CFr2 > index && (CFr2 += value) : (CFr1 += value,
                        CFr2 += value) : "column" == type && (CFc1 < index ? (CFc2 == index && "lefttop" == direction || CFc2 > index) && (CFc2 += value) : CFc1 == index ? "lefttop" == direction ? (CFc1 += value,
                        CFc2 += value) : "rightbottom" == direction && CFc2 > index && (CFc2 += value) : (CFc1 += value,
                        CFc2 += value)),
                        cf_new_range.push({
                            row: [CFr1, CFr2],
                            column: [CFc1, CFc2]
                        })
                    }
                    var cf = $.extend(!0, {}, CFarr[_i]);
                    cf.cellrange = cf_new_range,
                    newCFarr.push(cf)
                }
            var AFarr = file.luckysheet_alternateformat_save
              , newAFarr = [];
            if (null != AFarr && AFarr.length > 0)
                for (var _i2 = 0; _i2 < AFarr.length; _i2++) {
                    var AFr1 = AFarr[_i2].cellrange.row[0]
                      , AFr2 = AFarr[_i2].cellrange.row[1]
                      , AFc1 = AFarr[_i2].cellrange.column[0]
                      , AFc2 = AFarr[_i2].cellrange.column[1]
                      , af = $.extend(!0, {}, AFarr[_i2]);
                    "row" == type ? AFr1 < index ? (AFr2 == index && "lefttop" == direction || AFr2 > index) && (AFr2 += value) : AFr1 == index ? "lefttop" == direction ? (AFr1 += value,
                    AFr2 += value) : "rightbottom" == direction && AFr2 > index && (AFr2 += value) : (AFr1 += value,
                    AFr2 += value) : "column" == type && (AFc1 < index ? (AFc2 == index && "lefttop" == direction || AFc2 > index) && (AFc2 += value) : AFc1 == index ? "lefttop" == direction ? (AFc1 += value,
                    AFc2 += value) : "rightbottom" == direction && AFc2 > index && (AFc2 += value) : (AFc1 += value,
                    AFc2 += value)),
                    af.cellrange = {
                        row: [AFr1, AFr2],
                        column: [AFc1, AFc2]
                    },
                    newAFarr.push(af)
                }
            var newFreezen = {
                freezenhorizontaldata: null,
                freezenverticaldata: null
            };
            if (null != luckysheetFreezen.freezenhorizontaldata && "row" == type) {
                var freezen_scrollTop = luckysheetFreezen.freezenhorizontaldata[2]
                  , freezen_row_st = luckysheetFreezen.freezenhorizontaldata[1] - 1;
                (freezen_row_st == index && "lefttop" == direction || freezen_row_st > index) && (freezen_row_st += value);
                var freezen_top = Store.visibledatarow[freezen_row_st] - 2 - freezen_scrollTop + Store.columnHeaderHeight;
                newFreezen.freezenhorizontaldata = [Store.visibledatarow[freezen_row_st], freezen_row_st + 1, freezen_scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, freezen_row_st + 1), freezen_top]
            } else
                newFreezen.freezenhorizontaldata = luckysheetFreezen.freezenhorizontaldata;
            if (null != luckysheetFreezen.freezenverticaldata && "column" == type) {
                var freezen_scrollLeft = luckysheetFreezen.freezenverticaldata[2]
                  , freezen_col_st = luckysheetFreezen.freezenverticaldata[1] - 1;
                (freezen_col_st == index && "lefttop" == direction || freezen_col_st > index) && (freezen_col_st += value);
                var freezen_left = Store.visibledatacolumn[freezen_col_st] - 2 - freezen_scrollLeft + Store.rowHeaderWidth;
                newFreezen.freezenverticaldata = [Store.visibledatacolumn[freezen_col_st], freezen_col_st + 1, freezen_scrollLeft, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, freezen_col_st + 1), freezen_left]
            } else
                newFreezen.freezenverticaldata = luckysheetFreezen.freezenverticaldata;
            var dataVerification = file.dataVerification
              , newDataVerification = {};
            if (null != dataVerification)
                for (var key in dataVerification) {
                    var _r = Number(key.split("_")[0])
                      , _c = Number(key.split("_")[1])
                      , item = dataVerification[key];
                    if ("row" == type)
                        if (index < _r)
                            newDataVerification[_r + value + "_" + _c] = item;
                        else if (index == _r)
                            if ("lefttop" == direction) {
                                newDataVerification[_r + value + "_" + _c] = item;
                                for (var _i3 = 0; _i3 < value; _i3++)
                                    newDataVerification[_r + _i3 + "_" + _c] = item
                            } else {
                                newDataVerification[_r + "_" + _c] = item;
                                for (var _i4 = 0; _i4 < value; _i4++)
                                    newDataVerification[_r + _i4 + 1 + "_" + _c] = item
                            }
                        else
                            newDataVerification[_r + "_" + _c] = item;
                    else if ("column" == type)
                        if (index < _c)
                            newDataVerification[_r + "_" + (_c + value)] = item;
                        else if (index == _c)
                            if ("lefttop" == direction) {
                                newDataVerification[_r + "_" + (_c + value)] = item;
                                for (var _i5 = 0; _i5 < value; _i5++)
                                    newDataVerification[_r + "_" + (_c + _i5)] = item
                            } else {
                                newDataVerification[_r + "_" + _c] = item;
                                for (var _i6 = 0; _i6 < value; _i6++)
                                    newDataVerification[_r + "_" + (_c + _i6 + 1)] = item
                            }
                        else
                            newDataVerification[_r + "_" + _c] = item
                }
            var hyperlink = file.hyperlink, newHyperlink = {}, type1;
            if (null != hyperlink)
                for (var _key in hyperlink) {
                    var _r2 = Number(_key.split("_")[0])
                      , _c2 = Number(_key.split("_")[1])
                      , _item = hyperlink[_key];
                    "row" == type ? index < _r2 || index == _r2 && "lefttop" == direction ? newHyperlink[_r2 + value + "_" + _c2] = _item : newHyperlink[_r2 + "_" + _c2] = _item : "column" == type && (index < _c2 || index == _c2 && "lefttop" == direction ? newHyperlink[_r2 + "_" + (_c2 + value)] = _item : newHyperlink[_r2 + "_" + _c2] = _item)
                }
            if ("row" == type) {
                if (type1 = "r",
                null != cfg.rowlen) {
                    var rowlen_new = {};
                    for (var _r3 in cfg.rowlen)
                        _r3 = parseFloat(_r3),
                        _r3 < index ? rowlen_new[_r3] = cfg.rowlen[_r3] : _r3 == index ? "lefttop" == direction ? rowlen_new[_r3 + value] = cfg.rowlen[_r3] : "rightbottom" == direction && (rowlen_new[_r3] = cfg.rowlen[_r3]) : rowlen_new[_r3 + value] = cfg.rowlen[_r3];
                    cfg.rowlen = rowlen_new
                }
                if (null != cfg.rowhidden) {
                    var rowhidden_new = {};
                    for (var _r4 in cfg.rowhidden)
                        _r4 = parseFloat(_r4),
                        _r4 < index ? rowhidden_new[_r4] = cfg.rowhidden[_r4] : _r4 == index ? "lefttop" == direction ? rowhidden_new[_r4 + value] = cfg.rowhidden[_r4] : "rightbottom" == direction && (rowhidden_new[_r4] = cfg.rowhidden[_r4]) : rowhidden_new[_r4 + value] = cfg.rowhidden[_r4];
                    cfg.rowhidden = rowhidden_new
                }
                for (var row = [], _c3 = 0; _c3 < d[0].length; _c3++)
                    row.push(null);
                if (cfg.borderInfo && cfg.borderInfo.length > 0) {
                    for (var borderInfo = [], _i7 = 0; _i7 < cfg.borderInfo.length; _i7++) {
                        var rangeType = cfg.borderInfo[_i7].rangeType;
                        if ("range" == rangeType) {
                            for (var borderRange = cfg.borderInfo[_i7].range, emptyRange = [], _j = 0; _j < borderRange.length; _j++) {
                                var bd_r1 = borderRange[_j].row[0]
                                  , bd_r2 = borderRange[_j].row[1];
                                "lefttop" == direction ? index <= bd_r1 ? (bd_r1 += value,
                                bd_r2 += value) : index <= bd_r2 && (bd_r2 += value) : index < bd_r1 ? (bd_r1 += value,
                                bd_r2 += value) : index < bd_r2 && (bd_r2 += value),
                                bd_r2 >= bd_r1 && emptyRange.push({
                                    row: [bd_r1, bd_r2],
                                    column: borderRange[_j].column
                                })
                            }
                            if (emptyRange.length > 0) {
                                var bd_obj = {
                                    rangeType: "range",
                                    borderType: cfg.borderInfo[_i7].borderType,
                                    style: cfg.borderInfo[_i7].style,
                                    color: cfg.borderInfo[_i7].color,
                                    range: emptyRange
                                };
                                borderInfo.push(bd_obj)
                            }
                        } else if ("cell" == rangeType) {
                            var row_index = cfg.borderInfo[_i7].value.row_index;
                            "lefttop" == direction ? index <= row_index && (row_index += value) : index < row_index && (row_index += value),
                            cfg.borderInfo[_i7].value.row_index = row_index,
                            borderInfo.push(cfg.borderInfo[_i7])
                        }
                    }
                    cfg.borderInfo = borderInfo
                }
                for (var arr = [], _r5 = 0; _r5 < value; _r5++)
                    arr.push(JSON.stringify(row));
                "lefttop" == direction ? 0 == index ? eval("d.unshift(" + arr.join(",") + ")") : eval("d.splice(" + index + ", 0, " + arr.join(",") + ")") : eval("d.splice(" + (index + 1) + ", 0, " + arr.join(",") + ")")
            } else {
                if (type1 = "c",
                null != cfg.columnlen) {
                    var columnlen_new = {};
                    for (var _c4 in cfg.columnlen)
                        _c4 = parseFloat(_c4),
                        _c4 < index ? columnlen_new[_c4] = cfg.columnlen[_c4] : _c4 == index ? "lefttop" == direction ? columnlen_new[_c4 + value] = cfg.columnlen[_c4] : "rightbottom" == direction && (columnlen_new[_c4] = cfg.columnlen[_c4]) : columnlen_new[_c4 + value] = cfg.columnlen[_c4];
                    cfg.columnlen = columnlen_new
                }
                if (null != cfg.colhidden) {
                    var colhidden_new = {};
                    for (var _c5 in cfg.colhidden)
                        _c5 = parseFloat(_c5),
                        _c5 < index ? colhidden_new[_c5] = cfg.colhidden[_c5] : _c5 == index ? "lefttop" == direction ? colhidden_new[_c5 + value] = cfg.colhidden[_c5] : "rightbottom" == direction && (colhidden_new[_c5] = cfg.colhidden[_c5]) : colhidden_new[_c5 + value] = cfg.colhidden[_c5];
                    cfg.colhidden = colhidden_new
                }
                for (var col = [], _r6 = 0; _r6 < d.length; _r6++)
                    col.push(null);
                if (cfg.borderInfo && cfg.borderInfo.length > 0) {
                    for (var _borderInfo = [], _i8 = 0; _i8 < cfg.borderInfo.length; _i8++) {
                        var _rangeType = cfg.borderInfo[_i8].rangeType;
                        if ("range" == _rangeType) {
                            for (var _borderRange = cfg.borderInfo[_i8].range, _emptyRange = [], _j2 = 0; _j2 < _borderRange.length; _j2++) {
                                var bd_c1 = _borderRange[_j2].column[0]
                                  , bd_c2 = _borderRange[_j2].column[1];
                                "lefttop" == direction ? index <= bd_c1 ? (bd_c1 += value,
                                bd_c2 += value) : index <= bd_c2 && (bd_c2 += value) : index < bd_c1 ? (bd_c1 += value,
                                bd_c2 += value) : index < bd_c2 && (bd_c2 += value),
                                bd_c2 >= bd_c1 && _emptyRange.push({
                                    row: _borderRange[_j2].row,
                                    column: [bd_c1, bd_c2]
                                })
                            }
                            if (_emptyRange.length > 0) {
                                var _bd_obj = {
                                    rangeType: "range",
                                    borderType: cfg.borderInfo[_i8].borderType,
                                    style: cfg.borderInfo[_i8].style,
                                    color: cfg.borderInfo[_i8].color,
                                    range: _emptyRange
                                };
                                _borderInfo.push(_bd_obj)
                            }
                        } else if ("cell" == _rangeType) {
                            var col_index = cfg.borderInfo[_i8].value.col_index;
                            "lefttop" == direction ? index <= col_index && (col_index += value) : index < col_index && (col_index += value),
                            cfg.borderInfo[_i8].value.col_index = col_index,
                            _borderInfo.push(cfg.borderInfo[_i8])
                        }
                    }
                    cfg.borderInfo = _borderInfo
                }
                for (var _r7 = 0; _r7 < d.length; _r7++)
                    for (var _row = d[_r7], _i9 = 0; _i9 < value; _i9++)
                        "lefttop" == direction ? 0 == index ? _row.unshift(col[_r7]) : _row.splice(index, 0, col[_r7]) : _row.splice(index + 1, 0, col[_r7])
            }
            file.index == Store.currentSheetIndex ? jfrefreshgrid_adRC(d, cfg, "addRC", {
                index: index,
                len: value,
                direction: direction,
                rc: type1,
                restore: !1
            }, newCalcChain, newFilterObj, newCFarr, newAFarr, newFreezen, newDataVerification, newHyperlink) : (file.data = d,
            file.config = cfg,
            file.calcChain = newCalcChain,
            file.filter = newFilterObj.filter,
            file.filter_select = newFilterObj.filter_select,
            file.luckysheet_conditionformat_save = newCFarr,
            file.luckysheet_alternateformat_save = newAFarr,
            file.dataVerification = newDataVerification,
            file.hyperlink = newHyperlink);
            var range = null;
            if (range = "row" == type ? "lefttop" == direction ? [{
                row: [index, index + value - 1],
                column: [0, d[0].length - 1]
            }] : [{
                row: [index + 1, index + value],
                column: [0, d[0].length - 1]
            }] : "lefttop" == direction ? [{
                row: [0, d.length - 1],
                column: [index, index + value - 1]
            }] : [{
                row: [0, d.length - 1],
                column: [index + 1, index + value]
            }],
            file.luckysheet_select_save = range,
            file.index == Store.currentSheetIndex && (Store.luckysheet_select_save = range,
            selectHightlightShow()),
            "row" == type) {
                var scrollLeft = $("#luckysheet-cell-main").scrollLeft()
                  , scrollTop = $("#luckysheet-cell-main").scrollTop()
                  , winH = $("#luckysheet-cell-main").height()
                  , winW = $("#luckysheet-cell-main").width()
                  , _row2 = Store.visibledatarow[range[0].row[1]]
                  , row_pre = range[0].row[0] - 1 == -1 ? 0 : Store.visibledatarow[range[0].row[0] - 1];
                _row2 - scrollTop - winH + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(_row2 - winH + 20) : row_pre - scrollTop - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(row_pre - 20),
                value > 30 && ($("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide())
            }
        }
    }
    function luckysheetextendData(e, t) {
        var r = editor.deepCopyFlowData(Store.flowdata)
          , a = $.extend(!0, {}, Store.config);
        null == a.merge && (a.merge = {});
        var n = datagridgrowth([], e, r[0].length);
        r = r.concat(n);
        for (var o = 0; o < t.length; o++) {
            var l = t[o].r
              , i = t[o].c
              , s = t[o].v;
            setcellvalue(l, i, r, s),
            null != s && null != s.mc && null != s.mc.rs && (a.merge[s.mc.r + "_" + s.mc.c] = $.extend(!0, {}, s.mc))
        }
        Store.flowdata = r,
        editor.webWorkerFlowDataCache(Store.flowdata),
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = r,
        Store.config = a,
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
    }
    function luckysheetdeletetable(e, t, r, a) {
        if (a = a || Store.currentSheetIndex,
        ("row" != e || checkProtectionAuthorityNormal(a, "deleteRows")) && ("column" != e || checkProtectionAuthorityNormal(a, "deleteColumns"))) {
            var n = getSheetIndex(a)
              , o = Store.luckysheetfile[n]
              , l = $.extend(!0, [], o.data)
              , i = r - t + 1
              , s = $.extend(!0, {}, o.config);
            null == s.merge && (s.merge = {});
            var c = {};
            for (var u in s.merge) {
                var h = s.merge[u]
                  , d = h.r
                  , f = h.c
                  , m = h.rs
                  , p = h.cs;
                "row" == e ? d < t ? d + m - 1 < t ? c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: m,
                    cs: p
                } : d + m - 1 >= t && d + m - 1 < r ? c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: t - d,
                    cs: p
                } : d + m - 1 >= r && (c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: m - i,
                    cs: p
                }) : d >= t && d <= r ? d + m - 1 > r && (c[t + "_" + f] = {
                    r: t,
                    c: f,
                    rs: d + m - 1 - r,
                    cs: p
                }) : d > r && (c[d - i + "_" + f] = {
                    r: d - i,
                    c: f,
                    rs: m,
                    cs: p
                }) : "column" == e && (f < t ? f + p - 1 < t ? c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: m,
                    cs: p
                } : f + p - 1 >= t && f + p - 1 < r ? c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: m,
                    cs: t - f
                } : f + p - 1 >= r && (c[d + "_" + f] = {
                    r: d,
                    c: f,
                    rs: m,
                    cs: p - i
                }) : f >= t && f <= r ? f + p - 1 > r && (c[d + "_" + t] = {
                    r: d,
                    c: t,
                    rs: m,
                    cs: f + p - 1 - r
                }) : f > r && (c[d + "_" + (f - i)] = {
                    r: d,
                    c: f - i,
                    rs: m,
                    cs: p
                }))
            }
            s.merge = c;
            var g = o.calcChain
              , y = [];
            if (null != g && g.length > 0)
                for (var v = 0; v < g.length; v++) {
                    var A = $.extend(!0, {}, g[v])
                      , b = A.r
                      , k = A.c
                      , w = getcellFormula(b, k, A.index);
                    if ("row" == e) {
                        if (b < t || b > r) {
                            var x = "=" + luckysheetformula.functionStrChange(w, "del", "row", null, t, i);
                            l[b][k] && l[b][k].f == w && (l[b][k].f = x),
                            b > r && (A.r = b - i),
                            y.push(A)
                        }
                    } else if ("column" == e && (k < t || k > r)) {
                        var S = "=" + luckysheetformula.functionStrChange(w, "del", "col", null, t, i);
                        l[b][k] && l[b][k].f == w && (l[b][k].f = S),
                        k > r && (A.c = k - i),
                        y.push(A)
                    }
                }
            var _ = o.filter_select
              , C = o.filter
              , T = null;
            if (null != _ && "{}" != JSON.stringify(_)) {
                T = {
                    filter_select: null,
                    filter: null
                };
                var E = _.row[0]
                  , I = _.row[1]
                  , R = _.column[0]
                  , B = _.column[1];
                if ("row" == e) {
                    if (E > r ? (E -= i,
                    I -= i,
                    T.filter_select = {
                        row: [E, I],
                        column: [R, B]
                    }) : E < t && (I < t || (I <= r ? I = t - 1 : I -= i),
                    T.filter_select = {
                        row: [E, I],
                        column: [R, B]
                    }),
                    null != T.filter_select && null != C)
                        for (var N in C) {
                            var F = C[N].rowhidden
                              , P = {};
                            for (var L in F)
                                L < t ? P[L] = 0 : L > r && (P[L - i] = 0);
                            "{}" != JSON.stringify(P) && (null == T.filter && (T.filter = {}),
                            T.filter[N] = $.extend(!0, {}, C[N]),
                            T.filter[N].rowhidden = P,
                            T.filter[N].str = E,
                            T.filter[N].edr = I)
                        }
                } else if ("column" == e && (R > r ? (R -= i,
                B -= i,
                T.filter_select = {
                    row: [E, I],
                    column: [R, B]
                }) : R < t ? (B < t || (B <= r ? B = t - 1 : B -= i),
                T.filter_select = {
                    row: [E, I],
                    column: [R, B]
                }) : B > r && (R = t,
                B -= i,
                T.filter_select = {
                    row: [E, I],
                    column: [R, B]
                }),
                null != T.filter_select && null != C))
                    for (var O in C) {
                        var D = C[O].cindex;
                        D < t ? (null == T.filter && (T.filter = {}),
                        T.filter[D - R] = $.extend(!0, {}, C[O]),
                        T.filter[D - R].edc = B) : D > r && (D -= i,
                        null == T.filter && (T.filter = {}),
                        T.filter[D - R] = $.extend(!0, {}, C[O]),
                        T.filter[D - R].cindex = D,
                        T.filter[D - R].stc = R,
                        T.filter[D - R].edc = B)
                    }
            }
            if (null != T && null != T.filter)
                for (var M in null == s.rowhidden && (s.rowhidden = {}),
                T.filter) {
                    var U = T.filter[M].rowhidden;
                    for (var H in U)
                        s.rowhidden[H] = 0
                }
            var q = o.luckysheet_conditionformat_save
              , z = [];
            if (null != q && q.length > 0)
                for (var j = 0; j < q.length; j++) {
                    for (var V = q[j].cellrange, Q = [], G = 0; G < V.length; G++) {
                        var K = V[G].row[0]
                          , W = V[G].row[1]
                          , Y = V[G].column[0]
                          , X = V[G].column[1];
                        "row" == e ? K >= t && W <= r || (K > r ? (K -= i,
                        W -= i) : K < t ? W < t || (W <= r ? W = t - 1 : W -= i) : W > r && (K = t,
                        W -= i),
                        Q.push({
                            row: [K, W],
                            column: [Y, X]
                        })) : "column" == e && (Y >= t && X <= r || (Y > r ? (Y -= i,
                        X -= i) : Y < t ? X < t || (X <= r ? X = t - 1 : X -= i) : X > r && (Y = t,
                        X -= i),
                        Q.push({
                            row: [K, W],
                            column: [Y, X]
                        })))
                    }
                    if (Q.length > 0) {
                        var J = $.extend(!0, {}, q[j]);
                        J.cellrange = Q,
                        z.push(J)
                    }
                }
            var Z = o.luckysheet_alternateformat_save
              , ee = [];
            if (null != Z && Z.length > 0)
                for (var te = 0; te < Z.length; te++) {
                    var re = Z[te].cellrange.row[0]
                      , ae = Z[te].cellrange.row[1]
                      , ne = Z[te].cellrange.column[0]
                      , oe = Z[te].cellrange.column[1];
                    if ("row" == e) {
                        if (!(re >= t && ae <= r)) {
                            var le = $.extend(!0, {}, Z[te]);
                            re > r ? (re -= i,
                            ae -= i) : re < t ? ae < t || (ae <= r ? ae = t - 1 : ae -= i) : ae > r && (re = t,
                            ae -= i),
                            le.cellrange = {
                                row: [re, ae],
                                column: [ne, oe]
                            },
                            ee.push(le)
                        }
                    } else if ("column" == e && !(ne >= t && oe <= r)) {
                        var ie = $.extend(!0, {}, Z[te]);
                        ne > r ? (ne -= i,
                        oe -= i) : ne < t ? oe < t || (oe <= r ? oe = t - 1 : oe -= i) : oe > r && (ne = t,
                        oe -= i),
                        ie.cellrange = {
                            row: [re, ae],
                            column: [ne, oe]
                        },
                        ee.push(ie)
                    }
                }
            var se = {
                freezenhorizontaldata: null,
                freezenverticaldata: null
            };
            if (null != luckysheetFreezen.freezenhorizontaldata && "row" == e) {
                var ce = luckysheetFreezen.freezenhorizontaldata[2]
                  , ue = luckysheet_searcharray(Store.visibledatarow, ce);
                -1 == ue && (ue = 0);
                var he = luckysheetFreezen.freezenhorizontaldata[1] - 1;
                he >= t && (he < r ? he = t - 1 : he -= i),
                he < ue && (he = ue);
                var de = Store.visibledatarow[he] - 2 - ce + Store.columnHeaderHeight;
                se.freezenhorizontaldata = [Store.visibledatarow[he], he + 1, ce, luckysheetFreezen.cutVolumn(Store.visibledatarow, he + 1), de]
            } else
                se.freezenhorizontaldata = luckysheetFreezen.freezenhorizontaldata;
            if (null != luckysheetFreezen.freezenverticaldata && "column" == e) {
                var fe = luckysheetFreezen.freezenverticaldata[2]
                  , me = luckysheet_searcharray(Store.visibledatacolumn, fe);
                -1 == me && (me = 0);
                var pe = luckysheetFreezen.freezenverticaldata[1] - 1;
                pe >= t && (pe < r ? pe = t - 1 : pe -= i),
                pe < me && (pe = me);
                var ge = Store.visibledatacolumn[pe] - 2 - fe + Store.rowHeaderWidth;
                se.freezenverticaldata = [Store.visibledatacolumn[pe], pe + 1, fe, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, pe + 1), ge]
            } else
                se.freezenverticaldata = luckysheetFreezen.freezenverticaldata;
            var ye = o.dataVerification
              , ve = {};
            if (null != ye)
                for (var Ae in ye) {
                    var be = Number(Ae.split("_")[0])
                      , ke = Number(Ae.split("_")[1])
                      , we = ye[Ae];
                    "row" == e ? be < t ? ve[be + "_" + ke] = we : be > r && (ve[be - i + "_" + ke] = we) : "column" == e && (ke < t ? ve[be + "_" + ke] = we : ke > r && (ve[be + "_" + (ke - i)] = we))
                }
            var xe, Se = o.hyperlink, _e = {};
            if (null != Se)
                for (var Ce in Se) {
                    var Te = Number(Ce.split("_")[0])
                      , Ee = Number(Ce.split("_")[1])
                      , Ie = Se[Ce];
                    "row" == e ? Te < t ? _e[Te + "_" + Ee] = Ie : Te > r && (_e[Te - i + "_" + Ee] = Ie) : "column" == e && (Ee < t ? _e[Te + "_" + Ee] = Ie : Ee > r && (_e[Te + "_" + (Ee - i)] = Ie))
                }
            if ("row" == e) {
                xe = "r",
                null == s.rowlen && (s.rowlen = {});
                var Re = {};
                for (var Be in s.rowlen)
                    Be < t ? Re[Be] = s.rowlen[Be] : Be > r && (Re[Be - i] = s.rowlen[Be]);
                s.rowlen = Re,
                null == s.rowhidden && (s.rowhidden = {});
                var Ne = {};
                for (var Fe in s.rowhidden)
                    Fe < t ? Ne[Fe] = s.rowhidden[Fe] : Fe > r && (Ne[Fe - i] = s.rowhidden[Fe]);
                if (s.rowhidden = Ne,
                s.borderInfo && s.borderInfo.length > 0) {
                    for (var Pe = [], $e = 0; $e < s.borderInfo.length; $e++) {
                        var Le = s.borderInfo[$e].rangeType;
                        if ("range" == Le) {
                            for (var Oe = s.borderInfo[$e].range, De = [], Me = 0; Me < Oe.length; Me++) {
                                for (var Ue = Oe[Me].row[0], He = Oe[Me].row[1], qe = t; qe <= r; qe++)
                                    qe < Oe[Me].row[0] ? (Ue -= 1,
                                    He -= 1) : qe <= Oe[Me].row[1] && (He -= 1);
                                He >= Ue && De.push({
                                    row: [Ue, He],
                                    column: Oe[Me].column
                                })
                            }
                            if (De.length > 0) {
                                var ze = {
                                    rangeType: "range",
                                    borderType: s.borderInfo[$e].borderType,
                                    style: s.borderInfo[$e].style,
                                    color: s.borderInfo[$e].color,
                                    range: De
                                };
                                Pe.push(ze)
                            }
                        } else if ("cell" == Le) {
                            var je = s.borderInfo[$e].value.row_index;
                            je < t ? Pe.push(s.borderInfo[$e]) : je > r && (s.borderInfo[$e].value.row_index = je - (r - t + 1),
                            Pe.push(s.borderInfo[$e]))
                        }
                    }
                    s.borderInfo = Pe
                }
                l.splice(t, i);
                for (var Ve = [], Qe = 0; Qe < l[0].length; Qe++)
                    Ve.push(null);
                for (var Ge = 0; Ge < i; Ge++)
                    l.push(Ve)
            } else {
                xe = "c",
                null == s.columnlen && (s.columnlen = {});
                var Ke = {};
                for (var We in s.columnlen)
                    We < t ? Ke[We] = s.columnlen[We] : We > r && (Ke[We - i] = s.columnlen[We]);
                s.columnlen = Ke,
                null == s.colhidden && (s.colhidden = {});
                var Ye = {};
                for (var Xe in s.colhidden)
                    Xe < t ? Ye[Xe] = s.colhidden[Xe] : Xe > r && (Ye[Xe - i] = s.colhidden[Xe]);
                if (s.colhidden = Ye,
                s.borderInfo && s.borderInfo.length > 0) {
                    for (var Je = [], Ze = 0; Ze < s.borderInfo.length; Ze++) {
                        var et = s.borderInfo[Ze].rangeType;
                        if ("range" == et) {
                            for (var tt = s.borderInfo[Ze].range, rt = [], at = 0; at < tt.length; at++) {
                                for (var nt = tt[at].column[0], ot = tt[at].column[1], lt = t; lt <= r; lt++)
                                    lt < tt[at].column[0] ? (nt -= 1,
                                    ot -= 1) : lt <= tt[at].column[1] && (ot -= 1);
                                ot >= nt && rt.push({
                                    row: tt[at].row,
                                    column: [nt, ot]
                                })
                            }
                            if (rt.length > 0) {
                                var it = {
                                    rangeType: "range",
                                    borderType: s.borderInfo[Ze].borderType,
                                    style: s.borderInfo[Ze].style,
                                    color: s.borderInfo[Ze].color,
                                    range: rt
                                };
                                Je.push(it)
                            }
                        } else if ("cell" == et) {
                            var st = s.borderInfo[Ze].value.col_index;
                            st < t ? Je.push(s.borderInfo[Ze]) : st > r && (s.borderInfo[Ze].value.col_index = st - (r - t + 1),
                            Je.push(s.borderInfo[Ze]))
                        }
                    }
                    s.borderInfo = Je
                }
                for (var ct = [], ut = 0; ut < i; ut++)
                    ct.push(null);
                for (var ht = 0; ht < l.length; ht++) {
                    var dt = [].concat(l[ht]);
                    dt.splice(t, i),
                    l[ht] = dt.concat(ct)
                }
            }
            o.index == Store.currentSheetIndex ? jfrefreshgrid_adRC(l, s, "delRC", {
                index: t,
                len: r - t + 1,
                rc: xe
            }, y, T, z, ee, se, ve, _e) : (o.data = l,
            o.config = s,
            o.calcChain = y,
            o.filter = T.filter,
            o.filter_select = T.filter_select,
            o.luckysheet_conditionformat_save = z,
            o.luckysheet_alternateformat_save = ee,
            o.dataVerification = ve,
            o.hyperlink = _e)
        }
    }
    function luckysheetDeleteCell(e, t, r, a, n, o) {
        if (checkProtectionNotEnable(o = o || Store.currentSheetIndex)) {
            var l = getSheetIndex(o)
              , i = Store.luckysheetfile[l]
              , s = $.extend(!0, [], i.data)
              , c = r - t + 1
              , u = n - a + 1
              , h = $.extend(!0, {}, Store.config);
            null == h.merge && (h.merge = {});
            var d = {};
            for (var f in h.merge) {
                var m = h.merge[f]
                  , p = m.r
                  , g = m.c
                  , y = m.rs
                  , v = m.cs;
                if ("moveLeft" == e)
                    if (t > p + y - 1 || r < p || a > g + v - 1)
                        d[p + "_" + g] = {
                            r: p,
                            c: g,
                            rs: y,
                            cs: v
                        };
                    else if (t <= p && r >= p + y - 1 && n < g)
                        d[p + "_" + (g - u)] = {
                            r: p,
                            c: g - u,
                            rs: y,
                            cs: v
                        };
                    else
                        for (var A = p; A <= p + y - 1; A++)
                            for (var b = g; b <= g + v - 1; b++)
                                delete s[A][b].mc;
                else if ("moveUp" == e)
                    if (a > g + v - 1 || n < g || t > p + y - 1)
                        d[p + "_" + g] = {
                            r: p,
                            c: g,
                            rs: y,
                            cs: v
                        };
                    else if (a <= g && n >= g + v - 1 && r < p)
                        d[p - c + "_" + g] = {
                            r: p - c,
                            c: g,
                            rs: y,
                            cs: v
                        };
                    else
                        for (var k = p; k <= p + y - 1; k++)
                            for (var w = g; w <= g + v - 1; w++)
                                delete s[k][w].mc
            }
            h.merge = d;
            var x = i.calcChain
              , S = [];
            if (null != x && x.length > 0)
                for (var _ = 0; _ < x.length; _++) {
                    var C = $.extend(!0, {}, x[_])
                      , T = C.r
                      , E = C.c
                      , I = getcellFormula(T, E, C.index);
                    if (T < t || T > r || E < a || E > n) {
                        var R = void 0;
                        "moveLeft" == e ? (R = "=" + luckysheetformula.functionStrChange(I, "del", "col", null, a, u),
                        E > n && T >= t && T <= r && (C.c = E - u)) : "moveUp" == e && (R = "=" + luckysheetformula.functionStrChange(I, "del", "row", null, t, c),
                        T > r && E >= a && E <= n && (C.r = T - c)),
                        s[T][E] && s[T][E].f == I && (s[T][E].f = R),
                        S.push(C)
                    }
                }
            var B = i.filter_select
              , N = i.filter
              , F = null;
            if (null != B && "{}" != JSON.stringify(B)) {
                F = {
                    filter_select: null,
                    filter: null
                };
                var P = B.row[0]
                  , L = B.row[1]
                  , O = B.column[0]
                  , D = B.column[1];
                if ("moveUp" == e)
                    if (O >= a && D <= n) {
                        if (P > r ? F.filter_select = {
                            row: [P - c, L - c],
                            column: [O, D]
                        } : L < t ? F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        } : P < t && (F.filter_select = L > r ? {
                            row: [P, L - c],
                            column: [O, D]
                        } : {
                            row: [P, t - 1],
                            column: [O, D]
                        }),
                        null != F.filter_select && null != N)
                            for (var M in N) {
                                var U = N[M].rowhidden
                                  , H = {};
                                for (var q in U)
                                    q < t ? H[q] = 0 : q > r && (H[q - slen] = 0);
                                null == F.filter && (F.filter = {}),
                                F.filter[M] = $.extend(!0, {}, N[M]),
                                "{}" != JSON.stringify(H) && (F.filter[M].rowhidden = H),
                                F.filter[M].str = F.filter_select.row[0],
                                F.filter[M].edr = F.filter_select.row[1]
                            }
                    } else if (P >= t && L <= r) {
                        if (O > n ? F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        } : O >= a ? D > n && (F.filter_select = {
                            row: [P, L],
                            column: [a, D - u]
                        }) : F.filter_select = D < a ? {
                            row: [P, L],
                            column: [O, D]
                        } : D <= n ? {
                            row: [P, L],
                            column: [O, a - 1]
                        } : {
                            row: [P, L],
                            column: [O, D - u]
                        },
                        null != F.filter_select && null != N)
                            for (var z in N) {
                                var j = F.filter_select.column[0]
                                  , V = F.filter_select.column[1]
                                  , Q = N[z].cindex;
                                if (Q < a || Q > n) {
                                    null == F.filter && (F.filter = {}),
                                    Q > n && (Q -= u);
                                    var G = Q - j;
                                    F.filter[G] = $.extend(!0, {}, N[z]),
                                    F.filter[G].cindex = Q,
                                    F.filter[G].stc = j,
                                    F.filter[G].edc = V
                                }
                            }
                    } else
                        F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        },
                        null != N && (F.filter = N);
                else if ("moveLeft" == e)
                    if (P >= t && L <= r) {
                        if (O > n ? F.filter_select = {
                            row: [P, L],
                            column: [O - u, D - u]
                        } : D < a ? F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        } : O < a && (F.filter_select = D > n ? {
                            row: [P, L],
                            column: [O, D - u]
                        } : {
                            row: [P, L],
                            column: [O, a - 1]
                        }),
                        null != F.filter_select && null != N)
                            for (var K in N) {
                                var W = F.filter_select.column[0]
                                  , Y = F.filter_select.column[1]
                                  , X = N[K].cindex;
                                if (X < a || X > n) {
                                    null == F.filter && (F.filter = {}),
                                    X > n && (X -= u);
                                    var J = X - W;
                                    F.filter[J] = $.extend(!0, {}, N[K]),
                                    F.filter[J].cindex = X,
                                    F.filter[J].stc = W,
                                    F.filter[J].edc = Y
                                }
                            }
                    } else
                        O >= a && D <= n ? (P < t || P > r) && (F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        },
                        null != N && (F.filter = N)) : (F.filter_select = {
                            row: [P, L],
                            column: [O, D]
                        },
                        null != N && (F.filter = N))
            }
            if (null != F && null != F.filter)
                for (var Z in null == h.rowhidden && (h.rowhidden = {}),
                F.filter) {
                    var ee = F.filter[Z].rowhidden;
                    for (var te in ee)
                        h.rowhidden[te] = 0
                }
            var re = i.luckysheet_conditionformat_save
              , ae = [];
            if (null != re && re.length > 0)
                for (var ne = 0; ne < re.length; ne++) {
                    for (var oe = re[ne].cellrange, le = [], ie = 0; ie < oe.length; ie++) {
                        var se = oe[ie].row[0]
                          , ce = oe[ie].row[1]
                          , ue = oe[ie].column[0]
                          , he = oe[ie].column[1];
                        t <= se && r >= ce && a <= ue && n >= he || (le = getMoveRange(e, t, r, a, n, se, ce, ue, he, c, u))
                    }
                    if (le.length > 0) {
                        var de = $.extend(!0, {}, re[ne]);
                        de.cellrange = le,
                        ae.push(de)
                    }
                }
            var fe = i.dataVerification
              , me = {};
            if (null != fe)
                for (var pe in fe) {
                    var ge = Number(pe.split("_")[0])
                      , ye = Number(pe.split("_")[1])
                      , ve = fe[pe];
                    (ge < t || ge > r || ye < a || ye > n) && ("moveLeft" == e ? ye > n && ge >= t && ge <= r ? me[ge + "_" + (ye - u)] = ve : me[ge + "_" + ye] = ve : "moveUp" == e && (ge > r && ye >= a && ye <= n ? me[ge - c + "_" + ye] = ve : me[ge + "_" + ye] = ve))
                }
            var Ae = i.hyperlink
              , be = {};
            if (null != Ae)
                for (var ke in Ae) {
                    var we = Number(ke.split("_")[0])
                      , xe = Number(ke.split("_")[1])
                      , Se = Ae[ke];
                    (we < t || we > r || xe < a || xe > n) && ("moveLeft" == e ? xe > n && we >= t && we <= r ? be[we + "_" + (xe - u)] = Se : be[we + "_" + xe] = Se : "moveUp" == e && (we > r && xe >= a && xe <= n ? be[we - c + "_" + xe] = Se : be[we + "_" + xe] = Se))
                }
            if (h.borderInfo && h.borderInfo.length > 0) {
                for (var _e = [], Ce = 0; Ce < h.borderInfo.length; Ce++) {
                    var Te = h.borderInfo[Ce].rangeType;
                    if ("range" == Te) {
                        for (var Ee = h.borderInfo[Ce].range, Ie = [], Re = 0; Re < Ee.length; Re++) {
                            var Be = Ee[Re].row[0]
                              , Ne = Ee[Re].row[1]
                              , Fe = Ee[Re].column[0]
                              , Pe = Ee[Re].column[1];
                            t <= Be && r >= Ne && a <= Fe && n >= Pe || (Ie = getMoveRange(e, t, r, a, n, Be, Ne, Fe, Pe, c, u))
                        }
                        if (Ie.length > 0) {
                            var $e = {
                                rangeType: "range",
                                borderType: h.borderInfo[Ce].borderType,
                                style: h.borderInfo[Ce].style,
                                color: h.borderInfo[Ce].color,
                                range: Ie
                            };
                            _e.push($e)
                        }
                    } else if ("cell" == Te) {
                        var Le = h.borderInfo[Ce].value.row_index
                          , Oe = h.borderInfo[Ce].value.col_index;
                        (Le < t || Le > r || Oe < a || Oe > n) && ("moveLeft" == e ? Oe > n && Le >= t && Le <= r && (Oe -= u,
                        h.borderInfo[Ce].value.col_index = Oe) : "moveUp" == e && Le > r && Oe >= a && Oe <= n && (Le -= c,
                        h.borderInfo[Ce].value.row_index = Le),
                        _e.push(h.borderInfo[Ce]))
                    }
                }
                h.borderInfo = _e
            }
            for (var De = [], Me = a; Me <= n; Me++)
                De.push(null);
            if ("moveUp" == e) {
                for (var Ue = [], He = t; He <= s.length - 1; He++) {
                    for (var qe = [], ze = a; ze <= n; ze++)
                        qe.push(s[He][ze]);
                    Ue.push(qe)
                }
                Ue.splice(0, c);
                for (var je = [], Ve = t; Ve <= r; Ve++)
                    je.push(De);
                Ue = Ue.concat(je);
                for (var Qe = t; Qe <= s.length - 1; Qe++)
                    for (var Ge = a; Ge <= n; Ge++)
                        s[Qe][Ge] = Ue[Qe - t][Ge - a]
            } else if ("moveLeft" == e)
                for (var Ke = t; Ke <= r; Ke++)
                    s[Ke].splice(a, u),
                    s[Ke] = s[Ke].concat(De);
            i.index == Store.currentSheetIndex ? jfrefreshgrid_deleteCell(s, h, {
                type: e,
                str: t,
                edr: r,
                stc: a,
                edc: n
            }, S, F, ae, me, be) : (i.data = s,
            i.config = h,
            i.calcChain = S,
            i.filter = F.filter,
            i.filter_select = F.filter_select,
            i.luckysheet_conditionformat_save = ae,
            i.dataVerification = me,
            i.hyperlink = be)
        }
    }
    function getMoveRange(e, t, r, a, n, o, l, i, s, c, u) {
        var h = [];
        if ("moveLeft" == e) {
            if (t > l || r < o || a > s)
                h.push({
                    row: [o, l],
                    column: [i, s]
                });
            else if (n < i) {
                if (t <= o && r >= l)
                    h.push({
                        row: [o, l],
                        column: [i - u, s - u]
                    });
                else if (t > o && r < l) {
                    var d = [{
                        row: [o, t - 1],
                        column: [i, s]
                    }, {
                        row: [r + 1, l],
                        column: [i, s]
                    }, {
                        row: [t, r],
                        column: [i - u, s - u]
                    }];
                    h = h.concat(d)
                } else if (t > o) {
                    var f = [{
                        row: [o, t - 1],
                        column: [i, s]
                    }, {
                        row: [t, l],
                        column: [i - u, s - u]
                    }];
                    h = h.concat(f)
                } else if (r < l) {
                    var m = [{
                        row: [o, r],
                        column: [i - u, s - u]
                    }, {
                        row: [r + 1, l],
                        column: [i, s]
                    }];
                    h = h.concat(m)
                }
            } else if (n >= i)
                if (a <= i && n >= s) {
                    if (t > o && r < l) {
                        var p = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }];
                        h = h.concat(p)
                    } else if (t > o) {
                        var g = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }];
                        h = h.concat(g)
                    } else if (r < l) {
                        var y = [{
                            row: [r + 1, l],
                            column: [i, s]
                        }];
                        h = h.concat(y)
                    }
                } else if (a > i && n < s) {
                    if (t <= o && r >= l)
                        h.push({
                            row: [o, l],
                            column: [i, s - u]
                        });
                    else if (t > o && r < l) {
                        var v = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }, {
                            row: [t, r],
                            column: [i, s - u]
                        }];
                        h = h.concat(v)
                    } else if (t > o) {
                        var A = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [t, l],
                            column: [i, s - u]
                        }];
                        h = h.concat(A)
                    } else if (r < l) {
                        var b = [{
                            row: [o, r],
                            column: [i, s - u]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }];
                        h = h.concat(b)
                    }
                } else if (a > i) {
                    if (t <= o && r >= l)
                        h.push({
                            row: [o, l],
                            column: [i, a - 1]
                        });
                    else if (t > o && r < l) {
                        var k = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }, {
                            row: [t, r],
                            column: [i, a - 1]
                        }];
                        h = h.concat(k)
                    } else if (t > o) {
                        var w = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [t, l],
                            column: [i, a - 1]
                        }];
                        h = h.concat(w)
                    } else if (r < l) {
                        var x = [{
                            row: [o, r],
                            column: [i, a - 1]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }];
                        h = h.concat(x)
                    }
                } else if (n < s)
                    if (t <= o && r >= l)
                        h.push({
                            row: [o, l],
                            column: [i - u, s - u]
                        });
                    else if (t > o && r < l) {
                        var S = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }, {
                            row: [t, r],
                            column: [i - u, s - u]
                        }];
                        h = h.concat(S)
                    } else if (t > o) {
                        var _ = [{
                            row: [o, t - 1],
                            column: [i, s]
                        }, {
                            row: [t, l],
                            column: [i - u, s - u]
                        }];
                        h = h.concat(_)
                    } else if (r < l) {
                        var C = [{
                            row: [o, r],
                            column: [i - u, s - u]
                        }, {
                            row: [r + 1, l],
                            column: [i, s]
                        }];
                        h = h.concat(C)
                    }
        } else if ("moveUp" == e)
            if (a > s || n < i || t > l)
                h.push({
                    row: [o, l],
                    column: [i, s]
                });
            else if (r < o) {
                if (a <= i && n >= s)
                    h.push({
                        row: [o - c, l - c],
                        column: [i, s]
                    });
                else if (a > i && n < s) {
                    var T = [{
                        row: [o, l],
                        column: [i, a - 1]
                    }, {
                        row: [o, l],
                        column: [n + 1, s]
                    }, {
                        row: [o - c, l - c],
                        column: [a, n]
                    }];
                    h = h.concat(T)
                } else if (a > i) {
                    var E = [{
                        row: [o, l],
                        column: [i, a - 1]
                    }, {
                        row: [o - c, l - c],
                        column: [a, s]
                    }];
                    h = h.concat(E)
                } else if (n < s) {
                    var I = [{
                        row: [o - c, l - c],
                        column: [i, n]
                    }, {
                        row: [o, l],
                        column: [n + 1, s]
                    }];
                    h = h.concat(I)
                }
            } else if (r >= o)
                if (t <= o && r >= l) {
                    if (a > i && n < s) {
                        var R = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }];
                        h = h.concat(R)
                    } else if (a > i) {
                        var B = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }];
                        h = h.concat(B)
                    } else if (n < s) {
                        var N = [{
                            row: [o, l],
                            column: [n + 1, s]
                        }];
                        h = h.concat(N)
                    }
                } else if (t > o && r < l) {
                    if (a <= i && n >= s)
                        h.push({
                            row: [o, l - c],
                            column: [i, s]
                        });
                    else if (a > i && n < s) {
                        var F = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }, {
                            row: [o, l - c],
                            column: [a, n]
                        }];
                        h = h.concat(F)
                    } else if (a > i) {
                        var P = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, l - c],
                            column: [a, s]
                        }];
                        h = h.concat(P)
                    } else if (n < s) {
                        var $ = [{
                            row: [o, l - c],
                            column: [i, n]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }];
                        h = h.concat($)
                    }
                } else if (t > o) {
                    if (a <= i && n >= s)
                        h.push({
                            row: [o, t - 1],
                            column: [i, s]
                        });
                    else if (a > i && n < s) {
                        var L = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }, {
                            row: [o, t - 1],
                            column: [a, n]
                        }];
                        h = h.concat(L)
                    } else if (a > i) {
                        var O = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, t - 1],
                            column: [a, s]
                        }];
                        h = h.concat(O)
                    } else if (n < s) {
                        var D = [{
                            row: [o, t - 1],
                            column: [i, n]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }];
                        h = h.concat(D)
                    }
                } else if (r < l)
                    if (a <= i && n >= s)
                        h.push({
                            row: [o - c, l - c],
                            column: [i, s]
                        });
                    else if (a > i && n < s) {
                        var M = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }, {
                            row: [o - c, l - c],
                            column: [a, n]
                        }];
                        h = h.concat(M)
                    } else if (a > i) {
                        var U = [{
                            row: [o, l],
                            column: [i, a - 1]
                        }, {
                            row: [o - c, l - c],
                            column: [a, s]
                        }];
                        h = h.concat(U)
                    } else if (n < s) {
                        var H = [{
                            row: [o - c, l - c],
                            column: [i, n]
                        }, {
                            row: [o, l],
                            column: [n + 1, s]
                        }];
                        h = h.concat(H)
                    }
        return h
    }
    function luckysheetcreatesheet(e, t, r, a, n) {
        null == n && (n = !0),
        Store.visibledatarow = [],
        Store.visibledatacolumn = [],
        Store.ch_width = 0,
        Store.rh_height = 0,
        Store.zoomRatio = 1,
        Store.config = null != a ? a : {},
        0 == r.length ? Store.flowdata = datagridgrowth(r, t, e) : r.length < t && r[0].length < e ? Store.flowdata = datagridgrowth(r, t - r.length, e - r[0].length) : r.length < t ? Store.flowdata = datagridgrowth(r, t - r.length, 0) : r[0].length < e ? Store.flowdata = datagridgrowth(r, 0, e - r[0].length) : Store.flowdata = r,
        editor.webWorkerFlowDataCache(Store.flowdata),
        rhchInit(t, e),
        n && (sheetmanage.showSheet(),
        setTimeout((function() {
            sheetmanage.restoreCache(),
            luckysheetformula.execFunctionGroup(),
            sheetmanage.restoreSheetAll(Store.currentSheetIndex),
            luckysheetrefreshgrid()
        }
        ), 1))
    }
    var defaultConfig = {
        defaultStore: {
            container: null,
            luckysheetfile: null,
            defaultcolumnNum: 60,
            defaultrowNum: 84,
            fullscreenmode: !0,
            devicePixelRatio: 1,
            currentSheetIndex: 0,
            calculateSheetIndex: 0,
            flowdata: [],
            config: {},
            visibledatarow: [],
            visibledatacolumn: [],
            ch_width: 0,
            rh_height: 0,
            cellmainWidth: 0,
            cellmainHeight: 0,
            toolbarHeight: 0,
            infobarHeight: 0,
            calculatebarHeight: 0,
            rowHeaderWidth: 46,
            columnHeaderHeight: 20,
            cellMainSrollBarSize: 12,
            sheetBarHeight: 31,
            statisticBarHeight: 23,
            luckysheetTableContentHW: [0, 0],
            defaultcollen: 73,
            defaultrowlen: 19,
            jfcountfuncTimeout: null,
            jfautoscrollTimeout: null,
            luckysheet_select_status: !1,
            luckysheet_select_save: [{
                row: [0, 0],
                column: [0, 0]
            }],
            luckysheet_selection_range: [],
            luckysheet_copy_save: {},
            luckysheet_paste_iscut: !1,
            filterchage: !0,
            luckysheet_filter_save: {
                row: [],
                column: []
            },
            luckysheet_sheet_move_status: !1,
            luckysheet_sheet_move_data: [],
            luckysheet_scroll_status: !1,
            luckysheetisrefreshdetail: !0,
            luckysheetisrefreshtheme: !0,
            luckysheetcurrentisPivotTable: !1,
            luckysheet_rows_selected_status: !1,
            luckysheet_cols_selected_status: !1,
            luckysheet_rows_change_size: !1,
            luckysheet_rows_change_size_start: [],
            luckysheet_cols_change_size: !1,
            luckysheet_cols_change_size_start: [],
            luckysheet_cols_dbclick_timeout: null,
            luckysheet_cols_dbclick_times: 0,
            luckysheetCellUpdate: [],
            luckysheet_shiftpositon: null,
            iscopyself: !0,
            orderbyindex: 0,
            luckysheet_model_move_state: !1,
            luckysheet_model_xy: [0, 0],
            luckysheet_model_move_obj: null,
            luckysheet_cell_selected_move: !1,
            luckysheet_cell_selected_move_index: [],
            luckysheet_cell_selected_extend: !1,
            luckysheet_cell_selected_extend_index: [],
            luckysheet_cell_selected_extend_time: null,
            clearjfundo: !0,
            jfredo: [],
            jfundo: [],
            lang: "en",
            createChart: "",
            highlightChart: "",
            zIndex: 15,
            chartparam: {
                luckysheetCurrentChart: null,
                luckysheetCurrentChartActive: !1,
                luckysheetCurrentChartMove: null,
                luckysheetCurrentChartMoveTimeout: null,
                luckysheetCurrentChartMoveObj: null,
                luckysheetCurrentChartMoveXy: null,
                luckysheetCurrentChartMoveWinH: null,
                luckysheetCurrentChartMoveWinW: null,
                luckysheetCurrentChartResize: null,
                luckysheetCurrentChartResizeObj: null,
                luckysheetCurrentChartResizeXy: null,
                luckysheetCurrentChartResizeWinH: null,
                luckysheetCurrentChartResizeWinW: null,
                luckysheetInsertChartTosheetChange: !0,
                luckysheetCurrentChartZIndexRank: 100,
                luckysheet_chart_redo_click: !1,
                luckysheetCurrentChartMaxState: !1,
                jfrefreshchartall: "",
                changeChartCellData: "",
                renderChart: "",
                getChartJson: ""
            },
            functionList: null,
            luckysheet_function: null,
            chart_selection: {},
            currentChart: "",
            scrollRefreshSwitch: !0,
            measureTextCache: {},
            measureTextCellInfoCache: {},
            measureTextCacheTimeOut: null,
            cellOverflowMapCache: {},
            zoomRatio: 1,
            visibledatacolumn_unique: null,
            visibledatarow_unique: null,
            showGridLines: !0,
            toobarObject: {},
            inlineStringEditCache: null,
            inlineStringEditRange: null,
            fontList: [],
            currentSheetView: "viewNormal"
        },
        defaultFormula: (_defaultFormula = {
            searchFunctionCell: null,
            functionlistPosition: {},
            rangechangeindex: null,
            rangestart: !1,
            rangetosheet: null,
            rangeSetValueTo: null,
            func_selectedrange: {},
            rangedrag_column_start: !1,
            rangedrag_row_start: !1,
            rangeResizeObj: null,
            rangeResize: null,
            rangeResizeIndex: null,
            rangeResizexy: null,
            rangeResizeWinH: null,
            rangeResizeWinW: null,
            rangeResizeTo: null,
            rangeMovexy: null,
            rangeMove: !1,
            rangeMoveObj: null,
            rangeMoveIndex: null,
            rangeMoveRangedata: null,
            functionHTMLIndex: 0,
            functionRangeIndex: null,
            execvertex: {},
            execFunctionGroupData: null,
            execFunctionExist: null,
            formulaContainSheetList: {},
            cellTextToIndexList: {},
            isFunctionRangeSave: !1
        },
        _defineProperty(_defaultFormula, "execvertex", {}),
        _defineProperty(_defaultFormula, "execFunctionGroupData", null),
        _defineProperty(_defaultFormula, "execFunctionExist", null),
        _defineProperty(_defaultFormula, "formulaContainSheetList", {}),
        _defineProperty(_defaultFormula, "formulaContainCellList", {}),
        _defineProperty(_defaultFormula, "cellTextToIndexList", {}),
        _defineProperty(_defaultFormula, "execFunctionGlobalData", {}),
        _defineProperty(_defaultFormula, "groupValuesRefreshData", []),
        _defineProperty(_defaultFormula, "functionResizeData", {}),
        _defineProperty(_defaultFormula, "functionResizeStatus", !1),
        _defineProperty(_defaultFormula, "functionResizeTimeout", null),
        _defineProperty(_defaultFormula, "data_parm_index", 0),
        _defaultFormula),
        defaultSheet: {
            sheetMaxIndex: 0,
            nulldata: null,
            mergeCalculationSheet: {},
            checkLoadSheetIndexToDataIndex: {},
            CacheNotLoadControll: []
        },
        defaultPivotTable: {
            pivotDatas: null,
            pivotSheetIndex: 0,
            pivotDataSheetIndex: 0,
            celldata: null,
            origindata: null,
            pivot_data_type: {},
            pivot_select_save: null,
            column: null,
            row: null,
            values: null,
            filter: null,
            showType: null,
            rowhidden: null,
            selected: null,
            caljs: null,
            initial: !0,
            filterparm: null,
            luckysheet_pivotTable_select_state: !1,
            jgridCurrentPivotInput: null,
            movestate: !1,
            moveitemposition: [],
            movesave: {},
            drawPivotTable: !0,
            pivotTableBoundary: [12, 6]
        },
        defaultImage: {
            imgItem: {
                type: "3",
                src: "",
                originWidth: null,
                originHeight: null,
                default: {
                    width: null,
                    height: null,
                    left: null,
                    top: null
                },
                crop: {
                    width: null,
                    height: null,
                    offsetLeft: 0,
                    offsetTop: 0
                },
                isFixedPos: !1,
                fixedLeft: null,
                fixedTop: null,
                border: {
                    width: 0,
                    radius: 0,
                    style: "solid",
                    color: "#000"
                }
            },
            images: null,
            currentImgId: null,
            currentWinW: null,
            currentWinH: null,
            resize: null,
            resizeXY: null,
            move: !1,
            moveXY: null,
            cropChange: null,
            cropChangeXY: null,
            cropChangeObj: null,
            copyImgItemObj: null
        },
        defaultDataVerification: {
            defaultItem: {
                type: "dropdown",
                type2: null,
                value1: "",
                value2: "",
                checked: !1,
                remote: !1,
                prohibitInput: !1,
                hintShow: !1,
                hintText: ""
            },
            curItem: null,
            dataVerification: null,
            selectRange: [],
            selectStatus: !1
        }
    }
      , method = {
        addDataAjax: function(e, t, r, a) {
            null == r && (r = server.loadSheetUrl),
            $("#luckysheet-grid-window-1").append(luckysheetlodingHTML()),
            e.currentPage++;
            var n = sessionStorage.getItem("x-auth-token");
            $.ajax({
                method: "POST",
                url: r,
                headers: {
                    "x-auth-token": n
                },
                data: JSON.stringify(e),
                contentType: "application/json;charset=UTF-8",
                success: function(e) {
                    "string" == typeof e && (e = JSON.parse(e));
                    var t = e.data
                      , r = t.celldata;
                    luckysheetextendData(t.row, r),
                    setTimeout((function() {
                        $("#luckysheetloadingdata").fadeOut().remove()
                    }
                    ), 500),
                    a && "function" == typeof a && a(t)
                }
            })
        },
        reload: function reload(param, index, url, func) {
            null == index && (index = Store.currentSheetIndex),
            null == url && (url = server.loadSheetUrl),
            $("#luckysheet-grid-window-1").append(luckysheetlodingHTML());
            var arg = {
                gridKey: server.gridKey,
                index: index
            };
            param = $.extend(!0, param, arg);
            var file = Store.luckysheetfile[getSheetIndex(index)];
            $.post(url, param, (function(d) {
                var dataset = eval("(" + d + ")");
                file.celldata = dataset[index.toString()];
                var data = sheetmanage.buildGridData(file);
                setTimeout((function() {
                    $("#luckysheetloadingdata").fadeOut().remove()
                }
                ), 500),
                file.data = data,
                Store.flowdata = data,
                editor.webWorkerFlowDataCache(data),
                luckysheetcreatesheet(data[0].length, data.length, data, null, !1),
                file.load = "1",
                Store.luckysheet_select_save = [],
                Store.luckysheet_selection_range = [],
                server.saveParam("shs", null, Store.currentSheetIndex),
                sheetmanage.changeSheet(index),
                func && "function" == typeof func && func()
            }
            ))
        },
        clearSheetByIndex: function(e) {
            var t = getSheetIndex(e)
              , r = Store.luckysheetfile[t];
            r.isPivotTable ? delete Store.luckysheetfile[t] : (r.data = [],
            r.row = Store.defaultrowNum,
            r.column = Store.defaultcolumnNum,
            r.chart = [],
            r.config = null,
            r.filter = null,
            r.filter_select = null,
            r.celldata = [],
            r.pivotTable = {},
            r.calcChain = [],
            r.status = 0,
            r.load = 0,
            Store.flowdata = [],
            editor.webWorkerFlowDataCache(Store.flowdata),
            $("#" + Store.container + " .luckysheet-data-visualization-chart").remove(),
            $("#" + Store.container + " .luckysheet-datavisual-selection-set").remove(),
            $("#luckysheet-row-count-show, #luckysheet-formula-functionrange-select, #luckysheet-row-count-show, #luckysheet-column-count-show, #luckysheet-change-size-line, #luckysheet-cell-selected-focus, #luckysheet-selection-copy, #luckysheet-cell-selected-extend, #luckysheet-cell-selected-move, #luckysheet-cell-selected").hide(),
            delete r.load)
        },
        clear: function(e) {
            if ("all" == e)
                for (var t = 0; t < Store.luckysheetfile.length; t++) {
                    var r = Store.luckysheetfile[t];
                    this.clearSheetByIndex(r.index)
                }
            else
                null == e && (e = Store.currentSheetIndex),
                this.clearSheetByIndex(e);
            sheetmanage.changeSheet(Store.luckysheetfile[0].index)
        },
        destroy: function() {
            $("#" + Store.container).empty(),
            $("body > .luckysheet-cols-menu").remove(),
            $("#luckysheet-modal-dialog-mask, #luckysheetTextSizeTest, #luckysheet-icon-morebtn-div").remove(),
            $("#luckysheet-input-box").parent().remove(),
            $("#luckysheet-formula-help-c").remove(),
            $(".chartSetting, .luckysheet-modal-dialog-slider").remove(),
            $(document).off(".luckysheetEvent"),
            $(document).off(".luckysheetProtection"),
            luckysheetFreezen.initialHorizontal = !0,
            luckysheetFreezen.initialVertical = !0;
            var e = $.extend(!0, {}, defaultConfig.defaultStore);
            for (var t in e)
                t in Store && (Store[t] = e[t]);
            var r = $.extend(!0, {}, defaultConfig.defaultFormula);
            for (var a in r)
                a in luckysheetformula && (luckysheetformula[a] = r[a]);
            var n = $.extend(!0, {}, defaultConfig.defaultSheet);
            for (var o in n)
                o in sheetmanage && (sheetmanage[o] = n[o]);
            var l = $.extend(!0, {}, defaultConfig.defaultPivotTable);
            for (var i in l)
                i in pivotTable && (pivotTable[i] = l[i]);
            var s = $.extend(!0, {}, defaultConfig.defaultImage);
            for (var c in s)
                c in imageCtrl && (imageCtrl[c] = s[c]);
            var u = $.extend(!0, {}, defaultConfig.defaultDataVerification);
            for (var h in u)
                h in dataVerificationCtrl && (dataVerificationCtrl[h] = u[h])
        },
        editorChart: function(e) {
            var t = luckyColor[0]
              , r = "luckysheetEditMode-datav-chart";
            e.chart_id = r;
            var a = e.chartTheme;
            a = null == a ? "default0000" : a,
            luckysheet.insertChartTosheet(e.sheetIndex, e.dataSheetIndex, e.option, e.chartType, e.selfOption, e.defaultOption, e.row, e.column, t, r, "luckysheetEditMode-datav-chart_selection", e.chartStyle, e.rangeConfigCheck, e.rangeRowCheck, e.rangeColCheck, e.chartMarkConfig, e.chartTitleConfig, e.winWidth, e.winHeight, e.scrollLeft, e.scrollTop, a, e.myWidth, e.myHeight, null != e.myLeft ? parseFloat(e.myLeft) : null, null != e.myTop ? parseFloat(e.myTop) : null, e.myindexrank, !0),
            $("#" + r).find(".luckysheet-modal-controll-update").click()
        },
        createHookFunction: function() {
            var e = arguments[0];
            if (luckysheetConfigsetting.hook && null != luckysheetConfigsetting.hook[e] && "function" == typeof luckysheetConfigsetting.hook[e]) {
                var t = Array.prototype.slice.apply(arguments);
                t.shift();
                var r = luckysheetConfigsetting.hook[e].apply(this, t);
                return !1 !== r
            }
            return !0
        }
    };
    function luckysheetDrawgridRowTitle(e, t, r) {
        null == e && (e = $("#luckysheet-cell-main").scrollTop()),
        null == t && (t = Store.luckysheetTableContentHW[1]),
        null == r && (r = Store.columnHeaderHeight);
        var a, n, o, l, i = $("#luckysheetTableContent").get(0).getContext("2d");
        i.save(),
        i.scale(Store.devicePixelRatio, Store.devicePixelRatio),
        i.clearRect(0, r, Store.rowHeaderWidth - 1, t),
        i.font = luckysheetdefaultFont(),
        i.textBaseline = luckysheetdefaultstyle.textBaseline,
        i.fillStyle = luckysheetdefaultstyle.fillStyle,
        -1 == (a = luckysheet_searcharray(Store.visibledatarow, e)) && (a = 0),
        -1 == (n = luckysheet_searcharray(Store.visibledatarow, e + t)) && (n = Store.visibledatarow.length - 1),
        i.save(),
        i.beginPath(),
        i.rect(0, r - 1, Store.rowHeaderWidth - 1, t - 2),
        i.clip();
        for (var s, c = a; c <= n; c++) {
            l = 0 == c ? -e - 1 : Store.visibledatarow[c - 1] - e - 1,
            o = Store.visibledatarow[c] - e;
            var u = a == c ? -2 : 0
              , h = n == c ? -2 : 0;
            if (method.createHookFunction("rowTitleCellRenderBefore", c + 1, {
                r: c,
                top: l + r + u,
                width: Store.rowHeaderWidth - 1,
                height: o - l + 1 + h - u
            }, i)) {
                if (null != Store.config.rowhidden && null != Store.config.rowhidden[c])
                    ;
                else {
                    i.fillStyle = "#ffffff",
                    i.fillRect(0, l + r + u, Store.rowHeaderWidth - 1, o - l + 1 + h - u),
                    i.fillStyle = "#000000",
                    i.save(),
                    i.scale(Store.zoomRatio, Store.zoomRatio);
                    var d = getMeasureText(c + 1, i)
                      , f = (Store.rowHeaderWidth - d.width) / 2
                      , m = l + (o - l) / 2 + r;
                    i.fillText(c + 1, f / Store.zoomRatio, m / Store.zoomRatio),
                    i.restore()
                }
                i.beginPath(),
                i.moveTo(Store.rowHeaderWidth - 2 + .5, l + r - 2),
                i.lineTo(Store.rowHeaderWidth - 2 + .5, o + r - 2),
                i.lineWidth = 1,
                i.strokeStyle = luckysheetdefaultstyle.strokeStyle,
                i.stroke(),
                i.closePath(),
                null != Store.config.rowhidden && null == Store.config.rowhidden[c] && null != Store.config.rowhidden[c + 1] ? (i.beginPath(),
                i.moveTo(-1, o + r - 4 + .5),
                i.lineTo(Store.rowHeaderWidth - 1, o + r - 4 + .5),
                i.closePath(),
                i.stroke()) : null != Store.config.rowhidden && null != Store.config.rowhidden[c] || (i.beginPath(),
                i.moveTo(-1, o + r - 2 + .5),
                i.lineTo(Store.rowHeaderWidth - 1, o + r - 2 + .5),
                i.closePath(),
                i.stroke()),
                null != Store.config.rowhidden && null != Store.config.rowhidden[c - 1] && null != s && (i.beginPath(),
                i.moveTo(-1, s + r + .5),
                i.lineTo(Store.rowHeaderWidth - 1, s + r + .5),
                i.closePath(),
                i.stroke()),
                s = o,
                method.createHookFunction("rowTitleCellRenderAfter", c + 1, {
                    r: c,
                    top: l + r + u,
                    width: Store.rowHeaderWidth - 1,
                    height: o - l + 1 + h - u
                }, i)
            }
        }
        i.restore(),
        i.restore()
    }
    function luckysheetDrawgridColumnTitle(e, t, r) {
        null == e && (e = $("#luckysheet-cell-main").scrollLeft()),
        null == t && (t = Store.luckysheetTableContentHW[0]),
        null == r && (r = Store.rowHeaderWidth);
        var a, n, o, l, i = $("#luckysheetTableContent").get(0).getContext("2d");
        i.save(),
        i.scale(Store.devicePixelRatio, Store.devicePixelRatio),
        i.clearRect(r, 0, t, Store.columnHeaderHeight - 1),
        i.font = luckysheetdefaultFont(),
        i.textBaseline = luckysheetdefaultstyle.textBaseline,
        i.fillStyle = luckysheetdefaultstyle.fillStyle,
        -1 == (a = luckysheet_searcharray(Store.visibledatacolumn, e)) && (a = 0),
        -1 == (n = luckysheet_searcharray(Store.visibledatacolumn, e + t)) && (n = Store.visibledatacolumn.length - 1),
        i.save(),
        i.beginPath(),
        i.rect(r - 1, 0, t, Store.columnHeaderHeight - 1),
        i.clip();
        for (var s, c = a; c <= n; c++) {
            l = 0 == c ? -e : Store.visibledatacolumn[c - 1] - e,
            o = Store.visibledatacolumn[c] - e;
            var u = chatatABC(c);
            if (method.createHookFunction("columnTitleCellRenderBefore", u, {
                c: c,
                left: l + r - 1,
                width: o - l,
                height: Store.columnHeaderHeight - 1
            }, i)) {
                if (null != Store.config.colhidden && null != Store.config.colhidden[c])
                    ;
                else {
                    i.fillStyle = "#ffffff",
                    i.fillRect(l + r - 1, 0, o - l, Store.columnHeaderHeight - 1),
                    i.fillStyle = "#000000",
                    i.save(),
                    i.scale(Store.zoomRatio, Store.zoomRatio);
                    var h = getMeasureText(u, i)
                      , d = Math.round(l + (o - l) / 2 + r - h.width / 2)
                      , f = Math.round(Store.columnHeaderHeight / 2);
                    i.fillText(u, d / Store.zoomRatio, f / Store.zoomRatio),
                    i.restore()
                }
                null != Store.config.colhidden && null == Store.config.colhidden[c] && null != Store.config.colhidden[c + 1] ? (i.beginPath(),
                i.moveTo(o + r - 4 + .5, 0),
                i.lineTo(o + r - 4 + .5, Store.columnHeaderHeight - 2),
                i.lineWidth = 1,
                i.strokeStyle = luckysheetdefaultstyle.strokeStyle,
                i.closePath(),
                i.stroke()) : null != Store.config.colhidden && null != Store.config.colhidden[c] || (i.beginPath(),
                i.moveTo(o + r - 2 + .5, 0),
                i.lineTo(o + r - 2 + .5, Store.columnHeaderHeight - 2),
                i.lineWidth = 1,
                i.strokeStyle = luckysheetdefaultstyle.strokeStyle,
                i.closePath(),
                i.stroke()),
                null != Store.config.colhidden && null != Store.config.colhidden[c - 1] && null != s && (i.beginPath(),
                i.moveTo(s + r + .5, 0),
                i.lineTo(s + r + .5, Store.columnHeaderHeight - 2),
                i.closePath(),
                i.stroke()),
                i.beginPath(),
                i.moveTo(l + r - 1, Store.columnHeaderHeight - 2 + .5),
                i.lineTo(o + r - 1, Store.columnHeaderHeight - 2 + .5),
                i.stroke(),
                i.closePath(),
                s = o,
                method.createHookFunction("columnTitleCellRenderAfter", u, {
                    c: c,
                    left: l + r - 1,
                    width: o - l,
                    height: Store.columnHeaderHeight - 1
                }, i)
            }
        }
        i.restore(),
        i.restore()
    }
    function luckysheetDrawMain(e, t, r, a, n, o, l, i, s) {
        if (null != Store.flowdata) {
            var c = sheetmanage.getSheetByIndex();
            clearTimeout(Store.measureTextCacheTimeOut),
            null == e && (e = $("#luckysheet-cell-main").scrollLeft()),
            null == t && (t = $("#luckysheet-cell-main").scrollTop()),
            null == r && (r = Store.luckysheetTableContentHW[0]),
            null == a && (a = Store.luckysheetTableContentHW[1]),
            null == n && (n = Store.rowHeaderWidth),
            null == o && (o = Store.columnHeaderHeight),
            null == l && (l = 0),
            null == i && (i = 0);
            var u, h, d, f, m, p, g = null;
            if (null == s)
                g = $("#luckysheetTableContent").get(0).getContext("2d");
            else if ("object" == getObjType(s))
                try {
                    g = s.get(0).getContext("2d")
                } catch (e) {
                    g = s
                }
            else
                g = $("#" + s).get(0).getContext("2d");
            g.save(),
            g.scale(Store.devicePixelRatio, Store.devicePixelRatio),
            g.clearRect(0, 0, Store.luckysheetTableContentHW[0], Store.luckysheetTableContentHW[1]),
            -1 == (u = luckysheet_searcharray(Store.visibledatarow, t)) && (u = 0),
            u += i,
            -1 == (h = luckysheet_searcharray(Store.visibledatarow, t + a)) && (h = Store.visibledatarow.length - 1),
            (h += i) >= Store.visibledatarow.length && (h = Store.visibledatarow.length - 1),
            -1 == (d = luckysheet_searcharray(Store.visibledatacolumn, e)) && (d = 0),
            d += l,
            -1 == (f = luckysheet_searcharray(Store.visibledatacolumn, e + r)) && (f = Store.visibledatacolumn.length - 1),
            (f += l) >= Store.visibledatacolumn.length && (f = Store.visibledatacolumn.length - 1),
            0 == u ? 0 : Store.visibledatarow[u - 1],
            m = Store.visibledatarow[h],
            0 == d ? 0 : Store.visibledatacolumn[d - 1],
            p = Store.visibledatacolumn[f],
            g.fillStyle = "#ffffff",
            g.fillRect(n - 1, o - 1, p - e, m - t),
            g.font = luckysheetdefaultFont(),
            g.fillStyle = luckysheetdefaultstyle.fillStyle;
            for (var y = [], v = {}, A = {}, b = u; b <= h; b++) {
                var k = void 0;
                k = 0 == b ? -t - 1 : Store.visibledatarow[b - 1] - t - 1;
                var w = Store.visibledatarow[b] - t;
                if (null == Store.config.rowhidden || null == Store.config.rowhidden[b])
                    for (var x = d; x <= f; x++) {
                        var S = void 0;
                        S = 0 == x ? -e : Store.visibledatacolumn[x - 1] - e;
                        var _ = Store.visibledatacolumn[x] - e;
                        if (null == Store.config.colhidden || null == Store.config.colhidden[x]) {
                            var C = Store.defaultcollen;
                            if (null != Store.config.columnlen && null != Store.config.columnlen[x] && (C = Store.config.columnlen[x]),
                            null != Store.flowdata[b] && null != Store.flowdata[b][x]) {
                                var T = Store.flowdata[b][x];
                                if ("object" == getObjType(T) && "mc"in T) {
                                    if (A[b + "_" + x] = {
                                        start_r: k,
                                        start_c: S,
                                        end_r: w,
                                        end_c: _
                                    },
                                    !("rs"in T.mc)) {
                                        var E = "r" + T.mc.r + "c" + T.mc.c
                                          , I = y[v[E]];
                                        null == I ? (v[E] = y.length,
                                        y.push({
                                            r: b,
                                            c: x,
                                            start_c: S,
                                            start_r: k,
                                            end_r: w,
                                            end_c: _,
                                            firstcolumnlen: C
                                        })) : (I.c == x && (I.end_r += w - k - 1),
                                        I.r == b && (I.end_c += _ - S,
                                        I.firstcolumnlen += C));
                                        continue
                                    }
                                    v["r" + b + "c" + x] = y.length
                                }
                            } else if (!method.createHookFunction("cellRenderBefore", Store.flowdata[b][x], {
                                r: b,
                                c: x,
                                start_r: k,
                                start_c: S,
                                end_r: w,
                                end_c: _
                            }, c, g))
                                continue;
                            y.push({
                                r: b,
                                c: x,
                                start_r: k,
                                start_c: S,
                                end_r: w,
                                end_c: _,
                                firstcolumnlen: C
                            }),
                            A[b + "_" + x] = {
                                start_r: k,
                                start_c: S,
                                end_r: w,
                                end_c: _
                            }
                        }
                    }
            }
            for (var R = dynamicArrayCompute(Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray), B = alternateformat.getComputeMap(), N = conditionformat.getComputeMap(), F = getCellOverflowMap(g, d, f, u, h), P = [], L = 0; L < y.length; L++) {
                var O = y[L]
                  , D = O.r
                  , M = O.c
                  , U = O.start_r
                  , H = O.start_c
                  , q = O.end_r
                  , z = O.end_c;
                O.firstcolumnlen;
                if (null != Store.flowdata[D] && method.createHookFunction("cellRenderBefore", Store.flowdata[D][M], {
                    r: D,
                    c: M,
                    start_r: U,
                    start_c: H,
                    end_r: q,
                    end_c: z
                }, c, g)) {
                    if (null == Store.flowdata[D][M])
                        nullCellRender(D, M, U, H, q, z, g, B, N, n, o, R, F, d, f, t, e, .5);
                    else {
                        var j = Store.flowdata[D][M]
                          , V = null;
                        if ("object" == _typeof(j) && "mc"in j ? P.push(y[L]) : V = getRealCellValue(D, M),
                        null == V || 0 == V.toString().length) {
                            nullCellRender(D, M, U, H, q, z, g, B, N, n, o, R, F, d, f, t, e, .5);
                            var Q = menuButton.borderfix(Store.flowdata, D, M)
                              , G = [H + n + Q[0], U + o + Q[1], z - H - 3 + Q[2], q - U - 3 - 1 + Q[3]];
                            sparklinesRender(D, M, G[0], G[1], "luckysheetTableContent", g)
                        } else
                            D + "_" + M in R && (V = R[D + "_" + M].v),
                            cellRender(D, M, U, H, q, z, V, g, B, N, n, o, R, F, d, f, t, e, .5)
                    }
                    method.createHookFunction("cellRenderAfter", Store.flowdata[D][M], {
                        r: D,
                        c: M,
                        start_r: U,
                        start_c: H,
                        end_r: q,
                        end_c: z
                    }, c, g)
                }
            }
            for (var K = 0; K < P.length; K++) {
                var W = P[K]
                  , Y = W.r
                  , X = W.c
                  , J = W.start_r
                  , Z = W.start_c
                  , ee = W.end_r
                  , te = W.end_c
                  , re = (W.firstcolumnlen,
                null)
                  , ae = Store.flowdata[Y][X].mc;
                re = getRealCellValue(ae.r, ae.c),
                Y = ae.r,
                X = ae.c;
                var ne = Store.flowdata[Y][X];
                if (Z = 0 == X ? -e : Store.visibledatacolumn[X - 1] - e,
                J = 0 == Y ? -t - 1 : Store.visibledatarow[Y - 1] - t - 1,
                ee = Store.visibledatarow[Y + ne.mc.rs - 1] - t,
                te = Store.visibledatacolumn[X + ne.mc.cs - 1] - e,
                null == re || 0 == re.toString().length) {
                    nullCellRender(Y, X, J, Z, ee, te, g, B, N, n, o, R, F, d, f, t, e, .5, !0);
                    var oe = menuButton.borderfix(Store.flowdata, Y, X)
                      , le = [Z + n + oe[0], J + o + oe[1], te - Z - 3 + oe[2], ee - J - 3 - 1 + oe[3]];
                    sparklinesRender(Y, X, le[0], le[1], "luckysheetTableContent", g)
                } else
                    Y + "_" + X in R && (re = R[Y + "_" + X].v),
                    cellRender(Y, X, J, Z, ee, te, re, g, B, N, n, o, R, F, d, f, t, e, .5, !0)
            }
            for (var ie = u; ie <= h; ie++) {
                var se = void 0;
                se = 0 == ie ? -t - 1 : Store.visibledatarow[ie - 1] - t - 1;
                for (var ce = Store.visibledatarow[ie] - t, ue = d; ue <= f; ue++) {
                    var he = void 0;
                    he = 0 == ue ? -e : Store.visibledatacolumn[ue - 1] - e;
                    var de = Store.visibledatacolumn[ue] - e;
                    Store.luckysheetcurrentisPivotTable && pivotTable.drawPivotTable ? ((0 == ue || 5 == ue) && ie <= 11 && (g.beginPath(),
                    g.moveTo(de - 2 + .5 + n, se + o),
                    g.lineTo(de - 2 + .5 + n, ce - 2 + .5 + o),
                    g.lineWidth = 1,
                    g.strokeStyle = "#000000",
                    g.closePath(),
                    g.stroke()),
                    (2 == ie || 11 == ie) && ue <= 5 && (g.beginPath(),
                    g.moveTo(he - 1 + n, ce - 2 + .5 + o),
                    g.lineTo(de - 2 + .5 + n, ce - 2 + .5 + o),
                    g.lineWidth = 1,
                    g.strokeStyle = "#000000",
                    g.closePath(),
                    g.stroke()),
                    6 == ie && 3 == ue && (g.save(),
                    g.font = "bold 30px Arial",
                    g.fillStyle = "#626675",
                    g.textAlign = "center",
                    g.fillText(locale().pivotTable.title, he + (de - he) / 2 + 4 + n, se + (ce - se) / 2 - 1 + o),
                    g.restore())) : Store.luckysheetcurrentisPivotTable && ue < pivotTable.pivotTableBoundary[1] && ie < pivotTable.pivotTableBoundary[0] && (g.beginPath(),
                    g.moveTo(de - 2 + .5 + n, se + o),
                    g.lineTo(de - 2 + .5 + n, ce - 2 + .5 + o),
                    g.lineWidth = 1,
                    g.strokeStyle = "#000000",
                    g.closePath(),
                    g.stroke(),
                    g.beginPath(),
                    g.moveTo(he - 1 + n, ce - 2 + .5 + o),
                    g.lineTo(de - 2 + n, ce - 2 + .5 + o),
                    g.lineWidth = 1,
                    g.strokeStyle = "#000000",
                    g.closePath(),
                    g.stroke())
                }
            }
            if (null != Store.config.borderInfo && Store.config.borderInfo.length > 0) {
                var fe = function(e, t, r, a, n, o, l, i, s) {
                    var c = e
                      , u = a - 2 + .5 + l
                      , h = r + i - 1
                      , d = a - 2 + .5 + l
                      , f = n - 2 + .5 + i;
                    s.save(),
                    menuButton.setLineDash(s, c, "v", u, h, d, f),
                    s.strokeStyle = t,
                    s.stroke(),
                    s.closePath(),
                    s.restore()
                }
                  , me = function(e, t, r, a, n, o, l, i, s) {
                    var c = e
                      , u = o - 2 + .5 + l
                      , h = r + i - 1
                      , d = o - 2 + .5 + l
                      , f = n - 2 + .5 + i;
                    s.save(),
                    menuButton.setLineDash(s, c, "v", u, h, d, f),
                    s.strokeStyle = t,
                    s.stroke(),
                    s.closePath(),
                    s.restore()
                }
                  , pe = function(e, t, r, a, n, o, l, i, s) {
                    var c = e
                      , u = a - 2 + .5 + l
                      , h = n - 2 + .5 + i
                      , d = o - 2 + .5 + l
                      , f = n - 2 + .5 + i;
                    s.save(),
                    menuButton.setLineDash(s, c, "h", u, h, d, f),
                    s.strokeStyle = t,
                    s.stroke(),
                    s.closePath(),
                    s.restore()
                }
                  , ge = function(e, t, r, a, n, o, l, i, s) {
                    var c = e
                      , u = a - 2 + .5 + l
                      , h = r - 1 + .5 + i
                      , d = o - 2 + .5 + l
                      , f = r - 1 + .5 + i;
                    s.save(),
                    menuButton.setLineDash(s, c, "h", u, h, d, f),
                    s.strokeStyle = t,
                    s.stroke(),
                    s.closePath(),
                    s.restore()
                }
                  , ye = getBorderInfoComputeRange(u, h, d, f);
                for (var ve in ye) {
                    var Ae = ve.substr(0, ve.indexOf("_"))
                      , be = ve.substr(ve.indexOf("_") + 1);
                    if (A[Ae + "_" + be]) {
                        var ke = A[Ae + "_" + be].start_r
                          , we = A[Ae + "_" + be].start_c
                          , xe = A[Ae + "_" + be].end_r
                          , Se = A[Ae + "_" + be].end_c
                          , _e = cellOverflow_colIn(F, Ae, be, d, f)
                          , Ce = ye[ve].l;
                        null == Ce || _e.colIn && _e.stc != be || fe(Ce.style, Ce.color, ke, we, xe, 0, n, o, g);
                        var Te = ye[ve].r;
                        null == Te || _e.colIn && !_e.colLast || me(Te.style, Te.color, ke, 0, xe, Se, n, o, g);
                        var Ee = ye[ve].t;
                        null != Ee && ge(Ee.style, Ee.color, ke, we, 0, Se, n, o, g);
                        var Ie = ye[ve].b;
                        null != Ie && pe(Ie.style, Ie.color, 0, we, xe, Se, n, o, g)
                    }
                }
            }
            f == Store.visibledatacolumn.length - 1 && g.clearRect(p - e + n - 1, o - 1, Store.ch_width - Store.visibledatacolumn[f], m - t),
            g.restore(),
            Store.measureTextCacheTimeOut = setTimeout((function() {
                Store.measureTextCache = {},
                Store.measureTextCellInfoCache = {},
                Store.cellOverflowMapCache = {}
            }
            ), 2e3)
        }
    }
    var sparklinesRender = function sparklinesRender(r, c, offsetX, offsetY, canvasid, ctx) {
        if (null != Store.flowdata[r] && null != Store.flowdata[r][c]) {
            var sparklines = Store.flowdata[r][c].spl;
            if (null != sparklines)
                if ("string" == typeof sparklines && (sparklines = eval("(" + sparklines + ")")),
                "object" == getObjType(sparklines)) {
                    var temp1 = sparklines
                      , x = temp1.offsetX
                      , y = temp1.offsetY;
                    x = null == x ? 0 : x,
                    y = null == y ? 0 : y,
                    luckysheetSparkline.render(temp1.shapeseq, temp1.shapes, offsetX + x, offsetY + y, temp1.pixelWidth, temp1.pixelHeight, canvasid, ctx)
                } else if ("array" == getObjType(sparklines) && "object" == getObjType(sparklines[0]))
                    for (var i = 0; i < sparklines.length; i++) {
                        var _temp = sparklines[i]
                          , _x = _temp.offsetX
                          , _y = _temp.offsetY;
                        _x = null == _x ? 0 : _x,
                        _y = null == _y ? 0 : _y,
                        luckysheetSparkline.render(_temp.shapeseq, _temp.shapes, offsetX + _x, offsetY + _y, _temp.pixelWidth, _temp.pixelHeight, canvasid, ctx)
                    }
        }
    }
      , nullCellRender = function(e, t, r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v) {
        var A = alternateformat.checksAF(e, t, i)
          , b = conditionformat.checksCF(e, t, s)
          , k = menuButton.borderfix(Store.flowdata, e, t)
          , w = menuButton.checkstatus(Store.flowdata, e, t, "bg");
        null != A && null != A[1] && (w = A[1]),
        null != b && null != b.cellColor && (w = b.cellColor),
        null != Store.flowdata[e][t] && null != Store.flowdata[e][t].tc && (w = Store.flowdata[e][t].tc),
        l.fillStyle = null == w ? "#FFFFFF" : w;
        var x = [a + c + k[0], r + u + k[1], o - a + k[2] - (v ? 1 : 0), n - r + k[3]];
        if (l.fillRect(x[0], x[1], x[2], x[3]),
        e + "_" + t in h) {
            var S = h[e + "_" + t].v;
            l.fillStyle = "#000000";
            var _ = luckysheetdefaultFont();
            l.font = _;
            var C = a + 4 + c
              , T = (browser.luckysheetrefreshfixed(),
            n + u - 2);
            l.textBaseline = "bottom",
            l.fillText(null == S ? "" : S, C, T)
        }
        if (null != Store.flowdata[e][t] && null != Store.flowdata[e][t].ps) {
            var E = 8 * Store.zoomRatio
              , I = 8 * Store.zoomRatio;
            l.beginPath(),
            l.moveTo(o + c - 1 - E, r + u),
            l.lineTo(o + c - 1, r + u),
            l.lineTo(o + c - 1, r + u + I),
            l.fillStyle = "#FC6666",
            l.fill(),
            l.closePath()
        }
        var R = cellOverflow_colIn(d, e, t, f, m);
        R.colLast && cellOverflowRender(R.rowIndex, R.colIndex, R.stc, R.edc, l, p, g, c, u, i, s),
        R.colIn && !R.colLast || Store.luckysheetcurrentisPivotTable || w || !Store.showGridLines || (l.beginPath(),
        l.moveTo(o + c - 2 + y, r + u),
        l.lineTo(o + c - 2 + y, n + u),
        l.lineWidth = 1,
        l.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        l.stroke(),
        l.closePath()),
        Store.luckysheetcurrentisPivotTable || w || !Store.showGridLines || (l.beginPath(),
        l.moveTo(a + c - 1, n + u - 2 + y),
        l.lineTo(o + c - 1, n + u - 2 + y),
        l.lineWidth = 1,
        l.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        l.stroke(),
        l.closePath())
    }
      , cellRender = function(e, t, r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A) {
        var b = Store.flowdata[e][t]
          , k = o - a - 2
          , w = n - r - 2
          , x = menuButton.checkstatus(Store.flowdata, e, t, "ht")
          , S = menuButton.checkstatus(Store.flowdata, e, t, "vt")
          , _ = alternateformat.checksAF(e, t, s)
          , C = conditionformat.checksCF(e, t, c)
          , T = menuButton.checkstatus(Store.flowdata, e, t, "bg");
        null != _ && null != _[1] && (T = _[1]),
        null != C && null != C.cellColor && (T = C.cellColor),
        i.fillStyle = null == T ? "#FFFFFF" : T;
        var E = menuButton.borderfix(Store.flowdata, e, t)
          , I = [a + u + E[0], r + h + E[1], o - a + E[2] - (A ? 1 : 0), n - r + E[3]];
        i.fillRect(I[0], I[1], I[2], I[3]);
        var R = dataVerificationCtrl.dataVerification;
        if (null != R && null != R[e + "_" + t] && !dataVerificationCtrl.validateCellData(l, R[e + "_" + t])) {
            var B = 5 * Store.zoomRatio
              , N = 5 * Store.zoomRatio;
            i.beginPath(),
            i.moveTo(a + u, r + h),
            i.lineTo(a + u + B, r + h),
            i.lineTo(a + u, r + h + N),
            i.fillStyle = "#FC6666",
            i.fill(),
            i.closePath()
        }
        if (null != b.ps) {
            var F = 8 * Store.zoomRatio
              , P = 8 * Store.zoomRatio;
            i.beginPath(),
            i.moveTo(o + u - F, r + h),
            i.lineTo(o + u, r + h),
            i.lineTo(o + u, r + h + P),
            i.fillStyle = "#FC6666",
            i.fill(),
            i.closePath()
        }
        if (1 == b.qp && isRealNum(b.v)) {
            var $ = 6 * Store.zoomRatio
              , L = 6 * Store.zoomRatio;
            i.beginPath(),
            i.moveTo(a + u + $ - 1, r + h),
            i.lineTo(a + u - 1, r + h),
            i.lineTo(a + u - 1, r + h + L),
            i.fillStyle = "#487f1e",
            i.fill(),
            i.closePath()
        }
        var O = !0
          , D = cellOverflow_colIn(f, e, t, m, p);
        if ("1" == b.tb && D.colIn)
            D.colLast ? cellOverflowRender(D.rowIndex, D.colIndex, D.stc, D.edc, i, g, y, u, h, s, c) : O = !1;
        else if (null != R && null != R[e + "_" + t] && "checkbox" == R[e + "_" + t].type) {
            var M = a + u
              , U = r + h + 1;
            i.save(),
            i.beginPath(),
            i.rect(M, U, k, w),
            i.clip(),
            i.scale(Store.zoomRatio, Store.zoomRatio);
            var H = getMeasureText(l, i)
              , q = H.width + 14
              , z = H.actualBoundingBoxDescent + H.actualBoundingBoxAscent
              , j = M + 2;
            "0" == x ? j = M + k / 2 - q / 2 : "2" == x && (j = M + k - 2 - q);
            var V = w > z ? w : z
              , Q = U + V - 2;
            i.textBaseline = "bottom";
            var G = Q - 13 * Store.zoomRatio;
            "0" == S ? (Q = U + V / 2,
            i.textBaseline = "middle",
            G = Q - 6 * Store.zoomRatio) : "1" == S && (Q = U + 2,
            i.textBaseline = "top",
            G = Q + 1 * Store.zoomRatio),
            j /= Store.zoomRatio,
            Q /= Store.zoomRatio,
            G /= Store.zoomRatio,
            i.lineWidth = 1,
            i.strokeStyle = "#000",
            i.strokeRect(j, G, 10, 10),
            R[e + "_" + t].checked && (i.beginPath(),
            i.lineTo(j + 1, G + 6),
            i.lineTo(j + 4, G + 9),
            i.lineTo(j + 9, G + 2),
            i.stroke(),
            i.closePath()),
            i.fillStyle = menuButton.checkstatus(Store.flowdata, e, t, "fc"),
            i.fillText(null == l ? "" : l, j + 14, Q),
            i.restore()
        } else {
            if (null != C && null != C.dataBar) {
                var K = a + u + 2
                  , W = r + h + 2
                  , Y = k - 4
                  , X = w - 4
                  , J = C.dataBar.valueType
                  , Z = C.dataBar.valueLen
                  , ee = C.dataBar.format;
                if ("minus" == J) {
                    var te = C.dataBar.minusLen;
                    if (ee.length > 1) {
                        var re = i.createLinearGradient(K + Y * te * (1 - Z), W, K + Y * te, W);
                        re.addColorStop(0, "#ffffff"),
                        re.addColorStop(1, "#ff0000"),
                        i.fillStyle = re
                    } else
                        i.fillStyle = "#ff0000";
                    i.fillRect(K + Y * te * (1 - Z), W, Y * te * Z, X),
                    i.beginPath(),
                    i.moveTo(K + Y * te * (1 - Z), W),
                    i.lineTo(K + Y * te * (1 - Z), W + X),
                    i.lineTo(K + Y * te, W + X),
                    i.lineTo(K + Y * te, W),
                    i.lineTo(K + Y * te * (1 - Z), W),
                    i.lineWidth = 1,
                    i.strokeStyle = "#ff0000",
                    i.stroke(),
                    i.closePath()
                } else if ("plus" == J) {
                    var ae = C.dataBar.plusLen;
                    if (1 == ae) {
                        if (ee.length > 1) {
                            var ne = i.createLinearGradient(K, W, K + Y * Z, W);
                            ne.addColorStop(0, ee[0]),
                            ne.addColorStop(1, ee[1]),
                            i.fillStyle = ne
                        } else
                            i.fillStyle = ee[0];
                        i.fillRect(K, W, Y * Z, X),
                        i.beginPath(),
                        i.moveTo(K, W),
                        i.lineTo(K, W + X),
                        i.lineTo(K + Y * Z, W + X),
                        i.lineTo(K + Y * Z, W),
                        i.lineTo(K, W),
                        i.lineWidth = 1,
                        i.strokeStyle = ee[0],
                        i.stroke(),
                        i.closePath()
                    } else {
                        var oe = C.dataBar.minusLen;
                        if (ee.length > 1) {
                            var le = i.createLinearGradient(K + Y * oe, W, K + Y * oe + Y * ae * Z, W);
                            le.addColorStop(0, ee[0]),
                            le.addColorStop(1, ee[1]),
                            i.fillStyle = le
                        } else
                            i.fillStyle = ee[0];
                        i.fillRect(K + Y * oe, W, Y * ae * Z, X),
                        i.beginPath(),
                        i.moveTo(K + Y * oe, W),
                        i.lineTo(K + Y * oe, W + X),
                        i.lineTo(K + Y * oe + Y * ae * Z, W + X),
                        i.lineTo(K + Y * oe + Y * ae * Z, W),
                        i.lineTo(K + Y * oe, W),
                        i.lineWidth = 1,
                        i.strokeStyle = ee[0],
                        i.stroke(),
                        i.closePath()
                    }
                }
            }
            var ie = a + u
              , se = r + h + 1;
            i.save(),
            i.beginPath(),
            i.rect(ie, se, k, w),
            i.clip(),
            i.scale(Store.zoomRatio, Store.zoomRatio);
            var ce = getCellTextInfo(b, i, {
                cellWidth: k,
                cellHeight: w,
                space_width: 2,
                space_height: 2,
                r: e,
                c: t
            });
            if (null != C && null != C.icons && "plain" == ce.type) {
                var ue = C.icons.left
                  , he = C.icons.top
                  , de = ce.values[0]
                  , fe = (de.left,
                se + de.top - ce.textHeightAll);
                "0" == S ? fe = se + w / 2 - ce.textHeightAll / 2 : "1" == S ? fe = se : "2" == S && (fe -= ce.desc),
                fe /= Store.zoomRatio,
                Store.zoomRatio,
                i.drawImage(luckysheet_CFiconsImg, 42 * ue, 32 * he, 32, 32, ie / Store.zoomRatio, fe, ce.textHeightAll / Store.zoomRatio, ce.textHeightAll / Store.zoomRatio),
                "0" != x && "2" != x && ce.textHeightAll / Store.zoomRatio
            }
            i.fillStyle = menuButton.checkstatus(Store.flowdata, e, t, "fc"),
            null != _ && null != _[0] && (i.fillStyle = _[0]),
            null != C && null != C.textColor && (i.fillStyle = C.textColor),
            cellTextRender(ce, i, {
                pos_x: ie,
                pos_y: se
            }),
            i.restore()
        }
        O && (Store.luckysheetcurrentisPivotTable || T || !Store.showGridLines || (i.beginPath(),
        i.moveTo(o + u - 2 + v, r + h),
        i.lineTo(o + u - 2 + v, n + h),
        i.lineWidth = 1,
        i.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        i.stroke(),
        i.closePath())),
        Store.luckysheetcurrentisPivotTable || T || !Store.showGridLines || (i.beginPath(),
        i.moveTo(a + u - 1, n + h - 2 + v),
        i.lineTo(o + u - 1, n + h - 2 + v),
        i.lineWidth = 1,
        i.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        i.stroke(),
        i.closePath())
    }
      , cellOverflowRender = function(e, t, r, a, n, o, l, i, s, c, u) {
        var h;
        h = 0 == e ? -o - 1 : Store.visibledatarow[e - 1] - o - 1;
        var d, f = Store.visibledatarow[e] - o;
        d = 0 == r ? -l : Store.visibledatacolumn[r - 1] - l;
        var m = Store.visibledatacolumn[a] - l
          , p = Store.flowdata[e][t]
          , g = m - d - 2
          , y = f - h - 2
          , v = d + i
          , A = h + s + 1
          , b = luckysheetfontformat(p);
        n.font = b,
        n.save(),
        n.beginPath(),
        n.rect(v, A, g, y),
        n.clip(),
        n.scale(Store.zoomRatio, Store.zoomRatio);
        var k = getCellTextInfo(p, n, {
            cellWidth: g,
            cellHeight: y,
            space_width: 2,
            space_height: 2,
            r: e,
            c: t
        })
          , w = alternateformat.checksAF(e, t, c)
          , x = conditionformat.checksCF(e, t, u);
        n.fillStyle = menuButton.checkstatus(Store.flowdata, e, t, "fc"),
        null != w && null != w[0] && (n.fillStyle = w[0]),
        null != x && null != x.textColor && (n.fillStyle = x.textColor),
        cellTextRender(k, n, {
            pos_x: v,
            pos_y: A
        }),
        n.restore()
    };
    function getCellOverflowMap(e, t, r, a, n) {
        for (var o = {}, l = Store.flowdata, i = a; i <= n; i++)
            if (null != l[i])
                if (null == Store.cellOverflowMapCache[i]) {
                    for (var s = !1, c = 0; c < l[i].length; c++) {
                        var u = l[i][c];
                        if ((null == Store.config.colhidden || null == Store.config.colhidden[c]) && (null != u && (!isRealNull(u.v) || isInlineStringCell(u)) && null == u.mc && "1" == u.tb)) {
                            var h = menuButton.checkstatus(l, i, c, "ht")
                              , d = getCellTextInfo(u, e, {
                                r: i,
                                c: c
                            })
                              , f = 0;
                            null != d && (f = d.textWidthAll);
                            var m = c - 1 < 0 ? 0 : Store.visibledatacolumn[c - 1]
                              , p = void 0
                              , g = void 0;
                            if (Store.visibledatacolumn[c] - m < f) {
                                if ("0" == h) {
                                    var y = cellOverflow_trace(i, c, c - 1, "forward", h, f)
                                      , v = cellOverflow_trace(i, c, c + 1, "backward", h, f);
                                    p = y.success ? y.c : y.c + 1,
                                    g = v.success ? v.c : v.c - 1
                                } else if ("1" == h) {
                                    var A = cellOverflow_trace(i, c, c + 1, "backward", h, f);
                                    p = c,
                                    g = A.success ? A.c : A.c - 1
                                } else if ("2" == h) {
                                    var b = cellOverflow_trace(i, c, c - 1, "forward", h, f);
                                    g = c,
                                    p = b.success ? b.c : b.c + 1
                                }
                            } else
                                p = c,
                                g = c;
                            if ((p <= r || g >= t) && p < g) {
                                var k = {
                                    r: i,
                                    stc: p,
                                    edc: g
                                };
                                null == o[i] && (o[i] = {}),
                                o[i][c] = k,
                                s = !0
                            }
                        }
                    }
                    s && (Store.cellOverflowMapCache[i] = o[i])
                } else
                    o[i] = Store.cellOverflowMapCache[i];
        return o
    }
    function cellOverflow_trace(e, t, r, a, n, o) {
        var l = Store.flowdata;
        if ("forward" == a && r < 0)
            return {
                success: !1,
                r: e,
                c: r
            };
        if ("backward" == a && r > l[e].length - 1)
            return {
                success: !1,
                r: e,
                c: r
            };
        var i = l[e][r];
        if (null != i && (!isRealNull(i.v) || null != i.mc))
            return {
                success: !1,
                r: e,
                c: r
            };
        var s = t - 1 < 0 ? 0 : Store.visibledatacolumn[t - 1]
          , c = Store.visibledatacolumn[t]
          , u = o - (c - s);
        "0" == n ? (s -= u / 2,
        c += u / 2) : "1" == n ? c += u : "2" == n && (s -= u);
        var h = r - 1 < 0 ? 0 : Store.visibledatacolumn[r - 1]
          , d = Store.visibledatacolumn[r];
        return "forward" == a ? s < h ? cellOverflow_trace(e, t, r - 1, a, n, o) : s < d ? {
            success: !0,
            r: e,
            c: r
        } : {
            success: !1,
            r: e,
            c: r
        } : "backward" == a ? c > d ? cellOverflow_trace(e, t, r + 1, a, n, o) : c > h ? {
            success: !0,
            r: e,
            c: r
        } : {
            success: !1,
            r: e,
            c: r
        } : void 0
    }
    function cellOverflow_colIn(e, t, r, a, n) {
        var o, l, i, s, c = !1, u = !1;
        for (var h in e) {
            for (var d in e[h]) {
                o = h,
                l = d;
                var f = e[h][d];
                if (i = f.stc,
                s = f.edc,
                o == t && r >= i && r <= s && (c = !0,
                r == s || r == n)) {
                    u = !0;
                    break
                }
            }
            if (u)
                break
        }
        return {
            colIn: c,
            colLast: u,
            rowIndex: o,
            colIndex: l,
            stc: i,
            edc: s
        }
    }
    function cellTextRender(e, t, r) {
        if (null != e) {
            var a = e.values
              , n = r.pos_x
              , o = r.pos_y;
            if (null != a) {
                0 != e.rotate && "verticalWrap" != e.type && (t.save(),
                t.translate((n + e.textLeftAll) / Store.zoomRatio, (o + e.textTopAll) / Store.zoomRatio),
                t.rotate(-e.rotate * Math.PI / 180),
                t.translate(-(e.textLeftAll + n) / Store.zoomRatio, -(o + e.textTopAll) / Store.zoomRatio));
                for (var l = 0; l < a.length; l++) {
                    var i = a[l];
                    if (!0 === i.inline && null != i.style ? (t.font = i.style.fontset,
                    t.fillStyle = i.style.fc) : t.font = i.style,
                    t.fillText(i.content, (n + i.left) / Store.zoomRatio, (o + i.top) / Store.zoomRatio),
                    null != i.cancelLine) {
                        var s = i.cancelLine;
                        t.beginPath(),
                        t.moveTo(Math.floor((n + s.startX) / Store.zoomRatio) + .5, Math.floor((o + s.startY) / Store.zoomRatio) + .5),
                        t.lineTo(Math.floor((n + s.endX) / Store.zoomRatio) + .5, Math.floor((o + s.endY) / Store.zoomRatio) + .5),
                        t.lineWidth = Math.floor(s.fs / 9),
                        t.strokeStyle = t.fillStyle,
                        t.stroke(),
                        t.closePath()
                    }
                    if (null != i.underLine)
                        for (var c = i.underLine, u = 0; u < c.length; u++) {
                            var h = c[u];
                            t.beginPath(),
                            t.moveTo(Math.floor((n + h.startX) / Store.zoomRatio) + .5, Math.floor((o + h.startY) / Store.zoomRatio)),
                            t.lineTo(Math.floor((n + h.endX) / Store.zoomRatio) + .5, Math.floor((o + h.endY) / Store.zoomRatio) + .5),
                            t.lineWidth = Math.floor(h.fs / 9),
                            t.strokeStyle = t.fillStyle,
                            t.stroke(),
                            t.closePath()
                        }
                }
                0 != e.rotate && "verticalWrap" != e.type && t.restore()
            }
        }
    }
    var hyperlinkCtrl = {
        item: {
            linkType: "external",
            linkAddress: "",
            linkTooltip: ""
        },
        hyperlink: null,
        createDialog: function() {
            var e = locale()
              , t = e.insertLink
              , r = e.toolbar
              , a = e.button;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-insertLink-dialog").remove();
            var n = "";
            Store.luckysheetfile.forEach((function(e) {
                n += '<option value="'.concat(e.name, '">').concat(e.name, "</option>")
            }
            ));
            var o = '<div class="box">\n                            <div class="box-item">\n                                <label for="luckysheet-insertLink-dialog-linkText">'.concat(t.linkText, '：</label>\n                                <input type="text" id="luckysheet-insertLink-dialog-linkText"/>\n                            </div>\n                            <div class="box-item">\n                                <label for="luckysheet-insertLink-dialog-linkType">').concat(t.linkType, '：</label>\n                                <select id="luckysheet-insertLink-dialog-linkType">\n                                    <option value="external">').concat(t.external, '</option>\n                                    <option value="internal">').concat(t.internal, '</option>\n                                </select>\n                            </div>\n                            <div class="show-box show-box-external">\n                                <div class="box-item">\n                                    <label for="luckysheet-insertLink-dialog-linkAddress">').concat(t.linkAddress, '：</label>\n                                    <input type="text" id="luckysheet-insertLink-dialog-linkAddress" placeholder="').concat(t.placeholder1, '" />\n                                </div>\n                            </div>\n                            <div class="show-box show-box-internal">\n                                <div class="box-item">\n                                    <label for="luckysheet-insertLink-dialog-linkSheet">').concat(t.linkSheet, '：</label>\n                                    <select id="luckysheet-insertLink-dialog-linkSheet">\n                                        ').concat(n, '\n                                    </select>\n                                </div>\n                                <div class="box-item">\n                                    <label for="luckysheet-insertLink-dialog-linkCell">').concat(t.linkCell, '：</label>\n                                    <input type="text" id="luckysheet-insertLink-dialog-linkCell" value="A1" placeholder="').concat(t.placeholder2, '" />\n                                </div>\n                            </div>\n                            <div class="box-item">\n                                <label for="luckysheet-insertLink-dialog-linkTooltip">').concat(t.linkTooltip, '：</label>\n                                <input type="text" id="luckysheet-insertLink-dialog-linkTooltip" placeholder="').concat(t.placeholder3, '" />\n                            </div>\n                        </div>');
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-insertLink-dialog",
                addclass: "luckysheet-insertLink-dialog",
                title: r.insertLink,
                content: o,
                botton: '<button id="luckysheet-insertLink-dialog-confirm" class="btn btn-primary">'.concat(a.confirm, '</button>\n                        <button class="btn btn-default luckysheet-model-close-btn">').concat(a.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var l = $("#luckysheet-insertLink-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 350).end()
              , i = l.outerHeight()
              , s = l.outerWidth()
              , c = $(window).width()
              , u = $(window).height()
              , h = $(document).scrollLeft()
              , d = $(document).scrollTop();
            $("#luckysheet-insertLink-dialog").css({
                left: (c + h - s) / 2,
                top: (u + d - i) / 3
            }).show(),
            this.dataAllocation()
        },
        init: function() {
            var e = this
              , t = locale().insertLink;
            $(document).off("change.linkType").on("change.linkType", "#luckysheet-insertLink-dialog-linkType", (function(e) {
                var t = this.value;
                $("#luckysheet-insertLink-dialog .show-box").hide(),
                $("#luckysheet-insertLink-dialog .show-box-" + t).show()
            }
            )),
            $(document).off("click.confirm").on("click.confirm", "#luckysheet-insertLink-dialog-confirm", (function(r) {
                var a = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , n = a.row_focus || a.row[0]
                  , o = a.column_focus || a.column[0]
                  , l = $("#luckysheet-insertLink-dialog-linkText").val()
                  , i = $("#luckysheet-insertLink-dialog-linkType").val()
                  , s = $("#luckysheet-insertLink-dialog-linkAddress").val()
                  , c = $("#luckysheet-insertLink-dialog-linkSheet").val()
                  , u = $("#luckysheet-insertLink-dialog-linkCell").val()
                  , h = $("#luckysheet-insertLink-dialog-linkTooltip").val();
                if ("external" == i) {
                    if (!/^http[s]?:\/\/([\w\-\.]+)+[\w-]*([\w\-\.\/\?%&=]+)?$/gi.test(s))
                        return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo1)
                } else {
                    if (!luckysheetformula.iscelldata(u))
                        return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', t.tooltipInfo2);
                    s = c + "!" + u
                }
                null != l && "" != l.replace(/\s/g, "") || (l = s);
                var d = {
                    linkType: i,
                    linkAddress: s,
                    linkTooltip: h
                }
                  , f = $.extend(!0, {}, e.hyperlink)
                  , m = $.extend(!0, {}, e.hyperlink);
                m[n + "_" + o] = d;
                var p = editor.deepCopyFlowData(Store.flowdata)
                  , g = p[n][o];
                null == g && (g = {}),
                g.fc = "rgb(0, 0, 255)",
                g.un = 1,
                g.v = l,
                p[n][o] = g,
                e.ref(f, m, Store.currentSheetIndex, p, {
                    row: [n, n],
                    column: [o, o]
                }),
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-insertLink-dialog").hide()
            }
            ))
        },
        dataAllocation: function() {
            var e = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
              , t = e.row_focus || e.row[0]
              , r = e.column_focus || e.column[0]
              , a = (this.hyperlink || {})[t + "_" + r] || {}
              , n = getcellvalue(t, r, null, "m");
            $("#luckysheet-insertLink-dialog-linkText").val(n);
            var o = a.linkType || "external";
            $("#luckysheet-insertLink-dialog-linkType").val(o),
            $("#luckysheet-insertLink-dialog .show-box").hide(),
            $("#luckysheet-insertLink-dialog .show-box-" + o).show();
            var l = a.linkAddress || "";
            if ("external" == o)
                $("#luckysheet-insertLink-dialog-linkAddress").val(l);
            else if (luckysheetformula.iscelldata(l)) {
                var i = l.split("!")[0]
                  , s = l.split("!")[1];
                $("#luckysheet-insertLink-dialog-linkSheet").val(i),
                $("#luckysheet-insertLink-dialog-linkCell").val(s)
            }
            var c = a.linkTooltip || "";
            $("#luckysheet-insertLink-dialog-linkTooltip").val(c)
        },
        cellFocus: function(e, t) {
            if (null != this.hyperlink && null != this.hyperlink[e + "_" + t]) {
                var r = this.hyperlink[e + "_" + t];
                if ("external" == r.linkType)
                    window.open(r.linkAddress);
                else {
                    var a = luckysheetformula.getcellrange(r.linkAddress)
                      , n = a.sheetIndex
                      , o = [{
                        row: a.row,
                        column: a.column
                    }];
                    n != Store.currentSheetIndex && ($("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
                    $("#luckysheet-sheets-item" + n).addClass("luckysheet-sheets-item-active"),
                    sheetmanage.changeSheet(n)),
                    Store.luckysheet_select_save = o,
                    selectHightlightShow();
                    var l = a.row[0] - 1 == -1 ? 0 : Store.visibledatarow[a.row[0] - 1]
                      , i = a.column[0] - 1 == -1 ? 0 : Store.visibledatacolumn[a.column[0] - 1];
                    $("#luckysheet-scrollbar-x").scrollLeft(i),
                    $("#luckysheet-scrollbar-y").scrollTop(l)
                }
            }
        },
        overshow: function(e) {
            if ($("#luckysheet-hyperlink-overshow").remove(),
            0 != $(e.target).closest("#luckysheet-cell-main").length) {
                var t = mouseposition(e.pageX, e.pageY)
                  , r = $("#luckysheet-cell-main").scrollLeft()
                  , a = $("#luckysheet-cell-main").scrollTop()
                  , n = t[0] + r
                  , o = t[1] + a;
                if (!(null != luckysheetFreezen.freezenverticaldata && t[0] < luckysheetFreezen.freezenverticaldata[0] - luckysheetFreezen.freezenverticaldata[2] || null != luckysheetFreezen.freezenhorizontaldata && t[1] < luckysheetFreezen.freezenhorizontaldata[0] - luckysheetFreezen.freezenhorizontaldata[2])) {
                    var l = rowLocation(o)[2]
                      , i = colLocation(n)[2]
                      , s = menuButton.mergeborer(Store.flowdata, l, i);
                    if (s && (l = s.row[2],
                    i = s.column[2]),
                    null != this.hyperlink && null != this.hyperlink[l + "_" + i]) {
                        var c = this.hyperlink[l + "_" + i]
                          , u = c.linkTooltip;
                        null != u && "" != u.replace(/\s/g, "") || (u = c.linkAddress);
                        var h = Store.visibledatarow[l]
                          , d = (l - 1 == -1 || Store.visibledatarow[l - 1],
                        Store.visibledatacolumn[i],
                        i - 1 == -1 ? 0 : Store.visibledatacolumn[i - 1]);
                        s && (h = s.row[1],
                        s.row[0],
                        s.column[1],
                        d = s.column[0]);
                        var f = '<div id="luckysheet-hyperlink-overshow" style="background:#fff;padding:5px 10px;border:1px solid #000;box-shadow:2px 2px #999;position:absolute;left:'.concat(d, "px;top:").concat(h + 5, 'px;z-index:100;">\n                        <div>').concat(u, "</div>\n                        <div>单击鼠标可以追踪</div>\n                    </div>");
                        $(f).appendTo($("#luckysheet-cell-main"))
                    }
                }
            }
        },
        ref: function(e, t, r, a, n) {
            if (Store.clearjfundo) {
                Store.jfundo = [];
                var o = {
                    type: "updateHyperlink"
                };
                o.sheetIndex = r,
                o.historyHyperlink = e,
                o.currentHyperlink = t,
                o.data = Store.flowdata,
                o.curData = a,
                o.range = n,
                Store.jfredo.push(o)
            }
            this.hyperlink = t,
            Store.luckysheetfile[getSheetIndex(r)].hyperlink = t,
            Store.flowdata = a,
            editor.webWorkerFlowDataCache(Store.flowdata),
            Store.luckysheetfile[getSheetIndex(r)].data = Store.flowdata,
            server.allowUpdate && (server.saveParam("all", r, t, {
                k: "hyperlink"
            }),
            server.historyParam(Store.flowdata, r, n)),
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        }
    }
      , refreshCanvasTimeOut = null;
    function runExecFunction(e, t, r) {
        luckysheetformula.execFunctionExist = [];
        for (var a = 0; a < e.length; a++)
            for (var n = e[a].row[0]; n <= e[a].row[1]; n++)
                for (var o = e[a].column[0]; o <= e[a].column[1]; o++)
                    luckysheetformula.execFunctionExist.push({
                        r: n,
                        c: o,
                        i: t
                    });
        luckysheetformula.execFunctionExist.reverse(),
        luckysheetformula.execFunctionGroup(null, null, null, null, r),
        luckysheetformula.execFunctionGlobalData = null
    }
    function jfrefreshgrid(data, range, allParam) {
        var isRunExecFunction = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]
          , isRefreshCanvas = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4];
        null == data && (data = Store.flowdata),
        null == range && (range = Store.luckysheet_select_save),
        clearTimeout(refreshCanvasTimeOut),
        null == allParam && (allParam = {});
        var cfg = allParam.cfg, RowlChange = allParam.RowlChange, cdformat = allParam.cdformat, dataVerification = allParam.dataVerification, dynamicArray = allParam.dynamicArray, file = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)], curConfig, curCdformat, curDataVerification, curDynamicArray;
        Store.clearjfundo && (Store.jfundo = [],
        curConfig = null == cfg ? $.extend(!0, {}, Store.config) : $.extend(!0, {}, cfg),
        curCdformat = null == cdformat ? $.extend(!0, [], file.luckysheet_conditionformat_save) : cdformat,
        curDataVerification = null == dataVerification ? $.extend(!0, {}, file.dataVerification) : dataVerification,
        curDynamicArray = null == dynamicArray ? $.extend(!0, [], file.dynamicArray) : dynamicArray,
        Store.jfredo.push({
            type: "datachange",
            data: Store.flowdata,
            curdata: data,
            sheetIndex: Store.currentSheetIndex,
            range: range,
            config: $.extend(!0, {}, Store.config),
            curConfig: curConfig,
            cdformat: $.extend(!0, [], file.luckysheet_conditionformat_save),
            curCdformat: curCdformat,
            RowlChange: RowlChange,
            dataVerification: $.extend(!0, [], file.dataVerification),
            curDataVerification: curDataVerification,
            dynamicArray: $.extend(!0, [], file.dynamicArray),
            curDynamicArray: curDynamicArray
        }));
        Store.flowdata = data,
        editor.webWorkerFlowDataCache(Store.flowdata),
        file.data = Store.flowdata,
        null != cfg && (Store.config = cfg,
        file.config = Store.config,
        server.saveParam("all", Store.currentSheetIndex, cfg, {
            k: "config"
        }),
        null != RowlChange && jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)),
        null != cdformat && (file.luckysheet_conditionformat_save = cdformat,
        server.saveParam("all", Store.currentSheetIndex, cdformat, {
            k: "luckysheet_conditionformat_save"
        })),
        null != dataVerification && (dataVerificationCtrl.dataVerification = dataVerification,
        file.dataVerification = dataVerification,
        server.saveParam("all", Store.currentSheetIndex, dataVerification, {
            k: "dataVerification"
        })),
        null != dynamicArray && (file.dynamicArray = dynamicArray,
        server.saveParam("all", Store.currentSheetIndex, dynamicArray, {
            k: "dynamicArray"
        }));
        for (var s = 0; s < range.length; s++) {
            var r1 = range[s].row[0]
              , c1 = range[s].column[0];
            if (null != Store.flowdata[r1][c1] && null != Store.flowdata[r1][c1].spl) {
                window.luckysheetCurrentRow = r1,
                window.luckysheetCurrentColumn = c1,
                window.luckysheetCurrentFunction = Store.flowdata[r1][c1].f;
                var fp = $.trim(luckysheetformula.functionParserExe(Store.flowdata[r1][c1].f))
                  , sparklines = eval(fp);
                Store.flowdata[r1][c1].spl = sparklines
            }
            server.allowUpdate && server.historyParam(Store.flowdata, Store.currentSheetIndex, range[s]),
            "function" == typeof Store.chartparam.jfrefreshchartall && Store.chartparam.jfrefreshchartall(Store.flowdata, range[s].row[0], range[s].row[1], range[s].column[0], range[s].column[1])
        }
        isRunExecFunction && runExecFunction(range, Store.currentSheetIndex, data),
        isRefreshCanvas && (refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)),
        window.luckysheet_getcelldata_cache = null
    }
    function jfrefreshgridall(e, t, r, a, n, o, l, i) {
        var s = !(arguments.length > 8 && void 0 !== arguments[8]) || arguments[8]
          , c = {}
          , u = !1;
        if (clearTimeout(refreshCanvasTimeOut),
        "cellRowChange" == o) {
            c.type = "cellRowChange",
            c.config = $.extend(!0, {}, Store.config),
            c.curconfig = $.extend(!0, {}, a),
            c.range = $.extend(!0, [], Store.luckysheet_select_save),
            c.currange = n,
            c.ctrlType = o,
            c.ctrlValue = l;
            var h = a.rowlen;
            null == h && (h = {}),
            server.saveParam("cg", Store.currentSheetIndex, h, {
                k: "rowlen"
            })
        } else if ("resizeC" == o) {
            c.type = "resize",
            c.config = $.extend(!0, {}, Store.config),
            c.curconfig = $.extend(!0, {}, a),
            c.range = $.extend(!0, [], Store.luckysheet_select_save),
            c.currange = n,
            c.ctrlType = o,
            c.ctrlValue = l;
            var d = a.columnlen;
            null == d && (d = {}),
            server.saveParam("cg", Store.currentSheetIndex, d, {
                k: "columnlen"
            })
        } else if (o.indexOf("extend") > -1)
            c.type = "extend",
            c.config = $.extend(!0, {}, Store.config),
            c.curconfig = $.extend(!0, {}, a),
            c.range = $.extend(!0, [], Store.luckysheet_select_save),
            c.currange = n,
            c.ctrlType = o,
            c.ctrlValue = l,
            server.saveParam("arc", Store.currentSheetIndex, {
                index: l.index,
                len: l.len,
                direction: l.direction,
                mc: a.merge
            }, {
                rc: l.type
            });
        else if (o.indexOf("dele") > -1)
            c.type = "dele",
            c.config = $.extend(!0, {}, Store.config),
            c.curconfig = $.extend(!0, {}, a),
            c.range = $.extend(!0, [], Store.luckysheet_select_save),
            c.currange = n,
            c.ctrlType = o,
            c.ctrlValue = l,
            server.saveParam("drc", Store.currentSheetIndex, {
                index: l.index,
                len: l.len,
                mc: a.merge,
                borderInfo: a.borderInfo
            }, {
                rc: l.type
            });
        else {
            c.type = "datachangeAll",
            c.range = $.extend(!0, [], Store.luckysheet_select_save),
            c.currange = n,
            c.ctrlType = o,
            c.ctrlValue = l,
            u = !0;
            for (var f = 0; f < n.length; f++)
                server.historyParam(r, Store.currentSheetIndex, n[f])
        }
        Store.clearjfundo && (Store.jfundo = [],
        c.data = Store.flowdata,
        c.curdata = r,
        c.sheetIndex = Store.currentSheetIndex,
        c.cdformat = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save),
        c.curCdformat = i,
        Store.jfredo.push(c)),
        Store.flowdata = r,
        editor.webWorkerFlowDataCache(r),
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata,
        null != a && (Store.config = a,
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
        server.saveParam("all", Store.currentSheetIndex, a, {
            k: "config"
        })),
        null != i && (Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save = i,
        server.saveParam("all", Store.currentSheetIndex, i, {
            k: "luckysheet_conditionformat_save"
        })),
        Store.luckysheet_select_save = $.extend(!0, [], n),
        Store.luckysheet_select_save.length > 0 && selectHightlightShow(),
        u && runExecFunction(n, Store.currentSheetIndex, r),
        jfrefreshgrid_rhcw(t, e),
        s && (refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)),
        sheetmanage.storeSheetParamALL(),
        window.luckysheet_getcelldata_cache = null
    }
    function jfrefreshrange(e, t, r) {
        clearTimeout(refreshCanvasTimeOut),
        Store.clearjfundo && (Store.jfundo = [],
        Store.jfredo.push({
            type: "rangechange",
            data: Store.flowdata,
            curdata: e,
            range: t,
            sheetIndex: Store.currentSheetIndex,
            cdformat: $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save),
            curCdformat: r
        })),
        Store.flowdata = e,
        editor.webWorkerFlowDataCache(Store.flowdata),
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata,
        null != r && (Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save = r),
        runExecFunction(t, Store.currentSheetIndex, e),
        refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1);
        for (var a = 0; a < t.length; a++)
            server.historyParam(Store.flowdata, Store.currentSheetIndex, t[a])
    }
    function jfrefreshgrid_adRC(e, t, r, a, n, o, l, i, s, c, u) {
        var h = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]
          , d = [];
        for (var f in t.merge)
            for (var m = t.merge[f], p = m.r; p <= m.r + m.rs - 1; p++)
                for (var g = m.c; g <= m.c + m.cs - 1; g++)
                    null == e[p][g] && (e[p][g] = {}),
                    p == m.r && g == m.c ? e[p][g].mc = m : e[p][g].mc = {
                        r: m.r,
                        c: m.c
                    },
                    d.push({
                        r: p,
                        c: g
                    });
        var y = [];
        if (n.length > 0)
            for (var v = 0; v < n.length; v++) {
                var A = n[v]
                  , b = A.r
                  , k = A.c
                  , w = A.index
                  , x = getcellFormula(b, k, w, e)
                  , S = luckysheetformula.execfunction(x, b, k, w, null, !0);
                A.func = S,
                e[b][k].f == x && (setcellvalue(b, k, e, S[1]),
                y.push({
                    r: b,
                    c: k
                }))
            }
        Store.clearjfundo && (Store.jfundo = [],
        Store.jfredo.push({
            type: r,
            sheetIndex: Store.currentSheetIndex,
            data: Store.flowdata,
            curData: e,
            config: $.extend(!0, {}, Store.config),
            curConfig: t,
            ctrlValue: a,
            mcData: d,
            calc: $.extend(!0, [], h.calcChain),
            curCalc: n,
            funcData: y,
            filterObj: {
                filter_select: $.extend(!0, {}, h.filter_select),
                filter: $.extend(!0, {}, h.filter)
            },
            curFilterObj: o,
            cf: $.extend(!0, [], h.luckysheet_conditionformat_save),
            curCf: l,
            af: $.extend(!0, [], h.luckysheet_alternateformat_save),
            curAf: i,
            freezen: {
                freezenhorizontaldata: luckysheetFreezen.freezenhorizontaldata,
                freezenverticaldata: luckysheetFreezen.freezenverticaldata
            },
            curFreezen: s,
            dataVerification: $.extend(!0, {}, h.dataVerification),
            curDataVerification: c,
            hyperlink: $.extend(!0, {}, h.hyperlink),
            curHyperlink: u
        }));
        var _ = a.index
          , C = a.len
          , T = a.rc;
        if ("addRC" == r) {
            var E = a.direction
              , I = [];
            if (a.restore)
                if ("r" == T) {
                    var R;
                    "lefttop" == E ? R = _ : "rightbottom" == E && (R = _ + 1);
                    for (var B = R + C - 1, N = R; N <= B; N++) {
                        for (var F = [], P = 0; P < e[0].length; P++) {
                            var L = e[N][P];
                            F.push(L)
                        }
                        I.push(F)
                    }
                } else if ("c" == T) {
                    var O;
                    "lefttop" == E ? O = _ : "rightbottom" == E && (O = _ + 1);
                    for (var D = O + C - 1, M = 0; M < e.length; M++) {
                        for (var U = [], H = O; H <= D; H++) {
                            var q = e[M][H];
                            U.push(q)
                        }
                        I.push(U)
                    }
                }
            server.saveParam("arc", Store.currentSheetIndex, {
                index: _,
                len: C,
                direction: E,
                data: I
            }, {
                rc: T
            })
        } else
            "delRC" == r && server.saveParam("drc", Store.currentSheetIndex, {
                index: _,
                len: C
            }, {
                rc: T
            });
        Store.flowdata = e,
        editor.webWorkerFlowDataCache(Store.flowdata),
        h.data = e,
        Store.config = t,
        h.config = Store.config,
        server.saveParam("all", Store.currentSheetIndex, t, {
            k: "config"
        });
        for (var z = 0; z < d.length; z++) {
            var j = d[z].r
              , V = d[z].c;
            server.saveParam("v", Store.currentSheetIndex, Store.flowdata[j][V], {
                r: j,
                c: V
            })
        }
        h.calcChain = n,
        server.saveParam("all", Store.currentSheetIndex, n, {
            k: "calcChain"
        });
        for (var Q = 0; Q < y.length; Q++) {
            var G = y[Q].r
              , K = y[Q].c;
            server.saveParam("v", Store.currentSheetIndex, Store.flowdata[G][K], {
                r: G,
                c: K
            })
        }
        null != o ? (h.filter_select = o.filter_select,
        h.filter = o.filter) : (h.filter_select = null,
        h.filter = null),
        createFilterOptions(h.filter_select, h.filter),
        server.saveParam("all", Store.currentSheetIndex, h.filter_select, {
            k: "filter_select"
        }),
        server.saveParam("all", Store.currentSheetIndex, h.filter, {
            k: "filter"
        }),
        h.luckysheet_conditionformat_save = l,
        server.saveParam("all", Store.currentSheetIndex, h.luckysheet_conditionformat_save, {
            k: "luckysheet_conditionformat_save"
        }),
        h.luckysheet_alternateformat_save = i,
        server.saveParam("all", Store.currentSheetIndex, h.luckysheet_alternateformat_save, {
            k: "luckysheet_alternateformat_save"
        }),
        null != s ? (luckysheetFreezen.freezenhorizontaldata = s.freezenhorizontaldata,
        luckysheetFreezen.freezenverticaldata = s.freezenverticaldata) : (luckysheetFreezen.freezenhorizontaldata = null,
        luckysheetFreezen.freezenverticaldata = null),
        dataVerificationCtrl.dataVerification = c,
        h.dataVerification = c,
        server.saveParam("all", Store.currentSheetIndex, h.dataVerification, {
            k: "dataVerification"
        }),
        hyperlinkCtrl.hyperlink = u,
        h.hyperlink = u,
        server.saveParam("all", Store.currentSheetIndex, h.hyperlink, {
            k: "hyperlink"
        }),
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
    }
    function jfrefreshgrid_deleteCell(e, t, r, a, n, o, l, i) {
        var s = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
        clearTimeout(refreshCanvasTimeOut);
        var c = [];
        if ("{}" == JSON.stringify(t.merge))
            for (var u = 0; u < e.length; u++)
                for (var h = 0; h < e[0].length; h++) {
                    var d = e[u][h];
                    null != d && null != d.mc && (delete d.mc,
                    c.push({
                        r: u,
                        c: h
                    }))
                }
        else
            for (var f in t.merge)
                for (var m = t.merge[f], p = m.r; p <= m.r + m.rs - 1; p++)
                    for (var g = m.c; g <= m.c + m.cs - 1; g++)
                        null == e[p][g] && (e[p][g] = {}),
                        p == m.r && g == m.c ? e[p][g].mc = m : e[p][g].mc = {
                            r: m.r,
                            c: m.c
                        },
                        c.push({
                            r: p,
                            c: g
                        });
        var y = [];
        if (a.length > 0)
            for (var v = 0; v < a.length; v++) {
                var A = a[v]
                  , b = A.r
                  , k = A.c
                  , w = A.index
                  , x = getcellFormula(b, k, w, e)
                  , S = luckysheetformula.execfunction(x, b, k, w, null, !0);
                A.func = S,
                e[b][k].f == x && (setcellvalue(b, k, e, S[1]),
                y.push({
                    r: b,
                    c: k
                }))
            }
        if (Store.clearjfundo && (Store.jfundo = [],
        Store.jfredo.push({
            type: "deleteCell",
            sheetIndex: Store.currentSheetIndex,
            ctrl: r,
            data: Store.flowdata,
            curData: e,
            config: $.extend(!0, {}, Store.config),
            curConfig: t,
            mcData: c,
            calc: $.extend(!0, [], s.calcChain),
            curCalc: a,
            funcData: y,
            filterObj: {
                filter_select: $.extend(!0, {}, s.filter_select),
                filter: $.extend(!0, {}, s.filter)
            },
            curFilterObj: n,
            cf: $.extend(!0, [], s.luckysheet_conditionformat_save),
            curCf: o,
            dataVerification: $.extend(!0, {}, s.dataVerification),
            curDataVerification: l,
            hyperlink: $.extend(!0, {}, s.hyperlink),
            curHyperlink: i
        })),
        Store.flowdata = e,
        editor.webWorkerFlowDataCache(Store.flowdata),
        s.data = e,
        server.allowUpdate) {
            var _, C = r.type, T = r.str, E = r.edr, I = r.stc, R = r.edc;
            "moveUp" == C ? _ = {
                row: [T, e.length - 1],
                column: [I, R]
            } : "moveLeft" == C && (_ = {
                row: [T, E],
                column: [I, e[0].length - 1]
            }),
            server.historyParam(Store.flowdata, Store.currentSheetIndex, _)
        }
        Store.config = t,
        s.config = Store.config,
        server.saveParam("all", Store.currentSheetIndex, t, {
            k: "config"
        });
        for (var B = 0; B < c.length; B++) {
            var N = c[B].r
              , F = c[B].c;
            server.saveParam("v", Store.currentSheetIndex, Store.flowdata[N][F], {
                r: N,
                c: F
            })
        }
        s.calcChain = a,
        server.saveParam("all", Store.currentSheetIndex, a, {
            k: "calcChain"
        });
        for (var P = 0; P < y.length; P++) {
            var L = y[P].r
              , O = y[P].c;
            server.saveParam("v", Store.currentSheetIndex, Store.flowdata[L][O], {
                r: L,
                c: O
            })
        }
        null != n ? (s.filter_select = n.filter_select,
        s.filter = n.filter) : (s.filter_select = null,
        s.filter = null),
        createFilterOptions(s.filter_select, s.filter),
        server.saveParam("all", Store.currentSheetIndex, s.filter_select, {
            k: "filter_select"
        }),
        server.saveParam("all", Store.currentSheetIndex, s.filter, {
            k: "filter"
        }),
        s.luckysheet_conditionformat_save = o,
        server.saveParam("all", Store.currentSheetIndex, s.luckysheet_conditionformat_save, {
            k: "luckysheet_conditionformat_save"
        }),
        dataVerificationCtrl.dataVerification = l,
        s.dataVerification = l,
        server.saveParam("all", Store.currentSheetIndex, s.dataVerification, {
            k: "dataVerification"
        }),
        hyperlinkCtrl.hyperlink = i,
        s.hyperlink = i,
        server.saveParam("all", Store.currentSheetIndex, s.hyperlink, {
            k: "hyperlink"
        }),
        refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)
    }
    function jfrefreshgrid_pastcut(e, t, r) {
        var a, n = {};
        luckysheetformula.execFunctionExist = [],
        clearTimeout(refreshCanvasTimeOut);
        for (var o = e.range.row[0]; o <= e.range.row[1]; o++)
            for (var l = e.range.column[0]; l <= e.range.column[1]; l++)
                o + "_" + l + "_" + e.sheetIndex in n || (n[o + "_" + l + "_" + e.sheetIndex] = 0,
                luckysheetformula.execFunctionExist.push({
                    r: o,
                    c: l,
                    i: e.sheetIndex
                }));
        for (var i = t.range.row[0]; i <= t.range.row[1]; i++)
            for (var s = t.range.column[0]; s <= t.range.column[1]; s++)
                i + "_" + s + "_" + t.sheetIndex in n || (n[i + "_" + s + "_" + t.sheetIndex] = 0,
                luckysheetformula.execFunctionExist.push({
                    r: i,
                    c: s,
                    i: t.sheetIndex
                }));
        if (Store.clearjfundo && (Store.jfundo = [],
        Store.jfredo.push({
            type: "pasteCut",
            source: e,
            target: t,
            RowlChange: r
        })),
        Store.currentSheetIndex == e.sheetIndex ? (Store.config = e.curConfig,
        a = e.curData.length,
        Store.luckysheetfile[getSheetIndex(t.sheetIndex)].config = t.curConfig) : Store.currentSheetIndex == t.sheetIndex && (Store.config = t.curConfig,
        a = t.curData.length,
        Store.luckysheetfile[getSheetIndex(e.sheetIndex)].config = e.curConfig),
        r) {
            Store.visibledatarow = [],
            Store.rh_height = 0;
            for (var c = 0; c < a; c++) {
                var u = Store.defaultrowlen;
                null != Store.config.rowlen && null != Store.config.rowlen[c] && (u = Store.config.rowlen[c]),
                null == Store.config.rowhidden || null == Store.config.rowhidden[c] ? (Store.rh_height += u + 1,
                Store.visibledatarow.push(Store.rh_height)) : (u = Store.config.rowhidden[c],
                Store.visibledatarow.push(Store.rh_height))
            }
            if (Store.rh_height += 110,
            Store.currentSheetIndex == e.sheetIndex) {
                var h = computeRowlenArr(t.curData.length, t.curConfig);
                Store.luckysheetfile[getSheetIndex(t.sheetIndex)].visibledatarow = h
            } else if (Store.currentSheetIndex == t.sheetIndex) {
                var d = computeRowlenArr(e.curData.length, e.curConfig);
                Store.luckysheetfile[getSheetIndex(e.sheetIndex)].visibledatarow = d
            }
        }
        Store.currentSheetIndex == e.sheetIndex ? (Store.flowdata = e.curData,
        Store.luckysheetfile[getSheetIndex(t.sheetIndex)].data = t.curData) : Store.currentSheetIndex == t.sheetIndex && (Store.flowdata = t.curData,
        Store.luckysheetfile[getSheetIndex(e.sheetIndex)].data = e.curData),
        editor.webWorkerFlowDataCache(Store.flowdata),
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata,
        Store.currentSheetIndex == t.sheetIndex ? Store.luckysheet_select_save = [{
            row: t.range.row,
            column: t.range.column
        }] : Store.luckysheet_select_save = [{
            row: e.range.row,
            column: e.range.column
        }],
        Store.luckysheet_select_save.length > 0 && selectHightlightShow(),
        Store.luckysheetfile[getSheetIndex(e.sheetIndex)].luckysheet_conditionformat_save = e.curCdformat,
        Store.luckysheetfile[getSheetIndex(t.sheetIndex)].luckysheet_conditionformat_save = t.curCdformat,
        Store.currentSheetIndex == e.sheetIndex ? dataVerificationCtrl.dataVerification = e.curDataVerification : Store.currentSheetIndex == t.sheetIndex && (dataVerificationCtrl.dataVerification = t.curDataVerification),
        Store.luckysheetfile[getSheetIndex(e.sheetIndex)].dataVerification = e.curDataVerification,
        Store.luckysheetfile[getSheetIndex(t.sheetIndex)].dataVerification = t.curDataVerification,
        luckysheetformula.execFunctionExist.reverse(),
        luckysheetformula.execFunctionGroup(null, null, null, null, t.curData),
        luckysheetformula.execFunctionGlobalData = null,
        refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1),
        sheetmanage.storeSheetParamALL(),
        server.saveParam("all", e.sheetIndex, e.curConfig, {
            k: "config"
        }),
        server.saveParam("all", t.sheetIndex, t.curConfig, {
            k: "config"
        }),
        server.historyParam(e.curData, e.sheetIndex, {
            row: e.range.row,
            column: e.range.column
        }),
        server.historyParam(t.curData, t.sheetIndex, {
            row: t.range.row,
            column: t.range.column
        }),
        server.saveParam("all", e.sheetIndex, e.curCdformat, {
            k: "luckysheet_conditionformat_save"
        }),
        server.saveParam("all", t.sheetIndex, t.curCdformat, {
            k: "luckysheet_conditionformat_save"
        }),
        server.saveParam("all", e.sheetIndex, e.curDataVerification, {
            k: "dataVerification"
        }),
        server.saveParam("all", t.sheetIndex, t.curDataVerification, {
            k: "dataVerification"
        })
    }
    function jfrefreshgrid_rhcw(rowheight, colwidth) {
        var isRefreshCanvas = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
        rhchInit(rowheight, colwidth),
        clearTimeout(refreshCanvasTimeOut),
        sheetmanage.storeSheetParam();
        var calcChain = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].calcChain;
        if (null != calcChain && calcChain.length > 0) {
            null == Store.config.rowlen && (Store.config.rowlen = {}),
            null == Store.config.columnlen && (Store.config.columnlen = {});
            for (var i = 0; i < calcChain.length; i++) {
                var r = calcChain[i].r
                  , c = calcChain[i].c
                  , index = calcChain[i].index;
                if (index == Store.currentSheetIndex && null != Store.flowdata[r][c] && null != Store.flowdata[r][c].spl && (r in Store.config.rowlen || c in Store.config.columnlen)) {
                    window.luckysheetCurrentRow = r,
                    window.luckysheetCurrentColumn = c,
                    window.luckysheetCurrentFunction = Store.flowdata[r][c].f;
                    var fp = $.trim(luckysheetformula.functionParserExe(Store.flowdata[r][c].f))
                      , sparklines = eval(fp);
                    Store.flowdata[r][c].spl = sparklines,
                    server.saveParam("v", Store.currentSheetIndex, Store.flowdata[r][c], {
                        r: r,
                        c: c
                    })
                }
            }
            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata
        }
        if (luckysheetPostil.positionSync(),
        selectHightlightShow(),
        $(".luckysheet-selection-copy").is(":visible") && selectionCopyShow(),
        $("#luckysheet-dropCell-icon").is(":visible") && $("#luckysheet-dropCell-icon").remove(),
        null != luckysheetFreezen.freezenhorizontaldata && null != luckysheetFreezen.freezenverticaldata) {
            var row_st = luckysheetFreezen.freezenhorizontaldata[1] - 1
              , col_st = luckysheetFreezen.freezenverticaldata[1] - 1
              , scrollTop = luckysheetFreezen.freezenhorizontaldata[2]
              , scrollLeft = luckysheetFreezen.freezenverticaldata[2]
              , top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight
              , freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top]
              , left = Store.visibledatacolumn[col_st] - 2 - scrollLeft + Store.rowHeaderWidth
              , freezenverticaldata = [Store.visibledatacolumn[col_st], col_st + 1, scrollLeft, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, col_st + 1), left];
            luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, freezenverticaldata, left),
            luckysheetFreezen.createFreezenHorizontal(freezenhorizontaldata, top),
            luckysheetFreezen.createFreezenVertical(freezenverticaldata, left),
            luckysheetFreezen.createAssistCanvas()
        } else if (null != luckysheetFreezen.freezenhorizontaldata) {
            var _row_st = luckysheetFreezen.freezenhorizontaldata[1] - 1
              , _scrollTop = luckysheetFreezen.freezenhorizontaldata[2]
              , _top = Store.visibledatarow[_row_st] - 2 - _scrollTop + Store.columnHeaderHeight
              , _freezenhorizontaldata = [Store.visibledatarow[_row_st], _row_st + 1, _scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, _row_st + 1), _top];
            luckysheetFreezen.saveFreezen(_freezenhorizontaldata, _top, null, null),
            luckysheetFreezen.createFreezenHorizontal(_freezenhorizontaldata, _top),
            luckysheetFreezen.createAssistCanvas()
        } else if (null != luckysheetFreezen.freezenverticaldata) {
            var _col_st = luckysheetFreezen.freezenverticaldata[1] - 1
              , _scrollLeft = luckysheetFreezen.freezenverticaldata[2]
              , _left = Store.visibledatacolumn[_col_st] - 2 - _scrollLeft + Store.rowHeaderWidth
              , _freezenverticaldata = [Store.visibledatacolumn[_col_st], _col_st + 1, _scrollLeft, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, _col_st + 1), _left];
            luckysheetFreezen.saveFreezen(null, null, _freezenverticaldata, _left),
            luckysheetFreezen.createFreezenVertical(_freezenverticaldata, _left),
            luckysheetFreezen.createAssistCanvas()
        } else
            $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").length > 0 && $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function(e, t) {
                var r = $(t).data("str")
                  , a = $(t).data("cindex")
                  , n = Store.visibledatacolumn[a] - 20
                  , o = r - 1 == -1 ? 0 : Store.visibledatarow[r - 1];
                $(t).css({
                    left: n,
                    top: o
                })
            }
            ));
        if ($("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex).length > 0) {
            var luckysheet_filter_save = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].filter_select
              , r1 = luckysheet_filter_save.row[0]
              , r2 = luckysheet_filter_save.row[1]
              , c1 = luckysheet_filter_save.column[0]
              , c2 = luckysheet_filter_save.column[1]
              , row = Store.visibledatarow[r2]
              , row_pre = r1 - 1 == -1 ? 0 : Store.visibledatarow[r1 - 1]
              , col = Store.visibledatacolumn[c2]
              , col_pre = c1 - 1 == -1 ? 0 : Store.visibledatacolumn[c1 - 1];
            $("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex).css({
                left: col_pre,
                width: col - col_pre - 1,
                top: row_pre,
                height: row - row_pre - 1
            })
        }
        sheetmanage.showSheet(),
        isRefreshCanvas && (refreshCanvasTimeOut = setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1))
    }
    function luckysheetrefreshgrid(e, t) {
        if (luckysheetformula.groupValuesRefresh(),
        null == e && (e = $("#luckysheet-cell-main").scrollLeft()),
        null == t && (t = $("#luckysheet-cell-main").scrollTop()),
        null != luckysheetFreezen.freezenverticaldata || null != luckysheetFreezen.freezenhorizontaldata) {
            var r, a, n, o, l = Store.luckysheetTableContentHW[0], i = Store.luckysheetTableContentHW[1];
            null != luckysheetFreezen.freezenverticaldata && null != luckysheetFreezen.freezenhorizontaldata ? (r = luckysheetFreezen.freezenhorizontaldata[0],
            luckysheetFreezen.freezenhorizontaldata[1],
            a = luckysheetFreezen.freezenhorizontaldata[2],
            n = luckysheetFreezen.freezenverticaldata[0],
            luckysheetFreezen.freezenverticaldata[1],
            luckysheetDrawMain(o = luckysheetFreezen.freezenverticaldata[2], a, n, r, 1, 1, null, null, "freezen_3"),
            luckysheetDrawMain(e + n - o, a, l - n + o, r, 1, 1, null, null, "freezen_4"),
            luckysheetDrawMain(o, t + r - a, n, i - r + a, 1, 1, null, null, "freezen_7"),
            luckysheetDrawMain(e + n - o, t + r - a, l - n + o, i - r + a, n - o + Store.rowHeaderWidth, r - a + Store.columnHeaderHeight),
            luckysheetDrawgridColumnTitle(o, n, Store.rowHeaderWidth),
            luckysheetDrawgridColumnTitle(e + n - o, l - n + o, n - o + Store.rowHeaderWidth),
            luckysheetDrawgridRowTitle(a, r, Store.columnHeaderHeight),
            luckysheetDrawgridRowTitle(t + r - a, i - r + a, r - a + Store.columnHeaderHeight)) : null != luckysheetFreezen.freezenhorizontaldata ? (r = luckysheetFreezen.freezenhorizontaldata[0],
            luckysheetFreezen.freezenhorizontaldata[1],
            luckysheetDrawMain(e, a = luckysheetFreezen.freezenhorizontaldata[2], l, r, 1, 1, null, null, "freezen_h"),
            luckysheetDrawMain(e, t + r - a, l, i - r + a, null, r - a + Store.columnHeaderHeight),
            luckysheetDrawgridColumnTitle(e, l, null),
            luckysheetDrawgridRowTitle(a, r, Store.columnHeaderHeight),
            luckysheetDrawgridRowTitle(t + r - a, i - r + a, r - a + Store.columnHeaderHeight)) : null != luckysheetFreezen.freezenverticaldata && (n = luckysheetFreezen.freezenverticaldata[0],
            luckysheetFreezen.freezenverticaldata[1],
            luckysheetDrawMain(o = luckysheetFreezen.freezenverticaldata[2], t, n, i, 1, 1, null, null, "freezen_v"),
            luckysheetDrawMain(e + n - o, t, l - n + o, i, n - o + Store.rowHeaderWidth, null),
            luckysheetDrawgridRowTitle(t, i, null),
            luckysheetDrawgridColumnTitle(o, n, Store.rowHeaderWidth),
            luckysheetDrawgridColumnTitle(e + n - o, l - n + o, n - o + Store.rowHeaderWidth))
        } else {
            if (0 == $("#luckysheetTableContent").length)
                return;
            var s = $("#luckysheetTableContent").get(0).getContext("2d");
            luckysheetDrawMain(e, t),
            luckysheetDrawgridColumnTitle(e),
            luckysheetDrawgridRowTitle(t),
            s.clearRect(0, 0, Store.rowHeaderWidth * Store.devicePixelRatio - 1, Store.columnHeaderHeight * Store.devicePixelRatio - 1)
        }
    }
    var conditionformat = {
        fileClone: [],
        editorRule: null,
        ruleTypeHtml: function() {
            var e = locale().conditionformat;
            return '<div class="ruleTypeBox">\n                    <div class="ruleTypeItem">\n                        <span class="icon iconfont icon-youjiantou"></span>\n                        <span>'.concat(e.ruleTypeItem1, '</span>\n                    </div>\n                    <div class="ruleTypeItem">\n                        <span class="icon iconfont icon-youjiantou"></span>\n                        <span>').concat(e.ruleTypeItem2, '</span>\n                    </div>\n                    <div class="ruleTypeItem">\n                        <span class="icon iconfont icon-youjiantou"></span>\n                        <span>').concat(e.ruleTypeItem3, '</span>\n                    </div>\n                    <div class="ruleTypeItem">\n                        <span class="icon iconfont icon-youjiantou"></span>\n                        <span>').concat(e.ruleTypeItem4, '</span>\n                    </div>\n                    <div class="ruleTypeItem">\n                        <span class="icon iconfont icon-youjiantou"></span>\n                        <span>').concat(e.ruleTypeItem5, "</span>\n                    </div>\n                </div>")
        },
        textCellColorHtml: function() {
            var e = locale().conditionformat;
            return '<div id="textCellColor">\n                    <div class="colorbox">\n                        <input id="checkTextColor" type="checkbox" checked="checked">\n                        <label for="checkTextColor">'.concat(e.textColor, '：</label>\n                        <input id="textcolorshow" data-tips="').concat(e.textColor, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#9c0006" style="display: none;">\n                    </div>\n                    <div class="colorbox">\n                        <input id="checkCellColor" type="checkbox" checked="checked">\n                        <label for="checkCellColor">').concat(e.cellColor, '：</label>\n                        <input id="cellcolorshow" data-tips="').concat(e.cellColor, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#ffc7ce" style="display: none;">\n                    </div>\n                </div>')
        },
        selectRange: [],
        selectStatus: !1,
        dataBarList: [{
            format: ["#638ec6", "#ffffff"]
        }, {
            format: ["#63c384", "#ffffff"]
        }, {
            format: ["#ff555a", "#ffffff"]
        }, {
            format: ["#ffb628", "#ffffff"]
        }, {
            format: ["#008aef", "#ffffff"]
        }, {
            format: ["#d6007b", "#ffffff"]
        }, {
            format: ["#638ec6"]
        }, {
            format: ["#63c384"]
        }, {
            format: ["#ff555a"]
        }, {
            format: ["#ffb628"]
        }, {
            format: ["#008aef"]
        }, {
            format: ["#d6007b"]
        }],
        colorGradationList: [{
            format: ["rgb(99, 190, 123)", "rgb(255, 235, 132)", "rgb(248, 105, 107)"]
        }, {
            format: ["rgb(248, 105, 107)", "rgb(255, 235, 132)", "rgb(99, 190, 123)"]
        }, {
            format: ["rgb(99, 190, 123)", "rgb(252, 252, 255)", "rgb(248, 105, 107)"]
        }, {
            format: ["rgb(248, 105, 107)", "rgb(252, 252, 255)", "rgb(99, 190, 123)"]
        }, {
            format: ["rgb(90, 138, 198)", "rgb(252, 252, 255)", "rgb(248, 105, 107)"]
        }, {
            format: ["rgb(248, 105, 107)", "rgb(252, 252, 255)", "rgb(90, 138, 198)"]
        }, {
            format: ["rgb(252, 252, 255)", "rgb(248, 105, 107)"]
        }, {
            format: ["rgb(248, 105, 107)", "rgb(252, 252, 255)"]
        }, {
            format: ["rgb(99, 190, 123)", "rgb(252, 252, 255)"]
        }, {
            format: ["rgb(252, 252, 255)", "rgb(99, 190, 123)"]
        }, {
            format: ["rgb(99, 190, 123)", "rgb(255, 235, 132)"]
        }, {
            format: ["rgb(255, 235, 132)", "rgb(99, 190, 123)"]
        }],
        init: function() {
            var e = this
              , t = locale().conditionformat;
            $(document).off("change.CFchooseSheet").on("change.CFchooseSheet", "#luckysheet-administerRule-dialog .chooseSheet", (function() {
                var t = $("#luckysheet-administerRule-dialog .chooseSheet option:selected").val();
                e.getConditionRuleList(t)
            }
            )),
            $(document).off("click.CFadministerRuleItem").on("click.CFadministerRuleItem", "#luckysheet-administerRule-dialog .ruleList .listBox .item", (function() {
                $(this).addClass("on").siblings().removeClass("on")
            }
            )),
            $(document).off("click.CFadministerRuleConfirm").on("click.CFadministerRuleConfirm", "#luckysheet-administerRule-dialog-confirm", (function() {
                if (checkProtectionFormatCells(Store.currentSheetIndex)) {
                    for (var t = $.extend(!0, [], Store.luckysheetfile), r = e.getHistoryRules(t), a = $.extend(!0, [], e.fileClone), n = 0; n < a.length; n++) {
                        var o = a[n].index;
                        Store.luckysheetfile[getSheetIndex(o)].luckysheet_conditionformat_save = a[getSheetIndex(o)].luckysheet_conditionformat_save
                    }
                    var l = $.extend(!0, [], Store.luckysheetfile)
                      , i = e.getCurrentRules(l);
                    if (e.ref(r, i),
                    $("#luckysheet-modal-dialog-mask").hide(),
                    $("#luckysheet-administerRule-dialog").hide(),
                    server.allowUpdate)
                        for (var s = $.extend(!0, [], Store.luckysheetfile), c = 0; c < s.length; c++)
                            server.saveParam("all", s[c].index, s[c].luckysheet_conditionformat_save, {
                                k: "luckysheet_conditionformat_save"
                            })
                }
            }
            )),
            $(document).off("click.CFadministerRuleClose").on("click.CFadministerRuleClose", "#luckysheet-administerRule-dialog-close", (function() {
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-administerRule-dialog").hide(),
                e.fileClone = []
            }
            )),
            $(document).off("click.CFadministerRuleFa").on("click.CFadministerRuleFa", "#luckysheet-administerRule-dialog .item .fa-table", (function() {
                $(this).parents("#luckysheet-administerRule-dialog").hide();
                var t = $("#luckysheet-administerRule-dialog .chooseSheet select option:selected").val();
                t != Store.currentSheetIndex && sheetmanage.changeSheetExec(t);
                var r = $(this).siblings("input").val().trim()
                  , a = $(this).parents(".item").attr("data-item");
                e.multiRangeDialog(a, r),
                e.selectRange = [];
                var n = e.getRangeByTxt(r);
                if (n.length > 0)
                    for (var o = 0; o < n.length; o++) {
                        var l = n[o].row[0]
                          , i = n[o].row[1]
                          , s = n[o].column[0]
                          , c = n[o].column[1]
                          , u = Store.visibledatarow[i]
                          , h = l - 1 == -1 ? 0 : Store.visibledatarow[l - 1]
                          , d = Store.visibledatacolumn[c]
                          , f = s - 1 == -1 ? 0 : Store.visibledatacolumn[s - 1];
                        e.selectRange.push({
                            left: f,
                            width: d - f - 1,
                            top: h,
                            height: u - h - 1,
                            left_move: f,
                            width_move: d - f - 1,
                            top_move: h,
                            height_move: u - h - 1,
                            row: [l, i],
                            column: [s, c],
                            row_focus: l,
                            column_focus: s
                        })
                    }
                selectionCopyShow(e.selectRange)
            }
            )),
            $(document).off("click.CFmultiRangeConfirm").on("click.CFmultiRangeConfirm", "#luckysheet-multiRange-dialog-confirm", (function() {
                $(this).parents("#luckysheet-multiRange-dialog").hide();
                var t = $(this).attr("data-item")
                  , r = $(this).parents("#luckysheet-multiRange-dialog").find("input").val();
                $("#luckysheet-administerRule-dialog .item[data-item=" + t + "] input").val(r);
                var a = $("#luckysheet-administerRule-dialog .chooseSheet option:selected").val();
                e.fileClone[getSheetIndex(a)].luckysheet_conditionformat_save[t].cellrange = e.getRangeByTxt(r),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-administerRule-dialog").show();
                selectionCopyShow([])
            }
            )),
            $(document).off("click.CFmultiRangeClose").on("click.CFmultiRangeClose", "#luckysheet-multiRange-dialog-close", (function() {
                $(this).parents("#luckysheet-multiRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-administerRule-dialog").show(),
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide();
                selectionCopyShow([])
            }
            )),
            $(document).off("click.CFnewConditionRule").on("click.CFnewConditionRule", "#newConditionRule", (function() {
                checkProtectionFormatCells($("#luckysheet-administerRule-dialog .chooseSheet option:selected").val()) && (0 != Store.luckysheet_select_save.length ? e.newConditionRuleDialog(1) : isEditMode() ? alert(t.pleaseSelectRange) : tooltip.info(t.pleaseSelectRange, ""))
            }
            )),
            $(document).off("click.CFnewConditionRuleConfirm").on("click.CFnewConditionRuleConfirm", "#luckysheet-newConditionRule-dialog-confirm", (function() {
                if (checkProtectionFormatCells(Store.currentSheetIndex)) {
                    var r, a, n = $("#luckysheet-newConditionRule-dialog .ruleTypeItem.on").index(), o = $("#luckysheet-newConditionRule-dialog #type1 option:selected").val(), l = $("#luckysheet-newConditionRule-dialog ." + o + "Box #type2 option:selected").val();
                    if (0 == n) {
                        if ("dataBar" == o) {
                            var i = $(this).parents("#luckysheet-newConditionRule-dialog").find(".dataBarBox .luckysheet-conditionformat-config-color").spectrum("get").toHexString();
                            "gradient" == l ? r = [i, "#ffffff"] : "solid" == l && (r = [i]),
                            a = {
                                type: "dataBar",
                                cellrange: $.extend(!0, [], Store.luckysheet_select_save),
                                format: r
                            }
                        } else if ("colorGradation" == o) {
                            var s = $(this).parents("#luckysheet-newConditionRule-dialog").find(".colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString()
                              , c = $(this).parents("#luckysheet-newConditionRule-dialog").find(".colorGradationBox .midVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString()
                              , u = $(this).parents("#luckysheet-newConditionRule-dialog").find(".colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString();
                            "threeColor" == l ? r = [s, c, u] : "twoColor" == l && (r = [s, u]),
                            a = {
                                type: "colorGradation",
                                cellrange: $.extend(!0, [], Store.luckysheet_select_save),
                                format: r
                            }
                        } else if ("icons" == o) {
                            r = {
                                len: $(this).parents("#luckysheet-newConditionRule-dialog").find(".iconsBox .model").attr("data-len"),
                                leftMin: $(this).parents("#luckysheet-newConditionRule-dialog").find(".iconsBox .model").attr("data-leftmin"),
                                top: $(this).parents("#luckysheet-newConditionRule-dialog").find(".iconsBox .model").attr("data-top")
                            },
                            a = {
                                type: "icons",
                                cellrange: $.extend(!0, [], Store.luckysheet_select_save),
                                format: r
                            }
                        }
                    } else {
                        var h = ""
                          , d = []
                          , f = [];
                        if (1 == n) {
                            if ("number" == o)
                                if (h = l,
                                "betweenness" == l) {
                                    var m = $("#luckysheet-newConditionRule-dialog #conditionVal input").val().trim()
                                      , p = $("#luckysheet-newConditionRule-dialog #conditionVal2 input").val().trim()
                                      , g = e.getRangeByTxt(m);
                                    if (g.length > 1)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    if (1 == g.length) {
                                        var y = g[0].row[0]
                                          , v = g[0].row[1]
                                          , A = g[0].column[0]
                                          , b = g[0].column[1];
                                        if (y != v || A != b)
                                            return void e.infoDialog(t.onlySingleCell, "");
                                        m = getcellvalue(y, A, Store.flowdata),
                                        d.push({
                                            row: g[0].row,
                                            column: g[0].column
                                        }),
                                        f.push(m)
                                    } else if (0 == g.length) {
                                        if (isNaN(m) || "" == m)
                                            return void e.infoDialog(t.conditionValueCanOnly, "");
                                        f.push(m)
                                    }
                                    var k = e.getRangeByTxt(p);
                                    if (k.length > 1)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    if (1 == k.length) {
                                        var w = k[0].row[0]
                                          , x = k[0].row[1]
                                          , S = k[0].column[0]
                                          , _ = k[0].column[1];
                                        if (w != x || S != _)
                                            return void e.infoDialog(t.onlySingleCell, "");
                                        p = getcellvalue(w, S, Store.flowdata),
                                        d.push({
                                            row: k[0].row,
                                            column: k[0].column
                                        }),
                                        f.push(p)
                                    } else if (0 == k.length) {
                                        if (isNaN(p) || "" == p)
                                            return void e.infoDialog(t.conditionValueCanOnly, "");
                                        f.push(p)
                                    }
                                } else {
                                    var C = $("#luckysheet-newConditionRule-dialog #conditionVal input").val().trim()
                                      , T = e.getRangeByTxt(C);
                                    if (T.length > 1)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    if (1 == T.length) {
                                        var E = T[0].row[0]
                                          , I = T[0].row[1]
                                          , R = T[0].column[0]
                                          , B = T[0].column[1];
                                        if (E != I || R != B)
                                            return void e.infoDialog(t.onlySingleCell, "");
                                        C = getcellvalue(E, R, Store.flowdata),
                                        d.push({
                                            row: T[0].row,
                                            column: T[0].column
                                        }),
                                        f.push(C)
                                    } else if (0 == T.length) {
                                        if (isNaN(C) || "" == C)
                                            return void e.infoDialog(t.conditionValueCanOnly, "");
                                        f.push(C)
                                    }
                                }
                            else if ("text" == o) {
                                h = "textContains";
                                var N = $("#luckysheet-newConditionRule-dialog #conditionVal input").val().trim()
                                  , F = e.getRangeByTxt(N);
                                if (F.length > 1)
                                    return void e.infoDialog(t.onlySingleCell, "");
                                if (1 == F.length) {
                                    var P = F[0].row[0]
                                      , L = F[0].row[1]
                                      , O = F[0].column[0]
                                      , D = F[0].column[1];
                                    if (P != L || O != D)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    N = getcellvalue(P, O, Store.flowdata),
                                    d.push({
                                        row: F[0].row,
                                        column: F[0].column
                                    }),
                                    f.push(N)
                                } else if (0 == F.length) {
                                    if ("" == N)
                                        return void e.infoDialog(t.conditionValueCanOnly, "");
                                    f.push(N)
                                }
                            } else if ("date" == o) {
                                h = "occurrenceDate";
                                var M = $("#luckysheet-newConditionRule-dialog #daterange-btn").val();
                                if ("" == M || null == M)
                                    return void e.infoDialog(t.pleaseSelectADate, "");
                                f.push(M)
                            }
                        } else if (2 == n) {
                            "top" == o ? h = $("#luckysheet-newConditionRule-dialog #isPercent").is(":selected") ? "top10%" : "top10" : "last" == o && (h = $("#luckysheet-newConditionRule-dialog #isPercent").is(":selected") ? "last10%" : "last10");
                            var U = $("#luckysheet-newConditionRule-dialog #conditionVal input").val().trim();
                            if (parseInt(U) != U || parseInt(U) < 1 || parseInt(U) > 1e3)
                                return void e.infoDialog(t.pleaseEnterInteger, "");
                            f.push(parseInt(U))
                        } else
                            3 == n ? "AboveAverage" == o ? (h = "AboveAverage",
                            f.push("AboveAverage")) : "SubAverage" == o && (h = "SubAverage",
                            f.push("SubAverage")) : 4 == n && (h = "duplicateValue",
                            f.push(o));
                        r = {
                            textColor: $("#luckysheet-newConditionRule-dialog #checkTextColor").is(":checked") ? $("#luckysheet-newConditionRule-dialog #textcolorshow").spectrum("get").toHexString() : null,
                            cellColor: $("#luckysheet-newConditionRule-dialog #checkCellColor").is(":checked") ? $("#luckysheet-newConditionRule-dialog #cellcolorshow").spectrum("get").toHexString() : null
                        },
                        a = {
                            type: "default",
                            cellrange: $.extend(!0, [], Store.luckysheet_select_save),
                            format: r,
                            conditionName: h,
                            conditionRange: d,
                            conditionValue: f
                        }
                    }
                    $("#luckysheet-newConditionRule-dialog").hide();
                    var H = $(this).attr("data-source");
                    if (0 == H) {
                        $("#luckysheet-modal-dialog-mask").hide();
                        var q = $.extend(!0, [], Store.luckysheetfile)
                          , z = e.getHistoryRules(q)
                          , j = null == Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save ? [] : Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save;
                        j.push(a),
                        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save = j;
                        var V = $.extend(!0, [], Store.luckysheetfile)
                          , Q = e.getCurrentRules(V);
                        e.ref(z, Q),
                        server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, j, {
                            k: "luckysheet_conditionformat_save"
                        })
                    } else if (1 == H) {
                        var G = e.fileClone[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save ? e.fileClone[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save : [];
                        G.push(a),
                        e.fileClone[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save = G,
                        e.administerRuleDialog()
                    }
                }
            }
            )),
            $(document).off("click.CFnewConditionRuleClose").on("click.CFnewConditionRuleClose", "#luckysheet-newConditionRule-dialog-close", (function() {
                var e = $(this).attr("data-source");
                0 == e && $("#luckysheet-modal-dialog-mask").hide(),
                1 == e && $("#luckysheet-administerRule-dialog").show(),
                $("#luckysheet-newConditionRule-dialog").hide(),
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide()
            }
            )),
            $(document).off("click.CFeditorConditionRule").on("click.CFeditorConditionRule", "#editorConditionRule", (function() {
                var t = $("#luckysheet-administerRule-dialog .chooseSheet option:selected").val();
                if (checkProtectionFormatCells(t)) {
                    var r = $("#luckysheet-administerRule-dialog .ruleList .listBox .item.on").attr("data-item")
                      , a = {
                        sheetIndex: t,
                        itemIndex: r,
                        data: e.fileClone[getSheetIndex(t)].luckysheet_conditionformat_save[r]
                    };
                    e.editorRule = a,
                    e.editorConditionRuleDialog()
                }
            }
            )),
            $(document).off("click.CFeditorConditionRuleConfirm").on("click.CFeditorConditionRuleConfirm", "#luckysheet-editorConditionRule-dialog-confirm", (function() {
                var r, a, n = $("#luckysheet-editorConditionRule-dialog .ruleTypeItem.on").index(), o = $("#luckysheet-editorConditionRule-dialog #type1 option:selected").val(), l = $("#luckysheet-editorConditionRule-dialog ." + o + "Box #type2 option:selected").val(), i = e.editorRule.data.cellrange;
                if (0 == n) {
                    if ("dataBar" == o) {
                        var s = $(this).parents("#luckysheet-editorConditionRule-dialog").find(".dataBarBox .luckysheet-conditionformat-config-color").spectrum("get").toHexString();
                        "gradient" == l ? r = [s, "#ffffff"] : "solid" == l && (r = [s]),
                        a = {
                            type: "dataBar",
                            cellrange: i,
                            format: r
                        }
                    } else if ("colorGradation" == o) {
                        var c = $(this).parents("#luckysheet-editorConditionRule-dialog").find(".colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString()
                          , u = $(this).parents("#luckysheet-editorConditionRule-dialog").find(".colorGradationBox .midVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString()
                          , h = $(this).parents("#luckysheet-editorConditionRule-dialog").find(".colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("get").toRgbString();
                        "threeColor" == l ? r = [c, u, h] : "twoColor" == l && (r = [c, h]),
                        a = {
                            type: "colorGradation",
                            cellrange: i,
                            format: r
                        }
                    } else if ("icons" == o) {
                        a = {
                            type: "icons",
                            cellrange: i,
                            format: r = {
                                len: $(this).parents("#luckysheet-editorConditionRule-dialog").find(".iconsBox .model").attr("data-len"),
                                leftMin: $(this).parents("#luckysheet-editorConditionRule-dialog").find(".iconsBox .model").attr("data-leftmin"),
                                top: $(this).parents("#luckysheet-editorConditionRule-dialog").find(".iconsBox .model").attr("data-top")
                            }
                        }
                    }
                } else {
                    var d = ""
                      , f = []
                      , m = [];
                    if (1 == n) {
                        if ("number" == o)
                            if (d = l,
                            "betweenness" == l) {
                                var p = $("#luckysheet-editorConditionRule-dialog #conditionVal input").val().trim()
                                  , g = $("#luckysheet-editorConditionRule-dialog #conditionVal2 input").val().trim()
                                  , y = e.getRangeByTxt(p);
                                if (y.length > 1)
                                    return void e.infoDialog(t.onlySingleCell, "");
                                if (1 == y.length) {
                                    var v = y[0].row[0]
                                      , A = y[0].row[1]
                                      , b = y[0].column[0]
                                      , k = y[0].column[1];
                                    if (v != A || b != k)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    p = getcellvalue(v, b, Store.flowdata),
                                    f.push({
                                        row: y[0].row,
                                        column: y[0].column
                                    }),
                                    m.push(p)
                                } else if (0 == y.length) {
                                    if (isNaN(p) || "" == p)
                                        return void e.infoDialog(t.conditionValueCanOnly, "");
                                    m.push(p)
                                }
                                var w = e.getRangeByTxt(g);
                                if (w.length > 1)
                                    return void e.infoDialog(t.onlySingleCell, "");
                                if (1 == w.length) {
                                    var x = w[0].row[0]
                                      , S = w[0].row[1]
                                      , _ = w[0].column[0]
                                      , C = w[0].column[1];
                                    if (x != S || _ != C)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    g = getcellvalue(x, _, Store.flowdata),
                                    f.push({
                                        row: w[0].row,
                                        column: w[0].column
                                    }),
                                    m.push(g)
                                } else if (0 == w.length) {
                                    if (isNaN(g) || "" == g)
                                        return void e.infoDialog(t.conditionValueCanOnly, "");
                                    m.push(g)
                                }
                            } else {
                                var T = $("#luckysheet-editorConditionRule-dialog #conditionVal input").val().trim()
                                  , E = e.getRangeByTxt(T);
                                if (E.length > 1)
                                    return void e.infoDialog(t.onlySingleCell, "");
                                if (1 == E.length) {
                                    var I = E[0].row[0]
                                      , R = E[0].row[1]
                                      , B = E[0].column[0]
                                      , N = E[0].column[1];
                                    if (I != R || B != N)
                                        return void e.infoDialog(t.onlySingleCell, "");
                                    T = getcellvalue(I, B, Store.flowdata),
                                    f.push({
                                        row: E[0].row,
                                        column: E[0].column
                                    }),
                                    m.push(T)
                                } else if (0 == E.length) {
                                    if (isNaN(T) || "" == T)
                                        return void e.infoDialog(t.conditionValueCanOnly, "");
                                    m.push(T)
                                }
                            }
                        else if ("text" == o) {
                            d = "textContains";
                            var F = $("#luckysheet-editorConditionRule-dialog #conditionVal input").val().trim()
                              , P = e.getRangeByTxt(F);
                            if (P.length > 1)
                                return void e.infoDialog(t.onlySingleCell, "");
                            if (1 == P.length) {
                                var L = P[0].row[0]
                                  , O = P[0].row[1]
                                  , D = P[0].column[0]
                                  , M = P[0].column[1];
                                if (L != O || D != M)
                                    return void e.infoDialog(t.onlySingleCell, "");
                                F = getcellvalue(L, D, Store.flowdata),
                                f.push({
                                    row: P[0].row,
                                    column: P[0].column
                                }),
                                m.push(F)
                            } else if (0 == P.length) {
                                if (isNaN(F) || "" == F)
                                    return void e.infoDialog(t.conditionValueCanOnly, "");
                                m.push(F)
                            }
                        } else if ("date" == o) {
                            d = "occurrenceDate";
                            var U = $("#luckysheet-editorConditionRule-dialog #daterange-btn").val();
                            if ("" == U || null == U)
                                return void e.infoDialog(t.pleaseSelectADate, "");
                            m.push(U)
                        }
                    } else if (2 == n) {
                        "top" == o ? d = $("#luckysheet-editorConditionRule-dialog #isPercent").is(":selected") ? "top10%" : "top10" : "last" == o && (d = $("#luckysheet-editorConditionRule-dialog #isPercent").is(":selected") ? "last10%" : "last10");
                        var H = $("#luckysheet-editorConditionRule-dialog #conditionVal input").val().trim();
                        if (parseInt(H) != H || parseInt(H) < 1 || parseInt(H) > 1e3)
                            return void e.infoDialog(t.pleaseEnterInteger, "");
                        m.push(H)
                    } else
                        3 == n ? "AboveAverage" == o ? (d = "AboveAverage",
                        m.push("AboveAverage")) : "SubAverage" == o && (d = "SubAverage",
                        m.push("SubAverage")) : 4 == n && (d = "duplicateValue",
                        m.push(o));
                    a = {
                        type: "default",
                        cellrange: i,
                        format: r = {
                            textColor: $("#luckysheet-editorConditionRule-dialog #checkTextColor").is(":checked") ? $("#luckysheet-editorConditionRule-dialog #textcolorshow").spectrum("get").toHexString() : null,
                            cellColor: $("#luckysheet-editorConditionRule-dialog #checkCellColor").is(":checked") ? $("#luckysheet-editorConditionRule-dialog #cellcolorshow").spectrum("get").toHexString() : null
                        },
                        conditionName: d,
                        conditionRange: f,
                        conditionValue: m
                    }
                }
                var q = e.editorRule.sheetIndex
                  , z = e.editorRule.itemIndex;
                e.fileClone[getSheetIndex(q)].luckysheet_conditionformat_save[z] = a,
                $("#luckysheet-editorConditionRule-dialog").hide(),
                e.administerRuleDialog()
            }
            )),
            $(document).off("click.CFeditorConditionRuleClose").on("click.CFeditorConditionRuleClose", "#luckysheet-editorConditionRule-dialog-close", (function() {
                $("#luckysheet-editorConditionRule-dialog").hide(),
                $("#luckysheet-administerRule-dialog").show(),
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide()
            }
            )),
            $(document).off("click.CFnewEditorRuleItem").on("click.CFnewEditorRuleItem", ".luckysheet-newEditorRule-dialog .ruleTypeItem", (function() {
                $(this).addClass("on").siblings().removeClass("on");
                var t = $(this).index();
                $(this).parents(".luckysheet-newEditorRule-dialog").find(".ruleExplainBox").html(e.getRuleExplain(t)),
                e.colorSelectInit()
            }
            )),
            $(document).off("change.CFnewEditorRuleType1").on("change.CFnewEditorRuleType1", ".luckysheet-newEditorRule-dialog #type1", (function() {
                var t = $(this).find("option:selected").val();
                "dataBar" != t && "colorGradation" != t && "icons" != t && "number" != t && "text" != t && "date" != t || $(this).parents(".luckysheet-newEditorRule-dialog").find("." + t + "Box").show().siblings().hide(),
                "date" == t && e.daterangeInit($(this).parents(".luckysheet-newEditorRule-dialog").attr("id"))
            }
            )),
            $(document).off("change.CFnewEditorRuleType2").on("change.CFnewEditorRuleType2", ".luckysheet-newEditorRule-dialog #type2", (function() {
                var e = $(this).parents(".luckysheet-newEditorRule-dialog").find("#type1 option:selected").val();
                if ("colorGradation" == e)
                    "threeColor" == $(this).find("option:selected").val() ? $(this).parents(".luckysheet-newEditorRule-dialog").find(".midVal").show() : $(this).parents(".luckysheet-newEditorRule-dialog").find(".midVal").hide();
                else if ("number" == e) {
                    "betweenness" == $(this).find("option:selected").val() ? ($(this).parents(".luckysheet-newEditorRule-dialog").find(".txt").show(),
                    $(this).parents(".luckysheet-newEditorRule-dialog").find("#conditionVal2").show()) : ($(this).parents(".luckysheet-newEditorRule-dialog").find(".txt").hide(),
                    $(this).parents(".luckysheet-newEditorRule-dialog").find("#conditionVal2").hide())
                }
            }
            )),
            $(document).off("click.CFiconsShowbox").on("click.CFiconsShowbox", ".luckysheet-newEditorRule-dialog .iconsBox .showbox", (function() {
                $(this).parents(".iconsBox").find("ul").toggle()
            }
            )),
            $(document).off("click.CFiconsLi").on("click.CFiconsLi", ".luckysheet-newEditorRule-dialog .iconsBox li", (function() {
                var e = $(this).find("div").attr("data-len")
                  , t = $(this).find("div").attr("data-leftmin")
                  , r = $(this).find("div").attr("data-top")
                  , a = $(this).find("div").attr("title")
                  , n = $(this).find("div").css("background-position");
                $(this).parents(".iconsBox").find(".showbox .model").css("background-position", n),
                $(this).parents(".iconsBox").find(".showbox .model").attr("data-len", e),
                $(this).parents(".iconsBox").find(".showbox .model").attr("data-leftmin", t),
                $(this).parents(".iconsBox").find(".showbox .model").attr("data-top", r),
                $(this).parents(".iconsBox").find(".showbox .model").attr("title", a),
                $(this).parents("ul").hide()
            }
            )),
            $(document).off("click.CFdeleteConditionRule").on("click.CFdeleteConditionRule", "#deleteConditionRule", (function() {
                var t = $("#luckysheet-administerRule-dialog .chooseSheet option:selected").val();
                if (checkProtectionFormatCells(t)) {
                    var r = $("#luckysheet-administerRule-dialog .ruleList .listBox .item.on").attr("data-item");
                    e.fileClone[getSheetIndex(t)].luckysheet_conditionformat_save.splice(r, 1),
                    e.administerRuleDialog()
                }
            }
            )),
            $(document).off("click.CFdefault").on("click.CFdefault", "#luckysheet-conditionformat-dialog-confirm", (function() {
                if (checkProtectionFormatCells(Store.currentSheetIndex)) {
                    var r, a, n = $("#luckysheet-conditionformat-dialog .box").attr("data-itemvalue"), o = [], l = [];
                    if ("greaterThan" == n || "lessThan" == n || "equal" == n || "textContains" == n) {
                        var i = $("#luckysheet-conditionformat-dialog #conditionVal").val().trim()
                          , s = e.getRangeByTxt(i);
                        if (s.length > 1)
                            return void e.infoDialog(t.onlySingleCell, "");
                        if (1 == s.length) {
                            var c = s[0].row[0]
                              , u = s[0].row[1]
                              , h = s[0].column[0]
                              , d = s[0].column[1];
                            if (c != u || h != d)
                                return void e.infoDialog(t.onlySingleCell, "");
                            i = getcellvalue(c, h, Store.flowdata),
                            o.push({
                                row: s[0].row,
                                column: s[0].column
                            }),
                            l.push(i)
                        } else if (0 == s.length) {
                            if (isNaN(i) || "" == i)
                                return void e.infoDialog(t.conditionValueCanOnly, "");
                            l.push(i)
                        }
                    } else if ("betweenness" == n) {
                        var f = $("#luckysheet-conditionformat-dialog #conditionVal").val().trim()
                          , m = $("#luckysheet-conditionformat-dialog #conditionVal2").val().trim()
                          , p = e.getRangeByTxt(f);
                        if (p.length > 1)
                            return void e.infoDialog(t.onlySingleCell, "");
                        if (1 == p.length) {
                            var g = p[0].row[0]
                              , y = p[0].row[1]
                              , v = p[0].column[0]
                              , A = p[0].column[1];
                            if (g != y || v != A)
                                return void e.infoDialog(t.onlySingleCell, "");
                            f = getcellvalue(g, v, Store.flowdata),
                            o.push({
                                row: p[0].row,
                                column: p[0].column
                            }),
                            l.push(f)
                        } else if (0 == p.length) {
                            if (isNaN(f) || "" == f)
                                return void e.infoDialog(t.conditionValueCanOnly, "");
                            l.push(f)
                        }
                        var b = e.getRangeByTxt(m);
                        if (b.length > 1)
                            return void e.infoDialog(t.onlySingleCell, "");
                        if (1 == b.length) {
                            var k = b[0].row[0]
                              , w = b[0].row[1]
                              , x = b[0].column[0]
                              , S = b[0].column[1];
                            if (k != w || x != S)
                                return void e.infoDialog(t.onlySingleCell, "");
                            m = getcellvalue(k, x, Store.flowdata),
                            o.push({
                                row: b[0].row,
                                column: b[0].column
                            }),
                            l.push(m)
                        } else if (0 == b.length) {
                            if (isNaN(m) || "" == m)
                                return void e.infoDialog(t.conditionValueCanOnly, "");
                            l.push(m)
                        }
                    } else if ("occurrenceDate" == n) {
                        var _ = $("#luckysheet-conditionformat-dialog #daterange-btn").val();
                        if ("" == _ || null == _)
                            return void e.infoDialog(t.pleaseSelectADate, "");
                        l.push(_)
                    } else if ("duplicateValue" == n)
                        l.push($("#luckysheet-conditionformat-dialog #conditionVal option:selected").val());
                    else if ("top10" == n || "top10%" == n || "last10" == n || "last10%" == n) {
                        var C = $("#luckysheet-conditionformat-dialog #conditionVal").val().trim();
                        if (parseInt(C) != C || parseInt(C) < 1 || parseInt(C) > 1e3)
                            return void e.infoDialog(t.pleaseEnterInteger, "");
                        l.push(C)
                    } else
                        "AboveAverage" == n ? l.push("AboveAverage") : "SubAverage" == n && l.push("SubAverage");
                    r = $("#checkTextColor").is(":checked") ? $("#textcolorshow").spectrum("get").toHexString() : null,
                    a = $("#checkCellColor").is(":checked") ? $("#cellcolorshow").spectrum("get").toHexString() : null;
                    var T = $.extend(!0, [], Store.luckysheetfile)
                      , E = e.getHistoryRules(T)
                      , I = {
                        type: "default",
                        cellrange: $.extend(!0, [], Store.luckysheet_select_save),
                        format: {
                            textColor: r,
                            cellColor: a
                        },
                        conditionName: n,
                        conditionRange: o,
                        conditionValue: l
                    }
                      , R = null == Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save ? [] : Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save;
                    R.push(I),
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save = R;
                    var B = $.extend(!0, [], Store.luckysheetfile)
                      , N = e.getCurrentRules(B);
                    e.ref(E, N),
                    $("#luckysheet-modal-dialog-mask").hide(),
                    $("#luckysheet-conditionformat-dialog").hide(),
                    server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, R, {
                        k: "luckysheet_conditionformat_save"
                    })
                }
            }
            )),
            $(document).off("click.CFicons").on("click.CFicons", "#luckysheet-CFicons-dialog .item", (function() {
                if ($("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-CFicons-dialog").hide(),
                Store.luckysheet_select_save.length > 0) {
                    var t = $.extend(!0, [], Store.luckysheet_select_save)
                      , r = {
                        len: $(this).attr("data-len"),
                        leftMin: $(this).attr("data-leftMin"),
                        top: $(this).attr("data-top")
                    };
                    e.updateItem("icons", t, r)
                }
            }
            )),
            $(document).on("click", ".range .fa-table", (function() {
                var t, r = $(this).parents(".luckysheet-modal-dialog").attr("id");
                $("#" + r).hide(),
                "luckysheet-conditionformat-dialog" == r ? t = "conditionVal" == $(this).siblings("input").attr("id") ? "0_1" : "0_2" : "luckysheet-newConditionRule-dialog" == r ? t = "conditionVal" == $(this).parents(".range").attr("id") ? "1_1" : "1_2" : "luckysheet-editorConditionRule-dialog" == r && (t = "conditionVal" == $(this).parents(".range").attr("id") ? "2_1" : "2_2");
                var a = $(this).siblings("input").val();
                e.singleRangeDialog(t, a),
                selectionCopyShow(e.getRangeByTxt(a))
            }
            )),
            $(document).on("click", "#luckysheet-singleRange-dialog-confirm", (function() {
                $("#luckysheet-modal-dialog-mask").show(),
                $(this).parents("#luckysheet-singleRange-dialog").hide();
                var e = $(this).attr("data-source")
                  , t = $(this).parents("#luckysheet-singleRange-dialog").find("input").val();
                "0_1" == e ? ($("#luckysheet-conditionformat-dialog").show(),
                $("#luckysheet-conditionformat-dialog #conditionVal").val(t)) : "0_2" == e ? ($("#luckysheet-conditionformat-dialog").show(),
                $("#luckysheet-conditionformat-dialog #conditionVal2").val(t)) : "1_1" == e ? ($("#luckysheet-newConditionRule-dialog").show(),
                $("#luckysheet-newConditionRule-dialog #conditionVal input").val(t)) : "1_2" == e ? ($("#luckysheet-newConditionRule-dialog").show(),
                $("#luckysheet-newConditionRule-dialog #conditionVal2 input").val(t)) : "2_1" == e ? ($("#luckysheet-editorConditionRule-dialog").show(),
                $("#luckysheet-editorConditionRule-dialog #conditionVal input").val(t)) : "2_2" == e && ($("#luckysheet-editorConditionRule-dialog").show(),
                $("#luckysheet-editorConditionRule-dialog #conditionVal2 input").val(t));
                selectionCopyShow([])
            }
            )),
            $(document).on("click", "#luckysheet-singleRange-dialog-close", (function() {
                $("#luckysheet-modal-dialog-mask").show(),
                $(this).parents("#luckysheet-singleRange-dialog").hide();
                var e = $(this).attr("data-source");
                "0_1" == e || "0_2" == e ? $("#luckysheet-conditionformat-dialog").show() : "1_1" == e || "1_2" == e ? $("#luckysheet-newConditionRule-dialog").show() : "2_1" != e && "2_2" != e || $("#luckysheet-editorConditionRule-dialog").show();
                selectionCopyShow([])
            }
            )),
            $(document).on("click", ".luckysheet-modal-dialog-title-close", (function() {
                var e = $(this).parents(".luckysheet-modal-dialog").attr("id");
                "luckysheet-newConditionRule-dialog" == e && (1 == $("#" + e).find("#luckysheet-newConditionRule-dialog-close").attr("data-source") && $("#luckysheet-administerRule-dialog").show());
                if ("luckysheet-editorConditionRule-dialog" == e && $("#luckysheet-administerRule-dialog").show(),
                "luckysheet-singleRange-dialog" == e) {
                    $("#luckysheet-modal-dialog-mask").show();
                    var t = $(this).parents("#luckysheet-singleRange-dialog").find("#luckysheet-singleRange-dialog-confirm").attr("data-source");
                    "0_1" == t || "0_2" == t ? $("#luckysheet-conditionformat-dialog").show() : "1_1" == t || "1_2" == t ? $("#luckysheet-newConditionRule-dialog").show() : "2_1" != t && "2_2" != t || $("#luckysheet-editorConditionRule-dialog").show();
                    selectionCopyShow([])
                }
                if ("luckysheet-multiRange-dialog" == e) {
                    $("#luckysheet-modal-dialog-mask").show(),
                    $("#luckysheet-administerRule-dialog").show();
                    selectionCopyShow([])
                }
                "luckysheet-conditionformat-info-dialog" == e && $("#luckysheet-modal-dialog-mask").show()
            }
            )),
            $(document).on("click", "#luckysheet-conditionformat-info-dialog-close", (function() {
                $(this).parents("#luckysheet-conditionformat-info-dialog").hide()
            }
            ))
        },
        singleRangeDialog: function(e, t) {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-singleRange-dialog").remove();
            var r = locale().conditionformat;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-singleRange-dialog",
                addclass: "luckysheet-singleRange-dialog",
                title: r.selectCell,
                content: '<input readonly="readonly" placeholder="'.concat(r.pleaseSelectCell, '" value="').concat(t, '"/>'),
                botton: '<button id="luckysheet-singleRange-dialog-confirm" class="btn btn-primary" data-source="'.concat(e, '">').concat(r.confirm, '</button>\n                        <button id="luckysheet-singleRange-dialog-close" class="btn btn-default" data-source="').concat(e, '">').concat(r.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-singleRange-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-singleRange-dialog").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3
            }).show()
        },
        multiRangeDialog: function(e, t) {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-multiRange-dialog").remove();
            var r = locale().conditionformat;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-multiRange-dialog",
                addclass: "luckysheet-multiRange-dialog",
                title: r.selectRange,
                content: '<input readonly="readonly" placeholder="'.concat(r.pleaseSelectRange, '" value="').concat(t, '"/>'),
                botton: '<button id="luckysheet-multiRange-dialog-confirm" class="btn btn-primary" data-item="'.concat(e, '">').concat(r.confirm, '</button>\n                        <button id="luckysheet-multiRange-dialog-close" class="btn btn-default">').concat(r.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-multiRange-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-multiRange-dialog").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3
            }).show(),
            selectionCopyShow(this.getRangeByTxt(t))
        },
        getTxtByRange: function(e) {
            if (e.length > 0) {
                for (var t = [], r = 0; r < e.length; r++) {
                    var a = e[r].row[0]
                      , n = e[r].row[1]
                      , o = e[r].column[0]
                      , l = e[r].column[1];
                    t.push(getRangetxt(Store.currentSheetIndex, {
                        row: [a, n],
                        column: [o, l]
                    }, Store.currentSheetIndex))
                }
                return t.join(",")
            }
        },
        getRangeByTxt: function(e) {
            var t = [];
            if (-1 != (e = e.toString()).indexOf(","))
                for (var r = e.split(","), a = 0; a < r.length; a++) {
                    if (!luckysheetformula.iscelldata(r[a])) {
                        t = [];
                        break
                    }
                    t.push(luckysheetformula.getcellrange(r[a]))
                }
            else
                luckysheetformula.iscelldata(e) && t.push(luckysheetformula.getcellrange(e));
            return t
        },
        colorSelectInit: function() {
            var e = locale().conditionformat;
            $(".luckysheet-conditionformat-config-color").spectrum({
                showPalette: !0,
                showPaletteOnly: !0,
                preferredFormat: "hex",
                clickoutFiresChange: !1,
                showInitial: !0,
                showInput: !0,
                hideAfterPaletteSelect: !0,
                showSelectionPalette: !0,
                maxPaletteSize: 8,
                maxSelectionSize: 8,
                cancelText: e.cancel,
                chooseText: e.confirmColor,
                togglePaletteMoreText: "自定义",
                togglePaletteLessText: "收起",
                togglePaletteOnly: !0,
                clearText: e.clearColorSelect,
                noColorSelectedText: "没有颜色被选择",
                localStorageKey: "spectrum.textcolor" + server.gridKey,
                palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                change: function(e) {
                    null != e && (e = e.toHexString())
                }
            })
        },
        conditionformatDialog: function(e, t) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-conditionformat-dialog").remove();
            var r = locale().conditionformat;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-conditionformat-dialog",
                addclass: "luckysheet-conditionformat-dialog",
                title: e,
                content: t,
                botton: '<button id="luckysheet-conditionformat-dialog-confirm" class="btn btn-primary">'.concat(r.confirm, '</button>\n                        <button class="btn btn-default luckysheet-model-close-btn">').concat(r.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-conditionformat-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-conditionformat-dialog").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3
            }).show(),
            this.init(),
            this.colorSelectInit(),
            e == locale().conditionformat.conditionformat_occurrenceDate && this.daterangeInit("luckysheet-conditionformat-dialog")
        },
        CFiconsDialog: function() {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-CFicons-dialog").remove();
            var e = locale().conditionformat
              , t = '<div class="box">\n                            <div style="margin-bottom: 10px;">'.concat(e.pleaseSelectIcon, '</div>\n                            <div class="title">').concat(e.direction, '</div>\n                            <div class="list">\n                                <div class="left">\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="0" title="').concat(e.threeWayArrow, "(").concat(e.multicolor, ')"><div style="background-position:0 0;"></div></div>\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="1" title="').concat(e.threeTriangles, '"><div style="background-position:0 -20px;"></div></div>\n                                    <div class="item" data-len="4" data-leftMin="0" data-top="2" title="').concat(e.fourWayArrow, "(").concat(e.multicolor, ')"><div style="background-position:0 -40px;"></div></div>\n                                    <div class="item" data-len="5" data-leftMin="0" data-top="3" title="').concat(e.fiveWayArrow, "(").concat(e.multicolor, ')"><div style="background-position:0 -60px;"></div></div>\n                                </div>\n                                <div class="right">\n                                    <div class="item" data-len="3" data-leftMin="5" data-top="0" title="').concat(e.threeWayArrow, "(").concat(e.grayColor, ')"><div style="background-position:-131px 0;"></div></div>\n                                    <div class="item" data-len="4" data-leftMin="5" data-top="1" title="').concat(e.fourWayArrow, "(").concat(e.grayColor, ')"><div style="background-position:-131px -20px;"></div></div>\n                                    <div class="item" data-len="5" data-leftMin="5" data-top="2" title="').concat(e.fiveWayArrow, "(").concat(e.grayColor, ')"><div style="background-position:-131px -40px;"></div></div>\n                                </div>\n                                <div style="clear:both;"></div>\n                            </div>\n                            <div class="title">').concat(e.shape, '</div>\n                            <div class="list">\n                                <div class="left">\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="4" title="').concat(e.threeColorTrafficLight, "(").concat(e.rimless, ')"><div style="background-position:0 -80px;"></div></div>\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="5" title="').concat(e.threeSigns, '"><div style="background-position:0 -100px;"></div></div>\n                                    <div class="item" data-len="4" data-leftMin="0" data-top="6" title="').concat(e.greenRedBlackGradient, '"><div style="background-position:0 -120px;"></div></div>\n                                </div>\n                                <div class="right">\n                                    <div class="item" data-len="3" data-leftMin="5" data-top="4" title="').concat(e.threeColorTrafficLight, "(").concat(e.bordered, ')"><div style="background-position:-131px -80px;"></div></div>\n                                    <div class="item" data-len="4" data-leftMin="5" data-top="5" title="').concat(e.fourColorTrafficLight, '"><div style="background-position:-131px -100px;"></div></div>\n                                </div>\n                                <div style="clear:both;"></div>\n                            </div>\n                            <div class="title">').concat(e.mark, '</div>\n                            <div class="list">\n                                <div class="left">\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="7" title="').concat(e.threeSymbols, "(").concat(e.circled, ')"><div style="background-position:0 -140px;"></div></div>\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="8" title="').concat(e.tricolorFlag, '"><div style="background-position:0 -160px;"></div></div>\n                                </div>\n                                <div class="right">\n                                    <div class="item" data-len="3" data-leftMin="5" data-top="7" title="').concat(e.threeSymbols, "(").concat(e.noCircle, ')"><div style="background-position:-131px -140px;"></div></div>\n                                </div>\n                                <div style="clear:both;"></div>\n                            </div>\n                            <div class="title">').concat(e.grade, '</div>\n                            <div class="list">\n                                <div class="left">\n                                    <div class="item" data-len="3" data-leftMin="0" data-top="9" title="').concat(e.threeStars, '"><div style="background-position:0 -180px;"></div></div>\n                                    <div class="item" data-len="5" data-leftMin="0" data-top="10" title="').concat(e.fiveQuadrantDiagram, '"><div style="background-position:0 -200px;"></div></div>\n                                    <div class="item" data-len="5" data-leftMin="0" data-top="11" title="').concat(e.fiveBoxes, '"><div style="background-position:0 -220px;"></div></div>\n                                </div>\n                                <div class="right">\n                                    <div class="item" data-len="4" data-leftMin="5" data-top="9" title="').concat(e.grade4, '"><div style="background-position:-131px -180px;"></div></div>\n                                    <div class="item" data-len="5" data-leftMin="5" data-top="10" title="').concat(e.grade5, '"><div style="background-position:-131px -200px;"></div></div>\n                                </div>\n                                <div style="clear:both;"></div>\n                            </div>\n                        </div>');
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-CFicons-dialog",
                addclass: "luckysheet-CFicons-dialog",
                title: e.icons,
                content: t,
                botton: '<button class="btn btn-default luckysheet-model-close-btn">'.concat(e.close, "</button>"),
                style: "z-index:100003"
            }));
            var r = $("#luckysheet-CFicons-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , a = r.outerHeight()
              , n = r.outerWidth()
              , o = $(window).width()
              , l = $(window).height()
              , i = $(document).scrollLeft()
              , s = $(document).scrollTop();
            $("#luckysheet-CFicons-dialog").css({
                left: (o + i - n) / 2,
                top: (l + s - a) / 3
            }).show()
        },
        administerRuleDialog: function() {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-administerRule-dialog").remove();
            for (var e = locale().conditionformat, t = "", r = 0; r < Store.luckysheetfile.length; r++)
                "1" == Store.luckysheetfile[r].status ? t += '<option value="'.concat(Store.luckysheetfile[r].index, '" selected="selected">\n                                ').concat(e.currentSheet, "：").concat(Store.luckysheetfile[r].name, "\n                            </option>") : t += '<option value="'.concat(Store.luckysheetfile[r].index, '">\n                                ').concat(e.sheet, "：").concat(Store.luckysheetfile[r].name, "\n                            </option>");
            var a = '<div class="chooseSheet">\n                            <label>'.concat(e.showRules, "：</label>\n                            <select>").concat(t, '</select>\n                        </div>\n                        <div class="ruleBox">\n                            <div class="ruleBtn">\n                                <button id="newConditionRule" class="btn btn-default">').concat(e.newRule, '</button>\n                                <button id="editorConditionRule" class="btn btn-default">').concat(e.editRule, '</button>\n                                <button id="deleteConditionRule" class="btn btn-default">').concat(e.deleteRule, '</button>\n                            </div>\n                            <div class="ruleList">\n                                <div class="listTitle">\n                                    <span>').concat(e.rule, "</span>\n                                    <span>").concat(e.format, "</span>\n                                    <span>").concat(e.applyRange, '</span>\n                                </div>\n                                <div class="listBox"></div>\n                            </div>\n                        </div>');
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-administerRule-dialog",
                addclass: "luckysheet-administerRule-dialog",
                title: e.conditionformatManageRules,
                content: a,
                botton: '<button id="luckysheet-administerRule-dialog-confirm" class="btn btn-primary">'.concat(e.confirm, '</button>\n                        <button id="luckysheet-administerRule-dialog-close" class="btn btn-default">').concat(e.close, "</button>"),
                style: "z-index:100003"
            }));
            var n = $("#luckysheet-administerRule-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-administerRule-dialog").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show();
            var h = $("#luckysheet-administerRule-dialog .chooseSheet option:selected").val();
            this.getConditionRuleList(h)
        },
        getConditionRuleList: function(e) {
            $("#luckysheet-administerRule-dialog .ruleList .listBox").empty();
            var t = this.fileClone[getSheetIndex(e)].luckysheet_conditionformat_save;
            if (null != t && t.length > 0) {
                for (var r = locale().conditionformat, a = 0; a < t.length; a++) {
                    var n = t[a].type
                      , o = t[a].format
                      , l = t[a].cellrange
                      , i = void 0
                      , s = "";
                    "dataBar" == n ? (i = r.dataBar,
                    s = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>') : "colorGradation" == n ? (i = r.colorGradation,
                    s = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>') : "icons" == n ? (i = r.icons,
                    s = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>') : (i = this.getConditionRuleName(t[a].conditionName, t[a].conditionRange, t[a].conditionValue),
                    null != o.textColor && (s += '<span class="colorbox" title="' + r.textColor + '" style="background-color:' + o.textColor + '"></span>'),
                    null != o.cellColor && (s += '<span class="colorbox" title="' + r.cellColor + '" style="background-color:' + o.cellColor + '"></span>'));
                    for (var c = [], u = 0; u < l.length; u++) {
                        var h = l[u].row[0]
                          , d = l[u].row[1]
                          , f = l[u].column[0]
                          , m = l[u].column[1];
                        c.push(chatatABC(f) + (h + 1) + ":" + chatatABC(m) + (d + 1))
                    }
                    var p = '<div class="item" data-item="' + a + '"><div class="ruleName" title="' + i + '">' + i + '</div><div class="format">' + s + '</div><div class="ruleRange"><input class="formulaInputFocus" readonly="true" value="' + c.join(",") + '"/><i class="fa fa-table" aria-hidden="true" title="' + r.selectRange + '"></i></div></div>';
                    $("#luckysheet-administerRule-dialog .ruleList .listBox").prepend(p)
                }
                $("#luckysheet-administerRule-dialog .ruleList .listBox .item canvas").each((function(e) {
                    var r = $(this).closest(".item").attr("data-item")
                      , a = t[r].type
                      , n = t[r].format
                      , o = $(this).get(0).getContext("2d");
                    if ("dataBar" == a)
                        if (2 == n.length) {
                            var l = o.createLinearGradient(0, 0, 46, 0);
                            l.addColorStop(0, n[0]),
                            l.addColorStop(1, n[1]),
                            o.fillStyle = l,
                            o.fillRect(0, 0, 46, 18),
                            o.beginPath(),
                            o.moveTo(0, 0),
                            o.lineTo(0, 18),
                            o.lineTo(46, 18),
                            o.lineTo(46, 0),
                            o.lineTo(0, 0),
                            o.lineWidth = Store.devicePixelRatio,
                            o.strokeStyle = n[0],
                            o.stroke(),
                            o.closePath()
                        } else
                            1 == n.length && (o.fillStyle = n[0],
                            o.fillRect(0, 0, 46, 18),
                            o.beginPath(),
                            o.moveTo(0, 0),
                            o.lineTo(0, 18),
                            o.lineTo(46, 18),
                            o.lineTo(46, 0),
                            o.lineTo(0, 0),
                            o.lineWidth = Store.devicePixelRatio,
                            o.strokeStyle = n[0],
                            o.stroke(),
                            o.closePath());
                    else if ("colorGradation" == a) {
                        var i = o.createLinearGradient(0, 0, 46, 0);
                        3 == n.length ? (i.addColorStop(0, n[0]),
                        i.addColorStop(.5, n[1]),
                        i.addColorStop(1, n[2])) : 2 == n.length && (i.addColorStop(0, n[0]),
                        i.addColorStop(1, n[1])),
                        o.fillStyle = i,
                        o.fillRect(0, 0, 46, 18)
                    } else if ("icons" == a) {
                        var s = n.len
                          , c = n.leftMin
                          , u = n.top
                          , h = 32 * s + 10 * (s - 1)
                          , d = 1472 / h;
                        "0" == c ? o.drawImage(luckysheet_CFiconsImg, 0, 32 * u, h, 32, 0, (18 - d) / 2, 46, d) : "5" == c && o.drawImage(luckysheet_CFiconsImg, 210, 32 * u, h, 32, 0, (18 - d) / 2, 46, d)
                    }
                }
                )),
                $("#luckysheet-administerRule-dialog .ruleList .listBox .item").eq(0).addClass("on")
            }
        },
        getConditionRuleName: function(e, t, r) {
            var a;
            a = null != t[0] ? chatatABC(t[0].column[0]) + (t[0].row[0] + 1) : r[0];
            var n, o = locale().conditionformat;
            if ("greaterThan" == e)
                return o.cellValue + " > " + a;
            if ("lessThan" == e)
                return o.cellValue + " < " + a;
            if ("betweenness" == e)
                return n = null != t[1] ? chatatABC(t[1].column[0]) + (t[1].row[0] + 1) : r[1],
                o.cellValue + " " + o.between + " " + a + " " + o.in + " " + n + " " + o.between2;
            if ("equal" == e)
                return o.cellValue + " = " + a;
            if ("textContains" == e)
                return o.cellValue + o.contain + " =" + a;
            if ("occurrenceDate" == e)
                return r;
            if ("duplicateValue" == e) {
                if ("0" == r)
                    return o.duplicateValue;
                if ("1" == r)
                    return o.uniqueValue
            } else {
                if ("top10" == e)
                    return o.top + " " + a + " " + o.oneself;
                if ("top10%" == e)
                    return o.top + " " + a + "% " + o.oneself;
                if ("last10" == e)
                    return o.last + " " + a + " " + o.oneself;
                if ("last10%" == e)
                    return o.last + " " + a + "% " + o.oneself;
                if ("AboveAverage" == e)
                    return o.aboveAverage;
                if ("SubAverage" == e)
                    return o.belowAverage
            }
        },
        newConditionRuleDialog: function(e) {
            var t = locale().conditionformat
              , r = this.getRuleExplain(0);
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-administerRule-dialog").hide(),
            $("#luckysheet-newConditionRule-dialog").remove();
            var a = '<div><div class="boxTitle">' + t.chooseRuleType + "：</div>" + this.ruleTypeHtml() + '<div class="boxTitle">' + t.editRuleDescription + '：</div><div class="ruleExplainBox">' + r + "</div></div>";
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-newConditionRule-dialog",
                addclass: "luckysheet-newEditorRule-dialog",
                title: t.newFormatRule,
                content: a,
                botton: '<button id="luckysheet-newConditionRule-dialog-confirm" class="btn btn-primary" data-source="'.concat(e, '">').concat(t.confirm, '</button>\n                        <button id="luckysheet-newConditionRule-dialog-close" class="btn btn-default" data-source="').concat(e, '">').concat(t.cancel, "</button>"),
                style: "z-index:100003"
            }));
            var n = $("#luckysheet-newConditionRule-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-newConditionRule-dialog").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show(),
            $("#luckysheet-newConditionRule-dialog .ruleTypeBox .ruleTypeItem:eq(0)").addClass("on").siblings().removeClass("on"),
            this.colorSelectInit()
        },
        editorConditionRuleDialog: function() {
            var e = locale().conditionformat
              , t = this.editorRule.data;
            if (null != t) {
                var r, a, n = t.type, o = t.format, l = t.conditionName;
                "dataBar" == n || "colorGradation" == n || "icons" == n ? (r = 0,
                a = n) : "greaterThan" == l || "lessThan" == l || "betweenness" == l || "equal" == l || "textContains" == l || "occurrenceDate" == l ? (r = 1,
                "greaterThan" == l || "lessThan" == l || "betweenness" == l || "equal" == l ? a = "number" : "textContains" == l ? a = "text" : "occurrenceDate" == l && (a = "date")) : "top10" == l || "top10%" == l || "last10" == l || "last10%" == l ? (r = 2,
                "top10" == l || "top10%" == l ? a = "top" : "last10" != l && "last10%" != l || (a = "last")) : "AboveAverage" == l || "SubAverage" == l ? (r = 3,
                a = l) : "duplicateValue" == l && (r = 4,
                a = t.conditionValue);
                var i = this.getRuleExplain(r);
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-administerRule-dialog").hide(),
                $("#luckysheet-editorConditionRule-dialog").remove();
                var s = '<div><div class="boxTitle">' + e.chooseRuleType + "：</div>" + this.ruleTypeHtml() + '<div class="boxTitle">' + e.editRuleDescription + '：</div><div class="ruleExplainBox">' + i + "</div></div>";
                $("body").append(replaceHtml$1(modelHTML, {
                    id: "luckysheet-editorConditionRule-dialog",
                    addclass: "luckysheet-newEditorRule-dialog",
                    title: e.editFormatRule,
                    content: s,
                    botton: '<button id="luckysheet-editorConditionRule-dialog-confirm" class="btn btn-primary">'.concat(e.confirm, '</button>\n                        <button id="luckysheet-editorConditionRule-dialog-close" class="btn btn-default">').concat(e.cancel, "</button>"),
                    style: "z-index:100003"
                }));
                var c = $("#luckysheet-editorConditionRule-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
                  , u = c.outerHeight()
                  , h = c.outerWidth()
                  , d = $(window).width()
                  , f = $(window).height()
                  , m = $(document).scrollLeft()
                  , p = $(document).scrollTop();
                if ($("#luckysheet-editorConditionRule-dialog").css({
                    left: (d + m - h) / 2,
                    top: (f + p - u) / 3
                }).show(),
                this.colorSelectInit(),
                $("#luckysheet-editorConditionRule-dialog .ruleTypeBox .ruleTypeItem:eq(" + r + ")").addClass("on").siblings().removeClass("on"),
                $("#luckysheet-editorConditionRule-dialog #type1").val(a),
                "dataBar" != a && "colorGradation" != a && "icons" != a && "number" != a && "text" != a && "date" != a || ($("#luckysheet-editorConditionRule-dialog ." + a + "Box").show(),
                $("#luckysheet-editorConditionRule-dialog ." + a + "Box").siblings().hide()),
                "date" == a && this.daterangeInit("luckysheet-editorConditionRule-dialog"),
                "dataBar" == n || "colorGradation" == n || "icons" == n) {
                    if ("dataBar" == a)
                        2 == o.length ? $("#luckysheet-editorConditionRule-dialog .dataBarBox #type2").val("gradient") : 1 == o.length && $("#luckysheet-editorConditionRule-dialog .dataBarBox #type2").val("solid"),
                        $("#luckysheet-editorConditionRule-dialog .dataBarBox .luckysheet-conditionformat-config-color").spectrum("set", o[0]);
                    else if ("colorGradation" == a)
                        3 == o.length ? ($("#luckysheet-editorConditionRule-dialog .colorGradationBox #type2").val("threeColor"),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal").show(),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("set", o[0]),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal .luckysheet-conditionformat-config-color").spectrum("set", o[1]),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("set", o[2])) : 2 == o.length && ($("#luckysheet-editorConditionRule-dialog .colorGradationBox #type2").val("twoColor"),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .midVal").hide(),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .maxVal .luckysheet-conditionformat-config-color").spectrum("set", o[0]),
                        $("#luckysheet-editorConditionRule-dialog .colorGradationBox .minVal .luckysheet-conditionformat-config-color").spectrum("set", o[1]));
                    else if ("icons" == a) {
                        var g = o.len
                          , y = o.leftMin
                          , v = o.top;
                        $("#luckysheet-editorConditionRule-dialog .iconsBox li").each((function(e, t) {
                            if ($(t).find("div").attr("data-len") == g && $(t).find("div").attr("data-leftmin") == y && $(t).find("div").attr("data-top") == v)
                                return $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").css("background-position", $(t).find("div").css("background-position")),
                                $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-len", $(t).find("div").attr("data-len")),
                                $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-leftmin", $(t).find("div").attr("data-leftmin")),
                                $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("data-top", $(t).find("div").attr("data-leftmin")),
                                $("#luckysheet-editorConditionRule-dialog .iconsBox .showbox .model").attr("title", $(t).find("div").attr("title")),
                                !0
                        }
                        ))
                    }
                } else {
                    var A, b;
                    if ("number" == a)
                        if ($("#luckysheet-editorConditionRule-dialog .numberBox #type2").val(l),
                        A = null != t.conditionRange[0] ? getRangetxt(Store.currentSheetIndex, {
                            row: t.conditionRange[0].row,
                            column: t.conditionRange[0].column
                        }, Store.currentSheetIndex) : t.conditionValue[0],
                        $("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal input").val(A),
                        "betweenness" == l)
                            $("#luckysheet-editorConditionRule-dialog .numberBox .txt").show(),
                            $("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2").show(),
                            b = null != t.conditionRange[1] ? getRangetxt(Store.currentSheetIndex, {
                                row: t.conditionRange[1].row,
                                column: t.conditionRange[1].column
                            }, Store.currentSheetIndex) : t.conditionValue[1],
                            $("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2 input").val(b);
                        else
                            $("#luckysheet-editorConditionRule-dialog .numberBox .txt").hide(),
                            $("#luckysheet-editorConditionRule-dialog .numberBox #conditionVal2").hide();
                    else if ("text" == a) {
                        var k;
                        k = null != t.conditionRange[0] ? getRangetxt(Store.currentSheetIndex, {
                            row: t.conditionRange[0].row,
                            column: t.conditionRange[0].column
                        }, Store.currentSheetIndex) : t.conditionValue[0],
                        $("#luckysheet-editorConditionRule-dialog .textBox #conditionVal input").val(k)
                    } else if ("date" == a) {
                        this.daterangeInit("luckysheet-editorConditionRule-dialog");
                        var w = t.conditionValue[0];
                        $("#luckysheet-editorConditionRule-dialog .dateBox #daterange-btn").val(w)
                    } else if ("top" == a || "last" == a) {
                        t.conditionValue[0];
                        "top10%" != l && "last10%" != l || $("#luckysheet-editorConditionRule-dialog #isPercent").attr("checked", "checked")
                    }
                    $("#luckysheet-editorConditionRule-dialog #textcolorshow").spectrum("set", o.textColor),
                    $("#luckysheet-editorConditionRule-dialog #cellcolorshow").spectrum("set", o.cellColor)
                }
            }
        },
        infoDialog: function(e, t) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-conditionformat-info-dialog").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-conditionformat-info-dialog",
                addclass: "",
                title: e,
                content: t,
                botton: '<button id="luckysheet-conditionformat-info-dialog-close" class="btn btn-default">'.concat(locale().conditionformat.close, "</button>"),
                style: "z-index:100003"
            }));
            var r = $("#luckysheet-conditionformat-info-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , a = r.outerHeight()
              , n = r.outerWidth()
              , o = $(window).width()
              , l = $(window).height()
              , i = $(document).scrollLeft()
              , s = $(document).scrollTop();
            $("#luckysheet-conditionformat-info-dialog").css({
                left: (o + i - n) / 2,
                top: (l + s - a) / 3
            }).show()
        },
        getRuleExplain: function(e) {
            var t, r = locale().conditionformat, a = this.textCellColorHtml();
            switch (e) {
            case 0:
                t = '<div class="title">'.concat(r.ruleTypeItem1, '：</div>\n                                    <div style="height: 30px;margin-bottom: 5px;">\n                                        <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.formatStyle, '：</label>\n                                        <select id="type1">\n                                            <option value="dataBar">').concat(r.dataBar, '</option>\n                                            <option value="colorGradation">').concat(r.colorGradation, '</option>\n                                            <option value="icons">').concat(r.icons, '</option>\n                                        </select>\n                                    </div>\n                                    <div>\n                                        <div class="type1Box dataBarBox">\n                                            <div style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.fillType, '：</label>\n                                                <select id="type2">\n                                                    <option value="gradient">').concat(r.gradient, '</option>\n                                                    <option value="solid">').concat(r.solid, '</option>\n                                                </select>\n                                            </div>\n                                            <div style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.color, '：</label>\n                                                <input data-tips="').concat(r.dataBarColor, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#638ec6" style="display: none;"> \n                                            </div>\n                                        </div>\n                                        <div class="type1Box colorGradationBox" style="display: none;">\n                                            <div style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.fillType, '：</label>\n                                                <select id="type2">\n                                                    <option value="threeColor">').concat(r.tricolor, '</option>\n                                                    <option value="twoColor">').concat(r.twocolor, '</option>\n                                                </select>\n                                            </div>\n                                            <div class="maxVal" style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.maxValue, '：</label>\n                                                <input data-tips="').concat(r.maxValue, " ").concat(r.color, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(99, 190, 123)" style="display: none;">\n                                            </div>\n                                            <div class="midVal" style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.medianValue, '：</label>\n                                                <input data-tips="').concat(r.medianValue, " ").concat(r.color, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(255, 235, 132)" style="display: none;">\n                                            </div>\n                                            <div class="minVal" style="height: 30px;margin-bottom: 5px;">\n                                                <label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">').concat(r.minValue, '：</label>\n                                                <input data-tips="').concat(r.minValue, " ").concat(r.color, '" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(248, 105, 107)" style="display: none;">\n                                            </div>\n                                        </div>\n                                        <div class="type1Box iconsBox" style="display: none;">\n                                            <label>').concat(r.fillType, '：</label>\n                                            <div class="showbox">\n                                                <div class="model" data-len="3" data-leftmin="0" data-top="0" title="').concat(r.threeWayArrow, "(").concat(r.multicolor, ')" style="background-position: 0 0;"></div>\n                                                <span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s" style="margin-top: 2px;"></span>\n                                            </div>\n                                            <ul>\n                                                <li><div data-len="3" data-leftmin="0" data-top="0" title="').concat(r.threeWayArrow, "(").concat(r.multicolor, ')" style="background-position: 0 0;"></div></li>\n                                                <li><div data-len="3" data-leftmin="5" data-top="0" title="').concat(r.threeWayArrow, "(").concat(r.grayColor, ')" style="background-position: -131px 0;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="1" title="').concat(r.threeTriangles, '" style="background-position: 0 -20px;"></div></li>\n                                                <li><div data-len="4" data-leftmin="0" data-top="2" title="').concat(r.fourWayArrow, "(").concat(r.multicolor, ')" style="background-position: 0 -40px;"></div></li>\n                                                <li><div data-len="4" data-leftmin="5" data-top="1" title="').concat(r.fourWayArrow, "(").concat(r.grayColor, ')" style="background-position: -131px -20px;"></div></li>\n                                                <li><div data-len="5" data-leftmin="0" data-top="3" title="').concat(r.fiveWayArrow, "(").concat(r.multicolor, ')" style="background-position: 0 -60px;"></div></li>\n                                                <li><div data-len="5" data-leftmin="5" data-top="2" title="').concat(r.fiveWayArrow, "(").concat(r.grayColor, ')" style="background-position: -131px -40px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="4" title="').concat(r.threeColorTrafficLight, "(").concat(r.rimless, ')" style="background-position: 0 -80px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="5" data-top="4" title="').concat(r.threeColorTrafficLight, "(").concat(r.bordered, ')" style="background-position: -131px -80px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="5" title="').concat(r.threeSigns, '" style="background-position: 0 -100px;"></div></li>\n                                                <li><div data-len="4" data-leftmin="5" data-top="5" title="').concat(r.fourColorTrafficLight, '" style="background-position: -131px -100px;"></div></li>\n                                                <li><div data-len="4" data-leftmin="0" data-top="6" title="').concat(r.greenRedBlackGradient, '" style="background-position: 0 -120px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="7" title="').concat(r.threeSymbols, "(").concat(r.circled, ')" style="background-position: 0 -140px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="5" data-top="7" title="').concat(r.threeSymbols, "(").concat(r.noCircle, ')" style="background-position: -131px -140px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="8" title="').concat(r.tricolorFlag, '" style="background-position: 0 -160px;"></div></li>\n                                                <li><div data-len="3" data-leftmin="0" data-top="9" title="').concat(r.threeStars, '" style="background-position: 0 -180px;"></div></li>\n                                                <li><div data-len="5" data-leftmin="0" data-top="10" title="').concat(r.fiveQuadrantDiagram, '" style="background-position: 0 -200px;"></div></li>\n                                                <li><div data-len="5" data-leftmin="0" data-top="11" title="').concat(r.fiveBoxes, '" style="background-position: 0 -220px;"></div></li>\n                                                <li><div data-len="4" data-leftmin="5" data-top="9" title="').concat(r.grade4, '" style="background-position: -131px -180px;"></div></li>\n                                                <li><div data-len="5" data-leftmin="5" data-top="10" title="').concat(r.grade5, '" style="background-position: -131px -200px;"></div></li>\n                                            </ul>\n                                        </div>\n                                    </div>');
                break;
            case 1:
                t = '<div class="title">'.concat(r.ruleTypeItem2_title, '：</div>\n                                    <div style="height: 30px;margin-bottom: 10px;">\n                                        <select id="type1">\n                                            <option value="number">').concat(r.cellValue, '</option>\n                                            <option value="text">').concat(r.specificText, '</option>\n                                            <option value="date">').concat(r.occurrence, '</option>\n                                        </select>\n                                        <div>\n                                            <div class="type1Box numberBox">\n                                                <select id="type2">\n                                                    <option value="greaterThan">').concat(r.greaterThan, '</option>\n                                                    <option value="lessThan">').concat(r.lessThan, '</option>\n                                                    <option value="betweenness">').concat(r.between, '</option>\n                                                    <option value="equal">').concat(r.equal, '</option>\n                                                </select>\n                                                <div class="inpbox range" id="conditionVal">\n                                                    <input class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(r.selectCell, '"></i>\n                                                </div>\n                                                <span class="txt" style="display: none;">').concat(r.in, '</span>\n                                                <div class="inpbox range" id="conditionVal2" style="display: none;">\n                                                    <input class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(r.selectDataRange, '"></i>\n                                                </div>\n                                            </div>\n                                            <div class="type1Box textBox" style="display: none;">\n                                                <select id="type2">\n                                                    <option value="">').concat(r.contain, '</option>\n                                                </select>\n                                                <div class="inpbox range" id="conditionVal">\n                                                    <input class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(r.selectCell, '"></i>\n                                                </div>\n                                            </div>\n                                            <div class="type1Box dateBox" style="display: none;">\n                                                <div style="width: 162px;" class="inpbox">\n                                                    <input style="width: 150px;" id="daterange-btn" readonly="readonly" placeholder="').concat(r.pleaseSelectADate, '"/>\n                                                </div>\n                                            </div>\n                                        </div>\n                                    </div>\n                                    <div class="title">').concat(r.setFormat, ": </div>").concat(a);
                break;
            case 2:
                t = '<div class="title">'.concat(r.ruleTypeItem3_title, '：</div>\n                                    <div style="height: 30px;margin-bottom: 10px;">\n                                        <select id="type1">\n                                            <option value="top">').concat(r.top, '</option>\n                                            <option value="last">').concat(r.last, '</option>\n                                        </select>\n                                        <div class="inpbox" id="conditionVal">\n                                            <input class="formulaInputFocus" type="number" value="10"/>\n                                        </div>\n                                        <input id="isPercent" type="checkbox"/>\n                                        <label for="isPercent" class="txt">').concat(r.selectRange_percent, '</label>\n                                    </div>\n                                    <div class="title">').concat(r.setFormat, "：</div>").concat(a);
                break;
            case 3:
                t = '<div class="title">'.concat(r.ruleTypeItem4_title, '：</div>\n                                    <div style="height: 30px;margin-bottom: 10px;">\n                                        <select id="type1">\n                                            <option value="AboveAverage">').concat(r.above, '</option>\n                                            <option value="SubAverage">').concat(r.below, '</option>\n                                        </select>\n                                        <span class="txt">').concat(r.selectRange_average, '</span>\n                                    </div>\n                                    <div class="title">').concat(r.setFormat, "：</div>").concat(a);
                break;
            case 4:
                t = '<div class="title">'.concat(r.all, '：</div>\n                                    <div style="height: 30px;margin-bottom: 10px;">\n                                        <select id="type1">\n                                            <option value="0">').concat(r.duplicateValue, '</option>\n                                            <option value="1">').concat(r.uniqueValue, '</option>\n                                        </select>\n                                        <span class="txt">').concat(r.selectRange_value, '</span>\n                                    </div>\n                                    <div class="title">').concat(r.setFormat, "：</div>").concat(a)
            }
            return t
        },
        daterangeInit: function(e) {
            var t, r = locale().conditionformat;
            $(".ranges_1 ul").remove(),
            $("#" + e).find("#daterange-btn").daterangepicker({
                ranges: (t = {},
                _defineProperty(t, r.yesterday, [moment().subtract(1, "days"), moment().subtract(1, "days")]),
                _defineProperty(t, r.today, [moment(), moment()]),
                _defineProperty(t, r.lastWeek, [moment(moment().subtract(1, "week")).subtract((new Date).getDay() - 1, "days"), moment().subtract((new Date).getDay(), "days")]),
                _defineProperty(t, r.thisWeek, [moment().subtract((new Date).getDay() - 1, "days"), moment().add(7 - (new Date).getDay(), "days")]),
                _defineProperty(t, r.lastMonth, [moment(moment().format("YYYY-MM")).subtract(1, "month"), moment(moment().format("YYYY-MM")).subtract(1, "day")]),
                _defineProperty(t, r.thisMonth, [moment().format("YYYY-MM"), moment(moment(moment().format("YYYY-MM")).add(1, "month")).subtract(1, "day")]),
                _defineProperty(t, r.lastYear, [moment(moment(moment().format("YYYY"))).subtract(1, "years").format("YYYY"), moment(moment().format("YYYY")).subtract(1, "day")]),
                _defineProperty(t, r.thisYear, [moment().format("YYYY"), moment(moment(moment().add(1, "years")).format("YYYY")).subtract(1, "day")]),
                _defineProperty(t, r.last7days, [moment().subtract(6, "days"), moment()]),
                _defineProperty(t, r.last30days, [moment().subtract(29, "days"), moment()]),
                t),
                startDate: moment(),
                endDate: moment()
            }, (function(e, t, a) {
                var n = [r.yesterday, r.today]
                  , o = [r.lastWeek, r.thisWeek, r.lastMonth, r.thisMonth, r.lastYear, r.thisYear, r.last7days, r.last30days];
                a == r.all ? $("#daterange-btn").val("") : n.indexOf(a) > -1 ? $("#daterange-btn").val(e.format("YYYY/MM/DD")) : o.indexOf(a) > -1 && $("#daterange-btn").val(e.format("YYYY/MM/DD") + "-" + t.format("YYYY/MM/DD"))
            }
            ))
        },
        CFSplitRange: function(e, t, r, a) {
            var n = []
              , o = r.row[0] - t.row[0]
              , l = r.column[0] - t.column[0]
              , i = e.row[0]
              , s = e.row[1]
              , c = e.column[0]
              , u = e.column[1];
            return i >= t.row[0] && s <= t.row[1] && c >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i + o, s + o],
                column: [c + l, u + l]
            }] : "restPart" == a ? n = [] : "operatePart" == a && (n = [{
                row: [i + o, s + o],
                column: [c + l, u + l]
            }]) : i >= t.row[0] && i <= t.row[1] && c >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [i + o, t.row[1] + o],
                column: [c + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, t.row[1] + o],
                column: [c + l, u + l]
            }]) : s >= t.row[0] && s <= t.row[1] && c >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0] + o, s + o],
                column: [c + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, s + o],
                column: [c + l, u + l]
            }]) : i < t.row[0] && s > t.row[1] && c >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [t.row[0] + o, t.row[1] + o],
                column: [c + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, t.row[1] + o],
                column: [c + l, u + l]
            }]) : c >= t.column[0] && c <= t.column[1] && i >= t.row[0] && s <= t.row[1] ? "allPart" == a ? n = [{
                row: [i, s],
                column: [t.column[1] + 1, u]
            }, {
                row: [i + o, s + o],
                column: [c + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, s],
                column: [t.column[1] + 1, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, s + o],
                column: [c + l, t.column[1] + l]
            }]) : u >= t.column[0] && u <= t.column[1] && i >= t.row[0] && s <= t.row[1] ? "allPart" == a ? n = [{
                row: [i, s],
                column: [c, t.column[0] - 1]
            }, {
                row: [i + o, s + o],
                column: [t.column[0] + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, s],
                column: [c, t.column[0] - 1]
            }] : "operatePart" == a && (n = [{
                row: [i + o, s + o],
                column: [t.column[0] + l, u + l]
            }]) : c < t.column[0] && u > t.column[1] && i >= t.row[0] && s <= t.row[1] ? "allPart" == a ? n = [{
                row: [i, s],
                column: [c, t.column[0] - 1]
            }, {
                row: [i, s],
                column: [t.column[1] + 1, u]
            }, {
                row: [i + o, s + o],
                column: [t.column[0] + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, s],
                column: [c, t.column[0] - 1]
            }, {
                row: [i, s],
                column: [t.column[1] + 1, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, s + o],
                column: [t.column[0] + l, t.column[1] + l]
            }]) : i >= t.row[0] && i <= t.row[1] && c >= t.column[0] && c <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [i + o, t.row[1] + o],
                column: [c + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, t.row[1] + o],
                column: [c + l, t.column[1] + l]
            }]) : i >= t.row[0] && i <= t.row[1] && u >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [i + o, t.row[1] + o],
                column: [t.column[0] + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, t.row[1] + o],
                column: [t.column[0] + l, u + l]
            }]) : s >= t.row[0] && s <= t.row[1] && c >= t.column[0] && c <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[0] + o, s + o],
                column: [c + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [t.column[1] + 1, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, s + o],
                column: [c + l, t.column[1] + l]
            }]) : s >= t.row[0] && s <= t.row[1] && u >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[0] + o, s + o],
                column: [t.column[0] + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [c, t.column[0] - 1]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, s + o],
                column: [t.column[0] + l, u + l]
            }]) : i < t.row[0] && s > t.row[1] && c >= t.column[0] && c <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [t.row[0] + o, t.row[1] + o],
                column: [c + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, t.row[1] + o],
                column: [c + l, t.column[1] + l]
            }]) : i < t.row[0] && s > t.row[1] && u >= t.column[0] && u <= t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [t.row[0] + o, t.row[1] + o],
                column: [t.column[0] + l, u + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, t.row[1] + o],
                column: [t.column[0] + l, u + l]
            }]) : c < t.column[0] && u > t.column[1] && i >= t.row[0] && i <= t.row[1] ? "allPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [i, t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [i + o, t.row[1] + o],
                column: [t.column[0] + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [i, t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [i + o, t.row[1] + o],
                column: [t.column[0] + l, t.column[1] + l]
            }]) : c < t.column[0] && u > t.column[1] && s >= t.row[0] && s <= t.row[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[0], s],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[0] + o, s + o],
                column: [t.column[0] + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], s],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[0], s],
                column: [t.column[1] + 1, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, s + o],
                column: [t.column[0] + l, t.column[1] + l]
            }]) : i < t.row[0] && s > t.row[1] && c < t.column[0] && u > t.column[1] ? "allPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[0], t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }, {
                row: [t.row[0] + o, t.row[1] + o],
                column: [t.column[0] + l, t.column[1] + l]
            }] : "restPart" == a ? n = [{
                row: [i, t.row[0] - 1],
                column: [c, u]
            }, {
                row: [t.row[0], t.row[1]],
                column: [c, t.column[0] - 1]
            }, {
                row: [t.row[0], t.row[1]],
                column: [t.column[1] + 1, u]
            }, {
                row: [t.row[1] + 1, s],
                column: [c, u]
            }] : "operatePart" == a && (n = [{
                row: [t.row[0] + o, t.row[1] + o],
                column: [t.column[0] + l, t.column[1] + l]
            }]) : "allPart" == a || "restPart" == a ? n = [{
                row: [i, s],
                column: [c, u]
            }] : "operatePart" == a && (n = []),
            n
        },
        getcolorGradation: function(e, t, r, a, n) {
            var o = e.split(",")
              , l = parseInt(o[0].split("(")[1])
              , i = parseInt(o[1])
              , s = parseInt(o[2].split(")")[0])
              , c = t.split(",")
              , u = parseInt(c[0].split("(")[1])
              , h = parseInt(c[1])
              , d = parseInt(c[2].split(")")[0]);
            return "rgb(" + Math.round(l - (l - u) / (r - a) * (r - n)) + ", " + Math.round(i - (i - h) / (r - a) * (r - n)) + ", " + Math.round(s - (s - d) / (r - a) * (r - n)) + ")"
        },
        getCFPartRange: function(e, t, r) {
            var a = []
              , n = Store.luckysheetfile[getSheetIndex(e)].luckysheet_conditionformat_save;
            if (null != n && n.length > 0)
                e: for (var o = 0; o < n.length; o++)
                    for (var l = n[o].cellrange, i = 0; i < l.length; i++)
                        for (var s = l[i].row[0], c = l[i].row[1], u = l[i].column[0], h = l[i].column[1], d = 0; d < range.length; d++)
                            if (range[d].row[0] >= s && range[d].row[0] <= c || range[d].row[1] >= s && range[d].row[1] <= c || range[d].column[0] >= u && range[d].column[0] <= h || range[d].column[1] >= u && range[d].column[1] <= h) {
                                a.push(n[o]);
                                continue e
                            }
            return a
        },
        checksCF: function(e, t, r) {
            return null != r && e + "_" + t in r ? r[e + "_" + t] : null
        },
        getComputeMap: function(e) {
            var t = getSheetIndex(Store.currentSheetIndex);
            null != e && (t = getSheetIndex(e));
            var r = Store.luckysheetfile[t].luckysheet_conditionformat_save
              , a = Store.luckysheetfile[t].data;
            return null == a ? null : this.compute(r, a)
        },
        compute: function(e, t) {
            null == e && (e = []);
            var r = {};
            if (e.length > 0)
                for (var a = 0; a < e.length; a++) {
                    var n = e[a].type
                      , o = e[a].cellrange
                      , l = e[a].format;
                    if ("dataBar" == n) {
                        for (var i = null, s = null, c = 0; c < o.length; c++)
                            for (var u = o[c].row[0]; u <= o[c].row[1]; u++)
                                for (var h = o[c].column[0]; h <= o[c].column[1]; h++)
                                    if (null != t[u] && null != t[u][h]) {
                                        var d = t[u][h];
                                        "object" == getObjType(d) && null != d.ct && "n" == d.ct.t && null != d.v && ((null == i || parseInt(d.v) > i) && (i = parseInt(d.v)),
                                        (null == s || parseInt(d.v) < s) && (s = parseInt(d.v)))
                                    }
                        if (null != i && null != s)
                            if (s < 0) {
                                for (var f = Math.round(i / (i - s) * 10) / 10, m = Math.round(Math.abs(s) / (i - s) * 10) / 10, p = 0; p < o.length; p++)
                                    for (var g = o[p].row[0]; g <= o[p].row[1]; g++)
                                        for (var y = o[p].column[0]; y <= o[p].column[1]; y++)
                                            if (null != t[g] && null != t[g][y]) {
                                                var v = t[g][y];
                                                if ("object" == getObjType(v) && null != v.ct && "n" == v.ct.t && null != v.v) {
                                                    if (parseInt(v.v) < 0) {
                                                        var A = Math.round(Math.abs(parseInt(v.v)) / Math.abs(s) * 100) / 100;
                                                        g + "_" + y in r ? r[g + "_" + y].dataBar = {
                                                            valueType: "minus",
                                                            minusLen: m,
                                                            valueLen: A,
                                                            format: l
                                                        } : r[g + "_" + y] = {
                                                            dataBar: {
                                                                valueType: "minus",
                                                                minusLen: m,
                                                                valueLen: A,
                                                                format: l
                                                            }
                                                        }
                                                    }
                                                    if (parseInt(v.v) > 0) {
                                                        var b = Math.round(parseInt(v.v) / i * 100) / 100;
                                                        g + "_" + y in r ? r[g + "_" + y].dataBar = {
                                                            valueType: "plus",
                                                            plusLen: f,
                                                            minusLen: m,
                                                            valueLen: b,
                                                            format: l
                                                        } : r[g + "_" + y] = {
                                                            dataBar: {
                                                                valueType: "plus",
                                                                plusLen: f,
                                                                minusLen: m,
                                                                valueLen: b,
                                                                format: l
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                            } else
                                for (var k = 0; k < o.length; k++)
                                    for (var w = o[k].row[0]; w <= o[k].row[1]; w++)
                                        for (var x = o[k].column[0]; x <= o[k].column[1]; x++)
                                            if (null != t[w] && null != t[w][x]) {
                                                var S = t[w][x];
                                                if ("object" == getObjType(S) && null != S.ct && "n" == S.ct.t && null != S.v) {
                                                    var _ = void 0;
                                                    _ = 0 == i ? 1 : Math.round(parseInt(S.v) / i * 100) / 100,
                                                    w + "_" + x in r ? r[w + "_" + x].dataBar = {
                                                        valueType: "plus",
                                                        plusLen: 1,
                                                        valueLen: _,
                                                        format: l
                                                    } : r[w + "_" + x] = {
                                                        dataBar: {
                                                            valueType: "plus",
                                                            plusLen: 1,
                                                            valueLen: _,
                                                            format: l
                                                        }
                                                    }
                                                }
                                            }
                    } else if ("colorGradation" == n) {
                        for (var C = null, T = null, E = 0, I = 0, R = 0; R < o.length; R++)
                            for (var B = o[R].row[0]; B <= o[R].row[1]; B++)
                                for (var N = o[R].column[0]; N <= o[R].column[1]; N++)
                                    if (null != t[B] && null != t[B][N]) {
                                        var F = t[B][N];
                                        "object" == getObjType(F) && null != F.ct && "n" == F.ct.t && null != F.v && (I++,
                                        E += parseInt(F.v),
                                        (null == C || parseInt(F.v) > C) && (C = parseInt(F.v)),
                                        (null == T || parseInt(F.v) < T) && (T = parseInt(F.v)))
                                    }
                        if (null != C && null != T)
                            if (3 == l.length) {
                                for (var P = Math.floor(E / I), $ = 0; $ < o.length; $++)
                                    for (var L = o[$].row[0]; L <= o[$].row[1]; L++)
                                        for (var O = o[$].column[0]; O <= o[$].column[1]; O++)
                                            if (null != t[L] && null != t[L][O]) {
                                                var D = t[L][O];
                                                "object" == getObjType(D) && null != D.ct && "n" == D.ct.t && null != D.v && (parseInt(D.v) == T ? L + "_" + O in r ? r[L + "_" + O].cellColor = l[2] : r[L + "_" + O] = {
                                                    cellColor: l[2]
                                                } : parseInt(D.v) > T && parseInt(D.v) < P ? L + "_" + O in r ? r[L + "_" + O].cellColor = this.getcolorGradation(l[2], l[1], T, P, parseInt(D.v)) : r[L + "_" + O] = {
                                                    cellColor: this.getcolorGradation(l[2], l[1], T, P, parseInt(D.v))
                                                } : parseInt(D.v) == P ? L + "_" + O in r ? r[L + "_" + O].cellColor = l[1] : r[L + "_" + O] = {
                                                    cellColor: l[1]
                                                } : parseInt(D.v) > P && parseInt(D.v) < C ? L + "_" + O in r ? r[L + "_" + O].cellColor = this.getcolorGradation(l[1], l[0], P, C, parseInt(D.v)) : r[L + "_" + O] = {
                                                    cellColor: this.getcolorGradation(l[1], l[0], P, C, parseInt(D.v))
                                                } : parseInt(D.v) == C && (L + "_" + O in r ? r[L + "_" + O].cellColor = l[0] : r[L + "_" + O] = {
                                                    cellColor: l[0]
                                                }))
                                            }
                            } else if (2 == l.length)
                                for (var M = 0; M < o.length; M++)
                                    for (var U = o[M].row[0]; U <= o[M].row[1]; U++)
                                        for (var H = o[M].column[0]; H <= o[M].column[1]; H++)
                                            if (null != t[U] && null != t[U][H]) {
                                                var q = t[U][H];
                                                "object" == getObjType(q) && null != q.ct && "n" == q.ct.t && null != q.v && (parseInt(q.v) == T ? U + "_" + H in r ? r[U + "_" + H].cellColor = l[1] : r[U + "_" + H] = {
                                                    cellColor: l[1]
                                                } : parseInt(q.v) > T && parseInt(q.v) < C ? U + "_" + H in r ? r[U + "_" + H].cellColor = this.getcolorGradation(l[1], l[0], T, C, parseInt(q.v)) : r[U + "_" + H] = {
                                                    cellColor: this.getcolorGradation(l[1], l[0], T, C, parseInt(q.v))
                                                } : parseInt(q.v) == C && (U + "_" + H in r ? r[U + "_" + H].cellColor = l[0] : r[U + "_" + H] = {
                                                    cellColor: l[0]
                                                }))
                                            }
                    } else if ("icons" == n) {
                        for (var z = parseInt(l.len), j = parseInt(l.leftMin), V = parseInt(l.top), Q = null, G = null, K = 0; K < o.length; K++)
                            for (var W = o[K].row[0]; W <= o[K].row[1]; W++)
                                for (var Y = o[K].column[0]; Y <= o[K].column[1]; Y++)
                                    if (null != t[W] && null != t[W][Y]) {
                                        var X = t[W][Y];
                                        "object" == getObjType(X) && null != X.ct && "n" == X.ct.t && null != X.v && ((null == Q || parseInt(X.v) > Q) && (Q = parseInt(X.v)),
                                        (null == G || parseInt(X.v) < G) && (G = parseInt(X.v)))
                                    }
                        if (null != Q && null != G) {
                            var J = Math.floor((Q - G + 1) / z)
                              , Z = (Q - G + 1) % z;
                            if (3 == z) {
                                var ee = void 0
                                  , te = void 0
                                  , re = void 0;
                                2 == Z ? (ee = [G, G + J],
                                te = [G + J + 1, G + 2 * J],
                                re = [G + 2 * J + 1, Q]) : (ee = [G, G + J - 1],
                                te = [G + J, G + 2 * J - 1],
                                re = [G + 2 * J, Q]);
                                for (var ae = 0; ae < o.length; ae++)
                                    for (var ne = o[ae].row[0]; ne <= o[ae].row[1]; ne++)
                                        for (var oe = o[ae].column[0]; oe <= o[ae].column[1]; oe++)
                                            if (null != t[ne] && null != t[ne][oe]) {
                                                var le = t[ne][oe];
                                                "object" == getObjType(le) && null != le.ct && "n" == le.ct.t && null != le.v && (parseInt(le.v) >= ee[0] && parseInt(le.v) <= ee[1] ? ne + "_" + oe in r ? r[ne + "_" + oe].icons = {
                                                    left: j + 2,
                                                    top: V
                                                } : r[ne + "_" + oe] = {
                                                    icons: {
                                                        left: j + 2,
                                                        top: V
                                                    }
                                                } : parseInt(le.v) >= te[0] && parseInt(le.v) <= te[1] ? ne + "_" + oe in r ? r[ne + "_" + oe].icons = {
                                                    left: j + 1,
                                                    top: V
                                                } : r[ne + "_" + oe] = {
                                                    icons: {
                                                        left: j + 1,
                                                        top: V
                                                    }
                                                } : parseInt(le.v) >= re[0] && parseInt(le.v) <= re[1] && (ne + "_" + oe in r ? r[ne + "_" + oe].icons = {
                                                    left: j,
                                                    top: V
                                                } : r[ne + "_" + oe] = {
                                                    icons: {
                                                        left: j,
                                                        top: V
                                                    }
                                                }))
                                            }
                            } else if (4 == z) {
                                var ie = void 0
                                  , se = void 0
                                  , ce = void 0
                                  , ue = void 0;
                                2 == Z ? (ie = [G, G + J],
                                se = [G + J + 1, G + 2 * J],
                                ce = [G + 2 * J + 1, G + 3 * J],
                                ue = [G + 3 * J + 1, Q]) : 3 == Z ? (ie = [G, G + J],
                                se = [G + J + 1, G + 2 * J],
                                ce = [G + 2 * J + 1, G + 3 * J + 1],
                                ue = [G + 3 * J + 2, Q]) : (ie = [G, G + J - 1],
                                se = [G + J, G + 2 * J - 1],
                                ce = [G + 2 * J, G + 3 * J - 1],
                                ue = [G + 3 * J, Q]);
                                for (var he = 0; he < o.length; he++)
                                    for (var de = o[he].row[0]; de <= o[he].row[1]; de++)
                                        for (var fe = o[he].column[0]; fe <= o[he].column[1]; fe++)
                                            if (null != t[de] && null != t[de][fe]) {
                                                var me = t[de][fe];
                                                "object" == getObjType(me) && null != me.ct && "n" == me.ct.t && null != me.v && (parseInt(me.v) >= ie[0] && parseInt(me.v) <= ie[1] ? de + "_" + fe in r ? r[de + "_" + fe].icons = {
                                                    left: j + 3,
                                                    top: V
                                                } : r[de + "_" + fe] = {
                                                    icons: {
                                                        left: j + 3,
                                                        top: V
                                                    }
                                                } : parseInt(me.v) >= se[0] && parseInt(me.v) <= se[1] ? de + "_" + fe in r ? r[de + "_" + fe].icons = {
                                                    left: j + 2,
                                                    top: V
                                                } : r[de + "_" + fe] = {
                                                    icons: {
                                                        left: j + 2,
                                                        top: V
                                                    }
                                                } : parseInt(me.v) >= ce[0] && parseInt(me.v) <= ce[1] ? de + "_" + fe in r ? r[de + "_" + fe].icons = {
                                                    left: j + 1,
                                                    top: V
                                                } : r[de + "_" + fe] = {
                                                    icons: {
                                                        left: j + 1,
                                                        top: V
                                                    }
                                                } : parseInt(me.v) >= ue[0] && parseInt(me.v) <= ue[1] && (de + "_" + fe in r ? r[de + "_" + fe].icons = {
                                                    left: j,
                                                    top: V
                                                } : r[de + "_" + fe] = {
                                                    icons: {
                                                        left: j,
                                                        top: V
                                                    }
                                                }))
                                            }
                            } else if (5 == z) {
                                var pe = void 0
                                  , ge = void 0
                                  , ye = void 0
                                  , ve = void 0
                                  , Ae = void 0;
                                2 == Z ? (pe = [G, G + J],
                                ge = [G + J + 1, G + 2 * J],
                                ye = [G + 2 * J + 1, G + 3 * J],
                                ve = [G + 3 * J + 1, G + 4 * J],
                                Ae = [G + 4 * J + 1, Q]) : 3 == Z ? (pe = [G, G + J],
                                ge = [G + J + 1, G + 2 * J],
                                ye = [G + 2 * J + 1, G + 3 * J + 1],
                                ve = [G + 3 * J + 2, G + 4 * J + 1],
                                Ae = [G + 4 * J + 2, Q]) : 4 == Z ? (pe = [G, G + J],
                                ge = [G + J + 1, G + 2 * J + 1],
                                ye = [G + 2 * J + 2, G + 3 * J + 1],
                                ve = [G + 3 * J + 2, G + 4 * J + 2],
                                Ae = [G + 4 * J + 3, Q]) : (pe = [G, G + J - 1],
                                ge = [G + J, G + 2 * J - 1],
                                ye = [G + 2 * J, G + 3 * J - 1],
                                ve = [G + 3 * J, G + 4 * J - 1],
                                Ae = [G + 4 * J, Q]);
                                for (var be = 0; be < o.length; be++)
                                    for (var ke = o[be].row[0]; ke <= o[be].row[1]; ke++)
                                        for (var we = o[be].column[0]; we <= o[be].column[1]; we++)
                                            if (null != t[ke] && null != t[ke][we]) {
                                                var xe = t[ke][we];
                                                "object" == getObjType(xe) && null != xe.ct && "n" == xe.ct.t && null != xe.v && (parseInt(xe.v) >= pe[0] && parseInt(xe.v) <= pe[1] ? ke + "_" + we in r ? r[ke + "_" + we].icons = {
                                                    left: j + 4,
                                                    top: V
                                                } : r[ke + "_" + we] = {
                                                    icons: {
                                                        left: j + 4,
                                                        top: V
                                                    }
                                                } : parseInt(xe.v) >= ge[0] && parseInt(xe.v) <= ge[1] ? ke + "_" + we in r ? r[ke + "_" + we].icons = {
                                                    left: j + 3,
                                                    top: V
                                                } : r[ke + "_" + we] = {
                                                    icons: {
                                                        left: j + 3,
                                                        top: V
                                                    }
                                                } : parseInt(xe.v) >= ye[0] && parseInt(xe.v) <= ye[1] ? ke + "_" + we in r ? r[ke + "_" + we].icons = {
                                                    left: j + 2,
                                                    top: V
                                                } : r[ke + "_" + we] = {
                                                    icons: {
                                                        left: j + 2,
                                                        top: V
                                                    }
                                                } : parseInt(xe.v) >= ve[0] && parseInt(xe.v) <= ve[1] ? ke + "_" + we in r ? r[ke + "_" + we].icons = {
                                                    left: j + 1,
                                                    top: V
                                                } : r[ke + "_" + we] = {
                                                    icons: {
                                                        left: j + 1,
                                                        top: V
                                                    }
                                                } : parseInt(xe.v) >= Ae[0] && parseInt(xe.v) <= Ae[1] && (ke + "_" + we in r ? r[ke + "_" + we].icons = {
                                                    left: j,
                                                    top: V
                                                } : r[ke + "_" + we] = {
                                                    icons: {
                                                        left: j,
                                                        top: V
                                                    }
                                                }))
                                            }
                            }
                        }
                    } else
                        for (var Se = e[a].conditionName, _e = e[a].conditionValue[0], Ce = e[a].conditionValue[1], Te = l.textColor, Ee = l.cellColor, Ie = 0; Ie < o.length; Ie++)
                            if ("greaterThan" == Se || "lessThan" == Se || "equal" == Se || "textContains" == Se) {
                                for (var Re = o[Ie].row[0]; Re <= o[Ie].row[1]; Re++)
                                    for (var Be = o[Ie].column[0]; Be <= o[Ie].column[1]; Be++)
                                        if (null != t[Re] && null != t[Re][Be]) {
                                            var Ne = t[Re][Be];
                                            "object" != getObjType(Ne) || isRealNull(Ne.v) || ("greaterThan" == Se && Ne.v > _e || "lessThan" == Se && Ne.v < _e || "equal" == Se && Ne.v == _e || "textContains" == Se && -1 != Ne.v.toString().indexOf(_e)) && (Re + "_" + Be in r ? (r[Re + "_" + Be].textColor = Te,
                                            r[Re + "_" + Be].cellColor = Ee) : r[Re + "_" + Be] = {
                                                textColor: Te,
                                                cellColor: Ee
                                            })
                                        }
                            } else if ("betweenness" == Se) {
                                var Fe = void 0
                                  , Pe = void 0;
                                _e > Ce ? (Fe = _e,
                                Pe = Ce) : (Fe = Ce,
                                Pe = _e);
                                for (var $e = o[Ie].row[0]; $e <= o[Ie].row[1]; $e++)
                                    for (var Le = o[Ie].column[0]; Le <= o[Ie].column[1]; Le++)
                                        if (null != t[$e] && null != t[$e][Le]) {
                                            var Oe = t[$e][Le];
                                            "object" != getObjType(Oe) || isRealNull(Oe.v) || Oe.v >= Pe && Oe.v <= Fe && ($e + "_" + Le in r ? (r[$e + "_" + Le].textColor = Te,
                                            r[$e + "_" + Le].cellColor = Ee) : r[$e + "_" + Le] = {
                                                textColor: Te,
                                                cellColor: Ee
                                            })
                                        }
                            } else if ("occurrenceDate" == Se) {
                                var De = void 0
                                  , Me = void 0;
                                if (-1 == _e.toString().indexOf("-"))
                                    De = genarate(_e)[2],
                                    Me = genarate(_e)[2];
                                else {
                                    var Ue = _e.toString().split("-");
                                    De = genarate(Ue[1].trim())[2],
                                    Me = genarate(Ue[0].trim())[2]
                                }
                                for (var He = o[Ie].row[0]; He <= o[Ie].row[1]; He++)
                                    for (var qe = o[Ie].column[0]; qe <= o[Ie].column[1]; qe++)
                                        if (null != t[He] && null != t[He][qe] && null != t[He][qe].ct && "d" == t[He][qe].ct.t) {
                                            var ze = getcellvalue(He, qe, t);
                                            ze >= Me && ze <= De && (He + "_" + qe in r ? (r[He + "_" + qe].textColor = Te,
                                            r[He + "_" + qe].cellColor = Ee) : r[He + "_" + qe] = {
                                                textColor: Te,
                                                cellColor: Ee
                                            })
                                        }
                            } else if ("duplicateValue" == Se) {
                                for (var je = {}, Ve = o[Ie].row[0]; Ve <= o[Ie].row[1]; Ve++)
                                    for (var Qe = o[Ie].column[0]; Qe <= o[Ie].column[1]; Qe++) {
                                        var Ge = getcellvalue(Ve, Qe, t);
                                        Ge in je || (je[Ge] = []),
                                        je[Ge].push({
                                            r: Ve,
                                            c: Qe
                                        })
                                    }
                                if ("0" == _e)
                                    for (var Ke in je)
                                        if ("null" != Ke && "undefined" != Ke && je[Ke].length > 1)
                                            for (var We = 0; We < je[Ke].length; We++)
                                                je[Ke][We].r + "_" + je[Ke][We].c in r ? (r[je[Ke][We].r + "_" + je[Ke][We].c].textColor = Te,
                                                r[je[Ke][We].r + "_" + je[Ke][We].c].cellColor = Ee) : r[je[Ke][We].r + "_" + je[Ke][We].c] = {
                                                    textColor: Te,
                                                    cellColor: Ee
                                                };
                                if ("1" == _e)
                                    for (var Ye in je)
                                        "null" != Ye && "undefined" != Ye && 1 == je[Ye].length && (je[Ye][0].r + "_" + je[Ye][0].c in r ? (r[je[Ye][0].r + "_" + je[Ye][0].c].textColor = Te,
                                        r[je[Ye][0].r + "_" + je[Ye][0].c].cellColor = Ee) : r[je[Ye][0].r + "_" + je[Ye][0].c] = {
                                            textColor: Te,
                                            cellColor: Ee
                                        })
                            } else if ("top10" == Se || "top10%" == Se || "last10" == Se || "last10%" == Se || "AboveAverage" == Se || "SubAverage" == Se) {
                                for (var Xe = [], Je = o[Ie].row[0]; Je <= o[Ie].row[1]; Je++)
                                    for (var Ze = o[Ie].column[0]; Ze <= o[Ie].column[1]; Ze++)
                                        null != t[Je] && null != t[Je][Ze] && null != t[Je][Ze].ct && "n" == t[Je][Ze].ct.t && Xe.push(getcellvalue(Je, Ze, t));
                                if ("top10" == Se || "top10%" == Se || "last10" == Se || "last10%" == Se) {
                                    for (var et = 0; et < Xe.length; et++)
                                        for (var tt = 0; tt < Xe.length - 1 - et; tt++)
                                            if (Xe[tt] < Xe[tt + 1]) {
                                                var rt = Xe[tt];
                                                Xe[tt] = Xe[tt + 1],
                                                Xe[tt + 1] = rt
                                            }
                                    var at = void 0;
                                    "top10" == Se ? at = Xe.slice(0, _e) : "top10%" == Se ? at = Xe.slice(0, Math.floor(_e * Xe.length / 100)) : "last10" == Se ? at = Xe.slice(Xe.length - _e, Xe.length) : "last10%" == Se && (at = Xe.slice(Xe.length - Math.floor(_e * Xe.length / 100), Xe.length));
                                    for (var nt = o[Ie].row[0]; nt <= o[Ie].row[1]; nt++)
                                        for (var ot = o[Ie].column[0]; ot <= o[Ie].column[1]; ot++)
                                            if (null != t[nt] && null != t[nt][ot]) {
                                                var lt = getcellvalue(nt, ot, t);
                                                -1 != at.indexOf(lt) && (nt + "_" + ot in r ? (r[nt + "_" + ot].textColor = Te,
                                                r[nt + "_" + ot].cellColor = Ee) : r[nt + "_" + ot] = {
                                                    textColor: Te,
                                                    cellColor: Ee
                                                })
                                            }
                                } else if ("AboveAverage" == Se || "SubAverage" == Se) {
                                    for (var it = 0, st = 0; st < Xe.length; st++)
                                        it += Xe[st];
                                    var ct = it / Xe.length;
                                    if ("AboveAverage" == Se)
                                        for (var ut = o[Ie].row[0]; ut <= o[Ie].row[1]; ut++)
                                            for (var ht = o[Ie].column[0]; ht <= o[Ie].column[1]; ht++) {
                                                if (null != t[ut] && null != t[ut][ht])
                                                    getcellvalue(ut, ht, t) > ct && (ut + "_" + ht in r ? (r[ut + "_" + ht].textColor = Te,
                                                    r[ut + "_" + ht].cellColor = Ee) : r[ut + "_" + ht] = {
                                                        textColor: Te,
                                                        cellColor: Ee
                                                    })
                                            }
                                    else if ("SubAverage" == Se)
                                        for (var dt = o[Ie].row[0]; dt <= o[Ie].row[1]; dt++)
                                            for (var ft = o[Ie].column[0]; ft <= o[Ie].column[1]; ft++) {
                                                if (null != t[dt] && null != t[dt][ft])
                                                    getcellvalue(dt, ft, t) < ct && (dt + "_" + ft in r ? (r[dt + "_" + ft].textColor = Te,
                                                    r[dt + "_" + ft].cellColor = Ee) : r[dt + "_" + ft] = {
                                                        textColor: Te,
                                                        cellColor: Ee
                                                    })
                                            }
                                }
                            }
                }
            return r
        },
        updateItem: function(e, t, r) {
            if (checkProtectionFormatCells(Store.currentSheetIndex)) {
                var a, n = getSheetIndex(Store.currentSheetIndex), o = $.extend(!0, [], Store.luckysheetfile), l = this.getHistoryRules(o);
                if ("delSheet" == e)
                    a = [];
                else {
                    var i = {
                        type: e,
                        cellrange: t,
                        format: r
                    };
                    (a = null == Store.luckysheetfile[n].luckysheet_conditionformat_save ? [] : Store.luckysheetfile[n].luckysheet_conditionformat_save).push(i)
                }
                Store.luckysheetfile[n].luckysheet_conditionformat_save = a;
                var s = $.extend(!0, [], Store.luckysheetfile)
                  , c = this.getCurrentRules(s);
                this.ref(l, c),
                server.allowUpdate && server.saveParam("all", Store.currentSheetIndex, a, {
                    k: "luckysheet_conditionformat_save"
                })
            }
        },
        getHistoryRules: function(e) {
            for (var t = [], r = 0; r < e.length; r++)
                t.push({
                    sheetIndex: e[r].index,
                    luckysheet_conditionformat_save: e[r].luckysheet_conditionformat_save
                });
            return t
        },
        getCurrentRules: function(e) {
            for (var t = [], r = 0; r < e.length; r++)
                t.push({
                    sheetIndex: e[r].index,
                    luckysheet_conditionformat_save: e[r].luckysheet_conditionformat_save
                });
            return t
        },
        ref: function(e, t) {
            if (Store.clearjfundo) {
                Store.jfundo = [];
                var r = {
                    type: "updateCF"
                };
                r.data = {
                    historyRules: e,
                    currentRules: t
                },
                Store.jfredo.push(r)
            }
            setTimeout((function() {
                luckysheetrefreshgrid()
            }
            ), 1)
        }
    }
      , selection = {
        clearcopy: function(e) {
            var t = window.clipboardData;
            t || e && (t = e.originalEvent.clipboardData);
            if (Store.luckysheet_selection_range = [],
            selectionCopyShow(),
            t)
                return t.setData("Text", " "),
                !1;
            var r = $("#luckysheet-copy-content").css("visibility", "hidden");
            r.val(" "),
            r.focus(),
            r.select(),
            setTimeout((function() {
                r.blur().css("visibility", "visible")
            }
            ), 10)
        },
        getHtmlBorderStyle: function(e, t) {
            var r = "";
            return (e = {
                0: "none",
                1: "Thin",
                2: "Hair",
                3: "Dotted",
                4: "Dashed",
                5: "DashDot",
                6: "DashDotDot",
                7: "Double",
                8: "Medium",
                9: "MediumDashed",
                10: "MediumDashDot",
                11: "MediumDashDotDot",
                12: "SlantedDashDot",
                13: "Thick"
            }[e.toString()]).indexOf("Medium") > -1 ? r += "1pt " : r += "Thick" == e ? "1.5pt " : "0.5pt ",
            "Hair" == e ? r += "double " : e.indexOf("DashDotDot") > -1 ? r += "dotted " : e.indexOf("DashDot") > -1 ? r += "dashed " : e.indexOf("Dotted") > -1 ? r += "dotted " : e.indexOf("Dashed") > -1 ? r += "dashed " : r += "solid ",
            r + t + ";"
        },
        copy: function(e) {
            var t = window.clipboardData;
            t || (t = e.originalEvent.clipboardData),
            Store.luckysheet_selection_range = [];
            for (var r = [], a = [], n = [], o = !1, l = !1, i = 0; i < Store.luckysheet_select_save.length; i++) {
                for (var s = Store.luckysheet_select_save[i], c = s.row[0], u = s.row[1], h = s.column[0], d = s.column[1], f = c; f <= u; f++)
                    if (null == Store.config.rowhidden || null == Store.config.rowhidden[f]) {
                        r.includes(f) || r.push(f),
                        null != Store.config.rowlen && f in Store.config.rowlen && (o = !0);
                        for (var m = h; m <= d; m++)
                            if (null == Store.config.colhidden || null == Store.config.colhidden[m]) {
                                a.includes(m) || a.push(m);
                                var p = Store.flowdata[f][m];
                                "object" == getObjType(p) && "mc"in p && null != p.mc.rs && (l = !0)
                            }
                    }
                Store.luckysheet_selection_range.push({
                    row: s.row,
                    column: s.column
                }),
                n.push({
                    row: s.row,
                    column: s.column
                })
            }
            selectionCopyShow(),
            Store.luckysheet_copy_save = {
                dataSheetIndex: Store.currentSheetIndex,
                copyRange: n,
                RowlChange: o,
                HasMC: l
            };
            var g;
            Store.config.borderInfo && Store.config.borderInfo.length > 0 && (g = getBorderInfoCompute());
            for (var y = "", v = editor.deepCopyFlowData(Store.flowdata), A = "", b = 0; b < r.length; b++) {
                var k = r[b];
                if (null == Store.config.rowhidden || null == Store.config.rowhidden[k]) {
                    y += "<tr>";
                    for (var w = 0; w < a.length; w++) {
                        var x = a[w];
                        if (null == Store.config.colhidden || null == Store.config.colhidden[x]) {
                            var S = '<td ${span} style="${style}">';
                            if (null != v[k] && null != v[k][x]) {
                                var _ = ""
                                  , C = "";
                                k == r[0] && (null == Store.config || null == Store.config.columnlen || null == Store.config.columnlen[x.toString()] ? A += '<colgroup width="72px"></colgroup>' : A += '<colgroup width="' + Store.config.columnlen[x.toString()] + 'px"></colgroup>'),
                                x == a[0] && (null == Store.config || null == Store.config.rowlen || null == Store.config.rowlen[k.toString()] ? _ += "height:19px;" : _ += "height:" + Store.config.rowlen[k.toString()] + "px;");
                                var T = void 0;
                                if (T = null != v[k][x].ct && null != v[k][x].ct.fa && v[k][x].ct.fa.match(/^(w|W)((0?)|(0\.0+))$/) ? getcellvalue(k, x, v) : getcellvalue(k, x, v, "m"),
                                _ += menuButton.getStyleByCell(v, k, x),
                                "object" == getObjType(v[k][x]) && "mc"in v[k][x]) {
                                    if (!("rs"in v[k][x].mc))
                                        continue;
                                    if (C = 'rowspan="' + v[k][x].mc.rs + '" colspan="' + v[k][x].mc.cs + '"',
                                    g && g[k + "_" + x]) {
                                        for (var E = {
                                            color: {},
                                            style: {}
                                        }, I = {
                                            color: {},
                                            style: {}
                                        }, R = {
                                            color: {},
                                            style: {}
                                        }, B = {
                                            color: {},
                                            style: {}
                                        }, N = k; N < k + v[k][x].mc.rs; N++)
                                            for (var F = x; F < x + v[k][x].mc.cs; F++) {
                                                if (N == k && g[N + "_" + F] && g[N + "_" + F].t) {
                                                    var P = g[N + "_" + F].t.style
                                                      , L = g[N + "_" + F].t.color;
                                                    null == R.style[P] ? R.style[P] = 1 : R.style[P] = R.style[P] + 1,
                                                    null == R.color[L] ? R.color[L] = 1 : R.color[L] = R.color[L] + 1
                                                }
                                                if (N == k + v[k][x].mc.rs - 1 && g[N + "_" + F] && g[N + "_" + F].b) {
                                                    var O = g[N + "_" + F].b.style
                                                      , D = g[N + "_" + F].b.color;
                                                    null == B.style[O] ? B.style[O] = 1 : B.style[O] = B.style[O] + 1,
                                                    null == B.color[D] ? B.color[D] = 1 : B.color[D] = B.color[D] + 1
                                                }
                                                if (F == x && g[N + "_" + F] && g[N + "_" + F].l) {
                                                    var M = g[k + "_" + x].l.style
                                                      , U = g[N + "_" + F].l.color;
                                                    null == E.style[M] ? E.style[M] = 1 : E.style[M] = E.style[M] + 1,
                                                    null == E.color[U] ? E.color[U] = 1 : E.color[U] = E.color[U] + 1
                                                }
                                                if (F == x + v[k][x].mc.cs - 1 && g[N + "_" + F] && g[N + "_" + F].r) {
                                                    var H = g[N + "_" + F].r.style
                                                      , q = g[N + "_" + F].r.color;
                                                    null == I.style[H] ? I.style[H] = 1 : I.style[H] = I.style[H] + 1,
                                                    null == I.color[q] ? I.color[q] = 1 : I.color[q] = I.color[q] + 1
                                                }
                                            }
                                        var z = v[k][x].mc.rs
                                          , j = v[k][x].mc.cs;
                                        if (JSON.stringify(E).length > 23) {
                                            var V = null
                                              , Q = null;
                                            for (var G in E.color)
                                                E.color[G] >= z / 2 && (V = G);
                                            for (var K in E.style)
                                                E.style[K] >= z / 2 && (Q = K);
                                            null != V && null != Q && (_ += "border-left:" + this.getHtmlBorderStyle(Q, V))
                                        }
                                        if (JSON.stringify(I).length > 23) {
                                            var W = null
                                              , Y = null;
                                            for (var X in I.color)
                                                I.color[X] >= z / 2 && (W = X);
                                            for (var J in I.style)
                                                I.style[J] >= z / 2 && (Y = J);
                                            null != W && null != Y && (_ += "border-right:" + this.getHtmlBorderStyle(Y, W))
                                        }
                                        if (JSON.stringify(R).length > 23) {
                                            var Z = null
                                              , ee = null;
                                            for (var te in R.color)
                                                R.color[te] >= j / 2 && (Z = te);
                                            for (var re in R.style)
                                                R.style[re] >= j / 2 && (ee = re);
                                            null != Z && null != ee && (_ += "border-top:" + this.getHtmlBorderStyle(ee, Z))
                                        }
                                        if (JSON.stringify(B).length > 23) {
                                            var ae = null
                                              , ne = null;
                                            for (var oe in B.color)
                                                B.color[oe] >= j / 2 && (ae = oe);
                                            for (var le in B.style)
                                                B.style[le] >= j / 2 && (ne = le);
                                            null != ae && null != ne && (_ += "border-bottom:" + this.getHtmlBorderStyle(ne, ae))
                                        }
                                    }
                                } else if (g && g[k + "_" + x]) {
                                    if (g[k + "_" + x].l) {
                                        var ie = g[k + "_" + x].l.style
                                          , se = g[k + "_" + x].l.color;
                                        _ += "border-left:" + this.getHtmlBorderStyle(ie, se)
                                    }
                                    if (g[k + "_" + x].r) {
                                        var ce = g[k + "_" + x].r.style
                                          , ue = g[k + "_" + x].r.color;
                                        _ += "border-right:" + this.getHtmlBorderStyle(ce, ue)
                                    }
                                    if (g[k + "_" + x].b) {
                                        var he = g[k + "_" + x].b.style
                                          , de = g[k + "_" + x].b.color;
                                        _ += "border-bottom:" + this.getHtmlBorderStyle(he, de)
                                    }
                                    if (g[k + "_" + x].t) {
                                        var fe = g[k + "_" + x].t.style
                                          , me = g[k + "_" + x].t.color;
                                        _ += "border-top:" + this.getHtmlBorderStyle(fe, me)
                                    }
                                }
                                S = replaceHtml$1(S, {
                                    style: _,
                                    span: C
                                }),
                                null == T && (T = getcellvalue(k, x, v)),
                                null == T && (T = " "),
                                S += T
                            } else {
                                var pe = "";
                                if (g && g[k + "_" + x]) {
                                    if (g[k + "_" + x].l) {
                                        var ge = g[k + "_" + x].l.style
                                          , ye = g[k + "_" + x].l.color;
                                        pe += "border-left:" + this.getHtmlBorderStyle(ge, ye)
                                    }
                                    if (g[k + "_" + x].r) {
                                        var ve = g[k + "_" + x].r.style
                                          , Ae = g[k + "_" + x].r.color;
                                        pe += "border-right:" + this.getHtmlBorderStyle(ve, Ae)
                                    }
                                    if (g[k + "_" + x].b) {
                                        var be = g[k + "_" + x].b.style
                                          , ke = g[k + "_" + x].b.color;
                                        pe += "border-bottom:" + this.getHtmlBorderStyle(be, ke)
                                    }
                                    if (g[k + "_" + x].t) {
                                        var we = g[k + "_" + x].t.style
                                          , xe = g[k + "_" + x].t.color;
                                        pe += "border-top:" + this.getHtmlBorderStyle(we, xe)
                                    }
                                }
                                S += "",
                                k == r[0] && (null == Store.config || null == Store.config.columnlen || null == Store.config.columnlen[x.toString()] ? A += '<colgroup width="72px"></colgroup>' : A += '<colgroup width="' + Store.config.columnlen[x.toString()] + 'px"></colgroup>'),
                                x == a[0] && (null == Store.config || null == Store.config.rowlen || null == Store.config.rowlen[k.toString()] ? pe += "height:19px;" : pe += "height:" + Store.config.rowlen[k.toString()] + "px;"),
                                S = replaceHtml$1(S, {
                                    style: pe,
                                    span: ""
                                }),
                                S += " "
                            }
                            y += S += "</td>"
                        }
                    }
                    y += "</tr>"
                }
            }
            if (y = '<table data-type="luckysheet_copy_action_table">' + A + y + "</table>",
            Store.iscopyself = !0,
            t)
                return t.setData("Text", y),
                !1;
            var Se = $("#luckysheet-copy-content");
            Se.html(y),
            Se.focus(),
            Se.select(),
            document.execCommand("selectAll"),
            document.execCommand("Copy"),
            setTimeout((function() {
                $("#luckysheet-copy-content").blur()
            }
            ), 10)
        },
        copybyformat: function(e, t) {
            var r = window.clipboardData;
            r || (r = e.originalEvent && e.originalEvent.clipboardData),
            Store.luckysheet_selection_range = [{
                row: Store.luckysheet_select_save[0].row,
                column: Store.luckysheet_select_save[0].column
            }],
            selectionCopyShow();
            var a = t;
            if (Store.iscopyself = !0,
            r)
                return r.setData("Text", a),
                !1;
            var n = $("#luckysheet-copy-content");
            n.text(a),
            n.focus(),
            n.select(),
            document.execCommand("selectAll"),
            document.execCommand("Copy"),
            setTimeout((function() {
                n.blur()
            }
            ), 10)
        },
        isPasteAction: !1,
        paste: function(e, t) {
            var r = this;
            if (!1 !== Store.allowEdit) {
                var a = locale().drag
                  , n = $("#luckysheet-copy-content");
                n.focus(),
                n.select(),
                setTimeout((function() {
                    var o = n.html();
                    o.indexOf("luckysheet_copy_action_table") > -1 && null != Store.luckysheet_copy_save.copyRange && Store.luckysheet_copy_save.copyRange.length > 0 ? Store.luckysheet_paste_iscut ? (Store.luckysheet_paste_iscut = !1,
                    r.pasteHandlerOfCutPaste(Store.luckysheet_copy_save),
                    r.clearcopy(e)) : r.pasteHandlerOfCopyPaste(Store.luckysheet_copy_save) : "btn" != t ? r.pasteHandler(o) : isEditMode() ? alert(a.pasteMustKeybordAlert) : tooltip.info(a.pasteMustKeybordAlertHTMLTitle, a.pasteMustKeybordAlertHTML)
                }
                ), 10)
            }
        },
        pasteHandler: function(e, t) {
            if (checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex) && !1 !== Store.allowEdit)
                if (Store.luckysheet_select_save.length > 1 && (isEditMode() ? alert("不能对多重选择区域执行此操作，请选择单个区域，然后再试") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对多重选择区域执行此操作，请选择单个区域，然后再试")),
                "object" == _typeof(e)) {
                    if (0 == e.length)
                        return;
                    var r = $.extend(!0, {}, Store.config);
                    null == r.merge && (r.merge = {}),
                    JSON.stringify(t).length > 2 && null == r.borderInfo && (r.borderInfo = []);
                    var a = e.length
                      , n = e[0].length
                      , o = Store.luckysheet_select_save[0].row[0]
                      , l = o + a - 1
                      , i = Store.luckysheet_select_save[0].column[0]
                      , s = i + n - 1
                      , c = !1;
                    if (null != r.merge && (c = hasPartMC(r, o, l, i, s)),
                    c)
                        return void (isEditMode() ? alert("不能对合并单元格做部分更改") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改"));
                    var u = editor.deepCopyFlowData(Store.flowdata)
                      , h = l - u.length + 1
                      , d = s - u[0].length + 1;
                    (h > 0 || d > 0) && (u = datagridgrowth([].concat(u), h, d, !0)),
                    null == r.rowlen && (r.rowlen = {});
                    for (var f = !1, m = {}, p = o; p <= l; p++) {
                        var g = [].concat(u[p])
                          , y = Store.defaultrowlen;
                        null != r.rowlen[p] && (y = r.rowlen[p]);
                        for (var v = i; v <= s; v++) {
                            "object" == getObjType(g[v]) && "mc"in g[v] && ("rs"in g[v].mc && delete r.merge[g[v].mc.r + "_" + g[v].mc.c],
                            delete g[v].mc);
                            var A = null;
                            if (null != e[p - o] && null != e[p - o][v - i] && (A = e[p - o][v - i]),
                            g[v] = $.extend(!0, {}, A),
                            null != A && "mc"in g[v] && (null != g[v].mc.rs ? (g[v].mc.r = p,
                            g[v].mc.c = v,
                            r.merge[g[v].mc.r + "_" + g[v].mc.c] = g[v].mc,
                            m[A.mc.r + "_" + A.mc.c] = [g[v].mc.r, g[v].mc.c]) : g[v] = {
                                mc: {
                                    r: m[A.mc.r + "_" + A.mc.c][0],
                                    c: m[A.mc.r + "_" + A.mc.c][1]
                                }
                            }),
                            t[p - o + "_" + (v - i)]) {
                                var b = {
                                    rangeType: "cell",
                                    value: {
                                        row_index: p,
                                        col_index: v,
                                        l: t[p - o + "_" + (v - i)].l,
                                        r: t[p - o + "_" + (v - i)].r,
                                        t: t[p - o + "_" + (v - i)].t,
                                        b: t[p - o + "_" + (v - i)].b
                                    }
                                };
                                r.borderInfo.push(b)
                            }
                            var k = luckysheetfontformat(g[v])
                              , w = menuButton.getTextSize("田", k)[1];
                            w > y && (y = w,
                            f = !0)
                        }
                        u[p] = g,
                        y != Store.defaultrowlen && (r.rowlen[p] = y)
                    }
                    if (Store.luckysheet_select_save = [{
                        row: [o, l],
                        column: [i, s]
                    }],
                    h > 0 || d > 0 || f) {
                        var x = {
                            cfg: r,
                            RowlChange: !0
                        };
                        jfrefreshgrid(u, Store.luckysheet_select_save, x)
                    } else {
                        var S = {
                            cfg: r
                        };
                        jfrefreshgrid(u, Store.luckysheet_select_save, S),
                        selectHightlightShow()
                    }
                } else {
                    for (var _ = [], C = (e = e.replace(/\r/g, "")).split("\n"), T = C[0].split("\t").length, E = 0; E < C.length; E++)
                        C[E].split("\t").length < T || _.push(C[E].split("\t"));
                    var I = editor.deepCopyFlowData(Store.flowdata)
                      , R = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                      , B = null == R.row ? 0 : R.row[0]
                      , N = null == R.column ? 0 : R.column[0]
                      , F = _.length
                      , P = _[0].length
                      , L = !1;
                    if (null != Store.config.merge && (L = hasPartMC(Store.config, B, B + F - 1, N, N + P - 1)),
                    L)
                        return void (isEditMode() ? alert("不能对合并单元格做部分更改") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改"));
                    var O = B + F - I.length
                      , D = N + P - I[0].length;
                    (O > 0 || D > 0) && (I = datagridgrowth([].concat(I), O, D, !0));
                    for (var M = 0; M < F; M++) {
                        for (var U = [].concat(I[M + B]), H = 0; H < P; H++) {
                            var q = _[M][H];
                            isRealNum(q) && (q = parseFloat(q));
                            var z = U[H + N];
                            if (z instanceof Object)
                                z.v = q,
                                null != z.ct && null != z.ct.fa ? z.m = update(z.ct.fa, q) : z.m = q,
                                null != z.f && z.f.length > 0 && (z.f = "",
                                luckysheetformula.delFunctionGroup(M + B, H + N, Store.currentSheetIndex));
                            else {
                                var j = {}
                                  , V = genarate(q);
                                j.v = V[2],
                                j.ct = V[1],
                                j.m = V[0],
                                U[H + N] = j
                            }
                        }
                        I[M + B] = U
                    }
                    if (R.row = [B, B + F - 1],
                    R.column = [N, N + P - 1],
                    O > 0 || D > 0) {
                        jfrefreshgrid(I, Store.luckysheet_select_save, {
                            RowlChange: !0
                        })
                    } else
                        jfrefreshgrid(I, Store.luckysheet_select_save),
                        selectHightlightShow()
                }
        },
        pasteHandlerOfCutPaste: function(e) {
            if (checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex) && !1 !== Store.allowEdit) {
                var t = $.extend(!0, {}, Store.config);
                null == t.merge && (t.merge = {});
                var r = e.HasMC
                  , a = e.RowlChange
                  , n = e.dataSheetIndex
                  , o = e.copyRange[0].row[0]
                  , l = e.copyRange[0].row[1]
                  , i = e.copyRange[0].column[0]
                  , s = e.copyRange[0].column[1]
                  , c = $.extend(!0, [], getdatabyselection({
                    row: [o, l],
                    column: [i, s]
                }, n))
                  , u = c.length
                  , h = c[0].length
                  , d = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , f = d.row_focus
                  , m = f + u - 1
                  , p = d.column_focus
                  , g = p + h - 1
                  , y = !1;
                if (null != t.merge && (y = hasPartMC(t, f, m, p, g)),
                y)
                    isEditMode() ? alert("不能对合并单元格做部分更改") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改");
                else {
                    var v = editor.deepCopyFlowData(Store.flowdata)
                      , A = u + f - v.length
                      , b = h + p - v[0].length;
                    (A > 0 || b > 0) && (v = datagridgrowth([].concat(v), A, b, !0));
                    var k = getBorderInfoCompute(n)
                      , w = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(n)].dataVerification)
                      , x = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification);
                    if (Store.currentSheetIndex == n) {
                        for (var S = o; S <= l; S++)
                            for (var _ = i; _ <= s; _++) {
                                var C = v[S][_];
                                "object" == getObjType(C) && "mc"in C && ("rs"in C.mc && delete t.merge[C.mc.r + "_" + C.mc.c],
                                delete C.mc),
                                v[S][_] = null,
                                delete x[S + "_" + _]
                            }
                        if (t.borderInfo && t.borderInfo.length > 0) {
                            for (var T = [], E = 0; E < t.borderInfo.length; E++) {
                                var I = t.borderInfo[E].rangeType;
                                if ("range" == I) {
                                    for (var R = t.borderInfo[E].range, B = [], N = 0; N < R.length; N++)
                                        B = B.concat(conditionformat.CFSplitRange(R[N], {
                                            row: [o, l],
                                            column: [i, s]
                                        }, {
                                            row: [f, m],
                                            column: [p, g]
                                        }, "restPart"));
                                    t.borderInfo[E].range = B,
                                    T.push(t.borderInfo[E])
                                } else if ("cell" == I) {
                                    var F = t.borderInfo[E].value.row_index
                                      , P = t.borderInfo[E].value.col_index;
                                    F >= o && F <= l && P >= i && P <= s || T.push(t.borderInfo[E])
                                }
                            }
                            t.borderInfo = T
                        }
                    }
                    for (var L, O, D = {}, M = f; M <= m; M++) {
                        for (var U = [].concat(v[M]), H = p; H <= g; H++) {
                            if (k[o + M - f + "_" + (i + H - p)]) {
                                var q = {
                                    rangeType: "cell",
                                    value: {
                                        row_index: M,
                                        col_index: H,
                                        l: k[o + M - f + "_" + (i + H - p)].l,
                                        r: k[o + M - f + "_" + (i + H - p)].r,
                                        t: k[o + M - f + "_" + (i + H - p)].t,
                                        b: k[o + M - f + "_" + (i + H - p)].b
                                    }
                                };
                                null == t.borderInfo && (t.borderInfo = []),
                                t.borderInfo.push(q)
                            } else if (k[M + "_" + H]) {
                                var z = {
                                    rangeType: "cell",
                                    value: {
                                        row_index: M,
                                        col_index: H,
                                        l: null,
                                        r: null,
                                        t: null,
                                        b: null
                                    }
                                };
                                null == t.borderInfo && (t.borderInfo = []),
                                t.borderInfo.push(z)
                            }
                            w[o + M - f + "_" + (i + H - p)] && (x[M + "_" + H] = w[o + M - f + "_" + (i + H - p)]),
                            "object" == getObjType(U[H]) && "mc"in U[H] && ("rs"in U[H].mc && delete t.merge[U[H].mc.r + "_" + U[H].mc.c],
                            delete U[H].mc);
                            var j = null;
                            null != c[M - f] && null != c[M - f][H - p] && (j = c[M - f][H - p]),
                            U[H] = $.extend(!0, {}, j),
                            null != j && r && "mc"in U[H] && (null != U[H].mc.rs ? (U[H].mc.r = M,
                            U[H].mc.c = H,
                            t.merge[U[H].mc.r + "_" + U[H].mc.c] = U[H].mc,
                            D[j.mc.r + "_" + j.mc.c] = [U[H].mc.r, U[H].mc.c]) : U[H] = {
                                mc: {
                                    r: D[j.mc.r + "_" + j.mc.c][0],
                                    c: D[j.mc.r + "_" + j.mc.c][1]
                                }
                            })
                        }
                        v[M] = U
                    }
                    if (d.row = [f, m],
                    d.column = [p, g],
                    a && (Store.currentSheetIndex != n || (t = rowlenByRange(v, o, l, t)),
                    t = rowlenByRange(v, f, m, t)),
                    Store.currentSheetIndex != n) {
                        var V = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(n)].data)
                          , Q = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(n)].config)
                          , G = $.extend(!0, [], V)
                          , K = $.extend(!0, {}, Q);
                        null == K.merge && (K.merge = {});
                        for (var W = o; W <= l; W++)
                            for (var Y = i; Y <= s; Y++) {
                                var X = G[W][Y];
                                "object" == getObjType(X) && "mc"in X && ("rs"in X.mc && delete K.merge[X.mc.r + "_" + X.mc.c],
                                delete X.mc),
                                G[W][Y] = null
                            }
                        if (a && (K = rowlenByRange(G, o, l, K)),
                        K.borderInfo && K.borderInfo.length > 0) {
                            for (var J = [], Z = 0; Z < K.borderInfo.length; Z++) {
                                var ee = K.borderInfo[Z].rangeType;
                                if ("range" == ee) {
                                    for (var te = K.borderInfo[Z].range, re = [], ae = 0; ae < te.length; ae++)
                                        re = re.concat(conditionformat.CFSplitRange(te[ae], {
                                            row: [o, l],
                                            column: [i, s]
                                        }, {
                                            row: [f, m],
                                            column: [p, g]
                                        }, "restPart"));
                                    K.borderInfo[Z].range = re,
                                    J.push(K.borderInfo[Z])
                                } else if ("cell" == ee) {
                                    var ne = K.borderInfo[Z].value.row_index
                                      , oe = K.borderInfo[Z].value.col_index;
                                    ne >= o && ne <= l && oe >= i && oe <= s || J.push(K.borderInfo[Z])
                                }
                            }
                            K.borderInfo = J
                        }
                        var le = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(n)].luckysheet_conditionformat_save)
                          , ie = $.extend(!0, [], le)
                          , se = [];
                        if (null != ie && ie.length > 0)
                            for (var ce = 0; ce < ie.length; ce++) {
                                for (var ue = ie[ce].cellrange, he = [], de = [], fe = 0; fe < ue.length; fe++) {
                                    var me = conditionformat.CFSplitRange(ue[fe], {
                                        row: [o, l],
                                        column: [i, s]
                                    }, {
                                        row: [f, m],
                                        column: [p, g]
                                    }, "restPart");
                                    he = he.concat(me);
                                    var pe = conditionformat.CFSplitRange(ue[fe], {
                                        row: [o, l],
                                        column: [i, s]
                                    }, {
                                        row: [f, m],
                                        column: [p, g]
                                    }, "operatePart");
                                    pe.length > 0 && (de = de.concat(pe))
                                }
                                if (ie[ce].cellrange = he,
                                de.length > 0) {
                                    var ge = $.extend(!0, {}, ie[ce]);
                                    ge.cellrange = de,
                                    se.push(ge)
                                }
                            }
                        var ye = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save)
                          , ve = $.extend(!0, [], ye);
                        se.length > 0 && (ve = ve.concat(se));
                        for (var Ae = o; Ae <= l; Ae++)
                            for (var be = i; be <= s; be++)
                                delete w[Ae + "_" + be];
                        L = {
                            sheetIndex: n,
                            data: V,
                            curData: G,
                            config: Q,
                            curConfig: K,
                            cdformat: le,
                            curCdformat: ie,
                            dataVerification: $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(n)].dataVerification),
                            curDataVerification: w,
                            range: {
                                row: [o, l],
                                column: [i, s]
                            }
                        },
                        O = {
                            sheetIndex: Store.currentSheetIndex,
                            data: Store.flowdata,
                            curData: v,
                            config: $.extend(!0, {}, Store.config),
                            curConfig: t,
                            cdformat: ye,
                            curCdformat: ve,
                            dataVerification: $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification),
                            curDataVerification: x,
                            range: {
                                row: [f, m],
                                column: [p, g]
                            }
                        }
                    } else {
                        var ke = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save)
                          , we = $.extend(!0, [], ke);
                        if (null != we && we.length > 0)
                            for (var xe = 0; xe < we.length; xe++) {
                                for (var Se = we[xe].cellrange, _e = [], Ce = 0; Ce < Se.length; Ce++) {
                                    var Te = conditionformat.CFSplitRange(Se[Ce], {
                                        row: [o, l],
                                        column: [i, s]
                                    }, {
                                        row: [f, m],
                                        column: [p, g]
                                    }, "allPart");
                                    _e = _e.concat(Te)
                                }
                                we[xe].cellrange = _e
                            }
                        L = {
                            sheetIndex: Store.currentSheetIndex,
                            data: Store.flowdata,
                            curData: v,
                            config: $.extend(!0, {}, Store.config),
                            curConfig: t,
                            cdformat: ke,
                            curCdformat: we,
                            dataVerification: $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification),
                            curDataVerification: x,
                            range: {
                                row: [o, l],
                                column: [i, s]
                            }
                        },
                        O = {
                            sheetIndex: Store.currentSheetIndex,
                            data: Store.flowdata,
                            curData: v,
                            config: $.extend(!0, {}, Store.config),
                            curConfig: t,
                            cdformat: ke,
                            curCdformat: we,
                            dataVerification: $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification),
                            curDataVerification: x,
                            range: {
                                row: [f, m],
                                column: [p, g]
                            }
                        }
                    }
                    jfrefreshgrid_pastcut(L, O, A > 0 || b > 0 || a)
                }
            }
        },
        pasteHandlerOfCopyPaste: function(e) {
            if (checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)) {
                var t = $.extend(!0, {}, Store.config);
                null == t.merge && (t.merge = {});
                for (var r = e.HasMC, a = e.RowlChange, n = e.dataSheetIndex, o = e.copyRange[0].row[0], l = e.copyRange[0].row[1], i = e.copyRange[0].column[0], s = e.copyRange[0].column[1], c = [], u = !1, h = function(t) {
                    var r = getdatabyselection({
                        row: e.copyRange[t].row,
                        column: e.copyRange[t].column
                    }, n);
                    e.copyRange.length > 1 ? o == e.copyRange[1].row[0] && l == e.copyRange[1].row[1] ? (r = r[0].map((function(e, t) {
                        return r.map((function(e) {
                            return e[t]
                        }
                        ))
                    }
                    )),
                    c = c.concat(r),
                    u = !0) : i == e.copyRange[1].column[0] && s == e.copyRange[1].column[1] && (c = c.concat(r)) : c = r
                }, d = 0; d < e.copyRange.length; d++)
                    h(d);
                u && (c = c[0].map((function(e, t) {
                    return c.map((function(e) {
                        return e[t]
                    }
                    ))
                }
                )));
                var f = $.extend(!0, [], c);
                if (e.copyRange.length > 1)
                    for (var m = 0; m < f.length; m++)
                        for (var p = 0; p < f[m].length; p++)
                            null != f[m][p] && null != f[m][p].f && (delete f[m][p].f,
                            delete f[m][p].spl);
                var g = f.length
                  , y = f[0].length
                  , v = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , A = v.row[0]
                  , b = v.row[1]
                  , k = v.column[0]
                  , w = v.column[1];
                0 == (b - A + 1) % g && 0 == (w - k + 1) % y || (b = A + g - 1,
                w = k + y - 1);
                var x = !1;
                if (null != t.merge && (x = hasPartMC(t, A, b, k, w)),
                x)
                    isEditMode() ? alert("不能对合并单元格做部分更改") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改");
                else {
                    var S = (b - A + 1) / g
                      , _ = (w - k + 1) / y
                      , C = editor.deepCopyFlowData(Store.flowdata)
                      , T = g + A - C.length
                      , E = y + k - C[0].length;
                    (T > 0 || E > 0) && (C = datagridgrowth([].concat(C), T, E, !0));
                    for (var I = getBorderInfoCompute(n), R = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(n)].dataVerification), B = null, N = 0, F = 0, P = 0, L = 0, O = 1; O <= S; O++)
                        for (var D = 1; D <= _; D++) {
                            L = A + O * g,
                            P = k + D * y;
                            for (var M = (N = A + (O - 1) * g) - o, U = (F = k + (D - 1) * y) - i, H = {}, q = N; q < L; q++) {
                                for (var z = [].concat(C[q]), j = F; j < P; j++) {
                                    if (I[o + q - N + "_" + (i + j - F)]) {
                                        var V = {
                                            rangeType: "cell",
                                            value: {
                                                row_index: q,
                                                col_index: j,
                                                l: I[o + q - N + "_" + (i + j - F)].l,
                                                r: I[o + q - N + "_" + (i + j - F)].r,
                                                t: I[o + q - N + "_" + (i + j - F)].t,
                                                b: I[o + q - N + "_" + (i + j - F)].b
                                            }
                                        };
                                        null == t.borderInfo && (t.borderInfo = []),
                                        t.borderInfo.push(V)
                                    } else if (I[q + "_" + j]) {
                                        var Q = {
                                            rangeType: "cell",
                                            value: {
                                                row_index: q,
                                                col_index: j,
                                                l: null,
                                                r: null,
                                                t: null,
                                                b: null
                                            }
                                        };
                                        null == t.borderInfo && (t.borderInfo = []),
                                        t.borderInfo.push(Q)
                                    }
                                    R[o + q - N + "_" + (i + j - F)] && (null == B && (B = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification)),
                                    B[q + "_" + j] = R[o + q - N + "_" + (i + j - F)]),
                                    "object" == getObjType(z[j]) && "mc"in z[j] && ("rs"in z[j].mc && delete t.merge[z[j].mc.r + "_" + z[j].mc.c],
                                    delete z[j].mc);
                                    var G = null;
                                    if (null != f[q - N] && null != f[q - N][j - F] && (G = $.extend(!0, {}, f[q - N][j - F])),
                                    null != G && null != G.f) {
                                        var K = G.f;
                                        M > 0 && (K = "=" + luckysheetformula.functionCopy(K, "down", M)),
                                        M < 0 && (K = "=" + luckysheetformula.functionCopy(K, "up", Math.abs(M))),
                                        U > 0 && (K = "=" + luckysheetformula.functionCopy(K, "right", U)),
                                        U < 0 && (K = "=" + luckysheetformula.functionCopy(K, "left", Math.abs(U)));
                                        var W = luckysheetformula.execfunction(K, q, j, void 0, !0);
                                        null != G.spl ? (G.f = W[2],
                                        G.v = W[1],
                                        G.spl = W[3].data) : (G.f = W[2],
                                        G.v = W[1],
                                        null != G.ct && null != G.ct.fa && (G.m = update(G.ct.fa, W[1])))
                                    }
                                    z[j] = $.extend(!0, {}, G),
                                    null != G && r && "mc"in z[j] && (null != z[j].mc.rs ? (z[j].mc.r = q,
                                    z[j].mc.c = j,
                                    t.merge[z[j].mc.r + "_" + z[j].mc.c] = z[j].mc,
                                    H[G.mc.r + "_" + G.mc.c] = [z[j].mc.r, z[j].mc.c]) : z[j] = {
                                        mc: {
                                            r: H[G.mc.r + "_" + G.mc.c][0],
                                            c: H[G.mc.r + "_" + G.mc.c][1]
                                        }
                                    })
                                }
                                C[q] = z
                            }
                        }
                    var Y = null;
                    if (1 == e.copyRange.length) {
                        var X = Store.luckysheetfile[getSheetIndex(n)]
                          , J = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]
                          , Z = $.extend(!0, [], X.luckysheet_conditionformat_save);
                        if (null != Z && Z.length > 0) {
                            Y = $.extend(!0, [], J.luckysheet_conditionformat_save);
                            for (var ee = 0; ee < Z.length; ee++) {
                                for (var te = Z[ee].cellrange, re = [], ae = 1; ae <= S; ae++)
                                    for (var ne = 1; ne <= _; ne++) {
                                        N = A + (ae - 1) * g,
                                        F = k + (ne - 1) * y,
                                        L = A + ae * g,
                                        P = k + ne * y;
                                        for (var oe = 0; oe < te.length; oe++) {
                                            var le = conditionformat.CFSplitRange(te[oe], {
                                                row: [o, l],
                                                column: [i, s]
                                            }, {
                                                row: [N, L - 1],
                                                column: [F, P - 1]
                                            }, "operatePart");
                                            le.length > 0 && (re = re.concat(le))
                                        }
                                    }
                                re.length > 0 && (Z[ee].cellrange = re,
                                Y.push(Z[ee]))
                            }
                        }
                    }
                    if (v.row = [A, b],
                    v.column = [k, w],
                    a || T > 0 || E > 0) {
                        var ie = {
                            cfg: t = rowlenByRange(C, A, b, t),
                            RowlChange: !0,
                            cdformat: Y,
                            dataVerification: B
                        };
                        jfrefreshgrid(C, Store.luckysheet_select_save, ie)
                    } else {
                        var se = {
                            cfg: t,
                            cdformat: Y,
                            dataVerification: B
                        };
                        jfrefreshgrid(C, Store.luckysheet_select_save, se),
                        selectHightlightShow()
                    }
                }
            }
        },
        pasteHandlerOfPaintModel: function(e) {
            if (checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)) {
                var t = $.extend(!0, {}, Store.config);
                null == t.merge && (t.merge = {});
                var r = e.HasMC
                  , a = e.RowlChange
                  , n = e.dataSheetIndex
                  , o = e.copyRange[0].row[0]
                  , l = e.copyRange[0].row[1]
                  , i = e.copyRange[0].column[0]
                  , s = e.copyRange[0].column[1]
                  , c = $.extend(!0, [], getdatabyselection({
                    row: [o, l],
                    column: [i, s]
                }, n))
                  , u = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , h = u.row[0]
                  , d = u.row[1]
                  , f = u.column[0]
                  , m = u.column[1]
                  , p = c.length
                  , g = c[0].length;
                if (h == d && f == m) {
                    var y = !1;
                    if (null != t.merge && (y = hasPartMC(t, h, h + p - 1, f, f + g - 1)),
                    y)
                        return void (isEditMode() ? alert("不能对合并单元格做部分更改") : tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改"));
                    d = h + p - 1,
                    m = f + g - 1
                }
                for (var v = Math.ceil((d - h + 1) / p), A = Math.ceil((m - f + 1) / g), b = editor.deepCopyFlowData(Store.flowdata), k = b[0].length, w = b.length, x = getBorderInfoCompute(n), S = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(n)].dataVerification), _ = null, C = 0, T = 0, E = 0, I = 0, R = 1; R <= v; R++)
                    for (var B = 1; B <= A; B++) {
                        T = f + (B - 1) * g,
                        (I = h + R * p > w ? w : h + R * p) > d + 1 && (I = d + 1),
                        (E = f + B * g > k ? k : f + B * g) > m + 1 && (E = m + 1);
                        for (var N = {}, F = C = h + (R - 1) * p; F < I; F++) {
                            for (var P = [].concat(b[F]), L = T; L < E; L++) {
                                if (x[o + F - C + "_" + (i + L - T)]) {
                                    var O = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: F,
                                            col_index: L,
                                            l: x[o + F - C + "_" + (i + L - T)].l,
                                            r: x[o + F - C + "_" + (i + L - T)].r,
                                            t: x[o + F - C + "_" + (i + L - T)].t,
                                            b: x[o + F - C + "_" + (i + L - T)].b
                                        }
                                    };
                                    null == t.borderInfo && (t.borderInfo = []),
                                    t.borderInfo.push(O)
                                } else if (x[F + "_" + L]) {
                                    var D = {
                                        rangeType: "cell",
                                        value: {
                                            row_index: F,
                                            col_index: L,
                                            l: null,
                                            r: null,
                                            t: null,
                                            b: null
                                        }
                                    };
                                    null == t.borderInfo && (t.borderInfo = []),
                                    t.borderInfo.push(D)
                                }
                                S[o + F - C + "_" + (i + L - T)] && (null == _ && (_ = $.extend(!0, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dataVerification)),
                                _[F + "_" + L] = S[o + F - C + "_" + (i + L - T)]),
                                "object" == getObjType(P[L]) && "mc"in P[L] && ("rs"in P[L].mc && delete t.merge[P[L].mc.r + "_" + P[L].mc.c],
                                delete P[L].mc);
                                var M = null;
                                if (null != c[F - C] && null != c[F - C][L - T] && (M = c[F - C][L - T]),
                                null != M && (delete M.v,
                                delete M.m,
                                delete M.f,
                                delete M.spl,
                                M.ct && "inlineStr" == M.ct.t && delete M.ct,
                                "object" == getObjType(P[L]) || (P[L] = {
                                    v: P[L]
                                }),
                                P[L] = $.extend(!0, P[L], M),
                                r && "mc"in P[L] && (null != P[L].mc.rs ? (P[L].mc.r = F,
                                P[L].mc.rs + F >= I && (P[L].mc.rs = I - F),
                                P[L].mc.c = L,
                                P[L].mc.cs + L >= E && (P[L].mc.cs = E - L),
                                t.merge[P[L].mc.r + "_" + P[L].mc.c] = P[L].mc,
                                N[M.mc.r + "_" + M.mc.c] = [P[L].mc.r, P[L].mc.c]) : P[L] = {
                                    mc: {
                                        r: N[M.mc.r + "_" + M.mc.c][0],
                                        c: N[M.mc.r + "_" + M.mc.c][1]
                                    }
                                }),
                                null != P[L].v && null != M.ct && null != M.ct.fa)) {
                                    var U = update(M.ct.fa, P[L].v);
                                    P[L].m = U
                                }
                            }
                            b[F] = P
                        }
                    }
                var H = null
                  , q = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(n)].luckysheet_conditionformat_save);
                if (null != q && q.length > 0) {
                    H = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save);
                    for (var z = 0; z < q.length; z++) {
                        for (var j = q[z].cellrange, V = [], Q = 0; Q < j.length; Q++) {
                            var G = conditionformat.CFSplitRange(j[Q], {
                                row: [o, l],
                                column: [i, s]
                            }, {
                                row: [h, d],
                                column: [f, m]
                            }, "operatePart");
                            G.length > 0 && (V = V.concat(G))
                        }
                        V.length > 0 && (q[z].cellrange = [{
                            row: [h, d],
                            column: [f, m]
                        }],
                        H.push(q[z]))
                    }
                }
                if (u.row = [h, d],
                u.column = [f, m],
                a) {
                    var K = {
                        cfg: t = rowlenByRange(b, h, d, t),
                        RowlChange: !0,
                        cdformat: H,
                        dataVerification: _
                    };
                    jfrefreshgrid(b, Store.luckysheet_select_save, K)
                } else {
                    var W = {
                        cfg: t,
                        cdformat: H,
                        dataVerification: _
                    };
                    jfrefreshgrid(b, Store.luckysheet_select_save, W),
                    selectHightlightShow()
                }
            }
        },
        matchcopy: function(e, t) {
            var r, a, n = [], o = [];
            if ("object" == _typeof(e))
                n = e;
            else {
                n = e.split("\n");
                for (var l = 0; l < n.length; l++)
                    n[l] = n[l].split("\t")
            }
            if (r = n.length,
            "object" == _typeof(t))
                o = t;
            else {
                o = t.split("\n");
                for (var i = 0; i < o.length; i++)
                    o[i] = o[i].split("\t")
            }
            if (r != (a = o.length))
                return !1;
            for (var s = 0; s < r; s++)
                if (null == Store.config.rowhidden || null == Store.config.rowhidden[s])
                    for (var c = 0; c < a; c++)
                        if (n[s].length != o[c].length)
                            return !1;
            for (var u = 0; u < r; u++)
                if (null == Store.config.rowhidden || null == Store.config.rowhidden[u])
                    for (var h = 0; h < n[0].length; h++)
                        if (getcellvalue(u, h, n) != getcellvalue(u, h, o))
                            return !1;
            return !0
        }
    };
    function cleargridelement(e) {
        $("#luckysheet-cols-h-hover").hide(),
        $("#luckysheet-rightclick-menu").hide(),
        $("#luckysheet-cell-selected-boxs .luckysheet-cell-selected").hide(),
        $("#luckysheet-cols-h-selected .luckysheet-cols-h-selected").hide(),
        $("#luckysheet-rows-h-selected .luckysheet-rows-h-selected").hide(),
        $("#luckysheet-cell-selected-focus").hide(),
        $("#luckysheet-rows-h-hover").hide(),
        $("#luckysheet-selection-copy .luckysheet-selection-copy").hide(),
        $("#luckysheet-cols-menu-btn").hide(),
        $("#luckysheet-row-count-show, #luckysheet-column-count-show").hide(),
        e || selection.clearcopy(e),
        $("#luckysheet-dropCell-icon").is(":visible") && e && $("#luckysheet-dropCell-icon").remove(),
        menuButton.luckysheetPaintModelOn && !e && menuButton.cancelPaintModel()
    }
    function luckysheetcreatedom(e, t, r, a, n) {
        var o = gridHTML();
        o = replaceHtml$1(o, {
            logotitle: n
        }),
        o = replaceHtml$1(o, {
            menu: menuToolBar()
        });
        var l = flow;
        null == Store.config && (Store.config = {}),
        rhchInit(t, e);
        var i = locale().info
          , s = '<button id="luckysheet-bottom-add-row" class="btn btn-default">' + i.add + '</button><input id="luckysheet-bottom-add-row-input" type="text" class="luckysheet-datavisual-config-input luckysheet-mousedown-cancel" placeholder="100"><span style="font-size: 14px;">' + i.row + '</span><span style="font-size: 14px;color: #9c9c9c;">(' + i.addLast + ")</span>"
          , c = ' <button id="luckysheet-bottom-bottom-top" class="btn btn-default" style="">' + i.backTop + "</button>"
          , u = replaceHtml$1(i.pageInfo, {
            total: luckysheetConfigsetting.total ? luckysheetConfigsetting.total : "",
            totalPage: luckysheetConfigsetting.pageInfo.totalPage ? luckysheetConfigsetting.pageInfo.totalPage : "",
            currentPage: luckysheetConfigsetting.pageInfo.currentPage ? luckysheetConfigsetting.pageInfo.currentPage : ""
        })
          , h = ' <span id="luckysheet-bottom-page-info" style="font-size: 14px;color: #f34141;">' + u + '</span> <button id="luckysheet-bottom-page-next" class="btn btn-danger" style="">下一页</button>'
          , d = ' <span id="luckysheet-bottom-page-info" style="font-size: 14px;color: #f34141;">' + u + "</span>"
          , f = "";
        luckysheetConfigsetting.enableAddRow && (f += s),
        luckysheetConfigsetting.enablePage && (1 == parseInt(luckysheetConfigsetting.pageInfo.totalPage) ? f += d : f += h),
        luckysheetConfigsetting.enableAddBackTop && (f += c);
        var m = replaceHtml$1('<div id="luckysheetcoltable_0" class="luckysheet-cell-flow-col"> <div id ="luckysheet-sheettable_0" class="luckysheet-cell-sheettable" style="height:${height}px;width:${width}px;"></div><div id="luckysheet-bottom-controll-row" class="luckysheet-bottom-controll-row"> ' + f + " </div> </div>", {
            height: Store.rh_height,
            width: Store.ch_width - 1
        })
          , p = replaceHtml$1(columnHeaderHTML, {
            width: Store.ch_width,
            index: 0,
            column: ""
        });
        l = replaceHtml$1(l, {
            width: Store.ch_width,
            flow: m,
            index: 0
        }),
        o = replaceHtml$1(o, {
            flow: l,
            rowHeader: "<div style='height:" + Store.rh_height + "px' id='luckysheetrowHeader_0' class='luckysheetsheetchange'></div>",
            columnHeader: p,
            functionButton: luckysheetConfigsetting.functionButton
        }),
        $("#" + Store.container).append(o),
        $("#luckysheet-scrollbar-x div").width(Store.ch_width),
        $("#luckysheet-scrollbar-y div").height(Store.rh_height + Store.columnHeaderHeight - Store.cellMainSrollBarSize - 3),
        $("body").append(maskHTML),
        $("body").append(colsmenuHTML),
        $("body").append(rightclickHTML()),
        $("body").append(inputHTML),
        $("body").append(replaceHtml$1(filtermenuHTML(), {
            menuid: "filter"
        })),
        $("body").append(replaceHtml$1(filtersubmenuHTML(), {
            menuid: "filter"
        })),
        $("body").append(sheetconfigHTML()),
        $("#luckysheet-rows-h").width(Store.rowHeaderWidth - 1.5),
        $("#luckysheet-cols-h-c").height(Store.columnHeaderHeight - 1.5),
        $("#luckysheet-left-top").css({
            width: Store.rowHeaderWidth - 1.5,
            height: Store.columnHeaderHeight - 1.5
        }),
        $("#luckysheet_info_detail_input").val(luckysheetConfigsetting.title)
    }
    var $findIndex = arrayIteration.findIndex
      , FIND_INDEX = "findIndex"
      , SKIPS_HOLES$1 = !0
      , USES_TO_LENGTH$9 = arrayMethodUsesToLength(FIND_INDEX);
    FIND_INDEX in [] && Array(1)[FIND_INDEX]((function() {
        SKIPS_HOLES$1 = !1
    }
    )),
    _export({
        target: "Array",
        proto: !0,
        forced: SKIPS_HOLES$1 || !USES_TO_LENGTH$9
    }, {
        findIndex: function(e) {
            return $findIndex(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    }),
    addToUnscopables(FIND_INDEX);
    var freezing = !fails((function() {
        return Object.isExtensible(Object.preventExtensions({}))
    }
    ))
      , internalMetadata = createCommonjsModule((function(e) {
        var t = objectDefineProperty.f
          , r = uid("meta")
          , a = 0
          , n = Object.isExtensible || function() {
            return !0
        }
          , o = function(e) {
            t(e, r, {
                value: {
                    objectID: "O" + ++a,
                    weakData: {}
                }
            })
        }
          , l = e.exports = {
            REQUIRED: !1,
            fastKey: function(e, t) {
                if (!isObject(e))
                    return "symbol" == typeof e ? e : ("string" == typeof e ? "S" : "P") + e;
                if (!has(e, r)) {
                    if (!n(e))
                        return "F";
                    if (!t)
                        return "E";
                    o(e)
                }
                return e[r].objectID
            },
            getWeakData: function(e, t) {
                if (!has(e, r)) {
                    if (!n(e))
                        return !0;
                    if (!t)
                        return !1;
                    o(e)
                }
                return e[r].weakData
            },
            onFreeze: function(e) {
                return freezing && l.REQUIRED && n(e) && !has(e, r) && o(e),
                e
            }
        };
        hiddenKeys[r] = !0
    }
    ))
      , ITERATOR$3 = wellKnownSymbol("iterator")
      , ArrayPrototype$1 = Array.prototype
      , isArrayIteratorMethod = function(e) {
        return void 0 !== e && (iterators.Array === e || ArrayPrototype$1[ITERATOR$3] === e)
    }
      , ITERATOR$4 = wellKnownSymbol("iterator")
      , getIteratorMethod = function(e) {
        if (null != e)
            return e[ITERATOR$4] || e["@@iterator"] || iterators[classof(e)]
    }
      , callWithSafeIterationClosing = function(e, t, r, a) {
        try {
            return a ? t(anObject(r)[0], r[1]) : t(r)
        } catch (t) {
            var n = e.return;
            throw void 0 !== n && anObject(n.call(e)),
            t
        }
    }
      , iterate_1 = createCommonjsModule((function(e) {
        var t = function(e, t) {
            this.stopped = e,
            this.result = t
        };
        (e.exports = function(e, r, a, n, o) {
            var l, i, s, c, u, h, d, f = functionBindContext(r, a, n ? 2 : 1);
            if (o)
                l = e;
            else {
                if ("function" != typeof (i = getIteratorMethod(e)))
                    throw TypeError("Target is not iterable");
                if (isArrayIteratorMethod(i)) {
                    for (s = 0,
                    c = toLength(e.length); c > s; s++)
                        if ((u = n ? f(anObject(d = e[s])[0], d[1]) : f(e[s])) && u instanceof t)
                            return u;
                    return new t(!1)
                }
                l = i.call(e)
            }
            for (h = l.next; !(d = h.call(l)).done; )
                if ("object" == typeof (u = callWithSafeIterationClosing(l, f, d.value, n)) && u && u instanceof t)
                    return u;
            return new t(!1)
        }
        ).stop = function(e) {
            return new t(!0,e)
        }
    }
    ))
      , anInstance = function(e, t, r) {
        if (!(e instanceof t))
            throw TypeError("Incorrect " + (r ? r + " " : "") + "invocation");
        return e
    }
      , ITERATOR$5 = wellKnownSymbol("iterator")
      , SAFE_CLOSING = !1;
    try {
        var called = 0
          , iteratorWithReturn = {
            next: function() {
                return {
                    done: !!called++
                }
            },
            return: function() {
                SAFE_CLOSING = !0
            }
        };
        iteratorWithReturn[ITERATOR$5] = function() {
            return this
        }
        ,
        Array.from(iteratorWithReturn, (function() {
            throw 2
        }
        ))
    } catch (error) {}
    var checkCorrectnessOfIteration = function(e, t) {
        if (!t && !SAFE_CLOSING)
            return !1;
        var r = !1;
        try {
            var a = {};
            a[ITERATOR$5] = function() {
                return {
                    next: function() {
                        return {
                            done: r = !0
                        }
                    }
                }
            }
            ,
            e(a)
        } catch (e) {}
        return r
    }
      , collection = function(e, t, r) {
        var a = -1 !== e.indexOf("Map")
          , n = -1 !== e.indexOf("Weak")
          , o = a ? "set" : "add"
          , l = global_1[e]
          , i = l && l.prototype
          , s = l
          , c = {}
          , u = function(e) {
            var t = i[e];
            redefine(i, e, "add" == e ? function(e) {
                return t.call(this, 0 === e ? 0 : e),
                this
            }
            : "delete" == e ? function(e) {
                return !(n && !isObject(e)) && t.call(this, 0 === e ? 0 : e)
            }
            : "get" == e ? function(e) {
                return n && !isObject(e) ? void 0 : t.call(this, 0 === e ? 0 : e)
            }
            : "has" == e ? function(e) {
                return !(n && !isObject(e)) && t.call(this, 0 === e ? 0 : e)
            }
            : function(e, r) {
                return t.call(this, 0 === e ? 0 : e, r),
                this
            }
            )
        };
        if (isForced_1(e, "function" != typeof l || !(n || i.forEach && !fails((function() {
            (new l).entries().next()
        }
        )))))
            s = r.getConstructor(t, e, a, o),
            internalMetadata.REQUIRED = !0;
        else if (isForced_1(e, !0)) {
            var h = new s
              , d = h[o](n ? {} : -0, 1) != h
              , f = fails((function() {
                h.has(1)
            }
            ))
              , m = checkCorrectnessOfIteration((function(e) {
                new l(e)
            }
            ))
              , p = !n && fails((function() {
                for (var e = new l, t = 5; t--; )
                    e[o](t, t);
                return !e.has(-0)
            }
            ));
            m || ((s = t((function(t, r) {
                anInstance(t, s, e);
                var n = inheritIfRequired(new l, t, s);
                return null != r && iterate_1(r, n[o], n, a),
                n
            }
            ))).prototype = i,
            i.constructor = s),
            (f || p) && (u("delete"),
            u("has"),
            a && u("get")),
            (p || d) && u(o),
            n && i.clear && delete i.clear
        }
        return c[e] = s,
        _export({
            global: !0,
            forced: s != l
        }, c),
        setToStringTag(s, e),
        n || r.setStrong(s, e, a),
        s
    }
      , redefineAll = function(e, t, r) {
        for (var a in t)
            redefine(e, a, t[a], r);
        return e
    }
      , defineProperty$6 = objectDefineProperty.f
      , fastKey = internalMetadata.fastKey
      , setInternalState$2 = internalState.set
      , internalStateGetterFor = internalState.getterFor
      , collectionStrong = {
        getConstructor: function(e, t, r, a) {
            var n = e((function(e, o) {
                anInstance(e, n, t),
                setInternalState$2(e, {
                    type: t,
                    index: objectCreate(null),
                    first: void 0,
                    last: void 0,
                    size: 0
                }),
                descriptors || (e.size = 0),
                null != o && iterate_1(o, e[a], e, r)
            }
            ))
              , o = internalStateGetterFor(t)
              , l = function(e, t, r) {
                var a, n, l = o(e), s = i(e, t);
                return s ? s.value = r : (l.last = s = {
                    index: n = fastKey(t, !0),
                    key: t,
                    value: r,
                    previous: a = l.last,
                    next: void 0,
                    removed: !1
                },
                l.first || (l.first = s),
                a && (a.next = s),
                descriptors ? l.size++ : e.size++,
                "F" !== n && (l.index[n] = s)),
                e
            }
              , i = function(e, t) {
                var r, a = o(e), n = fastKey(t);
                if ("F" !== n)
                    return a.index[n];
                for (r = a.first; r; r = r.next)
                    if (r.key == t)
                        return r
            };
            return redefineAll(n.prototype, {
                clear: function() {
                    for (var e = o(this), t = e.index, r = e.first; r; )
                        r.removed = !0,
                        r.previous && (r.previous = r.previous.next = void 0),
                        delete t[r.index],
                        r = r.next;
                    e.first = e.last = void 0,
                    descriptors ? e.size = 0 : this.size = 0
                },
                delete: function(e) {
                    var t = o(this)
                      , r = i(this, e);
                    if (r) {
                        var a = r.next
                          , n = r.previous;
                        delete t.index[r.index],
                        r.removed = !0,
                        n && (n.next = a),
                        a && (a.previous = n),
                        t.first == r && (t.first = a),
                        t.last == r && (t.last = n),
                        descriptors ? t.size-- : this.size--
                    }
                    return !!r
                },
                forEach: function(e) {
                    for (var t, r = o(this), a = functionBindContext(e, arguments.length > 1 ? arguments[1] : void 0, 3); t = t ? t.next : r.first; )
                        for (a(t.value, t.key, this); t && t.removed; )
                            t = t.previous
                },
                has: function(e) {
                    return !!i(this, e)
                }
            }),
            redefineAll(n.prototype, r ? {
                get: function(e) {
                    var t = i(this, e);
                    return t && t.value
                },
                set: function(e, t) {
                    return l(this, 0 === e ? 0 : e, t)
                }
            } : {
                add: function(e) {
                    return l(this, e = 0 === e ? 0 : e, e)
                }
            }),
            descriptors && defineProperty$6(n.prototype, "size", {
                get: function() {
                    return o(this).size
                }
            }),
            n
        },
        setStrong: function(e, t, r) {
            var a = t + " Iterator"
              , n = internalStateGetterFor(t)
              , o = internalStateGetterFor(a);
            defineIterator(e, t, (function(e, t) {
                setInternalState$2(this, {
                    type: a,
                    target: e,
                    state: n(e),
                    kind: t,
                    last: void 0
                })
            }
            ), (function() {
                for (var e = o(this), t = e.kind, r = e.last; r && r.removed; )
                    r = r.previous;
                return e.target && (e.last = r = r ? r.next : e.state.first) ? "keys" == t ? {
                    value: r.key,
                    done: !1
                } : "values" == t ? {
                    value: r.value,
                    done: !1
                } : {
                    value: [r.key, r.value],
                    done: !1
                } : (e.target = void 0,
                {
                    value: void 0,
                    done: !0
                })
            }
            ), r ? "entries" : "values", !r, !0),
            setSpecies(t)
        }
    }
      , es_map = collection("Map", (function(e) {
        return function() {
            return e(this, arguments.length ? arguments[0] : void 0)
        }
    }
    ), collectionStrong)
      , charAt$1 = stringMultibyte.charAt
      , STRING_ITERATOR = "String Iterator"
      , setInternalState$3 = internalState.set
      , getInternalState$1 = internalState.getterFor(STRING_ITERATOR);
    function generateRandomKey(e) {
        null == e && (e = "chart");
        for (var t = window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g, "").split(""), r = "", a = 0; a < 12; a++)
            r += t[Math.round(Math.random() * (t.length - 1))];
        return e + "_" + r + "_" + (new Date).getTime()
    }
    function replaceHtml(e, t) {
        return e.replace(/\$\{([\w]+)\}/g, (function(e, r) {
            var a = t[r];
            return void 0 !== a ? a : e
        }
        ))
    }
    defineIterator(String, "String", (function(e) {
        setInternalState$3(this, {
            type: STRING_ITERATOR,
            string: String(e),
            index: 0
        })
    }
    ), (function() {
        var e, t = getInternalState$1(this), r = t.string, a = t.index;
        return a >= r.length ? {
            value: void 0,
            done: !0
        } : (e = charAt$1(r, a),
        t.index += e.length,
        {
            value: e,
            done: !1
        })
    }
    ));
    var error$1 = {
        v: "#VALUE!",
        n: "#NAME?",
        na: "#N/A",
        r: "#REF!",
        d: "#DIV/0!",
        nm: "#NUM!",
        nl: "#NULL!",
        sp: "#SPILL!"
    }
      , func_methods = {
        getCellDataArr: function(e, t, r) {
            var a = [];
            if (null == e.data)
                r || ("number" == t ? a.push(0) : "text" == t && a.push(""));
            else if ("array" == getObjType(e.data))
                for (var n = 0; n < e.data.length; n++)
                    for (var o = 0; o < e.data[n].length; o++)
                        if (null != e.data[n][o]) {
                            var l = e.data[n][o];
                            l instanceof Object ? a.push(l.v) : a.push(l)
                        } else
                            r || ("number" == t ? a.push(0) : "text" == t && a.push(""));
            else
                isRealNull(e.data.v) ? r || ("number" == t ? a.push(0) : "text" == t && a.push("")) : a.push(e.data.v);
            return a
        },
        getCellDataDyadicArr: function(e, t) {
            var r = [];
            if (null == e.data) {
                var a = [];
                "number" == t ? a.push(0) : "text" == t && a.push(""),
                r.push(a)
            } else if ("array" == getObjType(e.data))
                for (var n = 0; n < e.data.length; n++) {
                    for (var o = [], l = 0; l < e.data[n].length; l++) {
                        var i = void 0;
                        if (null != e.data[n][l]) {
                            var s = e.data[n][l];
                            i = s instanceof Object ? s.v : s
                        } else
                            "number" == t ? i = 0 : "text" == t && (i = "");
                        o.push(i)
                    }
                    r.push(o)
                }
            else {
                var c = []
                  , u = e.data.v;
                isRealNull(u) && ("number" == t ? u = 0 : "text" == t && (u = "")),
                c.push(u),
                r.push(c)
            }
            return r
        },
        getDataArr: function(e, t) {
            var r = [];
            if (null == t && (t = !1),
            "array" == getObjType(e[0]))
                for (var a = 0; a < e.length; a++)
                    for (var n = 0; n < e[a].length; n++)
                        t && !isRealNum(e[a][n]) || r.push(e[a][n]);
            else
                for (var o = 0; o < e.length; o++)
                    t && !isRealNum(e[o]) || r.push(e[o]);
            return r
        },
        getDataDyadicArr: function(e) {
            var t = [];
            if ("array" == getObjType(e[0]))
                for (var r = 0; r < e.length; r++) {
                    for (var a = [], n = 0; n < e[r].length; n++)
                        a.push(e[r][n]);
                    t.push(a)
                }
            else {
                for (var o = [], l = 0; l < e.length; l++)
                    o.push(e[l]);
                t.push(o)
            }
            return t
        },
        isDyadicArr: function(e) {
            var t = !0;
            if (e.length > 1)
                for (var r = e[0].length, a = 1; a < e.length; a++)
                    if (e[a].length != r) {
                        t = !1;
                        break
                    }
            return t
        },
        getFirstValue: function(e, t) {
            var r;
            if (null == t && (t = "number"),
            "array" == getObjType(e))
                if ("array" == getObjType(e[0])) {
                    if (!this.isDyadicArr(e))
                        return error$1.v;
                    r = e[0][0]
                } else
                    r = e[0];
            else if ("object" == getObjType(e) && null != e.startCell)
                if (null == e.data)
                    "number" == t ? r = 0 : "text" == t && (r = "");
                else {
                    var a = window.luckysheetCurrentRow
                      , n = window.luckysheetCurrentColumn;
                    if (1 == e.rowl && 1 == e.coll)
                        null == (r = e.data) || isRealNull(r.v) ? "number" == t ? r = 0 : "text" == t && (r = "") : r = r.v;
                    else if (null != e.data[0][0].mc && e.data[0][0].mc.rs == e.rowl && e.data[0][0].mc.cs == e.coll)
                        null == (r = e.data[0][0]) || isRealNull(r.v) ? "number" == t ? r = 0 : "text" == t && (r = "") : r = r.v;
                    else {
                        if (1 != e.rowl && 1 != e.coll)
                            return error$1.v;
                        var o = luckysheetformula.getcellrange(e.startCell)
                          , l = o.row[0]
                          , i = l + e.rowl - 1
                          , s = o.column[0]
                          , c = s + e.coll - 1;
                        if (1 == e.rowl) {
                            if (n < s || n > c)
                                return error$1.v;
                            r = e.data[0][n - s]
                        } else if (1 == e.coll) {
                            if (a < l || a > i)
                                return error$1.v;
                            r = e.data[a - l][0]
                        }
                        null == r || isRealNull(r.v) || null != r.mc ? "number" == t ? r = 0 : "text" == t && (r = "") : r = r.v
                    }
                }
            else
                r = e;
            return r
        },
        getCellBoolen: function(e) {
            var t = this.getFirstValue(e);
            if (valueIsError(t))
                return t;
            if ("boolean" == getObjType(t))
                ;
            else if ("string" != getObjType(t) || "true" != t.toLowerCase() && "false" != t.toLowerCase()) {
                if (!isRealNum(t))
                    return error$1.v;
                t = 0 != (t = parseFloat(t))
            } else
                "true" == t.toLowerCase() ? t = !0 : "false" == t.toLowerCase() && (t = !1);
            return t
        },
        getCellDate: function(e) {
            var t;
            if ("array" == getObjType(e))
                if ("array" == getObjType(e[0])) {
                    if (!this.isDyadicArr(e))
                        return error$1.v;
                    t = e[0][0]
                } else
                    t = e[0];
            else if ("object" == getObjType(e) && null != e.startCell) {
                if (null == e.data || "array" == getObjType(e.data) || isRealNull(e.data.v))
                    return error$1.v;
                t = e.data.v,
                null != e.data.ct && "d" == e.data.ct.t && (t = update("YYYY-MM-DD h:mm:ss", t))
            } else
                t = e;
            return t
        },
        getCellrangeDate: function(e) {
            var t = [];
            if ("array" == getObjType(e)) {
                if ("array" == getObjType(e[0]) && !this.isDyadicArr(e))
                    return error$1.v;
                t = t.concat(this.getDataArr(e, !1))
            } else if ("object" == getObjType(e) && null != e.startCell)
                if (null == e.data)
                    t.push(0);
                else if ("array" == getObjType(e.data))
                    for (var r = 0; r < e.data.length; r++)
                        for (var a = 0; a < e.data[r].length; a++)
                            if (null == e.data[r][a] || isRealNull(e.data[r][a].v))
                                t.push(0);
                            else {
                                var n = e.data[r][a].v;
                                null != e.data[r][a].ct && "d" == e.data[r][a].ct.t && (n = update("YYYY-MM-DD h:mm:ss", n)),
                                t.push(n)
                            }
                else {
                    var o = e.data.v;
                    null != e.data.ct && "d" == e.data.ct.t && (o = update("YYYY-MM-DD h:mm:ss", o)),
                    t.push(o)
                }
            else
                t.push(e);
            return t
        },
        getRegExpStr: function(e) {
            return e.replace("~*", "\\*").replace("~?", "\\?").replace(".", "\\.").replace("*", ".*").replace("?", ".")
        },
        factorial: function(e) {
            return 0 == e || 1 == e ? 1 : e * this.factorial(e - 1)
        },
        factorialDouble: function(e) {
            return e <= 0 ? 1 : e * this.factorialDouble(e - 2)
        },
        variance: function(e) {
            for (var t = 0, r = 0, a = 0; a < e.length; a++) {
                t += e[a],
                r++
            }
            for (var n = t / r, o = 0, l = 0; l < e.length; l++) {
                var i = e[l];
                o += (i - n) * (i - n)
            }
            return o / r
        },
        variance_s: function(e) {
            for (var t = 0, r = 0, a = 0; a < e.length; a++) {
                t += e[a],
                r++
            }
            for (var n = t / r, o = 0, l = 0; l < e.length; l++) {
                var i = e[l];
                o += (i - n) * (i - n)
            }
            return o / (r - 1)
        },
        standardDeviation: function(e) {
            for (var t = 0, r = 0, a = 0; a < e.length; a++) {
                t += e[a],
                r++
            }
            for (var n = t / r, o = 0, l = 0; l < e.length; l++) {
                var i = e[l];
                o += (i - n) * (i - n)
            }
            return Math.sqrt(o / r)
        },
        standardDeviation_s: function(e) {
            for (var t = 0, r = 0, a = 0; a < e.length; a++) {
                t += e[a],
                r++
            }
            for (var n = t / r, o = 0, l = 0; l < e.length; l++) {
                var i = e[l];
                o += (i - n) * (i - n)
            }
            return Math.sqrt(o / (r - 1))
        },
        isLeapYear: function(e) {
            return 1 === new Date(e,1,29).getMonth()
        },
        feb29Between: function(e, t) {
            var r = moment(e).year()
              , a = moment().set({
                year: r,
                month: 2,
                date: 1
            });
            if (this.isLeapYear(r) && moment(e) < moment(a) && moment(t) >= moment(a))
                return !0;
            var n = moment(t).year()
              , o = moment().set({
                year: n,
                month: 2,
                date: 1
            });
            return this.isLeapYear(n) && moment(t) >= moment(o) && moment(e) < moment(o)
        },
        findResultIndex: function findResultIndex(database, criterias) {
            for (var matches = {}, _i13 = 1; _i13 < database[0].length; ++_i13)
                matches[_i13] = !0;
            var maxCriteriaLength = criterias[0].length;
            for (i = 1; i < criterias.length; ++i)
                criterias[i].length > maxCriteriaLength && (maxCriteriaLength = criterias[i].length);
            for (var k = 1; k < database.length; ++k)
                for (var l = 1; l < database[k].length; ++l) {
                    for (var currentCriteriaResult = !1, hasMatchingCriteria = !1, j = 0; j < criterias.length; ++j) {
                        var criteria = criterias[j];
                        if (!(criteria.length < maxCriteriaLength)) {
                            var criteriaField = criteria[0];
                            if (database[k][0] === criteriaField) {
                                hasMatchingCriteria = !0;
                                for (var p = 1; p < criteria.length; ++p)
                                    currentCriteriaResult = currentCriteriaResult || eval(database[k][l] + criteria[p])
                            }
                        }
                    }
                    hasMatchingCriteria && (matches[l] = matches[l] && currentCriteriaResult)
                }
            for (var result = [], n = 0; n < database[0].length; ++n)
                matches[n] && result.push(n - 1);
            return result
        },
        findField: function(e, t) {
            for (var r = null, a = 0; a < e.length; a++)
                if (e[a][0] == t) {
                    r = a;
                    break
                }
            return null == r ? error$1.v : r
        },
        rest: function(e, t) {
            return t = t || 1,
            e && "function" == typeof e.slice ? e.slice(t) : e
        },
        compact: function(e) {
            if (!e)
                return e;
            for (var t = [], r = 0; r < e.length; ++r)
                e[r] && t.push(e[r]);
            return t
        }
    }
      , matrix = {}
      , init = function(e) {
        var t = function() {};
        t.precision = 1e-6,
        t.create = function(e) {
            return (new t).setElements(e)
        }
        ,
        t.I = function(e) {
            for (var r, a = [], n = e; n--; )
                for (r = e,
                a[n] = []; r--; )
                    a[n][r] = n === r ? 1 : 0;
            return t.create(a)
        }
        ,
        t.prototype = {
            e: function(e, t) {
                return e < 1 || e > this.elements.length || t < 1 || t > this.elements[0].length ? null : this.elements[e - 1][t - 1]
            },
            dimensions: function() {
                var e = 0 === this.elements.length ? 0 : this.elements[0].length;
                return {
                    rows: this.elements.length,
                    cols: e
                }
            },
            rows: function() {
                return this.elements.length
            },
            cols: function() {
                return 0 === this.elements.length ? 0 : this.elements[0].length
            },
            eql: function(e) {
                var r = e.elements || e;
                if (r[0] && void 0 !== r[0][0] || (r = t.create(r).elements),
                0 === this.elements.length || 0 === r.length)
                    return this.elements.length === r.length;
                if (this.elements.length !== r.length)
                    return !1;
                if (this.elements[0].length !== r[0].length)
                    return !1;
                for (var a, n = this.elements.length, o = this.elements[0].length; n--; )
                    for (a = o; a--; )
                        if (Math.abs(this.elements[n][a] - r[n][a]) > t.precision)
                            return !1;
                return !0
            },
            dup: function() {
                return t.create(this.elements)
            },
            map: function(e, r) {
                if (0 === this.elements.length)
                    return t.create([]);
                for (var a, n = [], o = this.elements.length, l = this.elements[0].length; o--; )
                    for (a = l,
                    n[o] = []; a--; )
                        n[o][a] = e.call(r, this.elements[o][a], o + 1, a + 1);
                return t.create(n)
            },
            isSameSizeAs: function(e) {
                var r = e.elements || e;
                return void 0 === r[0][0] && (r = t.create(r).elements),
                0 === this.elements.length ? 0 === r.length : this.elements.length === r.length && this.elements[0].length === r[0].length
            },
            add: function(e) {
                if (0 === this.elements.length)
                    return this.map((function(e) {
                        return e
                    }
                    ));
                var r = e.elements || e;
                return void 0 === r[0][0] && (r = t.create(r).elements),
                this.isSameSizeAs(r) ? this.map((function(e, t, a) {
                    return e + r[t - 1][a - 1]
                }
                )) : null
            },
            subtract: function(e) {
                if (0 === this.elements.length)
                    return this.map((function(e) {
                        return e
                    }
                    ));
                var r = e.elements || e;
                return void 0 === r[0][0] && (r = t.create(r).elements),
                this.isSameSizeAs(r) ? this.map((function(e, t, a) {
                    return e - r[t - 1][a - 1]
                }
                )) : null
            },
            canMultiplyFromLeft: function(e) {
                if (0 === this.elements.length)
                    return !1;
                var r = e.elements || e;
                return void 0 === r[0][0] && (r = t.create(r).elements),
                this.elements[0].length === r.length
            },
            multiply: function(e) {
                if (0 === this.elements.length)
                    return null;
                if (!e.elements)
                    return this.map((function(t) {
                        return t * e
                    }
                    ));
                var r = !!e.modulus;
                if (void 0 === (u = e.elements || e)[0][0] && (u = t.create(u).elements),
                !this.canMultiplyFromLeft(u))
                    return null;
                for (var a, n, o, l = this.elements.length, i = u[0].length, s = this.elements[0].length, c = []; l--; )
                    for (a = i,
                    c[l] = []; a--; ) {
                        for (n = s,
                        o = 0; n--; )
                            o += this.elements[l][n] * u[n][a];
                        c[l][a] = o
                    }
                var u = t.create(c);
                return r ? u.col(1) : u
            },
            minor: function(e, r, a, n) {
                if (0 === this.elements.length)
                    return null;
                for (var o, l, i, s = [], c = a, u = this.elements.length, h = this.elements[0].length; c--; )
                    for (s[o = a - c - 1] = [],
                    l = n; l--; )
                        i = n - l - 1,
                        s[o][i] = this.elements[(e + o - 1) % u][(r + i - 1) % h];
                return t.create(s)
            },
            transpose: function() {
                if (0 === this.elements.length)
                    return t.create([]);
                for (var e, r = this.elements.length, a = [], n = this.elements[0].length; n--; )
                    for (e = r,
                    a[n] = []; e--; )
                        a[n][e] = this.elements[e][n];
                return t.create(a)
            },
            isSquare: function() {
                var e = 0 === this.elements.length ? 0 : this.elements[0].length;
                return this.elements.length === e
            },
            max: function() {
                if (0 === this.elements.length)
                    return null;
                for (var e, t = 0, r = this.elements.length, a = this.elements[0].length; r--; )
                    for (e = a; e--; )
                        Math.abs(this.elements[r][e]) > Math.abs(t) && (t = this.elements[r][e]);
                return t
            },
            indexOf: function(e) {
                if (0 === this.elements.length)
                    return null;
                var t, r, a = this.elements.length, n = this.elements[0].length;
                for (t = 0; t < a; t++)
                    for (r = 0; r < n; r++)
                        if (this.elements[t][r] === e)
                            return {
                                i: t + 1,
                                j: r + 1
                            };
                return null
            },
            diagonal: function() {
                if (!this.isSquare)
                    return null;
                for (var e = [], r = this.elements.length, a = 0; a < r; a++)
                    e.push(this.elements[a][a]);
                return t.create(e)
            },
            toRightTriangular: function() {
                if (0 === this.elements.length)
                    return t.create([]);
                var e, r, a, n, o = this.dup(), l = this.elements.length, i = this.elements[0].length;
                for (r = 0; r < l; r++) {
                    if (0 === o.elements[r][r])
                        for (a = r + 1; a < l; a++)
                            if (0 !== o.elements[a][r]) {
                                for (e = [],
                                n = 0; n < i; n++)
                                    e.push(o.elements[r][n] + o.elements[a][n]);
                                o.elements[r] = e;
                                break
                            }
                    if (0 !== o.elements[r][r])
                        for (a = r + 1; a < l; a++) {
                            var s = o.elements[a][r] / o.elements[r][r];
                            for (e = [],
                            n = 0; n < i; n++)
                                e.push(n <= r ? 0 : o.elements[a][n] - o.elements[r][n] * s);
                            o.elements[a] = e
                        }
                }
                return o
            },
            determinant: function() {
                if (0 === this.elements.length)
                    return 1;
                if (!this.isSquare())
                    return null;
                for (var e = this.toRightTriangular(), t = e.elements[0][0], r = e.elements.length, a = 1; a < r; a++)
                    t *= e.elements[a][a];
                return t
            },
            isSingular: function() {
                return this.isSquare() && 0 === this.determinant()
            },
            trace: function() {
                if (0 === this.elements.length)
                    return 0;
                if (!this.isSquare())
                    return null;
                for (var e = this.elements[0][0], t = this.elements.length, r = 1; r < t; r++)
                    e += this.elements[r][r];
                return e
            },
            rank: function() {
                if (0 === this.elements.length)
                    return 0;
                for (var e, r = this.toRightTriangular(), a = 0, n = this.elements.length, o = this.elements[0].length; n--; )
                    for (e = o; e--; )
                        if (Math.abs(r.elements[n][e]) > t.precision) {
                            a++;
                            break
                        }
                return a
            },
            augment: function(e) {
                if (0 === this.elements.length)
                    return this.dup();
                var r = e.elements || e;
                void 0 === r[0][0] && (r = t.create(r).elements);
                var a, n = this.dup(), o = n.elements[0].length, l = n.elements.length, i = r[0].length;
                if (l !== r.length)
                    return null;
                for (; l--; )
                    for (a = i; a--; )
                        n.elements[l][o + a] = r[l][a];
                return n
            },
            inverse: function() {
                if (0 === this.elements.length)
                    return null;
                if (!this.isSquare() || this.isSingular())
                    return null;
                for (var e, r, a, n, o, l = this.elements.length, i = l, s = this.augment(t.I(l)).toRightTriangular(), c = s.elements[0].length, u = []; i--; ) {
                    for (a = [],
                    u[i] = [],
                    n = s.elements[i][i],
                    r = 0; r < c; r++)
                        o = s.elements[i][r] / n,
                        a.push(o),
                        r >= l && u[i].push(o);
                    for (s.elements[i] = a,
                    e = i; e--; ) {
                        for (a = [],
                        r = 0; r < c; r++)
                            a.push(s.elements[e][r] - s.elements[i][r] * s.elements[e][i]);
                        s.elements[e] = a
                    }
                }
                return t.create(u)
            },
            round: function() {
                return this.map((function(e) {
                    return Math.round(e)
                }
                ))
            },
            snapTo: function(e) {
                return this.map((function(r) {
                    return Math.abs(r - e) <= t.precision ? e : r
                }
                ))
            },
            setElements: function(e) {
                var t, r, a = e.elements || e;
                if (a[0] && void 0 !== a[0][0]) {
                    for (t = a.length,
                    this.elements = []; t--; )
                        for (r = a[t].length,
                        this.elements[t] = []; r--; )
                            this.elements[t][r] = a[t][r];
                    return this
                }
                var n = a.length;
                for (this.elements = [],
                t = 0; t < n; t++)
                    this.elements.push([a[t]]);
                return this
            }
        },
        e.sylvester_matrix = t
    };
    function inverse(e) {
        return matrix.sylvester_matrix.create(e).inverse().elements
    }
    function luckysheet_compareWith() {
        var e, t = arguments[1], r = arguments[0];
        "object" == getObjType(r) && null != r.startCell ? 1 == (e = "&" == t ? func_methods.getCellDataDyadicArr(r, "text") : func_methods.getCellDataDyadicArr(r, "number")).length && 1 == e[0].length && (e = e[0][0]) : e = r;
        var a, n = arguments[2];
        if ("object" == getObjType(n) && null != n.startCell ? 1 == (a = "&" == t ? func_methods.getCellDataDyadicArr(n, "text") : func_methods.getCellDataDyadicArr(n, "number")).length && 1 == a[0].length && (a = a[0][0]) : a = n,
        valueIsError(e))
            return e;
        if (valueIsError(a))
            return a;
        if ("array" == getObjType(e) && "array" == getObjType(e[0]) && !func_methods.isDyadicArr(e))
            return error.v;
        if ("array" == getObjType(a) && "array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
            return error.v;
        if ("<>" == t && (t = "!="),
        "=" == t && (t = "=="),
        null == e && null == a)
            return "#INVERSE!";
        if ("#INVERSE!" == e)
            e = 0,
            "-" == t ? t = "+" : "+" == t && (t = "-");
        else if ("-" == t && null == e)
            e = 0;
        else if ("/" == t && (0 == a || null == a))
            return error.d;
        function o(e, t, r) {
            return isRealNum(e) && (e = parseFloat(e)),
            isRealNum(r) && (r = parseFloat(r)),
            "==" == t ? e == r : "!=" == t ? e != r : ">=" == t ? e >= r : "<=" == t ? e <= r : ">" == t ? e > r : "<" == t ? e < r : void 0
        }
        function l(e) {
            return null == e ? e : "true" == e.toString().toLowerCase() ? 1 : "false" == e.toString().toLowerCase() ? 0 : e
        }
        if ("*" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var i = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0]))
                    if (e.length == a.length && e[0].length == a[0].length)
                        for (var s = 0; s < e.length; s++) {
                            for (var c = [], u = 0; u < e[s].length; u++) {
                                e[s][u] = l(e[s][u]),
                                a[s][u] = l(a[s][u]);
                                var h = void 0;
                                h = isRealNum(e[s][u]) && isRealNum(a[s][u]) ? luckysheet_calcADPMM$1(e[s][u], t, a[s][u]) : error.v,
                                c.push(h)
                            }
                            i.push(c)
                        }
                    else if (e[0].length == a.length)
                        for (var d = e.length, f = a[0].length, m = 0; m < d; m++) {
                            for (var p = [], g = 0; g < f; g++) {
                                for (var y = 0, v = 0; v < e[0].length; v++)
                                    e[m][v] = l(e[m][v]),
                                    a[v][g] = l(a[v][g]),
                                    isRealNum(e[m][v]) && isRealNum(a[v][g]) ? y += luckysheet_calcADPMM$1(e[m][v], t, a[v][g]) : y += error.v;
                                "NaN" == y.toString() && (y = error.v),
                                p.push(y)
                            }
                            i.push(p)
                        }
                    else {
                        if (e.length != a[0].length)
                            return error.na;
                        for (var A = a.length, b = e[0].length, k = 0; k < A; k++) {
                            for (var w = [], x = 0; x < b; x++) {
                                for (var S = 0, _ = 0; _ < a[0].length; _++)
                                    e[_][x] = l(e[_][x]),
                                    a[k][_] = l(a[k][_]),
                                    isRealNum(a[k][_]) && isRealNum(e[_][x]) ? S += luckysheet_calcADPMM$1(e[_][x], t, a[k][_]) : S += error.v;
                                "NaN" == S.toString() && (S = error.v),
                                w.push(S)
                            }
                            i.push(w)
                        }
                    }
                else if ("array" == getObjType(e[0]))
                    if (e[0].length == a.length)
                        for (var C = 0; C < e.length; C++) {
                            for (var T = [], E = 0; E < e[C].length; E++) {
                                e[C][E] = l(e[C][E]),
                                a[E] = l(a[E]);
                                var I = void 0;
                                I = isRealNum(e[C][E]) && isRealNum(a[E]) ? luckysheet_calcADPMM$1(e[C][E], t, a[E]) : error.v,
                                T.push(I)
                            }
                            i.push(T)
                        }
                    else {
                        if (1 != e[0].length)
                            return error.na;
                        for (var R = e.length, B = a.length, N = 0; N < R; N++) {
                            for (var F = [], P = 0; P < B; P++) {
                                e[N][0] = l(e[N][0]),
                                a[P] = l(a[P]);
                                var $ = void 0;
                                $ = isRealNum(e[N][0]) && isRealNum(a[P]) ? luckysheet_calcADPMM$1(e[N][0], t, a[P]) : error.v,
                                F.push($)
                            }
                            i.push(F)
                        }
                    }
                else if ("array" == getObjType(a[0]))
                    if (a[0].length == e.length)
                        for (var L = 0; L < a.length; L++) {
                            for (var O = [], D = 0; D < a[L].length; D++) {
                                e[D] = l(e[D]),
                                a[L][D] = l(a[L][D]);
                                var M = void 0;
                                M = isRealNum(e[D]) && isRealNum(a[L][D]) ? luckysheet_calcADPMM$1(e[D], t, a[L][D]) : error.v,
                                O.push(M)
                            }
                            i.push(O)
                        }
                    else {
                        if (1 != a[0].length)
                            return error.na;
                        for (var U = a.length, H = e.length, q = 0; q < U; q++) {
                            for (var z = [], j = 0; j < H; j++) {
                                e[j] = l(e[j]),
                                a[q][0] = l(a[q][0]);
                                var V = void 0;
                                V = isRealNum(e[j]) && isRealNum(a[q][0]) ? luckysheet_calcADPMM$1(e[j], t, a[q][0]) : error.v,
                                z.push(V)
                            }
                            i.push(z)
                        }
                    }
                else {
                    if (e.length != a.length)
                        return error.na;
                    for (var Q = 0; Q < e.length; Q++) {
                        e[Q] = l(e[Q]),
                        a[Q] = l(a[Q]);
                        var G = void 0;
                        G = isRealNum(e[Q]) && isRealNum(a[Q]) ? luckysheet_calcADPMM$1(e[Q], t, a[Q]) : error.v,
                        i.push(G)
                    }
                }
                return i
            }
            if ("array" == getObjType(e)) {
                a = l(a);
                var K = [];
                if ("array" == getObjType(e[0]))
                    for (var W = 0; W < e.length; W++) {
                        for (var Y = [], X = 0; X < e[W].length; X++) {
                            e[W][X] = l(e[W][X]);
                            var J = void 0;
                            J = isRealNum(e[W][X]) && isRealNum(a) ? luckysheet_calcADPMM$1(e[W][X], t, a) : error.v,
                            Y.push(J)
                        }
                        K.push(Y)
                    }
                else
                    for (var Z = 0; Z < e.length; Z++) {
                        e[Z] = l(e[Z]);
                        var ee = void 0;
                        ee = isRealNum(e[Z]) && isRealNum(a) ? luckysheet_calcADPMM$1(e[Z], t, a) : error.v,
                        K.push(ee)
                    }
                return K
            }
            if ("array" == getObjType(a)) {
                e = l(e);
                var te = [];
                if ("array" == getObjType(a[0]))
                    for (var re = 0; re < a.length; re++) {
                        for (var ae = [], ne = 0; ne < a[re].length; ne++) {
                            a[re][ne] = l(a[re][ne]);
                            var oe = void 0;
                            oe = isRealNum(e) && isRealNum(a[re][ne]) ? luckysheet_calcADPMM$1(e, t, a[re][ne]) : error.v,
                            ae.push(oe)
                        }
                        te.push(ae)
                    }
                else
                    for (var le = 0; le < a.length; le++) {
                        a[le] = l(a[le]);
                        var ie = void 0;
                        ie = isRealNum(e) && isRealNum(a[le]) ? luckysheet_calcADPMM$1(e, t, a[le]) : error.v,
                        te.push(ie)
                    }
                return te
            }
            return e = l(e),
            a = l(a),
            isRealNum(e) && isRealNum(a) ? luckysheet_calcADPMM$1(e, t, a) : error.v
        }
        if ("/" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var se = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0]))
                    if (e.length == a.length && e[0].length == a[0].length)
                        for (var ce = 0; ce < e.length; ce++) {
                            for (var ue = [], he = 0; he < e[ce].length; he++) {
                                e[ce][he] = l(e[ce][he]),
                                a[ce][he] = l(a[ce][he]);
                                var de = void 0;
                                de = isRealNum(e[ce][he]) && isRealNum(a[ce][he]) ? 0 == parseFloat(a[ce][he]) ? error.d : luckysheet_calcADPMM$1(e[ce][he], t, a[ce][he]) : error.v,
                                ue.push(de)
                            }
                            se.push(ue)
                        }
                    else {
                        if (e[0].length != a.length)
                            return error.na;
                        for (var fe = inverse(a), me = e.length, pe = fe[0].length, ge = 0; ge < me; ge++) {
                            for (var ye = [], ve = 0; ve < pe; ve++) {
                                for (var Ae = 0, be = 0; be < e[0].length; be++)
                                    e[ge][be] = l(e[ge][be]),
                                    fe[be][ve] = l(fe[be][ve]),
                                    isRealNum(e[ge][be]) && isRealNum(fe[be][ve]) ? Ae += luckysheet_calcADPMM$1(e[ge][be], "*", fe[be][ve]) : Ae += error.v;
                                "NaN" == Ae.toString() && (Ae = error.v),
                                ye.push(Ae)
                            }
                            se.push(ye)
                        }
                    }
                else if ("array" == getObjType(e[0]))
                    if (e[0].length == a.length)
                        for (var ke = 0; ke < e.length; ke++) {
                            for (var we = [], xe = 0; xe < e[ke].length; xe++) {
                                e[ke][xe] = l(e[ke][xe]),
                                a[xe] = l(a[xe]);
                                var Se = void 0;
                                Se = isRealNum(e[ke][xe]) && isRealNum(a[xe]) ? 0 == parseFloat(a[xe]) ? error.d : luckysheet_calcADPMM$1(e[ke][xe], t, a[xe]) : error.v,
                                we.push(Se)
                            }
                            se.push(we)
                        }
                    else {
                        if (1 != e[0].length)
                            return error.na;
                        for (var _e = e.length, Ce = a.length, Te = 0; Te < _e; Te++) {
                            for (var Ee = [], Ie = 0; Ie < Ce; Ie++) {
                                e[Te][0] = l(e[Te][0]),
                                a[Ie] = l(a[Ie]);
                                var Re = void 0;
                                Re = isRealNum(e[Te][0]) && isRealNum(a[Ie]) ? 0 == parseFloat(a[Ie]) ? error.d : luckysheet_calcADPMM$1(e[Te][0], t, a[Ie]) : error.v,
                                Ee.push(Re)
                            }
                            se.push(Ee)
                        }
                    }
                else if ("array" == getObjType(a[0]))
                    if (a[0].length == e.length)
                        for (var Be = 0; Be < a.length; Be++) {
                            for (var Ne = [], Fe = 0; Fe < a[Be].length; Fe++) {
                                e[Fe] = l(e[Fe]),
                                a[Be][Fe] = l(a[Be][Fe]);
                                var Pe = void 0;
                                Pe = isRealNum(e[Fe]) && isRealNum(a[Be][Fe]) ? 0 == parseFloat(a[Be][Fe]) ? error.d : luckysheet_calcADPMM$1(e[Fe], t, a[Be][Fe]) : error.v,
                                Ne.push(Pe)
                            }
                            se.push(Ne)
                        }
                    else {
                        if (1 != a[0].length)
                            return error.na;
                        for (var $e = a.length, Le = e.length, Oe = 0; Oe < $e; Oe++) {
                            for (var De = [], Me = 0; Me < Le; Me++) {
                                e[Me] = l(e[Me]),
                                a[Oe][0] = l(a[Oe][0]);
                                var Ue = void 0;
                                Ue = isRealNum(e[Me]) && isRealNum(a[Oe][0]) ? 0 == parseFloat(a[Oe][0]) ? error.d : luckysheet_calcADPMM$1(e[Me], t, a[Oe][0]) : error.v,
                                De.push(Ue)
                            }
                            se.push(De)
                        }
                    }
                else {
                    if (e.length != a.length)
                        return error.na;
                    for (var He = 0; He < e.length; He++) {
                        e[He] = l(e[He]),
                        a[He] = l(a[He]);
                        var qe = void 0;
                        qe = isRealNum(e[He]) && isRealNum(a[He]) ? 0 == parseFloat(a[He]) ? error.d : luckysheet_calcADPMM$1(e[He], t, a[He]) : error.v,
                        se.push(qe)
                    }
                }
                return se
            }
            if ("array" == getObjType(e)) {
                a = l(a);
                var ze = [];
                if ("array" == getObjType(e[0]))
                    for (var je = 0; je < e.length; je++) {
                        for (var Ve = [], Qe = 0; Qe < e[je].length; Qe++) {
                            e[je][Qe] = l(e[je][Qe]);
                            var Ge = void 0;
                            Ge = isRealNum(e[je][Qe]) && isRealNum(a) ? 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e[je][Qe], t, a) : error.v,
                            Ve.push(Ge)
                        }
                        ze.push(Ve)
                    }
                else
                    for (var Ke = 0; Ke < e.length; Ke++) {
                        e[Ke] = l(e[Ke]);
                        var We = void 0;
                        We = isRealNum(e[Ke]) && isRealNum(a) ? 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e[Ke], t, a) : error.v,
                        ze.push(We)
                    }
                return ze
            }
            if ("array" == getObjType(a)) {
                e = l(e);
                var Ye = [];
                if ("array" == getObjType(a[0]))
                    for (var Xe = 0; Xe < a.length; Xe++) {
                        for (var Je = [], Ze = 0; Ze < a[Xe].length; Ze++) {
                            a[Xe][Ze] = l(a[Xe][Ze]);
                            var et = void 0;
                            et = isRealNum(e) && isRealNum(a[Xe][Ze]) ? 0 == parseFloat(a[Xe][Ze]) ? error.d : luckysheet_calcADPMM$1(e, t, a[Xe][Ze]) : error.v,
                            Je.push(et)
                        }
                        Ye.push(Je)
                    }
                else
                    for (var tt = 0; tt < a.length; tt++) {
                        a[tt] = l(a[tt]);
                        var rt = void 0;
                        rt = isRealNum(e) && isRealNum(a[tt]) ? 0 == parseFloat(a[tt]) ? error.d : luckysheet_calcADPMM$1(e, t, a[tt]) : error.v,
                        Ye.push(rt)
                    }
                return Ye
            }
            return e = l(e),
            a = l(a),
            isRealNum(e) && isRealNum(a) ? 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e, t, a) : error.v
        }
        if ("+" == t || "-" == t || "%" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var at = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0])) {
                    if (e.length != a.length && e[0].length != a[0].length)
                        return error.na;
                    for (var nt = 0; nt < e.length; nt++) {
                        for (var ot = [], lt = 0; lt < e[nt].length; lt++) {
                            e[nt][lt] = l(e[nt][lt]),
                            a[nt][lt] = l(a[nt][lt]);
                            var it = void 0;
                            it = isRealNum(e[nt][lt]) && isRealNum(a[nt][lt]) ? "%" == t && 0 == parseFloat(a[nt][lt]) ? error.d : luckysheet_calcADPMM$1(e[nt][lt], t, a[nt][lt]) : error.v,
                            ot.push(it)
                        }
                        at.push(ot)
                    }
                } else if ("array" == getObjType(e[0])) {
                    if (e[0].length != a.length)
                        return error.na;
                    for (var st = 0; st < e.length; st++) {
                        for (var ct = [], ut = 0; ut < e[st].length; ut++) {
                            e[st][ut] = l(e[st][ut]),
                            a[ut] = l(a[ut]);
                            var ht = void 0;
                            ht = isRealNum(e[st][ut]) && isRealNum(a[ut]) ? "%" == t && 0 == parseFloat(a[ut]) ? error.d : luckysheet_calcADPMM$1(e[st][ut], t, a[ut]) : error.v,
                            ct.push(ht)
                        }
                        at.push(ct)
                    }
                } else if ("array" == getObjType(a[0])) {
                    if (a[0].length != e.length)
                        return error.na;
                    for (var dt = 0; dt < a.length; dt++) {
                        for (var ft = [], mt = 0; mt < a[dt].length; mt++) {
                            e[mt] = l(e[mt]),
                            a[dt][mt] = l(a[dt][mt]);
                            var pt = void 0;
                            pt = isRealNum(e[mt]) && isRealNum(a[dt][mt]) ? "%" == t && 0 == parseFloat(a[dt][mt]) ? error.d : luckysheet_calcADPMM$1(e[mt], t, a[dt][mt]) : error.v,
                            ft.push(pt)
                        }
                        at.push(ft)
                    }
                } else {
                    if (e.length != a.length)
                        return error.na;
                    for (var gt = 0; gt < e.length; gt++) {
                        e[gt] = l(e[gt]),
                        a[gt] = l(a[gt]);
                        var yt = void 0;
                        yt = isRealNum(e[gt]) && isRealNum(a[gt]) ? "%" == t && 0 == parseFloat(a[gt]) ? error.d : luckysheet_calcADPMM$1(e[gt], t, a[gt]) : error.v,
                        at.push(yt)
                    }
                }
                return at
            }
            if ("array" == getObjType(e)) {
                a = l(a);
                var vt = [];
                if ("array" == getObjType(e[0]))
                    for (var At = 0; At < e.length; At++) {
                        for (var bt = [], kt = 0; kt < e[At].length; kt++) {
                            e[At][kt] = l(e[At][kt]);
                            var wt = void 0;
                            wt = isRealNum(e[At][kt]) && isRealNum(a) ? "%" == t && 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e[At][kt], t, a) : error.v,
                            bt.push(wt)
                        }
                        vt.push(bt)
                    }
                else
                    for (var xt = 0; xt < e.length; xt++) {
                        e[xt] = l(e[xt]);
                        var St = void 0;
                        St = isRealNum(e[xt]) && isRealNum(a) ? "%" == t && 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e[xt], t, a) : error.v,
                        vt.push(St)
                    }
                return vt
            }
            if ("array" == getObjType(a)) {
                e = l(e);
                var _t = [];
                if ("array" == getObjType(a[0]))
                    for (var Ct = 0; Ct < a.length; Ct++) {
                        for (var Tt = [], Et = 0; Et < a[Ct].length; Et++) {
                            a[Ct][Et] = l(a[Ct][Et]);
                            var It = void 0;
                            It = isRealNum(e) && isRealNum(a[Ct][Et]) ? "%" == t && 0 == parseFloat(a[Ct][Et]) ? error.d : luckysheet_calcADPMM$1(e, t, a[Ct][Et]) : error.v,
                            Tt.push(It)
                        }
                        _t.push(Tt)
                    }
                else
                    for (var Rt = 0; Rt < a.length; Rt++) {
                        a[Rt] = l(a[Rt]);
                        var Bt = void 0;
                        Bt = isRealNum(e) && isRealNum(a[Rt]) ? "%" == t && 0 == parseFloat(a[Rt]) ? error.d : luckysheet_calcADPMM$1(e, t, a[Rt]) : error.v,
                        _t.push(Bt)
                    }
                return _t
            }
            return e = l(e),
            a = l(a),
            isRealNum(e) && isRealNum(a) ? "%" == t && 0 == parseFloat(a) ? error.d : luckysheet_calcADPMM$1(e, t, a) : error.v
        }
        if ("==" == t || "!=" == t || ">=" == t || "<=" == t || ">" == t || "<" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var Nt = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0])) {
                    if (e.length != a.length && e[0].length != a[0].length)
                        return error.na;
                    for (var Ft = 0; Ft < e.length; Ft++) {
                        for (var Pt = [], $t = 0; $t < e[Ft].length; $t++) {
                            var Lt = o(e[Ft][$t], t, a[Ft][$t]);
                            Pt.push(Lt)
                        }
                        Nt.push(Pt)
                    }
                } else if ("array" == getObjType(e[0])) {
                    if (e[0].length != a.length)
                        return error.na;
                    for (var Ot = 0; Ot < e.length; Ot++) {
                        for (var Dt = [], Mt = 0; Mt < e[Ot].length; Mt++) {
                            var Ut = o(e[Ot][Mt], t, a[Mt]);
                            Dt.push(Ut)
                        }
                        Nt.push(Dt)
                    }
                } else if ("array" == getObjType(a[0])) {
                    if (a[0].length != e.length)
                        return error.na;
                    for (var Ht = 0; Ht < a.length; Ht++) {
                        for (var qt = [], zt = 0; zt < a[Ht].length; zt++) {
                            var jt = o(e[zt], t, a[Ht][zt]);
                            qt.push(jt)
                        }
                        Nt.push(qt)
                    }
                } else {
                    if (e.length != a.length)
                        return error.na;
                    for (var Vt = 0; Vt < e.length; Vt++) {
                        var Qt = o(e[Vt], t, a[Vt]);
                        Nt.push(Qt)
                    }
                }
                return Nt
            }
            if ("array" == getObjType(e)) {
                var Gt = [];
                if ("array" == getObjType(e[0]))
                    for (var Kt = 0; Kt < e.length; Kt++) {
                        for (var Wt = [], Yt = 0; Yt < e[Kt].length; Yt++) {
                            var Xt = o(e[Kt][Yt], t, a);
                            Wt.push(Xt)
                        }
                        Gt.push(Wt)
                    }
                else
                    for (var Jt = 0; Jt < e.length; Jt++) {
                        var Zt = o(e[Jt], t, a);
                        Gt.push(Zt)
                    }
                return Gt
            }
            if ("array" == getObjType(a)) {
                var er = [];
                if ("array" == getObjType(a[0]))
                    for (var tr = 0; tr < a.length; tr++) {
                        for (var rr = [], ar = 0; ar < a[tr].length; ar++) {
                            var nr = o(e, t, a[tr][ar]);
                            rr.push(nr)
                        }
                        er.push(rr)
                    }
                else
                    for (var or = 0; or < a.length; or++) {
                        var lr = o(e, t, a[or]);
                        er.push(lr)
                    }
                return er
            }
            return o(e, t, a)
        }
        if ("&" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var ir = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0])) {
                    if (e.length != a.length && e[0].length != a[0].length)
                        return error.na;
                    for (var sr = 0; sr < e.length; sr++) {
                        for (var cr = [], ur = 0; ur < e[sr].length; ur++)
                            cr.push(e[sr][ur] + "" + a[sr][ur]);
                        ir.push(cr)
                    }
                } else if ("array" == getObjType(e[0])) {
                    if (e[0].length != a.length)
                        return error.na;
                    for (var hr = 0; hr < e.length; hr++) {
                        for (var dr = [], fr = 0; fr < e[hr].length; fr++)
                            dr.push(e[hr][fr] + "" + a[fr]);
                        ir.push(dr)
                    }
                } else if ("array" == getObjType(a[0])) {
                    if (a[0].length != e.length)
                        return error.na;
                    for (var mr = 0; mr < a.length; mr++) {
                        for (var pr = [], gr = 0; gr < a[mr].length; gr++)
                            pr.push(e[gr] + "" + a[mr][gr]);
                        ir.push(pr)
                    }
                } else {
                    if (e.length != a.length)
                        return error.na;
                    for (var yr = 0; yr < e.length; yr++)
                        ir.push(e[yr] + "" + a[yr])
                }
                return ir
            }
            if ("array" == getObjType(e)) {
                var vr = [];
                if ("array" == getObjType(e[0]))
                    for (var Ar = 0; Ar < e.length; Ar++) {
                        for (var br = [], kr = 0; kr < e[Ar].length; kr++)
                            br.push(e[Ar][kr] + "" + a);
                        vr.push(br)
                    }
                else
                    for (var wr = 0; wr < e.length; wr++)
                        vr.push(e[wr] + "" + a);
                return vr
            }
            if ("array" == getObjType(a)) {
                var xr = [];
                if ("array" == getObjType(a[0]))
                    for (var Sr = 0; Sr < a.length; Sr++) {
                        for (var _r = [], Cr = 0; Cr < a[Sr].length; Cr++)
                            _r.push(e + "" + a[Sr][Cr]);
                        xr.push(_r)
                    }
                else
                    for (var Tr = 0; Tr < a.length; Tr++)
                        xr.push(e + "" + a[Tr]);
                return xr
            }
            return e + "" + a
        }
        if ("^" == t) {
            if ("array" == getObjType(e) && "array" == getObjType(a)) {
                var Er = [];
                if ("array" == getObjType(e[0]) && "array" == getObjType(a[0])) {
                    if (e.length != a.length && e[0].length != a[0].length)
                        return error.na;
                    for (var Ir = 0; Ir < e.length; Ir++) {
                        for (var Rr = [], Br = 0; Br < e[Ir].length; Br++) {
                            e[Ir][Br] = l(e[Ir][Br]),
                            a[Ir][Br] = l(a[Ir][Br]);
                            var Nr = void 0;
                            Nr = isRealNum(e[Ir][Br]) && isRealNum(a[Ir][Br]) ? Math.pow(parseFloat(e[Ir][Br]), parseFloat(a[Ir][Br])) : error.v,
                            Rr.push(Nr)
                        }
                        Er.push(Rr)
                    }
                } else if ("array" == getObjType(e[0])) {
                    if (e[0].length != a.length)
                        return error.na;
                    for (var Fr = 0; Fr < e.length; Fr++) {
                        for (var Pr = [], $r = 0; $r < e[Fr].length; $r++) {
                            e[Fr][$r] = l(e[Fr][$r]),
                            a[$r] = l(a[$r]);
                            var Lr = void 0;
                            Lr = isRealNum(e[Fr][$r]) && isRealNum(a[$r]) ? Math.pow(parseFloat(e[Fr][$r]), parseFloat(a[$r])) : error.v,
                            Pr.push(Lr)
                        }
                        Er.push(Pr)
                    }
                } else if ("array" == getObjType(a[0])) {
                    if (a[0].length != e.length)
                        return error.na;
                    for (var Or = 0; Or < a.length; Or++) {
                        for (var Dr = [], Mr = 0; Mr < a[Or].length; Mr++) {
                            e[Mr] = l(e[Mr]),
                            a[Or][Mr] = l(a[Or][Mr]);
                            var Ur = void 0;
                            Ur = isRealNum(e[Mr]) && isRealNum(a[Or][Mr]) ? Math.pow(parseFloat(e[Mr]), parseFloat(a[Or][Mr])) : error.v,
                            Dr.push(Ur)
                        }
                        Er.push(Dr)
                    }
                } else {
                    if (e.length != a.length)
                        return error.na;
                    for (var Hr = 0; Hr < e.length; Hr++) {
                        e[Hr] = l(e[Hr]),
                        a[Hr] = l(a[Hr]);
                        var qr = void 0;
                        qr = isRealNum(e[Hr]) && isRealNum(a[Hr]) ? Math.pow(parseFloat(e[Hr]), parseFloat(a[Hr])) : error.v,
                        Er.push(qr)
                    }
                }
                return Er
            }
            if ("array" == getObjType(e)) {
                a = l(a);
                var zr = [];
                if ("array" == getObjType(e[0]))
                    for (var jr = 0; jr < e.length; jr++) {
                        for (var Vr = [], Qr = 0; Qr < e[jr].length; Qr++) {
                            e[jr][Qr] = l(e[jr][Qr]);
                            var Gr = void 0;
                            Gr = isRealNum(e[jr][Qr]) && isRealNum(a) ? Math.pow(parseFloat(e[jr][Qr]), parseFloat(a)) : error.v,
                            Vr.push(Gr)
                        }
                        zr.push(Vr)
                    }
                else
                    for (var Kr = 0; Kr < e.length; Kr++) {
                        e[Kr] = l(e[Kr]);
                        var Wr = void 0;
                        Wr = isRealNum(e[Kr]) && isRealNum(a) ? Math.pow(parseFloat(e[Kr]), parseFloat(a)) : error.v,
                        zr.push(Wr)
                    }
                return zr
            }
            if ("array" == getObjType(a)) {
                e = l(e);
                var Yr = [];
                if ("array" == getObjType(a[0]))
                    for (var Xr = 0; Xr < a.length; Xr++) {
                        for (var Jr = [], Zr = 0; Zr < a[Xr].length; Zr++) {
                            a[Xr][Zr] = l(a[Xr][Zr]);
                            var ea = void 0;
                            ea = isRealNum(e) && isRealNum(a[Xr][Zr]) ? Math.pow(parseFloat(e), parseFloat(a[Xr][Zr])) : error.v,
                            Jr.push(ea)
                        }
                        Yr.push(Jr)
                    }
                else
                    for (var ta = 0; ta < a.length; ta++) {
                        a[ta] = l(a[ta]);
                        var ra = void 0;
                        ra = isRealNum(e) && isRealNum(a[ta]) ? Math.pow(parseFloat(e), parseFloat(a[ta])) : error.v,
                        Yr.push(ra)
                    }
                return Yr
            }
            return e = l(e),
            a = l(a),
            isRealNum(e) && isRealNum(a) ? Math.pow(parseFloat(e), parseFloat(a)) : error.v
        }
    }
    function luckysheet_getarraydata() {
        var e = arguments[0]
          , t = [];
        if ((e = e.replace("{", "").replace("}", "").replace(/\"/g, "")).indexOf(";") > -1) {
            t = e.split(";");
            for (var r = 0; r < t.length; r++)
                t[r] = t[r].split(",")
        } else
            t = e.split(",");
        return t
    }
    function luckysheet_calcADPMM$1(fp, sp, tp) {
        var value;
        return "+" == sp ? value = numeral(fp).add(tp).value() : "-" == sp ? value = numeral(fp).subtract(tp).value() : "%" == sp ? value = eval(parseFloat(fp) + sp + "(" + parseFloat(tp) + ")") : "/" == sp ? value = numeral(fp).divide(tp).value() : "*" == sp && (value = numeral(fp).multiply(tp).value()),
        value
    }
    function luckysheet_getcelldata(e) {
        if (null == window.luckysheet_getcelldata_cache && (window.luckysheet_getcelldata_cache = {}),
        e in window.luckysheet_getcelldata_cache)
            return window.luckysheet_getcelldata_cache[e];
        var t = getluckysheetfile()
          , r = e.split("!")
          , a = ""
          , n = ""
          , o = -1
          , l = null;
        if (r.length > 1) {
            for (var i in a = r[0],
            n = r[1],
            "'" == a.substr(0, 1) && "'" == a.substr(a.length - 1, 1) && (a = a.substring(1, a.length - 1)),
            t)
                if (a == t[i].name) {
                    o = t[i].index,
                    l = t[i].data;
                    break
                }
            -1 == o && (o = 0)
        } else {
            var s = getSheetIndex(Store.calculateSheetIndex);
            a = t[s].name,
            o = t[s].index,
            l = t[s].data,
            n = r[0]
        }
        if (-1 == n.indexOf(":")) {
            var c = parseInt(n.replace(/[^0-9]/g, "")) - 1
              , u = ABCatNum(n.replace(/[^A-Za-z]/g, ""));
            if (isNaN(c) || isNaN(u))
                return [];
            var h = getdatabyselectionD(l, {
                row: [c, c],
                column: [u, u]
            })[0][0];
            if (null != luckysheetformula.execFunctionGlobalData) {
                var d = luckysheetformula.execFunctionGlobalData[c + "_" + u + "_" + o];
                null != d && (h = d)
            }
            var f = {
                sheetName: a,
                startCell: n,
                rowl: 1,
                coll: 1,
                data: h
            };
            return window.luckysheet_getcelldata_cache[e] = f,
            f
        }
        n = n.split(":");
        var m = []
          , p = [];
        if (m[0] = parseInt(n[0].replace(/[^0-9]/g, "")) - 1,
        m[1] = parseInt(n[1].replace(/[^0-9]/g, "")) - 1,
        isNaN(m[0]) && (m[0] = 0),
        isNaN(m[1]) && (m[1] = l.length - 1),
        m[0] > m[1])
            return tooltip.info("选择失败", "输入范围错误！"),
            [];
        if (p[0] = ABCatNum(n[0].replace(/[^A-Za-z]/g, "")),
        p[1] = ABCatNum(n[1].replace(/[^A-Za-z]/g, "")),
        isNaN(p[0]) && (p[0] = 0),
        isNaN(p[1]) && (p[1] = l[0].length - 1),
        p[0] > p[1])
            return tooltip.info("选择失败", "输入范围错误！"),
            [];
        var g = getdatabyselectionD(l, {
            row: m,
            column: p
        });
        if (null != luckysheetformula.execFunctionGlobalData)
            for (var y = m[0]; y <= m[1]; y++)
                for (var v = p[0]; v <= p[1]; v++) {
                    var A = luckysheetformula.execFunctionGlobalData[y + "_" + v + "_" + o];
                    null != A && (g[y - m[0]][v - p[0]] = A)
                }
        var b = m[1] - m[0] + 1
          , k = p[1] - p[0] + 1
          , w = {
            sheetName: a,
            startCell: n[0],
            rowl: b,
            coll: k,
            data: g
        };
        return window.luckysheet_getcelldata_cache[e] = w,
        w
    }
    function luckysheet_parseData(e) {
        return "object" === _typeof(e) ? null == e ? "" : Array.isArray(e) ? genarate(e[0])[2] : Array.isArray(e.data) ? error.v : void 0 === e.data.v ? "" : e.data.v : luckysheetformula.isCompareOperator(e).flag ? "string" == typeof e || "number" == typeof e ? e : error.v : genarate(e)[2]
    }
    function luckysheet_getValue() {
        for (var e = arguments[0], t = 0; t < e.length; t++) {
            var r = e[t];
            if ("object" === _typeof(r))
                if (null == r)
                    r = "";
                else if (Array.isArray(r)) {
                    var a = genarate(r[0]);
                    r = a[2]
                } else
                    r = Array.isArray(r.data) ? r.data : void 0 === r.data.v ? "" : r.data.v;
            else if (!luckysheetformula.isCompareOperator(r).flag) {
                var n = genarate(r);
                r = n[2]
            }
            e[t] = r
        }
    }
    function luckysheet_indirect_check() {
        var e = arguments[0];
        return null == e || 0 == e.length ? null : e
    }
    function luckysheet_indirect_check_return(e) {
        return e
    }
    function luckysheet_offset_check() {
        if ("object" != getObjType(arguments[0]) || null == arguments[0].startCell)
            return luckysheetformula.error.v;
        var e = arguments[0].startCell
          , t = func_methods.getFirstValue(arguments[1]);
        if (valueIsError(t))
            return t;
        if (!isRealNum(t))
            return luckysheetformula.error.v;
        t = parseInt(t);
        var r = func_methods.getFirstValue(arguments[2]);
        if (valueIsError(r))
            return r;
        if (!isRealNum(r))
            return luckysheetformula.error.v;
        r = parseInt(r);
        var a = arguments[0].rowl;
        if (arguments.length >= 4) {
            if (valueIsError(a = func_methods.getFirstValue(arguments[3])))
                return a;
            if (!isRealNum(a))
                return luckysheetformula.error.v;
            a = parseInt(a)
        }
        var n = arguments[0].coll;
        if (5 == arguments.length) {
            if (valueIsError(n = func_methods.getFirstValue(arguments[4])))
                return n;
            if (!isRealNum(n))
                return luckysheetformula.error.v;
            n = parseInt(n)
        }
        if (a < 1 || n < 1)
            return luckysheetformula.error.r;
        var o = luckysheetformula.getcellrange(e)
          , l = o.row[0]
          , i = o.column[0]
          , s = (l += t) + a - 1
          , c = (i += r) + n - 1;
        return l < 0 || s >= Store.flowdata.length || i < 0 || c >= Store.flowdata[0].length ? luckysheetformula.error.r : getRangetxt(Store.calculateSheetIndex, {
            row: [l, s],
            column: [i, c]
        })
    }
    function luckysheet_getSpecialReference(e, t, r) {
        var a, n;
        if (e ? (n = t,
        a = r) : (a = t,
        n = r),
        a.startCell.indexOf(":") > -1 || n.indexOf(":") > -1)
            return error.v;
        if (e)
            return luckysheet_getcelldata(n + ":" + a.startCell);
        var o = n
          , l = "";
        if (n.indexOf("!") > -1) {
            var i = n.split("!");
            l = i[0] + "!",
            o = i[1]
        }
        return luckysheet_getcelldata(l + a.startCell + ":" + o)
    }
    init(matrix);
    var _rowLocation = rowLocation
      , _colLocation = colLocation
      , dependScripts = ["https://cdn.jsdelivr.net/npm/vue@2.6.11", "https://unpkg.com/vuex@3.4.0"]
      , dependLinks = [];
    function chart(e, t) {
        loadLinks(dependLinks),
        seriesLoadScripts(dependScripts, null, (function() {
            var r = new Vuex.Store;
            console.info("chartmix::", chartmix.default),
            Vue.use(chartmix.default, {
                store: r
            });
            var a = document.getElementsByTagName("body")[0];
            chartmix.default.initChart(a, Store.lang),
            $(".chartSetting").css({
                top: "1px",
                bottom: "1px",
                position: "absolute",
                right: "0px",
                width: "350px",
                background: "#fff",
                border: "1px solid #E5E5E5",
                "z-index": 1004,
                "box-shadow": "0px 2px 4px rgba(0,0,0,0.2)",
                "-webkit-box-shadow": "0px 2px 4px rgba(0,0,0,0.2)",
                "-moz-box-shadow": "0px 2px 4px rgba(0,0,0,0.2)",
                "-moz-user-select": "none",
                "-khtml-user-select": "none",
                "-webkit-user-select": "none",
                "-ms-user-select": "none",
                "user-select": "none",
                "padding-left": "30px",
                display: "none"
            }),
            Store.createChart = chartmix.default.createChart,
            Store.highlightChart = chartmix.default.highlightChart,
            Store.deleteChart = chartmix.default.deleteChart,
            Store.resizeChart = chartmix.default.resizeChart,
            Store.changeChartRange = chartmix.default.changeChartRange,
            Store.changeChartCellData = chartmix.default.changeChartCellData,
            Store.getChartJson = chartmix.default.getChartJson,
            Store.chart_selection = chart_selection(),
            Store.chartparam.jfrefreshchartall = jfrefreshchartall,
            Store.chartparam.changeChartCellData = chartmix.default.changeChartCellData,
            Store.chartparam.renderChart = chartmix.default.renderChart,
            Store.chartparam.getChartJson = chartmix.default.getChartJson,
            Store.chartparam.insertToStore = chartmix.default.insertToStore;
            for (var n = 0; n < e.length; n++)
                renderCharts(e[n].chart, t);
            for (var o = 0; o < e.length; o++)
                "1" == e[o].status && renderChartShow(e[o].index)
        }
        ))
    }
    function renderCharts(e, t) {
        if (null != e)
            for (var r = function(r) {
                var a = e[r];
                t && Store.chartparam.insertToStore({
                    chart_id: a.chart_id,
                    chartOptions: a.chartOptions
                });
                var n = a.chart_id
                  , o = n + "_c"
                  , l = $(replaceHtml('<div id="${id}"class="luckysheet-modal-dialog luckysheet-modal-dialog-chart ${addclass}"tabindex="0"role="dialog"aria-labelledby=":41e"dir="ltr"><div class="luckysheet-modal-dialog-resize"><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lt"data-type="lt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mt"data-type="mt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lm"data-type="lm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rm"data-type="rm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rt"data-type="rt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lb"data-type="lb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mb"data-type="mb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rb"data-type="rb"></div></div><div class="luckysheet-modal-dialog-controll"><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-update"role="button"tabindex="0"aria-label="修改图表"title="修改图表"><i class="fa fa-pencil"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-max"role="butluckysheet_chartIns_indexton"tabindex="0"aria-label="最大化"title="最大化"><i class="fa fa-window-maximize"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-del"role="button"tabindex="0"aria-label="删除"title="删除"><i class="fa fa-trash"aria-hidden="true"></i></span></div><div class="luckysheet-modal-dialog-content">${content}</div></div>', {
                    id: o,
                    addclass: "luckysheet-data-visualization-chart",
                    title: "图表生成",
                    content: ""
                })).appendTo($(".luckysheet-cell-main"));
                $("#".concat(o)).children(".luckysheet-modal-dialog-content")[0].id = n;
                var i, s = document.getElementById(o);
                i = Store.chartparam.getChartJson(a.chart_id),
                Store.chartparam.renderChart({
                    chart_id: a.chart_id,
                    chartOptions: i
                }),
                Store.currentChart = i,
                showNeedRangeShow(n),
                $("#".concat(n, "_c .luckysheet-modal-controll-del")).click((function(e) {
                    delChart(n)
                }
                )),
                $("#".concat(n, "_c .luckysheet-modal-controll-update")).click((function(e) {
                    showChartSettingComponent()
                }
                )),
                l.children(".luckysheet-modal-dialog-content").mousedown((function(e) {
                    Store.chartparam.luckysheetCurrentChartMaxState || showNeedRangeShow(n),
                    e.stopPropagation()
                }
                )),
                l.mousedown((function(e) {
                    if (!Store.chartparam.luckysheetCurrentChartMaxState) {
                        showNeedRangeShow(n),
                        setluckysheet_scroll_status(!0),
                        $(e.target).is(".luckysheet-modal-dialog-controll") || $(e.target).is(".luckysheet-modal-controll-btn") || $(e.target).is("i") || (Store.chartparam.luckysheetCurrentChartMoveTimeout = setTimeout((function() {
                            Store.chartparam.luckysheetCurrentChartMove = !0
                        }
                        ), 100));
                        var t = Store.chartparam.luckysheetCurrentChartMoveObj.offset()
                          , r = Store.chartparam.luckysheetCurrentChartMoveObj.position();
                        Store.chartparam.luckysheetCurrentChartMoveXy = [e.pageX - t.left, e.pageY - t.top, r.left, r.top, $("#luckysheet-scrollbar-x").scrollLeft(), $("#luckysheet-scrollbar-y").scrollTop()],
                        Store.chartparam.luckysheetCurrentChartMoveWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                        Store.chartparam.luckysheetCurrentChartMoveWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                        $(e.target).hasClass("luckysheet-mousedown-cancel") || 0 != $(e.target).filter("[class*='sp-palette']").length || 0 != $(e.target).filter("[class*='sp-thumb']").length || 0 != $(e.target).filter("[class*='sp-']").length || ($("#luckysheet-rightclick-menu").hide(),
                        $("#luckysheet-cols-h-hover").hide(),
                        $("#luckysheet-cols-menu-btn").hide(),
                        $("#luckysheet-rightclick-menu").hide(),
                        $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu").hide(),
                        $("body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu").hide()),
                        e.stopPropagation()
                    }
                }
                )).find(".luckysheet-modal-dialog-resize-item").mousedown((function(e) {
                    if (Store.chartparam.luckysheetCurrentChartActive) {
                        Store.chartparam.luckysheetCurrentChartResize = $(this).data("type");
                        var t = mouseposition(e.pageX, e.pageY)
                          , r = $("#luckysheet-scrollbar-x").scrollLeft()
                          , a = $("#luckysheet-scrollbar-y").scrollTop()
                          , o = t[0] + r
                          , i = t[1] + a
                          , s = Store.chartparam.luckysheetCurrentChartResizeObj.position();
                        Store.chartparam.luckysheetCurrentChartResizeXy = [o, i, l.width(), l.height(), s.left + r, s.top + a, r, a],
                        Store.chartparam.luckysheetCurrentChartResizeWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                        Store.chartparam.luckysheetCurrentChartResizeWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                        Store.chartparam.luckysheetCurrentChart = n,
                        e.stopPropagation()
                    }
                }
                ));
                var c = a.width
                  , u = a.height
                  , h = a.left
                  , d = a.top;
                s.style.width = c + "px",
                s.style.height = u + "px",
                s.style.position = "absolute",
                s.style.background = "#fff",
                s.style.left = h + "px",
                s.style.top = d + "px",
                s.style.zIndex = Store.zIndex ? Store.zIndex : 15,
                Store.zIndex++
            }, a = 0; a < e.length; a++)
                r(a)
    }
    function jfrefreshchartall(e, t, r, a, n) {
        var o = Store.currentChart;
        if (o && 1 == o.rangeArray.length) {
            var l = o.rangeArray[0].row
              , i = o.rangeArray[0].column;
            if (t > l[1] || r < l[0] || a > i[1] || n < i[0])
                return;
            var s = luckysheetformula.getcellrange(o.rangeTxt)
              , c = -1 == s.sheetIndex ? 0 : s.sheetIndex
              , u = (s.row,
            s.column,
            luckysheet_getcelldata(o.rangeTxt));
            if ("object" === _typeof(u) && 0 != u.length && null != u.data.length) {
                var h = u.data;
                Store.chartparam.changeChartCellData(o.chart_id, h)
            }
        }
    }
    function chart_selection() {
        return {
            create: function() {
                var e = Store.currentChart;
                if (!(e.rangeArray.length > 1)) {
                    $("#luckysheet-chart-rangeShow").empty(),
                    $("#luckysheet-cell-selected-boxs").hide(),
                    $("#luckysheet-cell-selected-focus").hide(),
                    $("#luckysheet-rows-h-selected").empty(),
                    $("#luckysheet-cols-h-selected").empty(),
                    $("#luckysheet-row-count-show").hide(),
                    $("#luckysheet-column-count-show").hide();
                    var t = e.rangeArray[0].row[0]
                      , r = e.rangeArray[0].column[0]
                      , a = e.rangeSplitArray;
                    if (e.rangeRowCheck.exits)
                        var n = i("rowtitle", a.rowtitle.row[0] + t, a.rowtitle.row[1] + t, a.rowtitle.column[0] + r, a.rowtitle.column[1] + r);
                    else
                        n = "";
                    if (e.rangeColCheck.exits)
                        var o = i("coltitle", a.coltitle.row[0] + t, a.coltitle.row[1] + t, a.coltitle.column[0] + r, a.coltitle.column[1] + r);
                    else
                        o = "";
                    var l = i("content", a.content.row[0] + t, a.content.row[1] + t, a.content.column[0] + r, a.content.column[1] + r);
                    $("#luckysheet-chart-rangeShow").append(n + o + l)
                }
                function i(e, t, r, a, n) {
                    var o = getvisibledatarow()
                      , l = getvisibledatacolumn()
                      , i = o[r]
                      , s = t - 1 == -1 ? 0 : o[t - 1]
                      , c = l[n]
                      , u = a - 1 == -1 ? 0 : l[a - 1];
                    if ("rowtitle" == e)
                        var h = "#C65151";
                    if ("coltitle" == e)
                        h = "#9667C0";
                    if ("content" == e)
                        h = "#4970D1";
                    return '<div id="luckysheet-chart-rangeShow-' + e + '" style="left: ' + u + "px;width: " + (c - u - 1) + "px;top: " + s + "px;height: " + (i - s - 1) + 'px;border: none;margin: 0;position: absolute;z-index: 14;"><div class="luckysheet-chart-rangeShow-move" data-type="top" style="height: 2px;border-top: 2px solid #fff;border-bottom: 2px solid #fff;background: ' + h + ';position: absolute;left: 0;right: 0;top: -2px;z-index: 18;opacity: 0.9;cursor: move;"></div><div class="luckysheet-chart-rangeShow-move" data-type="right" style="width: 2px;border-left: 2px solid #fff;border-right: 2px solid #fff;background: ' + h + ';position: absolute;top: 0;bottom: 0;right: -2px;z-index: 18;opacity: 0.9;cursor: move;"></div><div class="luckysheet-chart-rangeShow-move" data-type="bottom" style="height: 2px;border-top: 2px solid #fff;border-bottom: 2px solid #fff;background: ' + h + ';position: absolute;left: 0;right: 0;bottom: -2px;z-index: 18;opacity: 0.9;cursor: move;"></div><div class="luckysheet-chart-rangeShow-move" data-type="left" style="width: 2px;border-left: 2px solid #fff;border-right: 2px solid #fff;background: ' + h + ';position: absolute;top: 0;bottom: 0;left: -2px;z-index: 18;opacity: 0.9;cursor: move;"></div><div style="border: 2px solid #85c0fc;background: ' + h + ';position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: 15;opacity: 0.1;"></div><div class="luckysheet-chart-rangeShow-resize" data-type="lt" style="width: 6px;height: 6px;border: 1px solid #fff;background: ' + h + ';position: absolute;left: -3px;top: -3px;z-index: 19;cursor: se-resize;"></div><div class="luckysheet-chart-rangeShow-resize" data-type="rt" style="width: 6px;height: 6px;border: 1px solid #fff;background: ' + h + ';position: absolute;right: -3px;top: -3px;z-index: 19;cursor: ne-resize;"></div><div class="luckysheet-chart-rangeShow-resize" data-type="lb" style="width: 6px;height: 6px;border: 1px solid #fff;background: ' + h + ';position: absolute;left: -3px;bottom: -3px;z-index: 19;cursor: ne-resize;"></div><div class="luckysheet-chart-rangeShow-resize" data-type="rb" style="width: 6px;height: 6px;border: 1px solid #fff;background: ' + h + ';position: absolute;right: -3px;bottom: -3px;z-index: 19;cursor: se-resize;"></div></div>'
                }
            },
            rangeMove: !1,
            rangeMovexy: null,
            rangeMoveIndex: null,
            rangeMoveObj: null,
            rangeMoveDraging: function(e, t, r) {
                var a = Store.currentChart
                  , n = a.rangeArray[0].row[0]
                  , o = a.rangeArray[0].column[0]
                  , l = a.rangeRowCheck
                  , i = a.rangeColCheck
                  , s = a.rangeSplitArray
                  , c = mouseposition(e.pageX, e.pageY)
                  , u = $("#luckysheet-cell-main").scrollLeft()
                  , h = $("#luckysheet-cell-main").scrollTop()
                  , d = c[0] + u
                  , f = c[1] + h
                  , m = $(window).height() + h - t - r
                  , p = $(window).width() + u
                  , g = _rowLocation(f)[2]
                  , y = _colLocation(d)[2]
                  , v = getvisibledatarow()
                  , A = getvisibledatacolumn()
                  , b = Store.chart_selection.rangeMoveObj.attr("id");
                if ("luckysheet-chart-rangeShow-content" == b) {
                    var k = Store.chart_selection.rangeMoveIndex[0] - Store.chart_selection.rangeMovexy[0] + g;
                    l.exits ? (k < n + l.range[1] + 1 || f < 0) && (k = n + l.range[1] + 1) : (k < 0 || f < 0) && (k = 0),
                    ((S = s.content.row[1] - s.content.row[0] + k) >= v.length - 1 || f > m) && (k = v.length - 1 - s.content.row[1] + s.content.row[0],
                    S = v.length - 1);
                    var w = Store.chart_selection.rangeMoveIndex[1] - Store.chart_selection.rangeMovexy[1] + y;
                    i.exits ? (w < o + i.range[1] + 1 || d < 0) && (w = o + i.range[1] + 1) : (w < 0 || d < 0) && (w = 0),
                    ((x = s.content.column[1] - s.content.column[0] + w) >= A.length - 1 || d > p) && (w = A.length - 1 - s.content.column[1] + s.content.column[0],
                    x = A.length - 1),
                    l.exits && i.exits ? (a.rangeArray = [{
                        row: [n, S],
                        column: [o, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: [n, S],
                        column: [o, x]
                    },
                    a.rangeSplitArray.content = {
                        row: [k - n, S - n],
                        column: [w - o, x - o]
                    },
                    a.rangeSplitArray.rowtitle = {
                        row: a.rangeSplitArray.rowtitle.row,
                        column: [w - o, x - o]
                    },
                    a.rangeSplitArray.coltitle = {
                        row: [k - n, S - n],
                        column: a.rangeSplitArray.coltitle.column
                    }) : l.exits ? (a.rangeArray = [{
                        row: [n, S],
                        column: [w, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: [n, S],
                        column: [w, x]
                    },
                    a.rangeSplitArray.content = {
                        row: [k - n, S - n],
                        column: a.rangeSplitArray.content.column
                    }) : i.exits ? (a.rangeArray = [{
                        row: [k, S],
                        column: [o, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: [k, S],
                        column: [o, x]
                    },
                    a.rangeSplitArray.content = {
                        row: a.rangeSplitArray.content.row,
                        column: [w - o, x - o]
                    }) : (a.rangeArray = [{
                        row: [k, S],
                        column: [w, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: [k, S],
                        column: [w, x]
                    })
                } else if ("luckysheet-chart-rangeShow-rowtitle" == b) {
                    var x;
                    w = Store.chart_selection.rangeMoveIndex[1] - Store.chart_selection.rangeMovexy[1] + y;
                    i.exits ? (w < o + i.range[1] + 1 || d < 0) && (w = o + i.range[1] + 1) : (w < 0 || d < 0) && (w = 0),
                    ((x = s.rowtitle.column[1] - s.rowtitle.column[0] + w) >= A.length - 1 || d > p) && (w = A.length - 1 - s.rowtitle.column[1] + s.rowtitle.column[0],
                    x = A.length - 1),
                    i.exits ? (a.rangeArray = [{
                        row: a.rangeArray[0].row,
                        column: [o, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: a.rangeArray[0].row,
                        column: [o, x]
                    },
                    a.rangeSplitArray.rowtitle = {
                        row: a.rangeSplitArray.rowtitle.row,
                        column: [w - o, x - o]
                    },
                    a.rangeSplitArray.content = {
                        row: a.rangeSplitArray.content.row,
                        column: [w - o, x - o]
                    }) : (a.rangeArray = [{
                        row: a.rangeArray[0].row,
                        column: [w, x]
                    }],
                    a.rangeSplitArray.range = {
                        row: a.rangeArray[0].row,
                        column: [w, x]
                    })
                } else if ("luckysheet-chart-rangeShow-coltitle" == b) {
                    var S;
                    k = Store.chart_selection.rangeMoveIndex[0] - Store.chart_selection.rangeMovexy[0] + g;
                    l.exits ? (k < n + l.range[1] + 1 || f < 0) && (k = n + l.range[1] + 1) : (k < 0 || f < 0) && (k = 0),
                    ((S = s.coltitle.row[1] - s.coltitle.row[0] + k) >= v.length - 1 || f > m) && (k = v.length - 1 - s.coltitle.row[1] + s.coltitle.row[0],
                    S = v.length - 1),
                    l.exits ? (a.rangeArray = [{
                        row: [n, S],
                        column: a.rangeArray[0].column
                    }],
                    a.rangeSplitArray.range = {
                        row: [n, S],
                        column: a.rangeArray[0].column
                    },
                    a.rangeSplitArray.coltitle = {
                        row: [k - n, S - n],
                        column: a.rangeSplitArray.coltitle.column
                    },
                    a.rangeSplitArray.content = {
                        row: [k - n, S - n],
                        column: a.rangeSplitArray.content.column
                    }) : (a.rangeArray = [{
                        row: [k, S],
                        column: a.rangeArray[0].column
                    }],
                    a.rangeSplitArray.range = {
                        row: [k, S],
                        column: a.rangeArray[0].column
                    })
                }
                Store.chart_selection.create()
            },
            rangeMoveDragged: function() {
                Store.chart_selection.rangeMove = !1;
                var e = Store.currentChart;
                e.rangeTxt = getRangetxt(Store.currentSheetIndex, e.rangeArray[0], Store.currentSheetIndex),
                e.chartData = getdatabyselection(e.rangeArray[0], Store.currentSheetIndex),
                Store.changeChartRange(e.chart_id, e.chartData, e.rangeArray, e.rangeTxt)
            },
            rangeResize: !1,
            rangeResizexy: null,
            rangeResizeIndex: null,
            rangeResizeObj: null,
            rangeResizeDraging: function(e, t, r) {
                var a = Store.currentChart
                  , n = a.rangeArray[0].row[0]
                  , o = a.rangeArray[0].column[0]
                  , l = a.rangeRowCheck
                  , i = a.rangeColCheck
                  , s = (a.rangeSplitArray,
                mouseposition(e.pageX, e.pageY))
                  , c = $("#luckysheet-cell-main").scrollLeft()
                  , u = $("#luckysheet-cell-main").scrollTop()
                  , h = s[0] + c
                  , d = s[1] + u
                  , f = $(window).height() + u - t - r
                  , m = $(window).width() + c
                  , p = _rowLocation(d)[2]
                  , g = _colLocation(h)[2]
                  , y = getvisibledatarow()
                  , v = getvisibledatacolumn()
                  , A = Store.chart_selection.rangeResizeObj.attr("id");
                if ("luckysheet-chart-rangeShow-content" == A) {
                    if ("lt" == Store.chart_selection.rangeResize ? (_ = Store.chart_selection.rangeResizeIndex.row[0],
                    b = Store.chart_selection.rangeResizeIndex.column[0],
                    C = Store.chart_selection.rangeResizeIndex.row[1],
                    k = Store.chart_selection.rangeResizeIndex.column[1]) : "lb" == Store.chart_selection.rangeResize ? (_ = Store.chart_selection.rangeResizeIndex.row[1],
                    b = Store.chart_selection.rangeResizeIndex.column[0],
                    C = Store.chart_selection.rangeResizeIndex.row[0],
                    k = Store.chart_selection.rangeResizeIndex.column[1]) : "rt" == Store.chart_selection.rangeResize ? (_ = Store.chart_selection.rangeResizeIndex.row[0],
                    b = Store.chart_selection.rangeResizeIndex.column[1],
                    C = Store.chart_selection.rangeResizeIndex.row[1],
                    k = Store.chart_selection.rangeResizeIndex.column[0]) : "rb" == Store.chart_selection.rangeResize && (_ = Store.chart_selection.rangeResizeIndex.row[1],
                    b = Store.chart_selection.rangeResizeIndex.column[1],
                    C = Store.chart_selection.rangeResizeIndex.row[0],
                    k = Store.chart_selection.rangeResizeIndex.column[0]),
                    l.exits)
                        (T = _ - Store.chart_selection.rangeResizexy[0] + p) < n + l.range[1] + 1 || d < 0 ? T = n + l.range[1] + 1 : (T >= y.length - 1 || d > f) && (T = y.length - 1);
                    else
                        (T = n - Store.chart_selection.rangeResizexy[0] + p) < 0 || d < 0 ? T = 0 : (T >= y.length - 1 || d > f) && (T = y.length - 1);
                    if (i.exits)
                        (w = b - Store.chart_selection.rangeResizexy[1] + g) < o + i.range[1] + 1 || h < 0 ? w = o + i.range[1] + 1 : (w >= v.length - 1 || h > m) && (w = v.length - 1);
                    else
                        (w = o - Store.chart_selection.rangeResizexy[1] + g) < 0 || h < 0 ? w = 0 : (w >= v.length - 1 || h > m) && (w = v.length - 1);
                    T > C ? (E = C,
                    I = T) : (E = T,
                    I = C),
                    w > k ? (x = k,
                    S = w) : (x = w,
                    S = k),
                    l.exits || i.exits ? (a.rangeArray = [{
                        row: [n, I],
                        column: [o, S]
                    }],
                    a.rangeSplitArray.range = {
                        row: [n, I],
                        column: [o, S]
                    },
                    a.rangeSplitArray.content = {
                        row: [E - n, I - n],
                        column: [x - o, S - o]
                    },
                    l.exits && (a.rangeSplitArray.rowtitle = {
                        row: a.rangeSplitArray.rowtitle.row,
                        column: [x - o, S - o]
                    }),
                    i.exits && (a.rangeSplitArray.coltitle = {
                        row: [E - n, I - n],
                        column: a.rangeSplitArray.coltitle.column
                    })) : (a.rangeArray = [{
                        row: [E, I],
                        column: [x, S]
                    }],
                    a.rangeSplitArray.range = {
                        row: [E, I],
                        column: [x, S]
                    })
                } else if ("luckysheet-chart-rangeShow-rowtitle" == A) {
                    var b, k, w, x, S;
                    if ("lt" == Store.chart_selection.rangeResize || "lb" == Store.chart_selection.rangeResize ? (b = Store.chart_selection.rangeResizeIndex.column[0],
                    k = Store.chart_selection.rangeResizeIndex.column[1]) : "rt" != Store.chart_selection.rangeResize && "rb" != Store.chart_selection.rangeResize || (b = Store.chart_selection.rangeResizeIndex.column[1],
                    k = Store.chart_selection.rangeResizeIndex.column[0]),
                    i.exits)
                        (w = b - Store.chart_selection.rangeResizexy[1] + g) < o + i.range[1] + 1 || h < 0 ? w = o + i.range[1] + 1 : (w >= v.length - 1 || h > m) && (w = v.length - 1);
                    else
                        (w = o - Store.chart_selection.rangeResizexy[1] + g) < 0 || h < 0 ? w = 0 : (w >= v.length - 1 || h > m) && (w = v.length - 1);
                    w > k ? (x = k,
                    S = w) : (x = w,
                    S = k),
                    i.exits ? (a.rangeArray = [{
                        row: a.rangeArray[0].row,
                        column: [o, S]
                    }],
                    a.rangeSplitArray.range = {
                        row: a.rangeArray[0].row,
                        column: [o, S]
                    },
                    a.rangeSplitArray.rowtitle = {
                        row: a.rangeSplitArray.rowtitle.row,
                        column: [x - o, S - o]
                    },
                    a.rangeSplitArray.content = {
                        row: a.rangeSplitArray.content.row,
                        column: [x - o, S - o]
                    }) : (a.rangeArray = [{
                        row: a.rangeArray[0].row,
                        column: [x, S]
                    }],
                    a.rangeSplitArray.range = {
                        row: a.rangeArray[0].row,
                        column: [x, S]
                    })
                } else if ("luckysheet-chart-rangeShow-coltitle" == A) {
                    var _, C, T, E, I;
                    if ("lt" == Store.chart_selection.rangeResize || "rt" == Store.chart_selection.rangeResize ? (_ = Store.chart_selection.rangeResizeIndex.row[0],
                    C = Store.chart_selection.rangeResizeIndex.row[1]) : "lb" != Store.chart_selection.rangeResize && "rb" != Store.chart_selection.rangeResize || (_ = Store.chart_selection.rangeResizeIndex.row[1],
                    C = Store.chart_selection.rangeResizeIndex.row[0]),
                    l.exits)
                        (T = _ - Store.chart_selection.rangeResizexy[0] + p) < n + l.range[1] + 1 || d < 0 ? T = n + l.range[1] + 1 : (T >= y.length - 1 || d > f) && (T = y.length - 1);
                    else
                        (T = n - Store.chart_selection.rangeResizexy[0] + p) < 0 || d < 0 ? T = 0 : (T >= y.length - 1 || d > f) && (T = y.length - 1);
                    T > C ? (E = C,
                    I = T) : (E = T,
                    I = C),
                    l.exits ? (a.rangeArray = [{
                        row: [n, I],
                        column: a.rangeArray[0].column
                    }],
                    a.rangeSplitArray.range = {
                        row: [n, I],
                        column: a.rangeArray[0].column
                    },
                    a.rangeSplitArray.coltitle = {
                        row: [E - n, I - n],
                        column: a.rangeSplitArray.coltitle.column
                    },
                    a.rangeSplitArray.content = {
                        row: [E - n, I - n],
                        column: a.rangeSplitArray.content.column
                    }) : (a.rangeArray = [{
                        row: [E, I],
                        column: a.rangeArray[0].column
                    }],
                    a.rangeSplitArray.range = {
                        row: [E, I],
                        column: a.rangeArray[0].column
                    })
                }
                Store.chart_selection.create()
            },
            rangeResizeDragged: function() {
                Store.chart_selection.rangeResize = null;
                var e = Store.currentChart;
                e.rangeTxt = getRangetxt(Store.currentSheetIndex, e.rangeArray[0], Store.currentSheetIndex),
                e.chartData = getdatabyselection(e.rangeArray[0], Store.currentSheetIndex),
                Store.changeChartRange(e.chart_id, e.chartData, e.rangeArray, e.rangeTxt)
            }
        }
    }
    function createLuckyChart(e, t, r, a) {
        var n = luckysheet.getluckysheet_select_save();
        1 == n.length && n[0].row[0] == n[0].row[1] && n[0].column[0] == n[0].column[1] && (luckysheetMoveHighlightRange2("right", "rangeOfSelect"),
        luckysheetMoveHighlightRange2("down", "rangeOfSelect"),
        n = luckysheet.getluckysheet_select_save());
        for (var o = -1, l = n[0].row[1] - n[0].row[0], i = n[0].row[0]; i <= n[0].row[1]; i++) {
            for (var s = n[0].column[0]; s <= n[0].column[1]; s++) {
                if (null != (h = getcellvalue(i, s, luckysheet.flowdata())) && h.toString().length > 0) {
                    o = i;
                    break
                }
            }
            if (-1 !== o)
                break
        }
        -1 == o && (o = 0),
        n[0].row = [o, o],
        luckysheet.setluckysheet_select_save(n),
        Store.luckysheet_shiftpositon = $.extend(!0, {}, n[0]),
        luckysheetMoveEndCell("down", "range", !1, l);
        var c = -1
          , u = (n = luckysheet.getluckysheet_select_save())[0].column[1] - n[0].column[0];
        for (s = n[0].column[0]; s <= n[0].column[1]; s++) {
            for (i = n[0].row[0]; i <= n[0].row[1]; i++) {
                var h;
                if (null != (h = getcellvalue(i, s, luckysheet.flowdata())) && h.toString().length > 0) {
                    c = s;
                    break
                }
            }
            if (-1 !== c)
                break
        }
        -1 == c && (c = 0),
        n[0].column = [c, c],
        luckysheet.setluckysheet_select_save(n),
        Store.luckysheet_shiftpositon = $.extend(!0, {}, n[0]),
        luckysheetMoveEndCell("right", "range", !1, u),
        n = luckysheet.getluckysheet_select_save();
        var d = $.extend(!0, [], n)
          , f = getRangetxt(Store.currentSheetIndex, d[0], Store.currentSheetIndex)
          , m = getdatabyselection();
        console.dir(m);
        var p = generateRandomKey("chart")
          , g = p + "_c"
          , y = $(replaceHtml('<div id="${id}"class="luckysheet-modal-dialog luckysheet-modal-dialog-chart ${addclass}"tabindex="0"role="dialog"aria-labelledby=":41e"dir="ltr"><div class="luckysheet-modal-dialog-resize"><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lt"data-type="lt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mt"data-type="mt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lm"data-type="lm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rm"data-type="rm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rt"data-type="rt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lb"data-type="lb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mb"data-type="mb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rb"data-type="rb"></div></div><div class="luckysheet-modal-dialog-controll"><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-update"role="button"tabindex="0"aria-label="修改图表"title="修改图表"><i class="fa fa-pencil"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-max"role="butluckysheet_chartIns_indexton"tabindex="0"aria-label="最大化"title="最大化"><i class="fa fa-window-maximize"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-del"role="button"tabindex="0"aria-label="删除"title="删除"><i class="fa fa-trash"aria-hidden="true"></i></span></div><div class="luckysheet-modal-dialog-content">${content}</div></div>', {
            id: g,
            addclass: "luckysheet-data-visualization-chart",
            title: "图表生成",
            content: ""
        })).appendTo($(".luckysheet-cell-main"))
          , v = document.getElementById(g)
          , A = Store.createChart($("#".concat(g)).children(".luckysheet-modal-dialog-content")[0], m, p, d, f)
          , b = A.render
          , k = A.chart_json;
        console.dir(JSON.stringify(k)),
        e = e || 400,
        t = t || 250,
        r = r || 0,
        a = a || 0,
        v.style.width = e + "px",
        v.style.height = t + "px",
        v.style.position = "absolute",
        v.style.background = "#fff",
        v.style.left = r + "px",
        v.style.top = a + "px",
        b.style.width = "100%",
        b.style.height = "100%",
        v.style.zIndex = Store.zIndex ? Store.zIndex : 15,
        Store.zIndex++;
        var w = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
        w.chart || (w.chart = []),
        w.chart.push({
            chart_id: p,
            width: e,
            height: t,
            left: r,
            top: a,
            sheetIndex: w.index
        }),
        showNeedRangeShow(p),
        $("#".concat(p, "_c .luckysheet-modal-controll-del")).click((function(e) {
            delChart(p)
        }
        )),
        $("#".concat(p, "_c .luckysheet-modal-controll-update")).click((function(e) {
            showChartSettingComponent()
        }
        )),
        y.children(".luckysheet-modal-dialog-content").mousedown((function(e) {
            Store.chartparam.luckysheetCurrentChartMaxState || showNeedRangeShow(p),
            e.stopPropagation()
        }
        )),
        y.mousedown((function(e) {
            if (!Store.chartparam.luckysheetCurrentChartMaxState) {
                showNeedRangeShow(p),
                setluckysheet_scroll_status(!0),
                $(e.target).is(".luckysheet-modal-dialog-controll") || $(e.target).is(".luckysheet-modal-controll-btn") || $(e.target).is("i") || (Store.chartparam.luckysheetCurrentChartMoveTimeout = setTimeout((function() {
                    Store.chartparam.luckysheetCurrentChartMove = !0
                }
                ), 100));
                var t = Store.chartparam.luckysheetCurrentChartMoveObj.offset()
                  , r = Store.chartparam.luckysheetCurrentChartMoveObj.position();
                Store.chartparam.luckysheetCurrentChartMoveXy = [e.pageX - t.left, e.pageY - t.top, r.left, r.top, $("#luckysheet-scrollbar-x").scrollLeft(), $("#luckysheet-scrollbar-y").scrollTop()],
                Store.chartparam.luckysheetCurrentChartMoveWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                Store.chartparam.luckysheetCurrentChartMoveWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                $(e.target).hasClass("luckysheet-mousedown-cancel") || 0 != $(e.target).filter("[class*='sp-palette']").length || 0 != $(e.target).filter("[class*='sp-thumb']").length || 0 != $(e.target).filter("[class*='sp-']").length || ($("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-cols-h-hover").hide(),
                $("#luckysheet-cols-menu-btn").hide(),
                $("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu").hide(),
                $("body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu").hide()),
                e.stopPropagation()
            }
        }
        )).find(".luckysheet-modal-dialog-resize-item").mousedown((function(e) {
            if (Store.chartparam.luckysheetCurrentChartActive) {
                Store.chartparam.luckysheetCurrentChartResize = $(this).data("type");
                var t = mouseposition(e.pageX, e.pageY)
                  , r = $("#luckysheet-scrollbar-x").scrollLeft()
                  , a = $("#luckysheet-scrollbar-y").scrollTop()
                  , n = t[0] + r
                  , o = t[1] + a
                  , l = Store.chartparam.luckysheetCurrentChartResizeObj.position();
                Store.chartparam.luckysheetCurrentChartResizeXy = [n, o, y.width(), y.height(), l.left + r, l.top + a, r, a],
                Store.chartparam.luckysheetCurrentChartResizeWinH = $("#luckysheet-cell-main")[0].scrollHeight,
                Store.chartparam.luckysheetCurrentChartResizeWinW = $("#luckysheet-cell-main")[0].scrollWidth,
                Store.chartparam.luckysheetCurrentChart = p,
                e.stopPropagation()
            }
        }
        ))
    }
    function delChart(e) {
        $(".luckysheet-cell-main #".concat(e, "_c")).remove(),
        hideAllNeedRangeShow();
        var t = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]
          , r = t.chart.findIndex((function(t) {
            return t.chart_id == e
        }
        ));
        t.chart.splice(r, 1),
        Store.deleteChart(e)
    }
    function showNeedRangeShow(e) {
        var t = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].chart;
        for (var r in t)
            t[r].needRangeShow = !1,
            t[r].chart_id == e && (t[r].needRangeShow = !0,
            Store.currentChart = Store.getChartJson(e));
        selectRangeBorderShow(e)
    }
    function hideAllNeedRangeShow() {
        var e = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].chart;
        for (var t in e)
            e[t].needRangeShow = !1;
        selectRangeBorderHide()
    }
    function selectRangeBorderShow(e) {
        var t = $("#" + e + "_c");
        Store.chart_selection.create(),
        Store.chartparam.luckysheetCurrentChartActive = !0,
        Store.chartparam.luckysheetCurrentChartMoveObj = t,
        Store.chartparam.luckysheetCurrentChartResizeObj = t,
        Store.chartparam.luckysheetCurrentChart = e,
        $("#luckysheet-cell-main").find(".luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize").hide(),
        $("#luckysheet-cell-main").find(".luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),
        t.css("z-index", Store.chartparam.luckysheetCurrentChartZIndexRank++),
        t.find(".luckysheet-modal-dialog-resize").show(),
        t.find(".luckysheet-modal-dialog-controll").show(),
        ($(".chartSetting").is(":visible") || Store.chartparam.luckysheet_chart_redo_click) && e != Store.chartparam.luckysheetCurrentChart && $("body .luckysheet-cols-menu").hide(),
        Store.currentChart = Store.highlightChart(e)
    }
    function selectRangeBorderHide(e) {
        $("#luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize, #luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),
        $("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").remove(),
        Store.chartparam.luckysheetCurrentChartActive = !1,
        $("#luckysheet-chart-rangeShow").empty(),
        e || !$(".chartSetting").is(":visible") || isEditMode() || hideChartSettingComponent()
    }
    function showChartSettingComponent(e, t) {
        $(".chartSetting").is(":visible") || ($(".chartSetting").show(),
        $("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").show(),
        Store.chartparam.luckysheetCurrentChartActive = !0,
        setTimeout((function() {
            luckysheetsizeauto()
        }
        ), 0))
    }
    function hideChartSettingComponent(e) {
        $(".chartSetting").is(":visible") && ($(".chartSetting").hide(),
        $("#luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-resize, #luckysheet-cell-main .luckysheet-modal-dialog-chart .luckysheet-modal-dialog-controll").hide(),
        $("#luckysheet-cell-main").find(".luckysheet-datavisual-selection-set div").remove(),
        Store.chartparam.luckysheetCurrentChartActive = !1,
        isEditMode() || e || setTimeout((function() {
            luckysheetsizeauto()
        }
        ), 0))
    }
    function renderChartShow(e) {
        selectRangeBorderHide("true"),
        Store.luckysheetfile.forEach((function(t) {
            t.index == e ? (t.chart || []).forEach((function(e) {
                e.isShow = !0,
                $("#" + e.chart_id + "_c").show(),
                Store.resizeChart(e.chart_id),
                1 == e.needRangeShow && (Store.currentChart = Store.getChartJson(e.chart_id),
                selectRangeBorderShow(e.chart_id))
            }
            )) : (t.chart || []).forEach((function(e) {
                e.isShow = !1,
                $("#" + e.chart_id + "_c").hide()
            }
            ))
        }
        ))
    }
    var luckysheetZoomTimeout = null;
    function zoomChange(e) {
        null != Store.flowdata && 0 != Store.flowdata.length && (clearTimeout(luckysheetZoomTimeout),
        luckysheetZoomTimeout = setTimeout((function() {
            Store.clearjfundo && Store.jfredo.push({
                type: "zoomChange",
                zoomRatio: Store.zoomRatio,
                curZoomRatio: e,
                sheetIndex: Store.currentSheetIndex
            }),
            Store.zoomRatio = e;
            var t = sheetmanage.getSheetByIndex();
            luckysheetPostil.buildAllPs(t.data),
            imageCtrl.images = t.images,
            imageCtrl.allImagesShow(),
            imageCtrl.init(),
            null == t.config && (t.config = {}),
            null == t.config.sheetViewZoom && (t.config.sheetViewZoom = {});
            var r = t.config.curentsheetView;
            null == r && (r = "viewNormal"),
            t.config.sheetViewZoom[r + "ZoomScale"] = e,
            server.saveParam("all", Store.currentSheetIndex, Store.zoomRatio, {
                k: "zoomRatio"
            }),
            server.saveParam("cg", Store.currentSheetIndex, t.config.sheetViewZoom, {
                k: "sheetViewZoom"
            }),
            zoomRefreshView()
        }
        ), 100))
    }
    function zoomRefreshView() {
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
        changeSheetContainerSize()
    }
    function zoomInitial() {
        $("#luckysheet-zoom-minus").click((function() {
            var e;
            e = null == Store.zoomRatio ? Store.zoomRatio = 1 : Math.ceil(10 * Store.zoomRatio) / 10,
            (e -= .1) == Store.zoomRatio && (e -= .1),
            e <= .1 && (e = .1),
            zoomChange(e),
            zoomNumberDomBind(e)
        }
        )),
        $("#luckysheet-zoom-plus").click((function() {
            var e;
            e = null == Store.zoomRatio ? Store.zoomRatio = 1 : Math.floor(10 * Store.zoomRatio) / 10,
            (e += .1) == Store.zoomRatio && (e += .1),
            e >= 4 && (e = 4),
            zoomChange(e),
            zoomNumberDomBind(e)
        }
        )),
        $("#luckysheet-zoom-slider").mousedown((function(e) {
            var t = $(this).offset().left
              , r = positionToRatio(e.pageX - t);
            zoomChange(r),
            zoomNumberDomBind(r)
        }
        )),
        $("#luckysheet-zoom-cursor").mousedown((function(e) {
            var t = e.pageX
              , r = parseFloat($("#luckysheet-zoom-cursor").css("left"));
            $("#luckysheet-zoom-cursor").css("transition", "none"),
            $(document).off("mousemove.zoomCursor").on("mousemove.zoomCursor", (function(e) {
                var a = e.pageX
                  , n = r + (a - t)
                  , o = positionToRatio(n);
                o > 4 && (o = 4,
                n = 100),
                o < .1 && (o = .1,
                n = 0),
                zoomChange(o);
                var l = Math.round(100 * o) + "%";
                $("#luckysheet-zoom-ratioText").html(l),
                $("#luckysheet-zoom-cursor").css("left", n - 4)
            }
            )),
            $(document).off("mouseup.zoomCursor").on("mouseup.zoomCursor", (function(e) {
                $(document).off(".zoomCursor"),
                $("#luckysheet-zoom-cursor").css("transition", "all 0.3s")
            }
            )),
            e.stopPropagation()
        }
        )).click((function(e) {
            e.stopPropagation()
        }
        )),
        $("#luckysheet-zoom-ratioText").click((function() {
            zoomChange(1),
            zoomNumberDomBind(1)
        }
        )),
        zoomNumberDomBind(Store.zoomRatio)
    }
    function positionToRatio(e) {
        var t = 1;
        return e < 50 ? t = Math.round(100 * (1.8 * e / 100 + .1)) / 100 : e > 50 && (t = Math.round(100 * (6 * (e - 50) / 100 + 1)) / 100),
        t
    }
    function zoomSlierDomBind(e) {
        var t = 50;
        e < 1 ? t = Math.round(100 * (e - .1) / .18) / 10 : e > 1 && (t = Math.round(100 * (e - 1) / .6) / 10 + 50),
        $("#luckysheet-zoom-cursor").css("left", t - 4)
    }
    function zoomNumberDomBind(e) {
        var t = Math.round(100 * e) + "%";
        $("#luckysheet-zoom-ratioText").html(t),
        zoomSlierDomBind(e)
    }
    var sheetmanage = {
        generateRandomSheetIndex: function(e) {
            null == e && (e = "Sheet");
            for (var t = window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g, "").split(""), r = "", a = 0; a < 12; a++)
                r += t[Math.round(Math.random() * (t.length - 1))];
            return e + "_" + r + "_" + (new Date).getTime()
        },
        generateRandomSheetName: function(e, t) {
            for (var r = e.length, a = locale().pivotTable.title, n = 0; n < e.length; n++)
                if (e[n].name.indexOf("Sheet") > -1 || e[n].name.indexOf(a) > -1) {
                    var o = parseFloat(e[n].name.replace("Sheet", "").replace(a, ""));
                    "NaN" != o && Math.ceil(o) > r && (r = Math.ceil(o))
                }
            return t ? a + (r + 1) : "Sheet" + (r + 1)
        },
        generateCopySheetName: function(e, t) {
            var r = ""
              , a = locale().info;
            if (t.toString().indexOf("(" + a.copy) > -1) {
                for (var n = t.toString().indexOf("(" + a.copy), o = t.toString().substring(0, n) + "(" + a.copy, l = null, i = 0; i < e.length; i++) {
                    var s = e[i].name.toString()
                      , c = s.indexOf(o);
                    if (c > -1) {
                        var u = s.indexOf(")", c + o.length)
                          , h = s.substring(c + o.length, u);
                        isRealNum(h) && (null == l || parseInt(h) > l) && (l = parseInt(h))
                    }
                }
                r = null == l ? o + "2)" : o + ++l + ")"
            } else {
                for (var d = null, f = !1, m = t + "(" + a.copy, p = 0; p < e.length; p++) {
                    var g = e[p].name.toString()
                      , y = g.indexOf(m);
                    if (y > -1) {
                        f = !0;
                        var v = g.indexOf(")", y + m.length)
                          , A = g.substring(y + m.length, v);
                        isRealNum(A) && (null == d || parseInt(A) > d) && (d = parseInt(A))
                    }
                }
                f ? null == d ? r = t + "(" + a.copy + "2)" : (d++,
                r = t + "(" + a.copy + d + ")") : r = t + "(" + a.copy + ")"
            }
            return r
        },
        getSheetByIndex: function(e) {
            null == e && (e = Store.currentSheetIndex);
            var t = this.getSheetIndex(e);
            return Store.luckysheetfile[t]
        },
        getSheetByName: function(e) {
            if (null == e)
                return null;
            for (var t = 0; t < Store.luckysheetfile.length; t++) {
                var r = Store.luckysheetfile[t];
                if (r.name == e)
                    return r
            }
            return null
        },
        getCurSheetnoset: function() {
            for (var e = 0, t = 0; t < Store.luckysheetfile.length; t++)
                if (1 == Store.luckysheetfile[t].status) {
                    e = Store.luckysheetfile[t].index;
                    break
                }
            return e
        },
        getCurSheet: function() {
            Store.currentSheetIndex = Store.luckysheetfile[0].index;
            for (var e = 0; e < Store.luckysheetfile.length; e++)
                if (1 == Store.luckysheetfile[e].status) {
                    Store.currentSheetIndex = Store.luckysheetfile[e].index;
                    break
                }
            return Store.currentSheetIndex
        },
        addNewSheet: function(e, t) {
            if (!isEditMode() && !1 !== Store.allowEdit) {
                var r = Store.luckysheetfile.length
                  , a = this.generateRandomSheetIndex()
                  , n = this.generateRandomSheetName(Store.luckysheetfile, t);
                $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                    index: a,
                    active: "",
                    name: n,
                    style: "",
                    colorset: ""
                }));
                var o = {
                    name: n,
                    color: "",
                    status: "0",
                    order: r,
                    index: a,
                    celldata: [],
                    row: Store.defaultrowNum,
                    column: Store.defaultcolumnNum,
                    config: {},
                    pivotTable: null,
                    isPivotTable: !!t
                };
                if (Store.luckysheetfile.push(o),
                $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
                $("#luckysheet-sheets-item" + a).addClass("luckysheet-sheets-item-active"),
                $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + a + '" class="luckysheet-datavisual-selection-set"></div>'),
                cleargridelement(e),
                server.saveParam("sha", null, $.extend(!0, {}, o)),
                Store.clearjfundo) {
                    Store.jfundo = [];
                    var l = {
                        type: "addSheet"
                    };
                    l.sheetconfig = $.extend(!0, {}, o),
                    l.index = a,
                    l.currentSheetIndex = Store.currentSheetIndex,
                    Store.jfredo.push(l)
                }
                this.changeSheetExec(a, t, !0)
            }
        },
        setSheetHide: function(e) {
            Store.luckysheetfile[this.getSheetIndex(e)].hide = 1;
            var t = $("#luckysheet-sheets-item" + e);
            t.hide(),
            $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active");
            var r = t.nextAll(":visible");
            r = t.nextAll(":visible").length > 0 ? r.eq(0).data("index") : t.prevAll(":visible").eq(0).data("index"),
            $("#luckysheet-sheets-item" + r).addClass("luckysheet-sheets-item-active"),
            this.changeSheetExec(r),
            server.saveParam("sh", t.data("index"), 1, {
                op: "hide",
                cur: r
            })
        },
        setSheetShow: function(e) {
            Store.luckysheetfile[this.getSheetIndex(e)].hide = 0,
            this.changeSheetExec(e),
            server.saveParam("sh", e, 0, {
                op: "show",
                cur: null
            })
        },
        sheetMaxIndex: 0,
        ordersheet: function(e) {
            return function(t, r) {
                return t[e] - r[e]
            }
        },
        getCurrentOrder: function() {
            var e = {};
            return $("#luckysheet-sheet-area div.luckysheet-sheets-item").each((function(t) {
                for (var r = $(this).data("index"), a = 0; a < Store.luckysheetfile.length; a++)
                    if (Store.luckysheetfile[a].index == r) {
                        e[r.toString()] = t;
                        break
                    }
            }
            )),
            e
        },
        reOrderAllSheet: function() {
            var e = {};
            $("#luckysheet-sheet-area div.luckysheet-sheets-item").each((function(t) {
                for (var r = $(this).data("index"), a = 0; a < Store.luckysheetfile.length; a++)
                    if (Store.luckysheetfile[a].index == r) {
                        Store.luckysheetfile[a].order = t,
                        e[r.toString()] = t;
                        break
                    }
            }
            )),
            server.saveParam("shr", null, e),
            Store.luckysheetfile.sort((function(e, t) {
                var r = e.order
                  , a = t.order;
                return null != r && null != a ? r - a : null != r ? -1 : 1
            }
            ))
        },
        createSheet: function() {
            var e = [];
            Store.luckysheetfile.sort(this.ordersheet("order"));
            for (var t = 0; t < Store.luckysheetfile.length; t++) {
                var r = ""
                  , a = Store.luckysheetfile[t].index
                  , n = "";
                null != Store.luckysheetfile[t].color && (n = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + Store.luckysheetfile[t].color + ';"></div>'),
                Store.currentSheetIndex == a ? e.push(replaceHtml$1(sheetHTML, {
                    index: a,
                    active: "luckysheet-sheets-item-active",
                    name: Store.luckysheetfile[t].name,
                    style: "",
                    colorset: n
                })) : (1 == Store.luckysheetfile[t].hide ? e.push(replaceHtml$1(sheetHTML, {
                    index: a,
                    active: "",
                    name: Store.luckysheetfile[t].name,
                    style: "display:none;",
                    colorset: n
                })) : e.push(replaceHtml$1(sheetHTML, {
                    index: a,
                    active: "",
                    name: Store.luckysheetfile[t].name,
                    style: "",
                    colorset: n
                })),
                r = "style='display:none;'"),
                $("#luckysheet-cell-main").append("<div " + r + ' id="luckysheet-datavisual-selection-set-' + a + '" class="luckysheet-datavisual-selection-set"></div>')
            }
            $("#luckysheet-sheet-container-c").append(e.join("")),
            this.locationSheet()
        },
        locationSheet: function() {
            var e = $("#luckysheet-sheet-container-c")
              , t = $("#" + Store.container).width()
              , r = ($("#luckysheet-sheet-container-c > div.luckysheet-sheets-item-active").eq(0),
            0)
              , a = 0;
            $("#luckysheet-sheet-container-c > div.luckysheet-sheets-item:visible").each((function() {
                $(this).hasClass("luckysheet-sheets-item-active") && (r = a),
                a += $(this).outerWidth()
            }
            )),
            setTimeout((function() {
                e.scrollLeft(r - 10),
                a >= .7 * t && luckysheetConfigsetting.showsheetbarConfig.sheet && ($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "inline-block"),
                $("#luckysheet-sheet-container .docs-sheet-fade-left").show())
            }
            ), 1)
        },
        copySheet: function(e, t) {
            if (!isEditMode() && !1 !== Store.allowEdit) {
                var r = Store.luckysheetfile.length
                  , a = this.generateRandomSheetIndex()
                  , n = this.getSheetIndex(e)
                  , o = $.extend(!0, {}, Store.luckysheetfile[n]);
                o.order = r,
                o.index = a,
                o.name = this.generateCopySheetName(Store.luckysheetfile, o.name);
                var l = "";
                null != o.color && (l = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + o.color + ';"></div>');
                var i = $("#luckysheet-sheets-item" + e);
                if ($("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                    index: o.index,
                    active: "",
                    name: o.name,
                    order: o.order,
                    style: "",
                    colorset: l
                })),
                $("#luckysheet-sheets-item" + o.index).insertAfter(i),
                Store.luckysheetfile.splice(n + 1, 0, o),
                $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
                $("#luckysheet-sheets-item" + a).addClass("luckysheet-sheets-item-active"),
                $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + a + '" class="luckysheet-datavisual-selection-set"></div>'),
                cleargridelement(t),
                server.saveParam("shc", a, {
                    copyindex: e,
                    name: o.name
                }),
                this.changeSheetExec(a),
                this.reOrderAllSheet(),
                Store.clearjfundo)
                    Store.jfredo.push({
                        type: "copySheet",
                        copyindex: e,
                        index: o.index,
                        sheetIndex: o.index
                    });
                else if (Store.jfredo.length > 0) {
                    var s = Store.jfredo[Store.jfredo.length - 1];
                    "copySheet" == s.type && (s.index = o.index,
                    s.sheetIndex = o.index)
                }
            }
        },
        hasSheet: function(e) {
            return null != e && null != (e = this.getSheetIndex(e))
        },
        createSheetbydata: function(e, t) {
            var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]
              , a = this
              , n = "";
            if (null != e.color && (n = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + e.color + ';"></div>'),
            $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
                index: e.index,
                active: "",
                name: e.name,
                order: e.order,
                style: "",
                colorset: n
            })),
            r) {
                var o = e.order;
                o >= Store.luckysheetfile.length ? (o = Store.luckysheetfile.length - 1,
                $("#luckysheet-sheets-item" + e.index).insertAfter($("#luckysheet-sheets-item" + Store.luckysheetfile[o].index))) : $("#luckysheet-sheets-item" + e.index).insertBefore($("#luckysheet-sheets-item" + Store.luckysheetfile[o].index))
            }
            Store.luckysheetfile.push(e),
            $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
            $("#luckysheet-sheets-item" + e.index).addClass("luckysheet-sheets-item-active"),
            $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + e.index + '" class="luckysheet-datavisual-selection-set"></div>'),
            cleargridelement(),
            null != t ? (server.saveParam("shre", null, {
                reIndex: e.index
            }),
            e.hide = 0,
            server.saveParam("sh", e.index, 0, {
                op: "show",
                cur: null
            })) : server.saveParam("sha", null, e),
            a.changeSheetExec(e.index, e.isPivotTable, !0),
            a.reOrderAllSheet()
        },
        deleteSheet: function(e) {
            if (!1 !== Store.allowEdit) {
                var t = this.getSheetIndex(e);
                this.setSheetHide(e),
                $("#luckysheet-sheets-item" + e).remove(),
                $("#luckysheet-datavisual-selection-set-" + e).remove();
                var r = Store.luckysheetfile.splice(t, 1);
                this.reOrderAllSheet(),
                server.saveParam("shd", null, {
                    deleIndex: e
                }),
                Store.clearjfundo && (r[0].type = "deleteSheet",
                Store.jfredo.push(r[0]))
            }
        },
        nulldata: null,
        getGridData: function(e) {
            for (var t = [], r = 0; r < e.length; r++)
                for (var a = 0; a < e[0].length; a++)
                    null != e[r][a] && t.push({
                        r: r,
                        c: a,
                        v: e[r][a]
                    });
            return t
        },
        buildGridData: function(e) {
            var t = datagridgrowth([], null == e.row ? Store.defaultrowNum : e.row, null == e.column ? Store.defaultcolumnNum : e.column)
              , r = e.celldata;
            if (null != r)
                for (var a = 0; a < r.length; a++) {
                    var n = r[a]
                      , o = n.r
                      , l = n.c
                      , i = n.v;
                    o >= t.length && (t = datagridgrowth(t, o - t.length + 1, 0)),
                    l >= t[0].length && (t = datagridgrowth(t, 0, l - t[0].length + 1)),
                    setcellvalue(o, l, t, i)
                }
            return luckysheetConfigsetting.autoFormatw = !1,
            luckysheetConfigsetting.accuracy = void 0,
            t
        },
        cutGridData: function(e) {
            for (var t = 0, r = e.length - 1; r >= 0; r--) {
                for (var a = !0, n = 0; n < e[0].length; n++) {
                    var o = getcellvalue(r, n);
                    if (null != o && $.trim(o).length > 0) {
                        a = !1;
                        break
                    }
                }
                if (!a)
                    break;
                t = r
            }
            return e.slice(0, t)
        },
        addGridData: function(e, t, r) {
            var a = datagridgrowth([], t, r);
            if (null != e)
                for (var n = 0; n < e.length; n++) {
                    var o = e[n]
                      , l = o.r
                      , i = o.c
                      , s = o.v;
                    l >= a.length && (a = datagridgrowth(a, l - a.length + 1, 0)),
                    i >= a[0].length && (a = datagridgrowth(a, 0, i - a[0].length + 1)),
                    setcellvalue(l, i, a, s)
                }
            return a
        },
        sheetParamRestore: function(e, t) {
            if (Store.luckysheet_select_save = e.luckysheet_select_save,
            null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length || (null != t[0] && null != t[0][0] && null != t[0][0].mc ? Store.luckysheet_select_save = [{
                row: [0, t[0][0].mc.rs - 1],
                column: [0, t[0][0].mc.cs - 1]
            }] : Store.luckysheet_select_save = [{
                row: [0, 0],
                column: [0, 0]
            }]),
            Store.luckysheet_selection_range = null == e.luckysheet_selection_range ? [] : e.luckysheet_selection_range,
            Store.config = null == e.config ? {} : e.config,
            Store.zoomRatio = null == e.zoomRatio ? 1 : e.zoomRatio,
            null != e.defaultRowHeight ? Store.defaultrowlen = parseFloat(e.defaultRowHeight) : Store.defaultrowlen = luckysheetConfigsetting.defaultRowHeight,
            null != e.defaultColWidth ? Store.defaultcollen = parseFloat(e.defaultColWidth) : Store.defaultcollen = luckysheetConfigsetting.defaultColWidth,
            null != e.showGridLines) {
                var r = e.showGridLines;
                Store.showGridLines = 0 != r && 0 != r
            } else
                Store.showGridLines = !0
        },
        initialjfFile: function initialjfFile(menu, title) {
            var _this = this;
            _this.getCurSheet();
            var file = Store.luckysheetfile[_this.getSheetIndex(Store.currentSheetIndex)];
            _this.nulldata = datagridgrowth([], Store.defaultrowNum, Store.defaultcolumnNum);
            var data = _this.buildGridData(file);
            this.sheetParamRestore(file, data);
            var r2 = Store.luckysheet_select_save[0].row[1]
              , c2 = Store.luckysheet_select_save[0].column[1];
            if (Store.luckysheet_select_save.length > 1)
                for (var i = 0; i < Store.luckysheet_select_save.length; i++)
                    Store.luckysheet_select_save[i].row[1] > r2 && (r2 = Store.luckysheet_select_save[i].row[1]),
                    Store.luckysheet_select_save[i].column[1] > c2 && (c2 = Store.luckysheet_select_save[i].column[1]);
            menuButton.fontInitial(Store.fontList),
            file.data = data;
            var rowheight = data.length;
            r2 > rowheight - 1 && (rowheight = r2 + 1);
            var colwidth = data[0].length;
            c2 > colwidth - 1 && (colwidth = c2 + 1),
            luckysheetcreatedom(colwidth, rowheight, data, menu, title),
            setTimeout((function() {
                tooltip.createHoverTip("#luckysheet_info_detail", ".luckysheet_info_detail_title, .luckysheet_info_detail_input, .luckysheet_info_detail_export"),
                tooltip.createHoverTip("#luckysheet-wa-editor", ".luckysheet-toolbar-menu-button, .luckysheet-toolbar-button, .luckysheet-toolbar-combo-button"),
                Store.luckysheetTableContentHW = [$("#luckysheet-cell-main").width() + Store.rowHeaderWidth - Store.cellMainSrollBarSize, $("#luckysheet-cell-main").height() + Store.columnHeaderHeight - Store.cellMainSrollBarSize],
                $("#luckysheetTableContent, #luckysheetTableContentF").attr({
                    width: Math.ceil(Store.luckysheetTableContentHW[0] * Store.devicePixelRatio),
                    height: Math.ceil(Store.luckysheetTableContentHW[1] * Store.devicePixelRatio)
                }).css({
                    width: Store.luckysheetTableContentHW[0],
                    height: Store.luckysheetTableContentHW[1]
                }).get(0).getContext("2d");
                var locale_info = locale().info
                  , key = server.gridKey
                  , cahce_key = key + "__qkcache"
                  , ini = function ini() {
                    file.load = "1",
                    _this.createSheet();
                    var execF = function() {
                        _this.mergeCalculation(file.index),
                        _this.setSheetParam(!1),
                        _this.storeSheetParam(),
                        _this.restoreselect(),
                        _this.CacheNotLoadControll = [],
                        _this.restoreCache(),
                        luckysheetformula.execFunctionGroupForce(luckysheetConfigsetting.forceCalculation),
                        _this.restoreSheetAll(Store.currentSheetIndex),
                        $("#luckysheet_info_detail_save").html(locale_info.detailSave),
                        file.isPivotTable ? (Store.luckysheetcurrentisPivotTable = !0,
                        pivotTable.changePivotTable(Store.currentSheetIndex)) : (Store.luckysheetcurrentisPivotTable = !1,
                        $("#luckysheet-modal-dialog-slider-pivot").hide(),
                        menuToolBarWidth(),
                        luckysheetsizeauto(),
                        null != file.scrollLeft && file.scrollLeft > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(file.scrollLeft) : $("#luckysheet-scrollbar-x").scrollLeft(0),
                        null != file.scrollTop && file.scrollTop > 0 ? $("#luckysheet-scrollbar-y").scrollTop(file.scrollTop) : $("#luckysheet-scrollbar-y").scrollTop(0)),
                        "function" == typeof luckysheetConfigsetting.beforeCreateDom && luckysheetConfigsetting.beforeCreateDom(luckysheet),
                        "function" == typeof luckysheetConfigsetting.workbookCreateBefore && luckysheetConfigsetting.workbookCreateBefore(luckysheet),
                        luckysheetConfigsetting.pointEdit ? setTimeout((function() {
                            $("#luckysheetloadingdata").remove()
                        }
                        ), 0) : setTimeout((function() {
                            $("#luckysheetloadingdata").fadeOut().remove()
                        }
                        ), 500)
                    }
                      , loadSheetUrl = server.loadSheetUrl;
                    if ("" == loadSheetUrl)
                        _this.loadOtherFile(file),
                        execF();
                    else {
                        for (var sheetindexset = _this.checkLoadSheetIndex(file), sheetindex = [], _i2 = 0; _i2 < sheetindexset.length; _i2++) {
                            var item = sheetindexset[_i2];
                            item != file.index && sheetindex.push(item)
                        }
                        $.post(loadSheetUrl, {
                            gridKey: server.gridKey,
                            index: sheetindex.join(",")
                        }, (function(d) {
                            var dataset = eval("(" + d + ")");
                            for (var _item in dataset)
                                if (_item != file.index) {
                                    var otherfile = Store.luckysheetfile[_this.getSheetIndex(_item)];
                                    null != otherfile.load && "0" != otherfile.load || (otherfile.celldata = dataset[_item.toString()],
                                    otherfile.data = _this.buildGridData(otherfile),
                                    otherfile.load = "1")
                                }
                            execF()
                        }
                        ))
                    }
                };
                try {
                    localforage.getItem(cahce_key).then((function(e) {
                        null != e && (_this.CacheNotLoadControll = e),
                        server.clearcachelocaldata((function() {
                            ini()
                        }
                        ))
                    }
                    ))
                } catch (e) {
                    ini(),
                    console.log("缓存操作失败")
                }
            }
            ), 1)
        },
        storeSheetParam: function() {
            var e = this.getSheetIndex(Store.currentSheetIndex)
              , t = Store.luckysheetfile[e];
            t.visibledatarow = Store.visibledatarow,
            t.visibledatacolumn = Store.visibledatacolumn,
            t.ch_width = Store.ch_width,
            t.rh_height = Store.rh_height,
            t.luckysheet_select_save = $.extend(!0, [], Store.luckysheet_select_save),
            t.luckysheet_selection_range = $.extend(!0, [], Store.luckysheet_selection_range),
            $("#luckysheet-scrollbar-x")[0].scrollWidth > $("#luckysheet-scrollbar-x")[0].offsetWidth && (t.scrollLeft = $("#luckysheet-scrollbar-x").scrollLeft()),
            $("#luckysheet-scrollbar-y")[0].scrollHeight > $("#luckysheet-scrollbar-y")[0].offsetHeight && (t.scrollTop = $("#luckysheet-scrollbar-y").scrollTop()),
            t.zoomRatio = Store.zoomRatio
        },
        setSheetParam: function() {
            var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]
              , t = this.getSheetIndex(Store.currentSheetIndex)
              , r = Store.luckysheetfile[t];
            Store.flowdata = r.data,
            editor.webWorkerFlowDataCache(Store.flowdata),
            luckysheetformula.execFunctionGlobalData = null,
            window.luckysheet_getcelldata_cache = null,
            this.sheetParamRestore(r, Store.flowdata),
            null == r.freezen ? (luckysheetFreezen.freezenhorizontaldata = null,
            luckysheetFreezen.freezenverticaldata = null) : (luckysheetFreezen.freezenhorizontaldata = null == r.freezen.horizontal ? null : r.freezen.horizontal.freezenhorizontaldata,
            luckysheetFreezen.freezenverticaldata = null == r.freezen.vertical ? null : r.freezen.vertical.freezenverticaldata),
            e && rhchInit(Store.flowdata.length, Store.flowdata[0].length),
            luckysheetPostil.buildAllPs(Store.flowdata),
            imageCtrl.images = r.images,
            imageCtrl.allImagesShow(),
            imageCtrl.init(),
            dataVerificationCtrl.dataVerification = r.dataVerification,
            dataVerificationCtrl.init(),
            hyperlinkCtrl.hyperlink = r.hyperlink,
            hyperlinkCtrl.init(),
            createFilterOptions(r.filter_select, r.filter)
        },
        restoreselect: function() {
            var e = this.getSheetIndex(Store.currentSheetIndex)
              , t = Store.luckysheetfile[e];
            selectHightlightShow(),
            selectionCopyShow(),
            null != t.scrollLeft && t.scrollLeft > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(t.scrollLeft) : $("#luckysheet-scrollbar-x").scrollLeft(0),
            null != t.scrollTop && t.scrollTop > 0 ? $("#luckysheet-scrollbar-y").scrollTop(t.scrollTop) : $("#luckysheet-scrollbar-y").scrollTop(0)
        },
        storeSheetParamALL: function() {
            this.storeSheetParam();
            var e = this.getSheetIndex(Store.currentSheetIndex);
            Store.luckysheetfile[e].data = Store.flowdata,
            Store.luckysheetfile[e].config = $.extend(!0, {}, Store.config)
        },
        mergeCalculationSheet: {},
        mergeCalculation: function(e) {
            var t = Store.luckysheetfile[this.getSheetIndex(e)]
              , r = t.config
              , a = t.data;
            if (null != r) {
                var n = r.merge;
                if (null != n && !(e in this.mergeCalculationSheet) && !1 !== t.autoCalculationMerge)
                    for (var o in this.mergeCalculationSheet[e] = 1,
                    n) {
                        var l = parseInt(o.substr(0, o.indexOf("_")))
                          , i = parseInt(o.substr(o.indexOf("_") + 1))
                          , s = n[o];
                        null == a[l][i] && (a[l][i] = {}),
                        a[l][i].mc = {
                            r: l,
                            c: i,
                            rs: s.rs,
                            cs: s.cs
                        };
                        for (var c = l; c < l + s.rs; c++)
                            for (var u = i; u < i + s.cs; u++)
                                c == l && u == i || (null == a[c][u] && (a[c][u] = {}),
                                a[c][u].mc = {
                                    r: l,
                                    c: i
                                })
                    }
            }
        },
        loadOtherFile: function(e) {
            for (var t = 0; t < Store.luckysheetfile.length; t++) {
                var r = Store.luckysheetfile[t];
                r.index != e.index && (null != r.load && "0" != r.load || (r.data = this.buildGridData(r),
                r.load = "1"))
            }
        },
        changeSheet: function changeSheet(index, isPivotInitial, isNewSheet) {
            if (!isEditMode()) {
                var _this = this;
                if (index != Store.currentSheetIndex) {
                    server.allowUpdate && ($("#luckysheet-cell-main #luckysheet-multipleRange-show").empty(),
                    server.multipleIndex = 0),
                    $("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex + ", #luckysheet-filter-options-sheet" + Store.currentSheetIndex).hide(),
                    $("#luckysheet-filter-selected-sheet" + index + ", #luckysheet-filter-options-sheet" + index).show(),
                    _this.storeSheetParamALL(),
                    _this.setCurSheet(index);
                    var file = Store.luckysheetfile[_this.getSheetIndex(index)]
                      , data = file.data
                      , cfg = file.config;
                    file.isPivotTable ? (Store.luckysheetcurrentisPivotTable = !0,
                    isPivotInitial || pivotTable.changePivotTable(index)) : (Store.luckysheetcurrentisPivotTable = !1,
                    $("#luckysheet-modal-dialog-slider-pivot").hide(),
                    luckysheetsizeauto(!1));
                    var load = file.load;
                    if (null != load)
                        _this.mergeCalculation(index),
                        _this.setSheetParam(!0),
                        _this.showSheet(),
                        setTimeout((function() {
                            luckysheetformula.execFunctionGroup(),
                            luckysheetrefreshgrid(),
                            server.saveParam("shs", null, Store.currentSheetIndex)
                        }
                        ), 1);
                    else {
                        var loadSheetUrl = server.loadSheetUrl;
                        if ("" == loadSheetUrl || Store.luckysheetcurrentisPivotTable || isNewSheet) {
                            var _data = _this.buildGridData(file);
                            file.data = _data,
                            file.load = "1",
                            _this.loadOtherFile(file),
                            _this.mergeCalculation(index),
                            _this.setSheetParam(),
                            _this.showSheet(),
                            setTimeout((function() {
                                _this.restoreCache(),
                                luckysheetformula.execFunctionGroupForce(luckysheetConfigsetting.forceCalculation),
                                _this.restoreSheetAll(Store.currentSheetIndex),
                                luckysheetrefreshgrid()
                            }
                            ), 1),
                            server.saveParam("shs", null, Store.currentSheetIndex)
                        } else {
                            $("#luckysheet-grid-window-1").append(luckysheetlodingHTML());
                            var sheetindex = _this.checkLoadSheetIndex(file);
                            $.post(loadSheetUrl, {
                                gridKey: server.gridKey,
                                index: sheetindex.join(",")
                            }, (function(d) {
                                var dataset = eval("(" + d + ")");
                                file.celldata = dataset[index.toString()];
                                var data = _this.buildGridData(file);
                                for (var item in setTimeout((function() {
                                    $("#luckysheetloadingdata").fadeOut().remove()
                                }
                                ), 500),
                                dataset)
                                    if (item != index) {
                                        var otherfile = Store.luckysheetfile[_this.getSheetIndex(item)];
                                        null != otherfile.load && "0" != otherfile.load || (otherfile.celldata = dataset[item.toString()],
                                        otherfile.data = _this.buildGridData(otherfile),
                                        otherfile.load = "1")
                                    }
                                file.data = data,
                                file.load = "1",
                                _this.mergeCalculation(index),
                                _this.setSheetParam(),
                                _this.showSheet(),
                                setTimeout((function() {
                                    _this.restoreCache(),
                                    luckysheetformula.execFunctionGroupForce(luckysheetConfigsetting.forceCalculation),
                                    _this.restoreSheetAll(Store.currentSheetIndex),
                                    luckysheetrefreshgrid()
                                }
                                ), 1),
                                server.saveParam("shs", null, Store.currentSheetIndex)
                            }
                            ))
                        }
                    }
                    $("#luckysheet-cell-main .luckysheet-datavisual-selection-set").hide(),
                    $("#luckysheet-datavisual-selection-set-" + index).show(),
                    renderChartShow(index),
                    luckysheetFreezen.initialFreezen(index),
                    _this.restoreselect()
                }
            }
        },
        checkLoadSheetIndexToDataIndex: {},
        checkLoadSheetIndex: function(e) {
            var t = this
              , r = luckysheetformula.getAllFunctionGroup()
              , a = e.chart
              , n = e.pivotTable
              , o = []
              , l = {};
            if (e.index in this.checkLoadSheetIndexToDataIndex)
                return [];
            if (o.push(e.index),
            l[e.index.toString()] = 1,
            this.checkLoadSheetIndexToDataIndex[e.index] = 1,
            null != r && function() {
                for (var e = {}, a = function(a) {
                    var n = r[a]
                      , o = n.index
                      , l = getcellFormula(n.r, n.c, o);
                    if (null == l) {
                        var i = Store.luckysheetfile[t.getSheetIndex(o)];
                        if (i.data = t.buildGridData(i),
                        null == (l = getcellFormula(n.r, n.c, o)))
                            return "continue"
                    }
                    if (-1 == l.indexOf("!"))
                        luckysheetformula.addToSheetIndexList(l, o);
                    else if (null != luckysheetformula.formulaContainSheetList && null != luckysheetformula.formulaContainSheetList[l])
                        for (var s in luckysheetformula.formulaContainSheetList[l])
                            e[s] = 1;
                    else
                        luckysheetformula.functionParser(l, (function(r) {
                            if (luckysheetformula.addToCellList(l, r),
                            r.indexOf("!") > -1) {
                                var a = r.substr(0, r.indexOf("!"))
                                  , n = t.getSheetByName(a);
                                if (null != n) {
                                    var o = n.index;
                                    e[o] = 1,
                                    luckysheetformula.addToSheetIndexList(l, o)
                                }
                            }
                        }
                        )),
                        null == luckysheetformula.formulaContainSheetList[l] && luckysheetformula.addToSheetIndexList(l, o);
                    if (null == o)
                        return "continue"
                }, n = 0; n < r.length; n++)
                    a(n);
                for (var i in e) {
                    var s = i;
                    null == l[s.toString()] && (o.push(s),
                    l[s.toString()] = 1,
                    t.checkLoadSheetIndexToDataIndex[s] = 1)
                }
            }(),
            null != a)
                for (var i = 0; i < a.length; i++) {
                    var s = a[i].dataSheetIndex;
                    null != s && (null == l[s.toString()] && (o.push(s),
                    l[s.toString()] = 1))
                }
            if (null != n) {
                var c = n.pivotDataSheetIndex;
                null != c && null == l[c.toString()] && (o.push(c),
                l[c.toString()] = 1)
            }
            return o
        },
        showSheet: function() {
            $("#luckysheet-cell-flow_0").css({
                width: Store.ch_width,
                top: "-1px"
            }),
            $("#luckysheet-sheettable_0").css({
                width: Store.ch_width - 1,
                height: Store.rh_height
            }),
            $("#luckysheetrowHeader_0").css("height", Store.rh_height),
            $("#luckysheet-cols-h-cells_0").css("width", Store.ch_width),
            $("#luckysheet-scrollbar-x div").width(Store.ch_width),
            $("#luckysheet-scrollbar-y div").height(Store.rh_height + Store.columnHeaderHeight - Store.cellMainSrollBarSize - 3);
            var e = this.getSheetIndex(Store.currentSheetIndex)
              , t = Store.luckysheetfile[e];
            Store.scrollRefreshSwitch = !1,
            null != t.scrollLeft && t.scrollLeft > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(t.scrollLeft * Store.zoomRatio) : $("#luckysheet-scrollbar-x").scrollLeft(0),
            null != t.scrollTop && t.scrollTop > 0 ? $("#luckysheet-scrollbar-y").scrollTop(t.scrollTop * Store.zoomRatio) : $("#luckysheet-scrollbar-y").scrollTop(0),
            setTimeout((function() {
                Store.scrollRefreshSwitch = !0
            }
            ), 0),
            zoomNumberDomBind(Store.zoomRatio)
        },
        setCurSheet: function(e) {
            for (var t = 0; t < Store.luckysheetfile.length; t++)
                Store.luckysheetfile[t].index == e ? Store.luckysheetfile[t].status = 1 : Store.luckysheetfile[t].status = 0;
            Store.currentSheetIndex = e
        },
        getSheetIndex: function(e) {
            for (var t = 0; t < Store.luckysheetfile.length; t++)
                if (Store.luckysheetfile[t].index == e)
                    return t;
            return null
        },
        changeSheetExec: function(e, t, r) {
            var a = $("#luckysheet-sheets-item" + e);
            window.luckysheet_getcelldata_cache = null,
            $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
            a.addClass("luckysheet-sheets-item-active").show(),
            cleargridelement(),
            this.changeSheet(e, t, r),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(),
            luckysheetformula.rangestart && luckysheetformula.createRangeHightlight(),
            this.sheetBarShowAndHide(e)
        },
        sheetArrowShowAndHide: function() {
            var e = $("#luckysheet-sheet-container").width()
              , t = 0;
            $("#luckysheet-sheet-container-c > div.luckysheet-sheets-item:visible").each((function() {
                t += $(this).outerWidth()
            }
            )),
            t >= e ? luckysheetConfigsetting.showsheetbarConfig.sheet && ($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "inline-block"),
            $("#luckysheet-sheet-container .docs-sheet-fade-left").show()) : ($("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "none"),
            $("#luckysheet-sheet-container .docs-sheet-fade-left").hide())
        },
        sheetBarShowAndHide: function(e) {
            var t = $("#luckysheet-sheet-container-c");
            if (null != e) {
                var r = $("#luckysheet-sheets-item" + e);
                t.scrollLeft(r.offset().left)
            }
            var a = t.width()
              , n = t[0].scrollWidth
              , o = t.scrollLeft();
            o <= 0 ? $("#luckysheet-sheet-container .docs-sheet-fade-left").hide() : $("#luckysheet-sheet-container .docs-sheet-fade-left").show(),
            a + o >= n ? $("#luckysheet-sheet-container .docs-sheet-fade-right").hide() : $("#luckysheet-sheet-container .docs-sheet-fade-right").show()
        },
        delChart: function(e, t) {
            var r = this.getSheetIndex(t)
              , a = Store.luckysheetfile[r];
            if (null == a.chart)
                a.chart = [];
            else
                for (var n = 0; n < a.chart.length; n++)
                    if (a.chart[n].chart_id == e) {
                        Store.luckysheetfile[r].chart.splice(n, 1);
                        break
                    }
        },
        saveChart: function(e) {
            var t = this.getSheetIndex(e.sheetIndex)
              , r = Store.luckysheetfile[t];
            if (null == r.chart)
                r.chart = [],
                r.chart.push(e);
            else {
                for (var a = 0; a < r.chart.length; a++)
                    if (r.chart[a].chart_id == e.chart_id) {
                        var n = $.extend(!0, {}, r.chart[a]);
                        return void (r.chart[a] = $.extend(!0, {}, n, e))
                    }
                r.chart.push(e)
            }
        },
        getChart: function(e, t) {
            var r = this.getSheetIndex(e)
              , a = Store.luckysheetfile[r];
            if (null == a.chart)
                return null;
            for (var n = 0; n < a.chart.length; n++)
                if (a.chart[n].chart_id == t)
                    return a.chart[n];
            return null
        },
        getRangetxt: function(e, t, r) {
            var a = "";
            null == r && (r = Store.currentSheetIndex),
            e != r && (a = Store.luckysheetfile[this.getSheetIndex(e)].name + "!");
            var n = t.row[0]
              , o = t.row[1]
              , l = t.column[0]
              , i = t.column[1];
            return null == n && null == o ? a + chatatABC(l) + ":" + chatatABC(i) : null == l && null == i ? a + (n + 1) + ":" + (o + 1) : l == i && n == o ? a + chatatABC(l) + (n + 1) : a + chatatABC(l) + (n + 1) + ":" + chatatABC(i) + (o + 1)
        },
        getSheetName: function(e) {
            return null == e && (e = Store.currentSheetIndex),
            Store.luckysheetfile[this.getSheetIndex(e)].name
        },
        getSheetMerge: function() {
            return null == Store.config.merge ? null : Store.config.merge
        },
        getSheetData: function(e) {
            return null == e && (e = Store.currentSheetIndex),
            Store.luckysheetfile[this.getSheetIndex(e)].data
        },
        getSheetConfig: function(e) {
            return null == e && (e = Store.currentSheetIndex),
            null == Store.luckysheetfile[this.getSheetIndex(e)].config && (Store.luckysheetfile[this.getSheetIndex(e)].config = {}),
            Store.luckysheetfile[this.getSheetIndex(e)].config
        },
        restoreFilter: function(e) {
            var t = this.getSheetIndex(e)
              , r = Store.luckysheetfile[t];
            if ("string" == getObjType(r.filter_select) && (r.filter_select = JSON.parse(r.filter_select)),
            null != r.filter_select && null != r.filter_select.row && null != r.filter_select.column) {
                createFilterOptions(r.filter_select),
                "object" != getObjType(r.filter) && null != r.filter && "string" == getObjType(r.filter) && (r.filter = JSON.parse(r.filter));
                var a = {};
                null != r.config && null != r.config.rowhidden && (a = r.config.rowhidden),
                $("#luckysheet-filter-options-sheet" + e + " .luckysheet-filter-options").each((function(e) {
                    if (null == r.filter)
                        return !1;
                    var t = $(this)
                      , n = r.filter[e];
                    if (null == n)
                        return !0;
                    "object" != getObjType(n) && (n = JSON.parse(n)),
                    labelFilterOptionState(t, n.optionstate, n.rowhidden, n.caljs, !1, n.st_r, n.ed_r, n.cindex, n.st_c, n.ed_c),
                    a = $.extend(!0, a, n.rowhidden)
                }
                )),
                null == r.config && (r.config = {}),
                r.config.rowhidden = a,
                Store.config = r.config,
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length, !1)
            }
        },
        restorePivot: function(e) {
            var t = this.getSheetIndex(e);
            Store.luckysheetfile[t].isPivotTable && (pivotTable.getCellData(e),
            pivotTable.initialPivotManage(!0),
            pivotTable.refreshPivotTable(!1))
        },
        restoreSheetAll: function(e) {
            this.restorePivot(e),
            this.restoreFilter(e),
            this.restoreFreezen(e)
        },
        restoreFreezen: function(e) {
            luckysheetFreezen.initialFreezen(e)
        },
        restoreCache: function() {
            var e = this.CacheNotLoadControll;
            if (this.CacheNotLoadControll = [],
            0 != e.length)
                for (var t = 0; t < e.length; t++) {
                    var r = e[t];
                    this.execCache(r)
                }
        },
        CacheNotLoadControll: [],
        execCache: function execCache(item) {
            var _this = this
              , type = item.t
              , index = item.i
              , value = item.v
              , file = Store.luckysheetfile[_this.getSheetIndex(index)];
            if ("sha" == type)
                Store.luckysheetfile.push(value);
            else if ("shc" == type) {
                var copyjson = $.extend(!0, {}, Store.luckysheetfile[_this.getSheetIndex(value.copyindex)]);
                copyjson.index = index,
                Store.luckysheetfile.push(copyjson)
            } else if ("shd" == type)
                Store.luckysheetfile.splice(value.deleIndex, 1);
            else if ("shr" == type)
                for (var pos in value)
                    Store.luckysheetfile[_this.getSheetIndex(pos)].order = value[pos];
            if (null != file && "1" == file.load || type in {
                sha: 0,
                shc: 0,
                shd: 0,
                shr: 0
            })
                if ("v" == type) {
                    var r = item.r
                      , c = item.c
                      , v = item.v
                      , data = _this.getSheetData(index);
                    file.data[r][c] = v
                } else if ("fc" == type) {
                    var op = item.op
                      , _pos = item.pos;
                    "object" != getObjType(value) && (value = eval("(" + value + ")"));
                    var _r = value.r
                      , _c = value.c;
                    "del" == op ? luckysheetformula.delFunctionGroup(_r, _c, index) : luckysheetformula.insertUpdateFunctionGroup(_r, _c, index)
                } else if ("cg" == type) {
                    var _v = value
                      , k = item.k
                      , config1 = _this.getSheetConfig(index);
                    for (var key in k in config1 || (config1[k] = {}),
                    _v)
                        config1[k][key] = _v[key];
                    Store.config = config1
                } else if ("f" == type) {
                    var _v2 = value
                      , _op = item.op
                      , _pos2 = item.pos
                      , filter = file.filter;
                    null == filter && (filter = {}),
                    "upOrAdd" == _op ? filter[_pos2] = _v2 : "del" == _op && delete filter[_pos2]
                } else if ("fsc" == type)
                    file.filter = null,
                    file.filter_select = null;
                else if ("fsr" == type) {
                    var _v3 = value;
                    file.filter = _v3.filter,
                    file.filter_select = _v3.filter_select
                } else if ("sh" == type) {
                    var _op2 = item.op
                      , cur = item.cur;
                    if ("hide" == _op2)
                        file.status = 0,
                        Store.luckysheetfile[_this.getSheetIndex(cur)].status = 1;
                    else if ("show" == _op2) {
                        for (var i = 0; i < Store.luckysheetfile.length; i++)
                            Store.luckysheetfile[i].status = 0;
                        file.status = 1
                    }
                } else if ("all" == type) {
                    var _k = item.k
                      , s = item.s;
                    s && "object" != getObjType(value) ? file[_k] = JSON.stringify(value) : file[_k] = value
                } else if ("c" == type) {
                    var _op3 = item.op
                      , cid = item.cid;
                    if ("add" == _op3)
                        file.chart.push(value);
                    else if ("xy" == _op3 || "wh" == _op3 || "update" == _op3) {
                        for (var _i3 = 0; _i3 < file.chart.length; _i3++)
                            if (file.chart[_i3].chart_id == cid) {
                                for (var _item2 in file.chart[_i3])
                                    for (var vitem in value)
                                        _item2 == vitem && (file.chart[_i3][_item2] = value[vitem]);
                                return
                            }
                    } else if ("del" == _op3)
                        for (var _i4 = 0; _i4 < file.chart.length; _i4++)
                            if (file.chart[_i4].chart_id == cid)
                                return void file.chart.splice(_i4, 1)
                } else if ("drc" == type) {
                    var rc = item.rc
                      , _index2 = value.index
                      , len = value.len
                      , celldata = file.celldata;
                    if ("r" == rc) {
                        for (var _i5 = 0; 0 == celldata.length; _i5++) {
                            var cell = celldata[_i5];
                            cell.r >= _index2 && cell.r < _index2 + len ? delete celldata[_i5] : cell.r >= _index2 + len && (cell.r -= len)
                        }
                        file.row -= len
                    } else {
                        for (var _i6 = 0; 0 == celldata.length; _i6++) {
                            var _cell = celldata[_i6];
                            _cell.c >= _index2 && _cell.c < _index2 + len ? delete celldata[_i6] : _cell.c >= _index2 + len && (_cell.c -= len)
                        }
                        file.column -= len
                    }
                    for (var ret = [], _i7 = 0, mtype, mst, med; _i7 < celldata.length; _i7++)
                        null != celldata[_i7] && ret.push(celldata[_i7]);
                    file.celldata = ret,
                    mtype = "r" == rc ? "row" : "column",
                    mst = _index2,
                    med = _index2 + len - 1,
                    luckysheetdeletetable(mtype, mst, med, !0)
                } else if ("arc" == type) {
                    var _rc = item.rc, _index3 = value.index, _len = value.len, _celldata = file.celldata, _mtype;
                    if ("r" == _rc) {
                        for (var _i8 = 0; _i8 < _celldata.length; _i8++) {
                            var _cell2 = _celldata[_i8];
                            _cell2.r > _index3 && (_cell2.r += _len)
                        }
                        file.row += _len
                    } else {
                        for (var _i9 = 0; _i9 < _celldata.length; _i9++) {
                            var _cell3 = _celldata[_i9];
                            _cell3.c > _index3 && (_cell3.c += _len)
                        }
                        file.column += _len
                    }
                    _mtype = "r" == _rc ? "row" : "column",
                    luckysheetextendtable(_mtype, _index3, _len, !0)
                } else
                    "na" == type ? server.saveParam("na", null, value) : "thumb" == type && setTimeout((function() {
                        _this.imageRequest()
                    }
                    ), 2e3);
            else
                _this.CacheNotLoadControll.push(item)
        }
    }
      , luckysheetformula = {
        error: {
            v: "#VALUE!",
            n: "#NAME?",
            na: "#N/A",
            r: "#REF!",
            d: "#DIV/0!",
            nm: "#NUM!",
            nl: "#NULL!",
            sp: "#SPILL!"
        },
        errorInfo: function(e) {
            return e
        },
        errorParamCheck: function(e, t, r) {
            var a, n, o = locale().formulaMore;
            return r < e.length ? (a = e[r].type,
            n = e[r].require) : (a = e[e.length - 1].type,
            n = e[e.length - 1].require),
            "o" != n || null != t && "" != t ? a.indexOf("all") > -1 || a.indexOf("range") > -1 && ("object" == getObjType(t) || "array" == getObjType(t)) || a.indexOf("number") > -1 && (isRealNum(t) || "boolean" == getObjType(t)) || a.indexOf("string") > -1 && "string" == getObjType(t) || a.indexOf("date") > -1 && isdatetime(t) ? [!0, o.tipSuccessText] : [!1, o.tipParamErrorText] : [!0, o.tipSuccessText]
        },
        getPureValueByData: function(e) {
            if (0 == e.length)
                return [];
            var t = [];
            if ("array" == getObjType(e))
                if ("array" == getObjType(e[0]))
                    for (var r = 0; r < e.length; r++) {
                        for (var a = [], n = 0; n < e[0].length; n++) {
                            var o = e[r][n];
                            "object" == getObjType(o) ? a.push(o.v) : a.push(o)
                        }
                        t.push(a)
                    }
                else
                    for (var l = 0; l < e.length; l++) {
                        var i = e[l];
                        "object" == getObjType(i) ? t.push(i.v) : t.push(i)
                    }
            else {
                var s = e;
                "object" == getObjType(s) ? t.push(s.v) : t.push(s)
            }
            return t
        },
        readCellDataToOneArray: function readCellDataToOneArray(rangeValue) {
            var _this = this;
            if (null == rangeValue)
                return [];
            if ("object" != getObjType(rangeValue))
                return [rangeValue];
            var dataformat = []
              , data = [];
            if (null == rangeValue || null == rangeValue.data)
                return null == rangeValue || isRealNull(rangeValue.v) ? [] : [rangeValue.v];
            if (data = rangeValue.data,
            "array" == getObjType(data))
                data = _this.getPureValueByData(data);
            else {
                if ("object" == getObjType(data))
                    return data = data.v,
                    [data];
                /\{.*?\}/.test(data) && (data = data.replace(/\{/g, "[").replace(/\}/g, "]")),
                data = eval("(" + data + ")")
            }
            if ("array" == getObjType(data[0]))
                for (var i = 0; i < data.length; i++)
                    dataformat = dataformat.concat(data[i]);
            else
                dataformat = data;
            return dataformat
        },
        getValueByFuncData: function(e, t) {
            return null == e ? null : "array" == getObjType(e) ? "avg" == t ? luckysheet_function.AVERAGE.f.apply(luckysheet_function.AVERAGE, e) : "sum" == t ? luckysheet_function.SUM.f.apply(luckysheet_function.SUM, e) : "object" == getObjType(e[0]) ? luckysheet.mask.getValueByFormat(e[0]) : e[0] : "object" == getObjType(e) ? luckysheet.mask.getValueByFormat(e) : e
        },
        sparklinesColorMap: function(e, t) {
            var r = null;
            if (null == t && (t = 5),
            e.length > t)
                for (var a = t; a < e.length; a++)
                    for (var n = e[a], o = this.readCellDataToOneArray(n), l = 0; l < o.length; l++) {
                        var i = o[l];
                        if (i.indexOf(":") > -1) {
                            r || (r = {});
                            var s = i.split(":");
                            2 == s.length ? r[s[0]] = s[1] : s.length > 1 && (r[s[0] + ":" + s[1]] = s[2])
                        } else
                            r || (r = []),
                            r.push(i)
                    }
            return r
        },
        colorList: ["#2ec7c9", "#fc5c5c", "#5ab1ef", "#ffb980", "#d87a80", "#8d98b3", "#e5cf0d", "#97b552", "#95706d", "#dc69aa", "#07a2a4", "#9a7fd1", "#588dd5", "#f5994e", "#c05050", "#59678c", "#c9ab00", "#7eb00a", "#6f5553", "#c14089"],
        classlist: {
            province: {
                11: "北京",
                12: "天津",
                13: "河北",
                14: "山西",
                15: "内蒙古",
                21: "辽宁",
                22: "吉林",
                23: "黑龙江",
                31: "上海",
                32: "江苏",
                33: "浙江",
                34: "安徽",
                35: "福建",
                36: "江西",
                37: "山东",
                41: "河南",
                42: "湖北",
                43: "湖南",
                44: "广东",
                45: "广西",
                46: "海南",
                50: "重庆",
                51: "四川",
                52: "贵州",
                53: "云南",
                54: "西藏",
                61: "陕西",
                62: "甘肃",
                63: "青海",
                64: "宁夏",
                65: "新疆",
                71: "台湾",
                81: "香港",
                82: "澳门",
                91: "国外"
            }
        },
        oldvalue: null,
        dontupdate: function() {
            Store.luckysheetCellUpdate.length = 0,
            $("#luckysheet-functionbox-cell, #luckysheet-rich-text-editor").html(this.oldvalue),
            this.cancelNormalSelected(),
            this.rangetosheet != Store.currentSheetIndex && sheetmanage.changeSheetExec(this.rangetosheet)
        },
        fucntionboxshow: function(e, t) {
            if (checkProtectionCellHidden(e, t, Store.currentSheetIndex)) {
                var r = Store.flowdata
                  , a = "";
                if (null != r[e] && null != r[e][t]) {
                    var n = r[e][t];
                    a = isInlineStringCell(n) ? getInlineStringNoStyle(e, t) : null != n.f ? getcellvalue(e, t, r, "f") : valueShowEs(e, t, r)
                }
                this.oldvalue = a,
                $("#luckysheet-functionbox-cell").html(a)
            } else
                $("#luckysheet-functionbox-cell").html("")
        },
        cellOffset: function(e, t, r, a, n) {
            var o = e.startCell
              , l = (e.rowl,
            e.coll,
            parseInt(o.replace(/[^0-9]/g, "")))
              , i = ABCatNum(o.replace(/[^A-Za-z]/g, ""))
              , s = []
              , c = [];
            s[0] = l + t,
            c[0] = i + r,
            s[1] = s[0] + a - 1,
            c[1] = c[0] + n - 1,
            c[0] = chatatABC(c[0]),
            c[1] = chatatABC(c[1]);
            var u = c[0] + s[0]
              , h = c[1] + s[1];
            return u == h ? e.sheetName + "!" + u : e.sheetName + "!" + u + ":" + h
        },
        parseDatetoNum: function(e) {
            if ("object" == _typeof(e) && "number" == typeof e.v)
                e = e.v;
            else if ("num" == isdatatype(e))
                e = parseFloat(e);
            else {
                if ("date" != isdatatype(e))
                    return this.error.v;
                e = genarate(e)[2]
            }
            return e
        },
        getRangeArray: function(e) {
            var t = []
              , r = "General";
            if (1 == e.length)
                for (var a = 0; a < e[0].length; a++)
                    if (null != e[0][a] && e[0][a].v) {
                        t.push(e[0][a].v);
                        var n = e[0][a].ct.fa;
                        r = "General" == r ? n : r
                    } else
                        t.push(null);
            else if (1 == e[0].length)
                for (var o = 0; o < e.length; o++)
                    if (null != e[o][0] && e[o][0].v) {
                        t.push(e[o][0].v);
                        var l = e[o][0].ct.fa;
                        r = "General" == r ? l : r
                    } else
                        t.push(null);
            else
                for (var i = 0; i < e.length; i++)
                    for (var s = 0; s < e[i].length; s++)
                        if (null != e[i][s] && e[i][s].v) {
                            t.push(e[i][s].v);
                            var c = e[i][s].ct.fa;
                            r = "General" == r ? c : r
                        } else
                            t.push(null);
            return [e = t, r]
        },
        getRangeArrayTwo: function(e) {
            var t = $.extend(!0, [], e);
            if (1 == t.length)
                for (var r = 0; r < t[0].length; r++)
                    t[0][r]instanceof Object && (null != t[0][r] && t[0][r]instanceof Object && t[0][r].m ? t[0][r] = t[0][r].m : null != t[0][r] && t[0][r]instanceof Object && t[0][r].v ? t[0][r] = t[0][r].v : t[0][r] = null);
            else if (1 == t[0].length)
                for (var a = 0; a < t.length; a++)
                    t[a][0]instanceof Object && (null != t[a][0] && t[a][0]instanceof Object && t[a][0].m ? t[a][0] = t[a][0].m : null != t[a][0] && t[a][0]instanceof Object && t[a][0].v ? t[a][0] = t[a][0].v : t[a][0] = null);
            else
                for (var n = 0; n < t.length; n++)
                    for (var o = 0; o < t[n].length; o++)
                        t[n][o]instanceof Object && (null != t[n][o] && t[n][o]instanceof Object && t[n][o].m ? t[n][o] = t[n][o].m : null != t[n][o] && t[n][o]instanceof Object && t[n][o].v ? t[n][o] = t[n][o].v : t[n][o] = null);
            return t
        },
        isWildcard: function(e, t) {
            e = e.toString(),
            t = t.toString(),
            this.isCompareOperator(t).flag && (t = this.isCompareOperator(t).num);
            for (var r = "", a = 0; a < t.length; a++) {
                var n = t.charAt(a);
                "*" == n ? r += ".*" : "?" == n ? r += "." : "~" == n ? "*" == t.charAt(a + 1) ? (r += "\\*",
                a++) : "?" == t.charAt(a + 1) ? (r += "\\?",
                a++) : r += "~" : r += n
            }
            var o = new RegExp("^" + r + "$","g");
            return !!e.match(o)
        },
        isCompareOperator: function(e) {
            var t = ""
              , r = ""
              , a = (e = e.toString()).substr(0, 1)
              , n = e.substr(1, 1)
              , o = !1;
            return ">" == a ? "=" == n ? (t = e.substr(0, 2),
            r = e.substr(2),
            o = !0) : "=" != n && (t = e.substr(0, 1),
            r = e.substr(1),
            o = !0) : "<" == a ? "=" == n || ">" == n ? (t = e.substr(0, 2),
            r = e.substr(2),
            o = !0) : "=" != n && ">" != n && (t = e.substr(0, 1),
            r = e.substr(1),
            o = !0) : "=" == a && "=" != n && (t = e.substr(0, 1),
            r = e.substr(1),
            o = !0),
            {
                flag: o,
                ope: t,
                num: r
            }
        },
        acompareb: function(e, t) {
            var r = !1;
            if (isRealNum(t))
                r = luckysheet_compareWith(e, "==", t);
            else if ("string" == typeof t) {
                if (-1 != t.indexOf("*") || -1 != t.indexOf("?"))
                    return this.isWildcard(e, t);
                r = this.isCompareOperator(t).flag ? luckysheet_compareWith(e, this.isCompareOperator(t).ope, this.isCompareOperator(t).num) : luckysheet_compareWith(e, "==", t)
            }
            return r
        },
        compareParams: function(e, t, r) {
            var a = !1
              , n = toString.call(e)
              , o = toString.call(t);
            if ((">" == r && e > t || ">=" == r && e >= t || "<" == r && e < t || "<=" == r && e <= t || "=" == r && e == t || "<>" == r && e != t) && (a = !0),
            "[object Object]" == n && "[object Object]" == o) {
                var l = Object.getOwnPropertyNames(e)
                  , i = Object.getOwnPropertyNames(t);
                if (l.length != i.length)
                    return !1;
                for (var s = 0; s < l.length; s++) {
                    var c = l[s];
                    if (e[c] !== t[c])
                        return !1
                }
                return !0
            }
            return "[object Array]" == n && "[object Array]" == o ? e.toString() == t.toString() : a
        },
        parseDecimal: function(e) {
            e = parseFloat(e);
            var t = parseInt(e, 10);
            return 0 == t ? e : e %= t
        },
        getcellrange: function(e, t) {
            if (null != e && 0 != e.length) {
                var r = ""
                  , a = ""
                  , n = null
                  , o = null
                  , l = getluckysheetfile();
                if (e.indexOf("!") > -1) {
                    if (e in this.cellTextToIndexList)
                        return this.cellTextToIndexList[e];
                    var i = e.split("!");
                    for (var s in r = i[0],
                    a = i[1],
                    "'" == (r = r.replace(/\\'/g, "'")).substr(0, 1) && "'" == r.substr(r.length - 1, 1) && (r = r.substring(1, r.length - 1)),
                    l)
                        if (r == l[s].name) {
                            n = l[s].index,
                            o = l[s].data;
                            break
                        }
                } else {
                    var c = t;
                    if (null == c && (c = Store.currentSheetIndex),
                    e + "_" + c in this.cellTextToIndexList)
                        return this.cellTextToIndexList[e + "_" + c];
                    var u = getSheetIndex(c);
                    r = l[u].name,
                    n = l[u].index,
                    o = Store.flowdata,
                    a = e
                }
                if (-1 == a.indexOf(":")) {
                    var h = parseInt(a.replace(/[^0-9]/g, "")) - 1
                      , d = ABCatNum(a.replace(/[^A-Za-z]/g, ""));
                    if (isNaN(h) || isNaN(d))
                        return null;
                    var f = {
                        row: [h, h],
                        column: [d, d],
                        sheetIndex: n
                    };
                    return this.addToCellIndexList(e, f),
                    f
                }
                a = a.split(":");
                var m = []
                  , p = [];
                if (m[0] = parseInt(a[0].replace(/[^0-9]/g, "")) - 1,
                m[1] = parseInt(a[1].replace(/[^0-9]/g, "")) - 1,
                isNaN(m[0]) && (m[0] = 0),
                isNaN(m[1]) && (m[1] = o.length - 1),
                m[0] > m[1])
                    return null;
                if (p[0] = ABCatNum(a[0].replace(/[^A-Za-z]/g, "")),
                p[1] = ABCatNum(a[1].replace(/[^A-Za-z]/g, "")),
                isNaN(p[0]) && (p[0] = 0),
                isNaN(p[1]) && (p[1] = o[0].length - 1),
                p[0] > p[1])
                    return null;
                var g = {
                    row: m,
                    column: p,
                    sheetIndex: n
                };
                return this.addToCellIndexList(e, g),
                g
            }
        },
        rangeHightlightHTML: '<div id="luckysheet-formula-functionrange-highlight-${id}" rangeindex="${id}"  class="luckysheet-selection-highlight luckysheet-formula-functionrange-highlight"><div data-type="top" class="luckysheet-selection-copy-top luckysheet-copy"></div><div data-type="right" class="luckysheet-selection-copy-right luckysheet-copy"></div><div data-type="bottom" class="luckysheet-selection-copy-bottom luckysheet-copy"></div><div data-type="left" class="luckysheet-selection-copy-left luckysheet-copy"></div><div class="luckysheet-selection-copy-hc"></div><div data-type="lt" class="luckysheet-selection-highlight-topleft luckysheet-highlight"></div><div data-type="rt" class="luckysheet-selection-highlight-topright luckysheet-highlight"></div><div data-type="lb" class="luckysheet-selection-highlight-bottomleft luckysheet-highlight"></div><div data-type="rb" class="luckysheet-selection-highlight-bottomright luckysheet-highlight"></div></div>',
        createRangeHightlight: function() {
            var e = this
              , t = $("#luckysheet-rich-text-editor").find("span.luckysheet-formula-functionrange-cell");
            $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight").remove(),
            t.each((function() {
                var t = $(this).attr("rangeindex")
                  , r = $(this).text();
                $("#luckysheet-formula-functionrange").append(replaceHtml$1(e.rangeHightlightHTML, {
                    id: t
                }));
                var a = e.getcellrange(r)
                  , n = "luckysheet-formula-functionrange-highlight-" + t;
                null == a || (a.sheetIndex == Store.currentSheetIndex || -1 == a.sheetIndex && e.rangetosheet == Store.currentSheetIndex) && ($("#" + n).data("range", a).find(".luckysheet-copy").css({
                    background: luckyColor[t]
                }).end().find(".luckysheet-highlight").css({
                    background: luckyColor[t]
                }).end().find(".luckysheet-selection-copy-hc").css({
                    background: luckyColor[t]
                }),
                seletedHighlistByindex(n, a.row[0], a.row[1], a.column[0], a.column[1]))
            }
            )),
            $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight").show()
        },
        searchHTML: '<div id="luckysheet-formula-search-c" class="luckysheet-formula-search-c"></div>',
        helpHTML: '<div id="luckysheet-formula-help-c" class="luckysheet-formula-help-c"> <div class="luckysheet-formula-help-close" title="${helpClose}"><i class="fa fa-times" aria-hidden="true"></i></div> <div class="luckysheet-formula-help-collapse" title="${helpCollapse}"><i class="fa fa-angle-up" aria-hidden="true"></i></div> <div class="luckysheet-formula-help-title"><div class="luckysheet-formula-help-title-formula"> <span class="luckysheet-arguments-help-function-name">SUM</span> <span class="luckysheet-arguments-paren">(</span> <span class="luckysheet-arguments-parameter-holder"> <span class="luckysheet-arguments-help-parameter luckysheet-arguments-help-parameter-active" dir="auto">A2:A100</span>, <span class="luckysheet-arguments-help-parameter" dir="auto">101</span> </span> <span class="luckysheet-arguments-paren">)</span> </div></div> <div class="luckysheet-formula-help-content"> <div class="luckysheet-formula-help-content-example"> <div class="luckysheet-arguments-help-section-title">${helpExample}</div> <div class="luckysheet-arguments-help-formula"> <span class="luckysheet-arguments-help-function-name">SUM</span> <span class="luckysheet-arguments-paren">(</span> <span class="luckysheet-arguments-parameter-holder"> <span class="luckysheet-arguments-help-parameter luckysheet-arguments-help-parameter-active" dir="auto">A2:A100</span>, <span class="luckysheet-arguments-help-parameter" dir="auto">101</span> </span> <span class="luckysheet-arguments-paren">)</span> </div> </div> <div class="luckysheet-formula-help-content-detail"> <div class="luckysheet-arguments-help-section"> <div class="luckysheet-arguments-help-section-title luckysheet-arguments-help-parameter-name">${helpAbstract}</div> <span class="luckysheet-arguments-help-parameter-content">${helpAbstract}</span> </div> </div> <div class="luckysheet-formula-help-content-param"> ${param} </div> </div> <div class="luckysheet-formula-help-foot"></div></div>',
        getrangeseleciton: function() {
            var e = window.getSelection()
              , t = $(e.anchorNode)
              , r = e.anchorOffset;
            if (t.parent().is("span") && 0 != r) {
                var a = $.trim(t.text());
                if (0 == a.length && t.parent().prev().length > 0) {
                    var n = t.parent().prev();
                    return (a = $.trim(n.text())).substr(a.length - 1, 1),
                    n
                }
                return a.substr(r - 1, 1),
                t.parent()
            }
            if (t.is("#luckysheet-rich-text-editor") || t.is("#luckysheet-functionbox-cell")) {
                var o = $.trim(t.find("span").last().text());
                if (0 == o.length && t.find("span").length > 1) {
                    var l = t.find("span");
                    return o = $.trim(l.eq(l.length - 2).text()),
                    l
                }
                return t.find("span").last()
            }
            if ((t.parent().is("#luckysheet-rich-text-editor") || t.parent().is("#luckysheet-functionbox-cell") || 0 == r) && (0 == r && (t = t.parent()),
            t.prev().length > 0)) {
                var i = $.trim(t.prev().text());
                i.substr(i.length - 1, 1);
                return t.prev()
            }
            return null
        },
        searchFunctionPosition: function(e, t, r, a, n) {
            var o = $(window).height()
              , l = $(window).width()
              , i = e.outerWidth()
              , s = e.outerHeight();
            null == n && (n = !1);
            var c = r;
            c = r + i > l ? r - i + t.outerWidth() : r;
            var u = a;
            a + s > o ? u = a - s : (u = a + t.outerHeight(),
            n || e.html(e.find(".luckysheet-formula-search-item").get().reverse())),
            u < 0 && (u = 0),
            c < 0 && (c = 0),
            e.css({
                top: u,
                left: c
            }).show()
        },
        searchFunctionCell: null,
        searchFunction: function(e) {
            var t = Store.functionlist
              , r = this.getrangeseleciton();
            if (this.searchFunctionCell = r,
            null != r && null != e) {
                var a = e.text()
                  , n = r.text().toUpperCase();
                if (/^[a-zA-Z]|[a-zA-Z_]+$/.test(n) && "=" == a.substr(0, 1)) {
                    for (var o = {
                        f: [],
                        s: [],
                        t: []
                    }, l = 0, i = 0; i < t.length; i++) {
                        var s = t[i]
                          , c = s.n;
                        if (c == n ? (o.f.unshift(s),
                        l++) : c.substr(0, n.length) == n ? (o.s.unshift(s),
                        l++) : c.indexOf(n) > -1 && (o.t.unshift(s),
                        l++),
                        l >= 10)
                            break
                    }
                    var u = o.t.concat(o.s.concat(o.f));
                    if (!(u.length <= 0)) {
                        var h = this.searchFunctionHTML(u);
                        $("#luckysheet-formula-search-c").html(h).show(),
                        $("#luckysheet-formula-help-c").hide();
                        var d = e.parent()
                          , f = d.offset();
                        this.searchFunctionPosition($("#luckysheet-formula-search-c"), d, f.left, f.top)
                    }
                }
            }
        },
        
        searchFunctionEnter: function(e) {
            var t = e.data("func");
            this.searchFunctionCell.text(t).after('<span dir="auto" class="luckysheet-formula-text-color">(</span>'),
            this.setCaretPosition(this.searchFunctionCell.next().get(0), 0, 1),
            $("#luckysheet-formula-search-c").hide(),
            this.helpFunctionExe(this.searchFunctionCell.closest("div"), this.searchFunctionCell.next())
        },
        searchFunctionHTML: function(e) {
            var t = this;
            0 == $("#luckysheet-formula-search-c").length && ($("body").append(t.searchHTML),
            $("#luckysheet-formula-search-c").on("mouseover", ".luckysheet-formula-search-item", (function() {
                $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").removeClass("luckysheet-formula-search-item-active"),
                $(this).addClass("luckysheet-formula-search-item-active")
            }
            )).on("mouseout", ".luckysheet-formula-search-item", (function() {}
            )).on("click", ".luckysheet-formula-search-item", (function() {
                null != t.searchFunctionCell && t.searchFunctionEnter($(this))
            }
            )));
            for (var r = '<div data-func="${n}" class="luckysheet-formula-search-item ${class}"><div class="luckysheet-formula-search-func">${n}</div><div class="luckysheet-formula-search-detail">${a}</div></div>', a = "", n = 0; n < e.length; n++) {
                var o = e[n];
                n == e.length - 1 ? a += replaceHtml$1(r, {
                    class: "luckysheet-formula-search-item-active",
                    n: o.n,
                    a: o.a
                }) : a += replaceHtml$1(r, {
                    class: "",
                    n: o.n,
                    a: o.a
                })
            }
            return a
        },
        functionlistPosition: {},
        helpFunction: function(e, t, r) {
            var a = Store.functionlist[this.functionlistPosition[$.trim(t).toUpperCase()]];
            if (null != a) {
                var n = locale().formulaMore;
                $("#luckysheet-formula-help-c .luckysheet-arguments-help-function-name").html(a.n),
                $("#luckysheet-formula-help-c .luckysheet-arguments-help-parameter-content").html(a.d);
                for (var o = "", l = "", i = "", s = 0; s < a.p.length; s++) {
                    var c = a.p[s]
                      , u = c.name
                      , h = c.name;
                    "y" == c.repeat && (u += ", ...",
                    h += '<span class="luckysheet-arguments-help-argument-info">...-' + n.allowRepeatText + "</span>"),
                    "o" == c.require && (u = "[" + u + "]",
                    h += '<span class="luckysheet-arguments-help-argument-info">-[' + n.allowOptionText + "]</span>"),
                    o += '<span class="luckysheet-arguments-help-parameter" dir="auto">' + u + "</span>, ",
                    l += '<span class="luckysheet-arguments-help-parameter" dir="auto">' + c.example + "</span>, ",
                    i += replaceHtml$1('<div class="luckysheet-arguments-help-section"><div class="luckysheet-arguments-help-section-title">${param}</div><span class="luckysheet-arguments-help-parameter-content">${content}</span></div>', {
                        param: h,
                        content: c.detail
                    })
                }
                if (o = o.substr(0, o.length - 2),
                l = l.substr(0, l.length - 2),
                $("#luckysheet-formula-help-c .luckysheet-formula-help-title .luckysheet-arguments-parameter-holder").html(o),
                $("#luckysheet-formula-help-c .luckysheet-arguments-help-formula .luckysheet-arguments-parameter-holder").html(l),
                $("#luckysheet-formula-help-c .luckysheet-formula-help-content-param").html(i),
                null == r)
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-title-formula .luckysheet-arguments-help-function-name").css("font-weight", "bold");
                else {
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-title-formula .luckysheet-arguments-help-function-name").css("font-weight", "normal");
                    var d = r >= a.p.length ? a.p.length - 1 : r;
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-title .luckysheet-arguments-parameter-holder .luckysheet-arguments-help-parameter").removeClass("luckysheet-arguments-help-parameter-active"),
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-title .luckysheet-arguments-parameter-holder .luckysheet-arguments-help-parameter").eq(d).addClass("luckysheet-arguments-help-parameter-active"),
                    $("#luckysheet-formula-help-c .luckysheet-arguments-help-formula .luckysheet-arguments-parameter-holder .luckysheet-arguments-help-parameter").removeClass("luckysheet-arguments-help-parameter-active"),
                    $("#luckysheet-formula-help-c .luckysheet-arguments-help-formula .luckysheet-arguments-parameter-holder .luckysheet-arguments-help-parameter").eq(d).addClass("luckysheet-arguments-help-parameter-active"),
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-content-param .luckysheet-arguments-help-section").removeClass("luckysheet-arguments-help-parameter-active"),
                    $("#luckysheet-formula-help-c .luckysheet-formula-help-content-param .luckysheet-arguments-help-section").eq(d).addClass("luckysheet-arguments-help-parameter-active")
                }
                var f = e.parent()
                  , m = f.offset();
                this.searchFunctionPosition($("#luckysheet-formula-help-c"), f, m.left, m.top, !0)
            }
        },
        helpFunctionExe: function(e, t) {
            var r = this
              , a = Store.functionlist
              , n = locale().formulaMore;
            if (0 == $("#luckysheet-formula-help-c").length) {
                $("body").after(replaceHtml$1(r.helpHTML, {
                    helpClose: n.helpClose,
                    helpCollapse: n.helpCollapse,
                    helpExample: n.helpExample,
                    helpAbstract: n.helpAbstract
                })),
                $("#luckysheet-formula-help-c .luckysheet-formula-help-close").click((function() {
                    $("#luckysheet-formula-help-c").hide()
                }
                )),
                $("#luckysheet-formula-help-c .luckysheet-formula-help-collapse").click((function() {
                    var e = $("#luckysheet-formula-help-c .luckysheet-formula-help-content");
                    e.slideToggle(100, (function() {
                        var e = r.rangeResizeTo.parent()
                          , t = e.offset();
                        r.searchFunctionPosition($("#luckysheet-formula-help-c"), e, t.left, t.top, !0)
                    }
                    )),
                    e.is(":hidden") ? $(this).html('<i class="fa fa-angle-up" aria-hidden="true"></i>') : $(this).html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
                }
                ));
                for (var o = 0; o < a.length; o++)
                    r.functionlistPosition[a[o].n] = o
            }
            if (t) {
                var l = t
                  , i = (e.length,
                e.find("span"))
                  , s = t.index()
                  , c = s;
                if (null != l) {
                    var u = null
                      , h = null;
                    if (i.eq(c).is(".luckysheet-formula-text-func"))
                        u = i.eq(c).text();
                    else
                        for (var d = null, f = [-1, -1]; --c > 0; )
                            if ((d = i.eq(c)).is(".luckysheet-formula-text-func") || $.trim(d.text()).toUpperCase()in r.functionlistPosition) {
                                u = d.text(),
                                h = null;
                                for (var m = !0, p = c; p <= s; p++)
                                    if (h || (h = 0),
                                    !(p >= f[0] && p <= f[1])) {
                                        if ((d = i.eq(p)).is(".luckysheet-formula-text-rpar")) {
                                            f = [c, p],
                                            u = null,
                                            m = !1;
                                            break
                                        }
                                        d.is(".luckysheet-formula-text-comma") && h++
                                    }
                                if (m)
                                    break
                            }
                    null != u && r.helpFunction(e, u, h)
                }
            }
        },
        rangeHightlightselected: function(e, t) {
            var r = this.getrangeseleciton();
            if ($("#luckysheet-formula-search-c, #luckysheet-formula-help-c").hide(),
            $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight .luckysheet-selection-copy-hc").css("opacity", "0.03"),
            $("#luckysheet-formula-search-c, #luckysheet-formula-help-c").hide(),
            this.helpFunctionExe(e, r),
            console.log(r, $(r).closest(".luckysheet-formula-functionrange-cell").length),
            0 != $(r).closest(".luckysheet-formula-functionrange-cell").length) {
                var a = $(r).closest(".luckysheet-formula-functionrange-cell").attr("rangeindex");
                $("#" + ("luckysheet-formula-functionrange-highlight-" + a)).find(".luckysheet-selection-copy-hc").css({
                    opacity: "0.13"
                })
            } else
                this.searchFunction(e)
        },
        updatecell: function(e, t, r) {
            var a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]
              , n = this
              , o = $("#luckysheet-rich-text-editor")
              , l = o.text()
              , i = o.html();
            if (null != n.rangetosheet && n.rangetosheet != Store.currentSheetIndex && sheetmanage.changeSheetExec(n.rangetosheet),
            checkProtectionLocked(e, t, Store.currentSheetIndex)) {
                if (null != dataVerificationCtrl.dataVerification) {
                    var s = dataVerificationCtrl.dataVerification[e + "_" + t];
                    if (null != s && s.prohibitInput && !dataVerificationCtrl.validateCellData(l, s)) {
                        var c = dataVerificationCtrl.getFailureText(s);
                        return tooltip.info(c, ""),
                        void n.cancelNormalSelected()
                    }
                }
                var u = Store.flowdata[e][t]
                  , h = isInlineStringCell(u)
                  , d = "=" != l.slice(0, 1) && "<span" == i.substr(0, 5);
                if (r || d || !h ? d && ("object" != getObjType(u) && (u = {}),
                delete u.f,
                delete u.v,
                delete u.m,
                null == u.ct && (u.ct = {},
                u.ct.fa = "General"),
                u.ct.t = "inlineStr",
                u.ct.s = convertSpanToShareString(o.find("span"))) : (delete u.ct.s,
                u.ct.t = "g",
                u.ct.fa = "General",
                r = ""),
                r = r || o.text(),
                !d) {
                    if (isRealNull(r) && !h) {
                        if (null == u || isRealNull(u.v) && null == u.spl && null == u.f)
                            return void n.cancelNormalSelected()
                    } else if (null != u && 1 != u.qp) {
                        if ("object" == getObjType(u) && (r == u.f || r == u.v || r == u.m))
                            return void n.cancelNormalSelected();
                        if (r == u)
                            return void n.cancelNormalSelected()
                    }
                    "string" == getObjType(r) && "=" == r.slice(0, 1) && r.length > 1 || "object" != getObjType(u) || null == u.ct || null == u.ct.fa || "@" == u.ct.fa || isRealNull(r) || (delete u.m,
                    null != u.f && (delete u.f,
                    delete u.spl))
                }
                window.luckysheet_getcelldata_cache = null;
                var f = !0
                  , m = editor.deepCopyFlowData(Store.flowdata)
                  , p = null;
                if ("object" == getObjType(u)) {
                    if (!d)
                        if ("string" == getObjType(r) && "=" == r.slice(0, 1) && r.length > 1) {
                            var g = n.execfunction(r, e, t, void 0, !0);
                            if (f = !1,
                            (u = m[e][t]).v = g[1],
                            u.f = g[2],
                            4 == g.length && "sparklines" == g[3].type) {
                                delete u.m,
                                delete u.v;
                                var y = g[3].data;
                                "array" == getObjType(y) && "object" != getObjType(y[0]) ? u.v = y[0] : u.spl = g[3].data
                            } else
                                4 == g.length && "dynamicArrayItem" == g[3].type && (p = g[3].data)
                        } else if ("object" == getObjType(r)) {
                            var v = r.f;
                            if ("string" == getObjType(v) && "=" == v.slice(0, 1) && v.length > 1) {
                                var A = n.execfunction(v, e, t, void 0, !0);
                                if (f = !1,
                                (u = m[e][t]).v = A[1],
                                u.f = A[2],
                                4 == A.length && "sparklines" == A[3].type) {
                                    delete u.m,
                                    delete u.v;
                                    var b = A[3].data;
                                    "array" == getObjType(b) && "object" != getObjType(b[0]) ? u.v = b[0] : u.spl = A[3].data
                                } else
                                    4 == A.length && "dynamicArrayItem" == A[3].type && (p = A[3].data)
                            } else
                                for (var k in r)
                                    u[k] = r[k]
                        } else
                            n.delFunctionGroup(e, t),
                            n.execFunctionGroup(e, t, r),
                            f = !1,
                            (u = m[e][t]).v = r,
                            delete u.f,
                            delete u.spl,
                            1 == u.qp && "'" != ("" + r).substr(0, 1) && (u.qp = 0,
                            null != u.ct && (u.ct.fa = "General",
                            u.ct.t = "n"));
                    r = u
                } else if ("string" == getObjType(r) && "=" == r.slice(0, 1) && r.length > 1) {
                    var w = n.execfunction(r, e, t, void 0, !0);
                    if (f = !1,
                    r = {
                        v: w[1],
                        f: w[2]
                    },
                    4 == w.length && "sparklines" == w[3].type) {
                        var x = w[3].data;
                        "array" == getObjType(x) && "object" != getObjType(x[0]) ? r.v = x[0] : r.spl = w[3].data
                    } else
                        4 == w.length && "dynamicArrayItem" == w[3].type && (p = w[3].data)
                } else if ("object" == getObjType(r)) {
                    var S = r.f;
                    if ("string" == getObjType(S) && "=" == S.slice(0, 1) && S.length > 1) {
                        var _ = n.execfunction(S, e, t, void 0, !0);
                        if (f = !1,
                        r.v = _[1],
                        r.f = _[2],
                        4 == _.length && "sparklines" == _[3].type) {
                            var C = _[3].data;
                            "array" == getObjType(C) && "object" != getObjType(C[0]) ? r.v = C[0] : r.spl = _[3].data
                        } else
                            4 == _.length && "dynamicArrayItem" == _[3].type && (p = _[3].data)
                    } else {
                        var T = u;
                        null == r.v && (r.v = T)
                    }
                } else
                    n.delFunctionGroup(e, t),
                    n.execFunctionGroup(e, t, r),
                    f = !1;
                setcellvalue(e, t, m, r),
                n.cancelNormalSelected();
                var E = !1
                  , I = $.extend(!0, {}, getluckysheetfile()[getSheetIndex(Store.currentSheetIndex)].config);
                if (null == I.rowlen && (I.rowlen = {}),
                "2" == m[e][t].tb && null != m[e][t].v || isInlineStringCell(m[e][t])) {
                    var R = Store.defaultrowlen
                      , B = $("#luckysheetTableContent").get(0).getContext("2d");
                    if (I.customHeight && 1 == I.customHeight[e])
                        ;
                    else {
                        var N = colLocationByIndex(t)[1] - colLocationByIndex(t)[0] - 2
                          , F = getCellTextInfo(m[e][t], B, {
                            r: e,
                            c: t,
                            cellWidth: N
                        })
                          , P = R;
                        null != F && (P = F.textHeightAll + 2),
                        P > R && (I.rowlen[e] = P,
                        E = !0)
                    }
                }
                var L = null;
                p && (L = $.extend(!0, [], this.insertUpdateDynamicArray(p)));
                var O = {
                    dynamicArray: L
                };
                if (E && (O = {
                    cfg: I,
                    dynamicArray: L,
                    RowlChange: E
                }),
                !a)
                    return {
                        data: m,
                        allParam: O
                    };
                jfrefreshgrid(m, [{
                    row: [e, e],
                    column: [t, t]
                }], O, f),
                n.execFunctionGlobalData = null
            }
        },
        cancelNormalSelected: function() {
            this.canceFunctionrangeSelected(),
            $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight").remove(),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-input-box-index").hide(),
            $("#luckysheet-wa-functionbox-cancel, #luckysheet-wa-functionbox-confirm").removeClass("luckysheet-wa-calculate-active"),
            this.rangestart = !1,
            this.rangedrag_column_start = !1,
            this.rangedrag_row_start = !1
        },
        canceFunctionrangeSelected: function() {
            $("#luckysheet-formula-functionrange-select").hide(),
            $("#luckysheet-row-count-show, #luckysheet-column-count-show").hide(),
            $("#luckysheet-formula-search-c, #luckysheet-formula-help-c").hide()
        },
        iscellformat: function(e) {},
        iscelldata: function(e) {
            var t, r = e.split("!"), a = /^(((([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+)))|((([a-zA-Z]+)|([$][a-zA-Z]+))))$/g;
            if (-1 == (t = r.length > 1 ? r[1] : r[0]).indexOf(":")) {
                var n = parseInt(t.replace(/[^0-9]/g, "")) - 1
                  , o = ABCatNum(t.replace(/[^A-Za-z]/g, ""));
                return !(isNaN(n) || isNaN(o) || !t.toString().match(/^(([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+))$/g)) || !!isNaN(n) && (isNaN(o),
                !1)
            }
            a = /^(((([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+)))|((([a-zA-Z]+)|([$][a-zA-Z]+)))|((([0-9]+)|([$][0-9]+s))))$/g,
            t = t.split(":");
            var l = []
              , i = [];
            return l[0] = parseInt(t[0].replace(/[^0-9]/g, "")) - 1,
            l[1] = parseInt(t[1].replace(/[^0-9]/g, "")) - 1,
            !(l[0] > l[1]) && (i[0] = ABCatNum(t[0].replace(/[^A-Za-z]/g, "")),
            i[1] = ABCatNum(t[1].replace(/[^A-Za-z]/g, "")),
            !(i[0] > i[1]) && !(!t[0].toString().match(a) || !t[1].toString().match(a)))
        },
        operator: "==|!=|<>|<=|>=|=|+|-|>|<|/|*|%|&|^",
        operatorjson: null,
        functionCopy: function(e, t, r) {
            if (null == this.operatorjson) {
                for (var a = this.operator.split("|"), n = {}, o = 0; o < a.length; o++)
                    n[a[o].toString()] = 1;
                this.operatorjson = n
            }
            null == t && (t = "down"),
            null == r && (r = 1),
            "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var l = e.split(""), i = 0, s = "", c = "", u = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0
            }; i < l.length; ) {
                var h = l[i];
                if ("(" == h && 0 == u.dquote)
                    u.bracket += 1,
                    s.length > 0 ? c += s + "(" : c += "(",
                    s = "";
                else if (")" == h && 0 == u.dquote)
                    u.bracket -= 1,
                    c += this.functionCopy(s, t, r) + ")",
                    s = "";
                else if ('"' == h && 0 == u.squote)
                    u.dquote > 0 ? (c += s + '"',
                    u.dquote -= 1,
                    s = "") : (u.dquote += 1,
                    s += '"');
                else if ("," == h && 0 == u.dquote)
                    c += this.functionCopy(s, t, r) + ",",
                    s = "";
                else if ("&" == h && 0 == u.dquote)
                    s.length > 0 ? (c += this.functionCopy(s, t, r) + "&",
                    s = "") : c += "&";
                else if (h in this.operatorjson && 0 == u.dquote) {
                    var d = "";
                    i + 1 < l.length && (d = l[i + 1]);
                    var f = i - 1
                      , m = null;
                    if (f >= 0)
                        do {
                            m = l[f--]
                        } while (f >= 0 && " " == m);h + d in this.operatorjson ? (s.length > 0 ? (c += this.functionCopy(s, t, r) + h + d,
                    s = "") : c += h + d,
                    i++) : /[^0-9]/.test(d) || "-" != h || "(" != m && null != m && "," != m && " " != m && !(m in this.operatorjson) ? s.length > 0 ? (c += this.functionCopy(s, t, r) + h,
                    s = "") : c += h : s += h
                } else
                    s += h;
                i == l.length - 1 && (this.iscelldata($.trim(s)) ? "down" == t ? c += this.downparam($.trim(s), r) : "up" == t ? c += this.upparam($.trim(s), r) : "left" == t ? c += this.leftparam($.trim(s), r) : "right" == t && (c += this.rightparam($.trim(s), r)) : c += $.trim(s)),
                i++
            }
            return c
        },
        isfreezonFuc: function(e) {
            var t = e.replace(/[^0-9]/g, "")
              , r = e.replace(/[^A-Za-z]/g, "")
              , a = e.substr(e.indexOf(t) - 1, 1)
              , n = e.substr(e.indexOf(r) - 1, 1)
              , o = [!1, !1];
            return "$" == a && (o[0] = !0),
            "$" == n && (o[1] = !0),
            o
        },
        setfreezonFuceExe: function(e) {
            var t = parseInt(e.replace(/[^0-9]/g, ""))
              , r = ABCatNum(e.replace(/[^A-Za-z]/g, ""));
            return isNaN(t) || isNaN(r) ? isNaN(t) ? isNaN(r) ? e : "$" + chatatABC(r) : "$" + t : "$" + chatatABC(r) + "$" + t
        },
        setfreezonFuc: function(e) {
            var t = this.getrangeseleciton();
            if (this.iscelldata(t.text())) {
                var r, a = t.text(), n = window.getSelection().anchorOffset, o = a.split("!"), l = "";
                o.length > 1 ? (r = o[1],
                l = o[0] + "!") : r = o[0];
                var i = ""
                  , s = ""
                  , c = r.indexOf(":");
                if (-1 == c)
                    s = (i = l + this.setfreezonFuceExe(r)).length;
                else if (r = r.split(":"),
                n > c) {
                    var u = l + r[0] + ":" + this.setfreezonFuceExe(r[1]);
                    i = u,
                    s = u.length
                } else {
                    var h = l + this.setfreezonFuceExe(r[0]);
                    i = h + ":" + r[1],
                    s = h.length
                }
                t.text(l + i),
                this.setCaretPosition(t.get(0), 0, s)
            }
        },
        updateparam: function(e, t, r) {
            var a, n = t.split("!"), o = "";
            if (n.length > 1 ? (a = n[1],
            o = n[0] + "!") : a = n[0],
            -1 == a.indexOf(":")) {
                var l = parseInt(a.replace(/[^0-9]/g, ""))
                  , i = ABCatNum(a.replace(/[^A-Za-z]/g, ""))
                  , s = this.isfreezonFuc(a)
                  , c = s[0] ? "$" : ""
                  , u = s[1] ? "$" : "";
                return "u" != e || s[0] ? "r" != e || s[1] ? "l" != e || s[1] ? "d" != e || s[0] || (l += r) : i -= r : i += r : l -= r,
                l[0] < 0 || i[0] < 0 ? this.error.r : isNaN(l) || isNaN(i) ? isNaN(l) ? isNaN(i) ? t : o + u + chatatABC(i) : o + c + l : o + u + chatatABC(i) + c + l
            }
            a = a.split(":");
            var h = []
              , d = [];
            if (h[0] = parseInt(a[0].replace(/[^0-9]/g, "")),
            h[1] = parseInt(a[1].replace(/[^0-9]/g, "")),
            h[0] > h[1])
                return t;
            if (d[0] = ABCatNum(a[0].replace(/[^A-Za-z]/g, "")),
            d[1] = ABCatNum(a[1].replace(/[^A-Za-z]/g, "")),
            d[0] > d[1])
                return t;
            var f = this.isfreezonFuc(a[0])
              , m = this.isfreezonFuc(a[1])
              , p = f[0] ? "$" : ""
              , g = f[1] ? "$" : ""
              , y = m[0] ? "$" : ""
              , v = m[1] ? "$" : "";
            return "u" == e ? (f[0] || (h[0] -= r),
            m[0] || (h[1] -= r)) : "r" == e ? (f[1] || (d[0] += r),
            m[1] || (d[1] += r)) : "l" == e ? (f[1] || (d[0] -= r),
            m[1] || (d[1] -= r)) : "d" == e && (f[0] || (h[0] += r),
            m[0] || (h[1] += r)),
            h[0] < 0 || d[0] < 0 ? this.error.r : isNaN(d[0]) && isNaN(d[1]) ? o + p + h[0] + ":" + y + h[1] : isNaN(h[0]) && isNaN(h[1]) ? o + g + chatatABC(d[0]) + ":" + v + chatatABC(d[1]) : o + g + chatatABC(d[0]) + p + h[0] + ":" + v + chatatABC(d[1]) + y + h[1]
        },
        downparam: function(e, t) {
            return this.updateparam("d", e, t)
        },
        upparam: function(e, t) {
            return this.updateparam("u", e, t)
        },
        leftparam: function(e, t) {
            return this.updateparam("l", e, t)
        },
        rightparam: function(e, t) {
            return this.updateparam("r", e, t)
        },
        functionStrChange: function(e, t, r, a, n, o) {
            if (null == this.operatorjson) {
                for (var l = this.operator.split("|"), i = {}, s = 0; s < l.length; s++)
                    i[l[s].toString()] = 1;
                this.operatorjson = i
            }
            "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var c = e.split(""), u = 0, h = "", d = "", f = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0
            }; u < c.length; ) {
                var m = c[u];
                if ("(" == m && 0 == f.dquote)
                    f.bracket += 1,
                    h.length > 0 ? d += h + "(" : d += "(",
                    h = "";
                else if (")" == m && 0 == f.dquote)
                    f.bracket -= 1,
                    d += this.functionStrChange(h, t, r, a, n, o) + ")",
                    h = "";
                else if ('"' == m && 0 == f.squote)
                    f.dquote > 0 ? (d += h + '"',
                    f.dquote -= 1,
                    h = "") : (f.dquote += 1,
                    h += '"');
                else if ("," == m && 0 == f.dquote)
                    d += this.functionStrChange(h, t, r, a, n, o) + ",",
                    h = "";
                else if ("&" == m && 0 == f.dquote)
                    h.length > 0 ? (d += this.functionStrChange(h, t, r, a, n, o) + "&",
                    h = "") : d += "&";
                else if (m in this.operatorjson && 0 == f.dquote) {
                    var p = "";
                    u + 1 < c.length && (p = c[u + 1]);
                    var g = u - 1
                      , y = null;
                    if (g >= 0)
                        do {
                            y = c[g--]
                        } while (g >= 0 && " " == y);m + p in this.operatorjson ? (h.length > 0 ? (d += this.functionStrChange(h, t, r, a, n, o) + m + p,
                    h = "") : d += m + p,
                    u++) : /[^0-9]/.test(p) || "-" != m || "(" != y && null != y && "," != y && " " != y && !(y in this.operatorjson) ? h.length > 0 ? (d += this.functionStrChange(h, t, r, a, n, o) + m,
                    h = "") : d += m : h += m
                } else
                    h += m;
                u == c.length - 1 && (this.iscelldata($.trim(h)) ? d += this.functionStrChange_range($.trim(h), t, r, a, n, o) : d += $.trim(h)),
                u++
            }
            return d
        },
        functionStrChange_range: function(e, t, r, a, n, o) {
            var l, i, s, c, u, h, d, f, m, p = e.split("!"), g = "";
            if (p.length > 1 ? (l = p[1],
            g = p[0] + "!") : l = p[0],
            -1 == l.indexOf(":")) {
                i = s = parseInt(l.replace(/[^0-9]/g, "")) - 1,
                c = u = ABCatNum(l.replace(/[^A-Za-z]/g, ""));
                var y = this.isfreezonFuc(l);
                h = d = y[0] ? "$" : "",
                f = m = y[1] ? "$" : ""
            } else {
                if (l = l.split(":"),
                (i = parseInt(l[0].replace(/[^0-9]/g, "")) - 1) > (s = parseInt(l[1].replace(/[^0-9]/g, "")) - 1))
                    return e;
                if ((c = ABCatNum(l[0].replace(/[^A-Za-z]/g, ""))) > (u = ABCatNum(l[1].replace(/[^A-Za-z]/g, ""))))
                    return e;
                var v = this.isfreezonFuc(l[0]);
                h = v[0] ? "$" : "",
                f = v[1] ? "$" : "";
                var A = this.isfreezonFuc(l[1]);
                d = A[0] ? "$" : "",
                m = A[1] ? "$" : ""
            }
            if ("del" == t) {
                if ("row" == r) {
                    if (i >= n && s <= n + o - 1)
                        return this.error.r;
                    i > n + o - 1 ? i -= o : i >= n && (i = n),
                    s > n + o - 1 ? s -= o : s >= n && (s = n - 1),
                    i < 0 && (i = 0),
                    s < i && (s = i)
                } else if ("col" == r) {
                    if (c >= n && u <= n + o - 1)
                        return this.error.r;
                    c > n + o - 1 ? c -= o : c >= n && (c = n),
                    u > n + o - 1 ? u -= o : u >= n && (u = n - 1),
                    c < 0 && (c = 0),
                    u < c && (u = c)
                }
                return i == s && c == u ? isNaN(i) || isNaN(c) ? isNaN(i) ? isNaN(c) ? e : g + f + chatatABC(c) : g + h + (i + 1) : g + f + chatatABC(c) + h + (i + 1) : isNaN(c) && isNaN(u) ? g + h + (i + 1) + ":" + d + (s + 1) : isNaN(i) && isNaN(s) ? g + f + chatatABC(c) + ":" + m + chatatABC(u) : g + f + chatatABC(c) + h + (i + 1) + ":" + m + chatatABC(u) + d + (s + 1)
            }
            if ("add" == t)
                return "row" == r ? "lefttop" == a ? (i >= n && (i += o),
                s >= n && (s += o)) : "rightbottom" == a && (i > n && (i += o),
                s > n && (s += o)) : "col" == r && ("lefttop" == a ? (c >= n && (c += o),
                u >= n && (u += o)) : "rightbottom" == a && (c > n && (c += o),
                u > n && (u += o))),
                i == s && c == u ? isNaN(i) || isNaN(c) ? isNaN(i) ? isNaN(c) ? e : g + f + chatatABC(c) : g + h + (i + 1) : g + f + chatatABC(c) + h + (i + 1) : isNaN(c) && isNaN(u) ? g + h + (i + 1) + ":" + d + (s + 1) : isNaN(i) && isNaN(s) ? g + f + chatatABC(c) + ":" + m + chatatABC(u) : g + f + chatatABC(c) + h + (i + 1) + ":" + m + chatatABC(u) + d + (s + 1)
        },
        israngeseleciton: function(e) {
            if (null == this.operatorjson) {
                for (var t = this.operator.split("|"), r = {}, a = 0; a < t.length; a++)
                    r[t[a].toString()] = 1;
                this.operatorjson = r
            }
            null == e && (e = !1);
            var n = window.getSelection()
              , o = $(n.anchorNode)
              , l = n.anchorOffset;
            if (o.parent().is("span") && 0 != l) {
                var i = $.trim(o.text())
                  , s = "";
                if (0 == i.length && o.parent().prev().length > 0) {
                    var c = o.parent().prev();
                    s = (i = $.trim(c.text())).substr(i.length - 1, 1),
                    this.rangeSetValueTo = c
                } else
                    s = i.substr(l - 1, 1),
                    this.rangeSetValueTo = o.parent();
                if (e && ("(" == s || "," == s) || !e && ("(" == s || "," == s || "=" == s || s in this.operatorjson || "&" == s))
                    return !0
            } else if (o.is("#luckysheet-rich-text-editor") || o.is("#luckysheet-functionbox-cell")) {
                var u, h = $.trim(o.find("span").last().text());
                if (this.rangeSetValueTo = o.find("span").last(),
                0 == h.length && o.find("span").length > 1) {
                    var d = o.find("span");
                    h = $.trim(d.eq(d.length - 2).text()),
                    this.rangeSetValueTo = d
                }
                if (u = h.substr(h.length - 1, 1),
                e && ("(" == u || "," == u) || !e && ("(" == u || "," == u || "=" == u || u in this.operatorjson || "&" == u))
                    return !0
            } else if ((o.parent().is("#luckysheet-rich-text-editor") || o.parent().is("#luckysheet-functionbox-cell") || 0 == l) && (0 == l && (o = o.parent()),
            o.prev().length > 0)) {
                var f = $.trim(o.prev().text())
                  , m = f.substr(f.length - 1, 1);
                if (this.rangeSetValueTo = o.prev(),
                e && ("(" == m || "," == m) || !e && ("(" == m || "," == m || "=" == m || m in this.operatorjson || "&" == m))
                    return !0
            }
            return !1
        },
        rangechangeindex: null,
        rangestart: !1,
        rangetosheet: null,
        rangeSetValueTo: null,
        func_selectedrange: {},
        rangeSetValue: function rangeSetValue(selected, obj) {
            var _this = this, range = "", rf = selected.row[0], cf = selected.column[0], $editor;
            if (range = null != Store.config.merge && rf + "_" + cf in Store.config.merge ? getRangetxt(Store.currentSheetIndex, {
                column: [cf, cf],
                row: [rf, rf]
            }, _this.rangetosheet) : getRangetxt(Store.currentSheetIndex, selected, _this.rangetosheet),
            _this.rangestart || _this.rangedrag_column_start || _this.rangedrag_row_start)
                if ($("#luckysheet-search-formula-parm").is(":visible") || $("#luckysheet-search-formula-parm-select").is(":visible")) {
                    $editor = $("#luckysheet-rich-text-editor"),
                    $("#luckysheet-search-formula-parm-select-input").val(range),
                    $("#luckysheet-search-formula-parm .parmBox").eq(_this.data_parm_index).find(".txt input").val(range);
                    var txtdata = luckysheet_getcelldata(range).data;
                    if (txtdata instanceof Array) {
                        for (var txtArr = [], i = 0; i < txtdata.length; i++)
                            for (var j = 0; j < txtdata[i].length; j++)
                                null == txtdata[i][j] ? txtArr.push(null) : txtArr.push(txtdata[i][j].v);
                        $("#luckysheet-search-formula-parm .parmBox").eq(_this.data_parm_index).find(".val").text(" = {" + txtArr.join(",") + "}")
                    } else
                        $("#luckysheet-search-formula-parm .parmBox").eq(_this.data_parm_index).find(".val").text(" = {" + txtdata.v + "}");
                    var isVal = !0, parmValArr = [], lvi = -1, functionHtmlTxt;
                    if ($("#luckysheet-search-formula-parm .parmBox").each((function(e, t) {
                        var r = $(t).find(".txt input").val();
                        "" == r && "m" == $(t).find(".txt input").attr("data_parm_require") && (isVal = !1),
                        "" != r && (lvi = e)
                    }
                    )),
                    -1 == lvi)
                        functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "()";
                    else if (0 == lvi)
                        functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "(" + $("#luckysheet-search-formula-parm .parmBox").eq(0).find(".txt input").val() + ")";
                    else {
                        for (var _j = 0; _j <= lvi; _j++)
                            parmValArr.push($("#luckysheet-search-formula-parm .parmBox").eq(_j).find(".txt input").val());
                        functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "(" + parmValArr.join(",") + ")"
                    }
                    var function_str = _this.functionHTMLGenerate(functionHtmlTxt);
                    if ($("#luckysheet-rich-text-editor").html(function_str),
                    $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
                    isVal) {
                        var fp = $.trim(_this.functionParserExe($("#luckysheet-rich-text-editor").text()))
                          , result = eval(fp);
                        $("#luckysheet-search-formula-parm .result span").text(result)
                    }
                } else {
                    var currSelection = window.getSelection()
                      , anchorOffset = currSelection.anchorNode;
                    $editor = $(anchorOffset).closest("div");
                    var $span = $editor.find("span[rangeindex='" + _this.rangechangeindex + "']").html(range);
                    _this.setCaretPosition($span.get(0), 0, range.length)
                }
            else {
                var _function_str = '<span class="luckysheet-formula-functionrange-cell" rangeindex="' + _this.functionHTMLIndex + '" dir="auto" style="color:' + luckyColor[_this.functionHTMLIndex] + ';">' + range + "</span>"
                  , $t = $(_function_str).insertAfter(_this.rangeSetValueTo);
                _this.rangechangeindex = _this.functionHTMLIndex,
                $editor = $(_this.rangeSetValueTo).closest("div"),
                _this.setCaretPosition($editor.find("span[rangeindex='" + _this.rangechangeindex + "']").get(0), 0, range.length),
                _this.functionHTMLIndex++
            }
            "luckysheet-rich-text-editor" == $editor.attr("id") ? $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()) : $("#luckysheet-rich-text-editor").html($("#luckysheet-functionbox-cell").html())
        },
        rangedrag: function(e) {
            var t = mouseposition(e.pageX, e.pageY)
              , r = t[0] + $("#luckysheet-cell-main").scrollLeft()
              , a = rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop())
              , n = a[1]
              , o = a[0]
              , l = a[2]
              , i = colLocation(r)
              , s = i[1]
              , c = i[0]
              , u = i[2]
              , h = 0
              , d = 0
              , f = [];
            this.func_selectedrange.top > o ? (h = o,
            d = this.func_selectedrange.top + this.func_selectedrange.height - o,
            f = [l, this.func_selectedrange.row[1]]) : this.func_selectedrange.top == o ? (h = o,
            d = this.func_selectedrange.top + this.func_selectedrange.height - o,
            f = [l, this.func_selectedrange.row[0]]) : (h = this.func_selectedrange.top,
            d = n - this.func_selectedrange.top - 1,
            f = [this.func_selectedrange.row[0], l]);
            var m = 0
              , p = 0
              , g = [];
            this.func_selectedrange.left > c ? (m = c,
            p = this.func_selectedrange.left + this.func_selectedrange.width - c,
            g = [u, this.func_selectedrange.column[1]]) : this.func_selectedrange.left == c ? (m = c,
            p = this.func_selectedrange.left + this.func_selectedrange.width - c,
            g = [u, this.func_selectedrange.column[0]]) : (m = this.func_selectedrange.left,
            p = s - this.func_selectedrange.left - 1,
            g = [this.func_selectedrange.column[0], u]),
            f[0] = luckysheetFreezen.changeFreezenIndex(f[0], "h"),
            f[1] = luckysheetFreezen.changeFreezenIndex(f[1], "h"),
            g[0] = luckysheetFreezen.changeFreezenIndex(g[0], "v"),
            g[1] = luckysheetFreezen.changeFreezenIndex(g[1], "v");
            var y = menuButton.mergeMoveMain(g, f, this.func_selectedrange, h, d, m, p);
            if (null != y && (g = y[0],
            f = y[1],
            h = y[2],
            d = y[3],
            m = y[4],
            p = y[5]),
            this.func_selectedrange.row = f,
            this.func_selectedrange.column = g,
            this.func_selectedrange.left_move = m,
            this.func_selectedrange.width_move = p,
            this.func_selectedrange.top_move = h,
            this.func_selectedrange.height_move = d,
            luckysheet_count_show(m, h, p, d, f, g),
            $("#luckysheet-formula-functionrange-select").css({
                left: m,
                width: p,
                top: h,
                height: d
            }).show(),
            $("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                var v = getRangetxt(Store.currentSheetIndex, {
                    row: f,
                    column: g
                }, Store.currentSheetIndex);
                $("#luckysheet-ifFormulaGenerator-multiRange-dialog input").val(v)
            } else
                this.rangeSetValue({
                    row: f,
                    column: g
                });
            luckysheetFreezen.scrollFreezen(f, g)
        },
        rangedrag_column_start: !1,
        rangedrag_row_start: !1,
        rangedrag_column: function(e) {
            var t = mouseposition(e.pageX, e.pageY)
              , r = t[0] + $("#luckysheet-cell-main").scrollLeft()
              , a = (t[1],
            $("#luckysheet-cell-main").scrollTop(),
            Store.visibledatarow)
              , n = a.length - 1
              , o = a[n]
              , l = colLocation(r)
              , i = l[1]
              , s = l[0]
              , c = l[2]
              , u = 0
              , h = 0
              , d = [];
            this.func_selectedrange.left > s ? (u = s,
            h = this.func_selectedrange.left + this.func_selectedrange.width - s,
            d = [c, this.func_selectedrange.column[1]]) : this.func_selectedrange.left == s ? (u = s,
            h = this.func_selectedrange.left + this.func_selectedrange.width - s,
            d = [c, this.func_selectedrange.column[0]]) : (u = this.func_selectedrange.left,
            h = i - this.func_selectedrange.left - 1,
            d = [this.func_selectedrange.column[0], c]),
            d[0] = luckysheetFreezen.changeFreezenIndex(d[0], "v"),
            d[1] = luckysheetFreezen.changeFreezenIndex(d[1], "v");
            var f = menuButton.mergeMoveMain(d, [0, n], this.func_selectedrange, 0, o - 0 - 1, u, h);
            null != f && (d = f[0],
            u = f[4],
            h = f[5]),
            this.func_selectedrange.column = d,
            this.func_selectedrange.left_move = u,
            this.func_selectedrange.width_move = h,
            luckysheet_count_show(u, 0, h, o - 0 - 1, [0, n], d),
            this.rangeSetValue({
                row: [null, null],
                column: d
            }),
            $("#luckysheet-formula-functionrange-select").css({
                left: u,
                width: h,
                top: 0,
                height: o - 0 - 1
            }).show(),
            luckysheetFreezen.scrollFreezen([0, n], d)
        },
        rangedrag_row: function(e) {
            var t = mouseposition(e.pageX, e.pageY)
              , r = (t[0],
            $("#luckysheet-cell-main").scrollLeft(),
            rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop()))
              , a = r[1]
              , n = r[0]
              , o = r[2]
              , l = Store.visibledatacolumn
              , i = l.length - 1
              , s = l[i]
              , c = 0
              , u = 0
              , h = [];
            this.func_selectedrange.top > n ? (c = n,
            u = this.func_selectedrange.top + this.func_selectedrange.height - n,
            h = [o, this.func_selectedrange.row[1]]) : this.func_selectedrange.top == n ? (c = n,
            u = this.func_selectedrange.top + this.func_selectedrange.height - n,
            h = [o, this.func_selectedrange.row[0]]) : (c = this.func_selectedrange.top,
            u = a - this.func_selectedrange.top - 1,
            h = [this.func_selectedrange.row[0], o]),
            h[0] = luckysheetFreezen.changeFreezenIndex(h[0], "h"),
            h[1] = luckysheetFreezen.changeFreezenIndex(h[1], "h");
            var d = menuButton.mergeMoveMain([0, i], h, this.func_selectedrange, c, u, 0, s - 0 - 1);
            null != d && (h = d[1],
            c = d[2],
            u = d[3]),
            this.func_selectedrange.row = h,
            this.func_selectedrange.top_move = c,
            this.func_selectedrange.height_move = u,
            luckysheet_count_show(0, c, s - 0 - 1, u, h, [0, i]),
            this.rangeSetValue({
                row: h,
                column: [null, null]
            }),
            $("#luckysheet-formula-functionrange-select").css({
                left: 0,
                width: s - 0 - 1,
                top: c,
                height: u
            }).show(),
            luckysheetFreezen.scrollFreezen(h, [0, i])
        },
        rangedragged: function() {},
        rangeResizeObj: null,
        rangeResize: null,
        rangeResizeIndex: null,
        rangeResizexy: null,
        rangeResizeWinH: null,
        rangeResizeWinW: null,
        rangeResizeTo: null,
        rangeResizeDraging: function(e, t, r, a, n, o, l, i) {
            var s = $("#luckysheet-scrollbar-y").scrollTop()
              , c = $("#luckysheet-scrollbar-x").scrollLeft()
              , u = mouseposition(e.pageX, e.pageY)
              , h = u[0] + c
              , d = u[1] + s
              , f = rowLocation(d)
              , m = f[1]
              , p = f[0]
              , g = colLocation(h)
              , y = g[1]
              , v = g[0];
            if (h < 0 || d < 0)
                return !1;
            var A = p - r[1]
              , b = v - r[0]
              , k = r[5]
              , w = r[3]
              , x = r[4]
              , S = r[2];
            if ("lt" == a || "lb" == a) {
                if (r[0] + r[2] < v)
                    return;
                x = v,
                S = r[2] - b,
                x > r[2] + r[4] - y + v ? (x = r[2] + r[4] - y + v,
                S = r[2] - (r[2] + r[4] - y + v - r[0])) : x <= 0 && (x = 0,
                S = r[2] + r[0])
            }
            if ("rt" == a || "rb" == a) {
                if (r[6] - r[2] > y)
                    return;
                (S = r[2] + y - r[6]) < y - v - 1 ? S = y - v - 1 : S >= l - x && (S = l - x)
            }
            if ("lt" == a || "rt" == a) {
                if (r[1] + r[3] < p)
                    return;
                k = p,
                w = r[3] - A,
                k > r[3] + r[5] - m + p ? (k = r[3] + r[5] - m + p,
                w = r[3] - (r[3] + r[5] - m + p - r[1])) : k <= 0 && (k = 0,
                w = r[3] + r[1])
            }
            if ("lb" == a || "rb" == a) {
                if (r[7] - r[3] > m)
                    return;
                (w = r[3] + m - r[7]) < m - p - 1 ? w = m - p - 1 : w >= i - k && (w = i - k)
            }
            var _ = this.rangeResizeIndex
              , C = {
                top: k,
                left: x,
                height: w,
                width: S
            }
              , T = this.getSelectedFromRange(C)
              , E = getRangetxt(Store.currentSheetIndex, T, this.rangetosheet);
            this.rangeResizeTo.find("span[rangeindex='" + _ + "']").html(E);
            luckysheetRangeLast(this.rangeResizeTo[0]),
            t.css(C).data("range", T)
        },
        getSelectedFromRange: function(e) {
            var t = e.top + 2
              , r = e.top + e.height - 2
              , a = e.left + 2
              , n = e.left + e.width - 2;
            return {
                row: [rowLocation(t)[2], rowLocation(r)[2]],
                column: [colLocation(a)[2], colLocation(n)[2]]
            }
        },
        rangeResizeDragged: function(e, t, r, a, n, o) {
            this.rangeResize = null,
            $("#luckysheet-formula-functionrange-highlight-" + this.rangeResizeIndex).find(".luckysheet-selection-copy-hc").css("opacity", .03)
        },
        rangeMovexy: null,
        rangeMove: !1,
        rangeMoveObj: null,
        rangeMoveIndex: null,
        rangeMoveRangedata: null,
        rangeMoveDraging: function(e, t, r, a, n, o) {
            var l = mouseposition(e.pageX, e.pageY)
              , i = $("#luckysheet-scrollbar-x").scrollLeft()
              , s = $("#luckysheet-scrollbar-y").scrollTop()
              , c = l[0] + i
              , u = l[1] + s
              , h = $(window).height() + s - n - o
              , d = $(window).width() + i
              , f = t[0]
              , m = t[1]
              , p = r.row[0] - f + rowLocation(u)[2]
              , g = r.row[1] - f + rowLocation(u)[2]
              , y = r.column[0] - m + colLocation(c)[2]
              , v = r.column[1] - m + colLocation(c)[2];
            (p < 0 || u < 0) && (p = 0,
            g = r.row[1] - r.row[0]),
            (y < 0 || c < 0) && (y = 0,
            v = r.column[1] - r.column[0]);
            var A = Store.visibledatarow;
            (g >= A[A.length - 1] || u > h) && (p = A.length - 1 - r.row[1] + r.row[0],
            g = A.length - 1);
            var b = Store.visibledatacolumn;
            (v >= b[b.length - 1] || c > d) && (y = b.length - 1 - r.column[1] + r.column[0],
            v = b.length - 1);
            var k = y - 1 == -1 ? 0 : b[y - 1]
              , w = b[v]
              , x = p - 1 == -1 ? 0 : A[p - 1]
              , S = A[g]
              , _ = this.rangeMoveIndex
              , C = {
                left: k,
                width: w - k - 2,
                top: x,
                height: S - x - 2,
                display: "block"
            }
              , T = this.getSelectedFromRange(C)
              , E = getRangetxt(Store.currentSheetIndex, T, this.rangetosheet);
            this.rangeResizeTo.find("span[rangeindex='" + _ + "']").html(E);
            luckysheetRangeLast(this.rangeResizeTo[0]),
            this.rangeMoveRangedata = T,
            a.css(C)
        },
        rangeMoveDragged: function(e) {
            this.rangeMove = !1,
            $("#luckysheet-formula-functionrange-highlight-" + this.rangeMoveIndex).data("range", this.rangeMoveRangedata).find(".luckysheet-selection-copy-hc").css("opacity", .03)
        },
        functionHTMLIndex: 0,
        functionRangeIndex: null,
        findrangeindex: function(e, t) {
            var r = /<span.*?>/g
              , a = e.replace(r, "")
              , n = t.replace(r, "");
            a = a.split("</span>"),
            n = n.split("</span>"),
            a.pop(),
            n.pop();
            var o = this.functionRangeIndex
              , l = (n.length > a.length ? a.length : n.length,
            n.length)
              , i = a.length;
            if (l == i) {
                var s = o[0]
                  , c = n[s]
                  , u = a[s];
                if (null == c)
                    return n.length <= s ? o = [n.length - 1, n.length - 1] : a.length <= s && (o = [a.length - 1, a.length - 1]),
                    o;
                if (c.length == u.length)
                    return null != n[s + 1] && null != a[s + 1] && n[s + 1].length < a[s + 1].length && (o[0] = o[0] + 1,
                    o[1] = 1),
                    o;
                if (c.length > u.length)
                    return null != c && null != a[s + 1] && '"' == a[s + 1].substr(0, 1) && (c.indexOf("{") > -1 || c.indexOf("}") > -1) && (o[0] = o[0] + 1,
                    o[1] = 1),
                    o;
                if (c.length < u.length)
                    return o[1] > u.length && (o[1] = u.length),
                    o
            } else {
                if (l > i) {
                    var h = o[0]
                      , d = n[h]
                      , f = a[h];
                    if (null == f)
                        if (a[h - 1].indexOf("{") > -1) {
                            o[0] = o[0] - 1;
                            var m = a[h - 1].search("{");
                            o[1] = o[1] + m
                        } else
                            o[0] = 0,
                            o[1] = 0;
                    else {
                        if (d.length == f.length)
                            return null == a[h + 1] || '"' != a[h + 1].substr(0, 1) && "{" != a[h + 1].substr(0, 1) && "}" != a[h + 1].substr(0, 1) ? null != d && d.length > 2 && '"' == d.substr(0, 1) && '"' == d.substr(d.length - 1, 1) || (null != a[h] && '")' == a[h] || null != a[h] && '"}' == a[h] || null != a[h] && "{)" == a[h] ? o[1] = 1 : o[1] = f.length) : (o[0] = o[0] + 1,
                            o[1] = 1),
                            o;
                        if (d.length > f.length)
                            return null == a[h + 1] || '"' != a[h + 1].substr(0, 1) && "{" != a[h + 1].substr(0, 1) && "}" != a[h + 1].substr(0, 1) || (o[0] = o[0] + 1,
                            o[1] = 1),
                            o;
                        if (d.length < f.length)
                            return o
                    }
                    return o
                }
                if (l < i) {
                    var p = o[0]
                      , g = n[p]
                      , y = a[p];
                    if (null == g)
                        o[0] = a.length - 1,
                        o[1] = null != y ? y.length : 1;
                    else {
                        if (g.length == y.length)
                            return null == n[p + 1] || '"' != n[p + 1].substr(0, 1) && "{" != n[p + 1].substr(0, 1) && "}" != n[p + 1].substr(0, 1) ? null == a[p + 1] || '"' != a[p + 1].substr(0, 1) || "{" != a[p + 1].substr(0, 1) && "}" != a[p + 1].substr(0, 1) ? null != y && '"' == y.substr(0, 1) && '"' == y.substr(y.length - 1, 1) && '"' == g.substr(0, 1) && ")" == g.substr(g.length - 1, 1) || null != y && "{" == y.substr(0, 1) && "}" == y.substr(y.length - 1, 1) && "{" == g.substr(0, 1) && ")" == g.substr(g.length - 1, 1) ? o[1] = y.length : (o[0] = o[0] + i - l,
                            a.length > n.length ? o[1] = a[p + 1].length : o[1] = 1) : (o[0] = o[0] + 1,
                            o[1] = 1) : o[1] = y.length,
                            o;
                        if (g.length > y.length)
                            return null != g && '"' == g.substr(0, 1) ? o[1] = y.length : null != a[p + 1] && /{.*?}/.test(a[p + 1]) ? (o[0] = o[0] + 1,
                            o[1] = a[p + 1].length) : null != g && '"' == a[p + 1].substr(0, 1) && (g.indexOf("{") > -1 || g.indexOf("}") > -1) ? (o[0] = o[0] + 1,
                            o[1] = 1) : null != g && (g.indexOf("{") > -1 || g.indexOf("}") > -1) || (o[0] = o[0] + i - l - 1,
                            o[1] = a[p - 1].length),
                            o;
                        if (g.length < y.length)
                            return o
                    }
                    return o
                }
            }
            return null
        },
        setCaretPosition: function(e, t, r) {
            try {
                var a = e
                  , n = document.createRange()
                  , o = window.getSelection();
                n.setStart(a.childNodes[t], r),
                n.collapse(!0),
                o.removeAllRanges(),
                o.addRange(n),
                a.focus()
            } catch (e) {
                luckysheetRangeLast(this.rangeResizeTo[0])
            }
        },
        functionRange: function(e, t, r) {
            if (window.getSelection) {
                var a = window.getSelection()
                  , n = this.findrangeindex(t, r);
                null == n ? (a.selectAllChildren(e.get(0)),
                a.collapseToEnd()) : this.setCaretPosition(e.find("span").get(n[0]), 0, n[1])
            } else
                document.selection && (this.functionRangeIndex.moveToElementText(e),
                this.functionRangeIndex.collapse(!1),
                this.functionRangeIndex.select())
        },
        functionInputHanddler: function(e, t, r) {
            if (!isEditMode()) {
                var a = this
                  , n = e
                  , o = t
                  , l = o.html()
                  , i = o.text();
                setTimeout((function() {
                    var e = o.text();
                    if (e.length > 0 && "=" == e.substr(0, 1) && (229 != r || 1 == e.length)) {
                        if (e = a.functionHTMLGenerate(e),
                        l = a.functionHTMLGenerate(i),
                        window.getSelection) {
                            var t = window.getSelection();
                            if ($(t.anchorNode).is("div")) {
                                var s = $("#luckysheet-rich-text-editor span").length;
                                a.functionRangeIndex = [s - 1, $("#luckysheet-rich-text-editor").find("span").eq(s - 1).text().length]
                            } else
                                a.functionRangeIndex = [$(t.anchorNode).parent().index(), t.anchorOffset]
                        } else {
                            var c = document.selection.createRange();
                            a.functionRangeIndex = c
                        }
                        o.html(e),
                        a.functionRange(o, e, l),
                        a.canceFunctionrangeSelected(),
                        46 != r && a.createRangeHightlight(),
                        n.html(e),
                        a.rangestart = !1,
                        a.rangedrag_column_start = !1,
                        a.rangedrag_row_start = !1,
                        a.rangeHightlightselected(o, r)
                    } else
                        "=" != i.substr(0, 1) && ("luckysheet-rich-text-editor" == n.attr("id") && "<span" == n.html().substr(0, 5) || n.html(e))
                }
                ), 1)
            }
        },
        functionHTMLGenerate: function(e) {
            return 0 == e.length || "=" != e.substr(0, 1) ? e : (this.functionHTMLIndex = 0,
            '<span dir="auto" class="luckysheet-formula-text-color">=</span>' + this.functionHTML(e))
        },
        functionHTML: function(e) {
            if (null == this.operatorjson) {
                for (var t = this.operator.split("|"), r = {}, a = 0; a < t.length; a++)
                    r[t[a].toString()] = 1;
                this.operatorjson = r
            }
            "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var n = e.split(""), o = 0, l = "", i = "", s = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0,
                braces: 0
            }; o < n.length; ) {
                var c = n[o];
                if ("(" == c && 0 == s.dquote && 0 == s.braces)
                    s.bracket += 1,
                    l.length > 0 ? i += '<span dir="auto" class="luckysheet-formula-text-func">' + l + '</span><span dir="auto" class="luckysheet-formula-text-lpar">(</span>' : i += '<span dir="auto" class="luckysheet-formula-text-lpar">(</span>',
                    l = "";
                else if (")" == c && 0 == s.dquote && 0 == s.braces)
                    s.bracket -= 1,
                    i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-rpar">)</span>',
                    l = "";
                else if ("{" == c && 0 == s.dquote)
                    l += "{",
                    s.braces += 1;
                else if ("}" == c && 0 == s.dquote)
                    l += "}",
                    s.braces -= 1;
                else if ('"' == c && 0 == s.squote)
                    s.dquote > 0 ? (l.length > 0 ? i += l + '"</span>' : i += '"</span>',
                    s.dquote -= 1,
                    l = "") : (s.dquote += 1,
                    l.length > 0 ? i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-string">"' : i += '<span dir="auto" class="luckysheet-formula-text-string">"',
                    l = "");
                else if ("," == c && 0 == s.dquote && 0 == s.braces)
                    i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-comma">,</span>',
                    l = "";
                else if ("&" == c && 0 == s.dquote && 0 == s.braces)
                    l.length > 0 ? (i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-calc">&</span>',
                    l = "") : i += '<span dir="auto" class="luckysheet-formula-text-calc">&</span>';
                else if (c in this.operatorjson && 0 == s.dquote && 0 == s.braces) {
                    var u = "";
                    o + 1 < n.length && (u = n[o + 1]);
                    var h = o - 1
                      , d = null;
                    if (h >= 0)
                        do {
                            d = n[h--]
                        } while (h >= 0 && " " == d);c + u in this.operatorjson ? (l.length > 0 ? (i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-calc">' + c + u + "</span>",
                    l = "") : i += '<span dir="auto" class="luckysheet-formula-text-calc">' + c + u + "</span>",
                    o++) : /[^0-9]/.test(u) || "-" != c || "(" != d && null != d && "," != d && " " != d && !(d in this.operatorjson) ? l.length > 0 ? (i += this.functionHTML(l) + '<span dir="auto" class="luckysheet-formula-text-calc">' + c + "</span>",
                    l = "") : i += '<span dir="auto" class="luckysheet-formula-text-calc">' + c + "</span>" : l += c
                } else
                    l += c;
                if (o == n.length - 1)
                    if (this.iscelldata($.trim(l)))
                        i += '<span class="luckysheet-formula-functionrange-cell" rangeindex="' + this.functionHTMLIndex + '" dir="auto" style="color:' + luckyColor[this.functionHTMLIndex] + ';">' + l + "</span>",
                        this.functionHTMLIndex++;
                    else if (s.dquote > 0)
                        i += l + "</span>";
                    else if (-1 == l.indexOf("</span>") && l.length > 0) {
                        var f = /{.*?}/;
                        if (f.test($.trim(l))) {
                            var m = f.exec(l)[0]
                              , p = l.search(f)
                              , g = "";
                            p > 0 && (g += '<span dir="auto" class="luckysheet-formula-text-color">' + l.substr(0, p) + "</span>"),
                            g += '<span dir="auto" style="color:#959a05" class="luckysheet-formula-text-array">' + m + "</span>",
                            p + m.length < l.length && (g += '<span dir="auto" class="luckysheet-formula-text-color">' + l.substr(p + m.length, l.length) + "</span>"),
                            i += g
                        } else
                            i += '<span dir="auto" class="luckysheet-formula-text-color">' + l + "</span>"
                    }
                o++
            }
            return i
        },
        getfunctionParam: function(e) {
            if (null == this.operatorjson) {
                for (var t = this.operator.split("|"), r = {}, a = 0; a < t.length; a++)
                    r[t[a].toString()] = 1;
                this.operatorjson = r
            }
            "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var n = e.split(""), o = 0, l = "", i = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0,
                compare: 0
            }, s = null, c = [], u = []; o < n.length; ) {
                var h = n[o];
                if ("(" == h && 0 == i.dquote)
                    l.length > 0 && 0 == u.length ? (s = l.toUpperCase(),
                    u.push(1),
                    l = "") : 0 == u.length ? (u.push(0),
                    l = "") : (u.push(0),
                    l += h);
                else if (")" == h && 0 == i.dquote) {
                    u.pop();
                    0 == u.length ? (c.push(l),
                    l = "") : l += h
                } else if ('"' == h)
                    l += '"',
                    i.dquote > 0 ? (i.dquote -= 1,
                    l = "") : i.dquote += 1;
                else if ("," == h && 0 == i.dquote)
                    u.length <= 1 ? (c.push(l),
                    l = "") : l += ",";
                else if (h in this.operatorjson && 0 == i.dquote) {
                    var d = "";
                    o + 1 < n.length && (d = n[o + 1]);
                    var f = o - 1
                      , m = null;
                    if (f >= 0)
                        do {
                            m = n[f--]
                        } while (f >= 0 && " " == m);/[^0-9]/.test(d) || "-" != h || "(" != m && null != m && "," != m && " " != m && !(m in this.operatorjson) ? l = "" : 0 == i.dquote ? l += $.trim(h) : l += h
                } else
                    0 == i.dquote ? l += $.trim(h) : l += h;
                o++
            }
            return {
                fn: s,
                param: c
            }
        },
        calPostfixExpression: function(e) {
            if (0 == e.length)
                return "";
            for (var t = [], r = e.length - 1; r >= 0; r--) {
                var a = e[r];
                if (a in this.operatorjson) {
                    var n = t.pop()
                      , o = "luckysheet_compareWith(" + t.pop() + ",'" + a + "', " + n + ")";
                    t.push(o)
                } else
                    t.push(a)
            }
            return t.length > 0 ? t[0] : ""
        },
        checkBracketNum: function(e) {
            var t = e.match(/\(/g)
              , r = e.match(/\)/g)
              , a = e.match(/(['"])(?:(?!\1).)*?\1/g)
              , n = e.match(/(['"])(?:(?!\1).)*?\1/g)
              , o = 0
              , l = 0;
            null != t && (o += t.length),
            null != r && (l += r.length);
            var i = 0
              , s = 0;
            if (null != a)
                for (var c = 0; c < a.length; c++) {
                    var u = a[c].match(/\(/g);
                    null != u && (i += u.length)
                }
            if (null != n)
                for (var h = 0; h < n.length; h++) {
                    var d = n[h].match(/\)/g);
                    null != d && (s += d.length)
                }
            return (o -= i) == (l -= s)
        },
        operatorPriority: {
            "^": 0,
            "%": 1,
            "*": 1,
            "/": 1,
            "+": 2,
            "-": 2
        },
        functionParserExe: function(e) {
            var t = this;
            return this.functionParser(e, (function(r) {
                t.addToCellList(e, r)
            }
            ))
        },
        functionParser: function(e, t) {
            if (null == this.operatorjson) {
                for (var r = this.operator.split("|"), a = {}, n = 0; n < r.length; n++)
                    a[r[n].toString()] = 1;
                this.operatorjson = a
            }
            if (null == e)
                return "";
            "=+" == e.substr(0, 2) ? e = e.substr(2) : "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var o = e.split(""), l = 0, i = "", s = "", c = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0,
                compare: 0,
                braces: 0
            }, u = [], h = [], d = []; l < o.length; ) {
                var f = o[l];
                if ("(" == f && 0 == c.dquote && 0 == c.braces)
                    if (i.length > 0 && 0 == d.length) {
                        if ((i = i.toUpperCase()).indexOf(":") > -1) {
                            var m = i.split(":");
                            s += "luckysheet_getSpecialReference(true,'" + $.trim(m[0]).replace(/'/g, "\\'") + "', luckysheet_function." + m[1] + ".f(#lucky#"
                        } else
                            s += "luckysheet_function." + i + ".f(";
                        d.push(1),
                        i = ""
                    } else
                        0 == d.length ? (s += "(",
                        d.push(0),
                        i = "") : (d.push(0),
                        i += f);
                else if (")" == f && 0 == c.dquote && 0 == c.braces) {
                    d.pop();
                    if (0 == d.length) {
                        var p = this.functionParser(i, t);
                        p.indexOf("#lucky#") > -1 && (p = p.replace(/#lucky#/g, "") + ")"),
                        s += p + ")",
                        i = ""
                    } else
                        i += f
                } else if ("{" == f && 0 == c.dquote)
                    i += "{",
                    c.braces += 1;
                else if ("}" == f && 0 == c.dquote)
                    i += "}",
                    c.braces -= 1;
                else if ('"' == f)
                    i += '"',
                    c.dquote > 0 ? c.dquote -= 1 : c.dquote += 1;
                else if ("'" == f)
                    i += "'",
                    c.squote > 0 ? c.squote -= 1 : c.squote += 1;
                else if ("," == f && 0 == c.dquote && 0 == c.braces)
                    if (d.length <= 1) {
                        var g = this.functionParser(i, t);
                        g.indexOf("#lucky#") > -1 && (g = g.replace(/#lucky#/g, "") + ")"),
                        s += g + ",",
                        i = ""
                    } else
                        i += ",";
                else if (f in this.operatorjson && 0 == c.dquote && 0 == c.braces) {
                    var y = ""
                      , v = this.operatorPriority;
                    if (l + 1 < o.length && (y = o[l + 1]),
                    f + y in this.operatorjson) {
                        if (0 == d.length) {
                            if ($.trim(i).length > 0 ? h.unshift(this.functionParser($.trim(i), t)) : $.trim(s).length > 0 && h.unshift($.trim(s)),
                            u[0]in this.operatorjson)
                                for (var A = v[u[0]]; u.length > 0 && null != A; )
                                    h.unshift(u.shift()),
                                    A = v[u[0]];
                            u.unshift(f + y),
                            s = "",
                            i = ""
                        } else
                            i += f + y;
                        l++
                    } else if (0 == d.length) {
                        if ($.trim(i).length > 0 ? h.unshift(this.functionParser($.trim(i), t)) : $.trim(s).length > 0 && h.unshift($.trim(s)),
                        u[0]in this.operatorjson) {
                            var b = v[u[0]];
                            b = null == b ? 1e3 : b;
                            var k = v[f];
                            for (k = null == k ? 1e3 : k; u.length > 0 && k >= b; )
                                h.unshift(u.shift()),
                                b = null == (b = v[u[0]]) ? 1e3 : b
                        }
                        u.unshift(f),
                        s = "",
                        i = ""
                    } else
                        i += f
                } else
                    0 == c.dquote && 0 == c.squote ? i += $.trim(f) : i += f;
                if (l == o.length - 1) {
                    var w = ""
                      , x = $.trim(i).replace(/'/g, "\\'");
                    if (this.iscelldata(x) && ":" != x.substr(0, 1))
                        w = "luckysheet_getcelldata('" + x + "')",
                        "function" == typeof t && t(x);
                    else if (":" == x.substr(0, 1))
                        x = x.substr(1),
                        this.iscelldata(x) && (w = "luckysheet_getSpecialReference(false," + s + ",'" + x + "')");
                    else {
                        i = $.trim(i);
                        var S = /{.*?}/;
                        if (S.test(i) && '"' != i.substr(0, 1) && '"' != i.substr(i.length - 1, 1)) {
                            var _ = S.exec(i)[0]
                              , C = i.search(S);
                            C > 0 && (w += i.substr(0, C)),
                            w += "luckysheet_getarraydata('" + _ + "')",
                            C + _.length < i.length && (w += i.substr(C + _.length, i.length))
                        } else
                            w = i
                    }
                    if (w.length > 0 && h.unshift(w),
                    u.length > 0)
                        for (s.length > 0 && (h.unshift(s),
                        s = ""); u.length > 0; )
                            h.unshift(u.shift());
                    h.length > 0 ? s = this.calPostfixExpression(h) : s += w
                }
                l++
            }
            return s
        },
        insertUpdateDynamicArray: function(e) {
            var t = e.r
              , r = e.c
              , a = e.index;
            null == a && (a = Store.currentSheetIndex);
            var n = getluckysheetfile()[getSheetIndex(a)].dynamicArray;
            null == n && (n = []);
            for (var o = 0; o < n.length; o++) {
                var l = n[o];
                if (l.r == t && l.c == r && l.index == a)
                    return l.data = e.data,
                    l.f = e.f,
                    n
            }
            return n.push(e),
            n
        },
        addFunctionGroup: function(e, t, r, a) {
            null == a && (a = Store.currentSheetIndex);
            var n = getluckysheetfile()
              , o = n[getSheetIndex(a)];
            null == o.calcChain && (o.calcChain = []);
            var l = {
                r: e,
                c: t,
                index: a,
                func: r
            };
            o.calcChain.push(l),
            server.saveParam("fc", a, JSON.stringify(l), {
                op: "add",
                pos: o.calcChain.length - 1
            }),
            setluckysheetfile(n)
        },
        getAllFunctionGroup: function() {
            for (var e = getluckysheetfile(), t = [], r = 0; r < e.length; r++) {
                var a = e[r].calcChain;
                null == a && (a = []),
                t = t.concat(a)
            }
            return t
        },
        getFunctionGroup: function(e) {
            null == e && (e = Store.currentSheetIndex);
            var t = getluckysheetfile()[getSheetIndex(e)];
            return null == t.calcChain ? [] : t.calcChain
        },
        updateFunctionGroup: function(e, t, r) {
            null == r && (r = Store.currentSheetIndex);
            var a = getluckysheetfile()
              , n = a[getSheetIndex(r)].calcChain;
            if (null != n)
                for (var o = 0; o < n.length; o++) {
                    var l = n[o];
                    if (l.r == e && l.c == t && l.index == r) {
                        server.saveParam("fc", r, JSON.stringify(l), {
                            op: "update",
                            pos: o
                        });
                        break
                    }
                }
            setluckysheetfile(a)
        },
        insertUpdateFunctionGroup: function(e, t, r) {
            null == r && (r = Store.currentSheetIndex);
            var a = getluckysheetfile()
              , n = a[getSheetIndex(r)]
              , o = n.calcChain;
            null == o && (o = []);
            for (var l = 0; l < o.length; l++) {
                var i = o[l];
                if (i.r == e && i.c == t && i.index == r)
                    return void server.saveParam("fc", r, JSON.stringify(i), {
                        op: "update",
                        pos: l
                    })
            }
            var s = {
                r: e,
                c: t,
                index: r
            };
            o.push(s),
            n.calcChain = o,
            server.saveParam("fc", r, JSON.stringify(s), {
                op: "add",
                pos: n.calcChain.length - 1
            }),
            setluckysheetfile(a)
        },
        isFunctionRangeSave: !1,
        isFunctionRangeSimple: function(e, t, r, a, n) {
            if (null != e && 0 != e.length) {
                var o = e.split(/==|!=|<>|<=|>=|[,()=+-\/*%&^><]/g);
                if (o.length > 0)
                    for (var l = 0; l < o.length; l++) {
                        var i = o[l];
                        i.length <= 1 || ('"' == i.substr(0, 1) && '"' == i.substr(i.length - 1, 1) || this.isFunctionRangeSaveChange(i, t, r, a, n))
                    }
            }
        },
        isFunctionRangeSimple1: function(e, t, r, a, n) {
            if (null == this.operatorjson) {
                for (var o = this.operator.split("|"), l = {}, i = 0; i < o.length; i++)
                    l[o[i].toString()] = 1;
                this.operatorjson = l
            }
            "=" == e.substr(0, 1) && (e = e.substr(1));
            var s = e.split("")
              , c = 0
              , u = ""
              , h = ""
              , d = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0
            };
            for (getluckysheetfile(); c < s.length; ) {
                var f = s[c];
                if ("(" == f && 0 == d.dquote)
                    d.bracket += 1,
                    u.length > 0 ? h += "luckysheet_function." + u.toUpperCase() + ".f(" : h += "(",
                    u = "";
                else if (")" == f && 0 == d.dquote)
                    d.bracket -= 1,
                    h += this.isFunctionRangeSimple(u, t, r, a, n) + ")",
                    u = "";
                else if ("," == f && 0 == d.dquote)
                    h += this.isFunctionRangeSimple(u, t, r, a, n) + ",",
                    u = "";
                else if (f in this.operatorjson && 0 == d.dquote) {
                    var m = "";
                    c + 1 < s.length && (m = s[c + 1]),
                    f + m in this.operatorjson ? (u.length > 0 ? (h += this.isFunctionRangeSimple(u, t, r, a, n) + f + m,
                    u = "") : h += f + m,
                    c++) : u.length > 0 ? (h += this.isFunctionRangeSimple(u, t, r, a, n) + f,
                    u = "") : h += f
                } else
                    u += f;
                c == s.length - 1 && this.iscelldata($.trim(u)) && this.isFunctionRangeSaveChange(u, t, r, a, n),
                c++
            }
            return h
        },
        isFunctionRangeSelect: function(e, t, r, a, n) {
            if (null != e && "" != e) {
                null == a && (a = Store.currentSheetIndex),
                null == n && (n = {});
                var o = this
                  , l = e.toUpperCase()
                  , i = l.indexOf("INDIRECT(") > -1 || l.indexOf("OFFSET(") > -1 || l.indexOf("INDEX(") > -1;
                if (e in this.formulaContainCellList) {
                    var s = this.formulaContainCellList[e];
                    if (i)
                        if (1 == s.__LuckyisOff__)
                            for (var c in s)
                                "__LuckyisOff__" != c && this.isFunctionRangeSaveChange(c, t, r, a, n);
                        else
                            this.isFunctionRange(e, t, r, a, n, (function(t) {
                                o.addToCellList(e, t)
                            }
                            )),
                            s.__LuckyisOff__ = !0;
                    else
                        for (var u in s)
                            "__LuckyisOff__" != u && this.isFunctionRangeSaveChange(u, t, r, a, n)
                } else
                    i ? this.isFunctionRange(e, t, r, a, n) : this.isFunctionRangeSimple(e, t, r, a, n)
            }
        },
        isFunctionRange: function(e, t, r, a, n, o) {
            if (null == this.operatorjson) {
                for (var l = this.operator.split("|"), i = {}, s = 0; s < l.length; s++)
                    i[l[s].toString()] = 1;
                this.operatorjson = i
            }
            "=" == e.substr(0, 1) && (e = e.substr(1));
            for (var c = e.split(""), u = 0, h = "", d = "", f = {
                bracket: 0,
                comma: 0,
                squote: 0,
                dquote: 0,
                compare: 0,
                braces: 0
            }, m = [], p = [], g = []; u < c.length; ) {
                var y = c[u];
                if ("(" == y && 0 == f.dquote && 0 == f.braces)
                    if (h.length > 0 && 0 == g.length) {
                        if ((h = h.toUpperCase()).indexOf(":") > -1) {
                            var v = h.split(":");
                            d += "luckysheet_getSpecialReference(true,'" + $.trim(v[0]).replace(/'/g, "\\'") + "', luckysheet_function." + v[1] + ".f(#lucky#"
                        } else
                            d += "luckysheet_function." + h + ".f(";
                        g.push(1),
                        h = ""
                    } else
                        0 == g.length ? (d += "(",
                        g.push(0),
                        h = "") : (g.push(0),
                        h += y);
                else if (")" == y && 0 == f.dquote && 0 == f.braces) {
                    g.pop();
                    if (0 == g.length) {
                        var A = this.isFunctionRange(h, t, r, a, n, o);
                        A.indexOf("#lucky#") > -1 && (A = A.replace(/#lucky#/g, "") + ")"),
                        d += A + ")",
                        h = ""
                    } else
                        h += y
                } else if ("{" == y && 0 == f.dquote)
                    h += "{",
                    f.braces += 1;
                else if ("}" == y && 0 == f.dquote)
                    h += "}",
                    f.braces -= 1;
                else if ('"' == y)
                    h += '"',
                    f.dquote > 0 ? f.dquote -= 1 : f.dquote += 1;
                else if ("'" == y)
                    h += "'",
                    f.squote > 0 ? f.squote -= 1 : f.squote += 1;
                else if ("," == y && 0 == f.dquote && 0 == f.braces)
                    if (g.length <= 1) {
                        var b = this.isFunctionRange(h, t, r, a, n, o);
                        b.indexOf("#lucky#") > -1 && (b = b.replace(/#lucky#/g, "") + ")"),
                        d += b + ",",
                        h = ""
                    } else
                        h += ",";
                else if (y in this.operatorjson && 0 == f.dquote && 0 == f.braces) {
                    var k = ""
                      , w = this.operatorPriority;
                    if (u + 1 < c.length && (k = c[u + 1]),
                    y + k in this.operatorjson) {
                        if (0 == g.length) {
                            if ($.trim(h).length > 0 ? p.unshift(this.isFunctionRange($.trim(h), t, r, a, n, o)) : $.trim(d).length > 0 && p.unshift($.trim(d)),
                            m[0]in this.operatorjson)
                                for (var x = w[m[0]]; m.length > 0 && null != x; )
                                    p.unshift(m.shift()),
                                    x = w[m[0]];
                            m.unshift(y + k),
                            d = "",
                            h = ""
                        } else
                            h += y + k;
                        u++
                    } else if (0 == g.length) {
                        if ($.trim(h).length > 0 ? p.unshift(this.isFunctionRange($.trim(h), t, r, a, n, o)) : $.trim(d).length > 0 && p.unshift($.trim(d)),
                        m[0]in this.operatorjson) {
                            var S = w[m[0]];
                            S = null == S ? 1e3 : S;
                            var _ = w[y];
                            for (_ = null == _ ? 1e3 : _; m.length > 0 && _ >= S; )
                                p.unshift(m.shift()),
                                S = null == (S = w[m[0]]) ? 1e3 : S
                        }
                        m.unshift(y),
                        d = "",
                        h = ""
                    } else
                        h += y
                } else
                    0 == f.dquote && 0 == f.squote ? h += $.trim(y) : h += y;
                if (u == c.length - 1) {
                    var C = ""
                      , T = $.trim(h).replace(/'/g, "\\'");
                    if (this.iscelldata(T) && ":" != T.substr(0, 1))
                        C = "luckysheet_getcelldata('" + T + "')",
                        this.isFunctionRangeSaveChange(h, t, r, a, n);
                    else if (":" == T.substr(0, 1))
                        T = T.substr(1),
                        this.iscelldata(T) && (C = "luckysheet_getSpecialReference(false," + d + ",'" + T + "')");
                    else {
                        h = $.trim(h);
                        var E = /{.*?}/;
                        if (E.test(h) && '"' != h.substr(0, 1) && '"' != h.substr(h.length - 1, 1)) {
                            var I = E.exec(h)[0]
                              , R = h.search(E);
                            R > 0 && (C += h.substr(0, R)),
                            C += "luckysheet_getarraydata('" + I + "')",
                            R + I.length < h.length && (C += h.substr(R + I.length, h.length))
                        } else
                            C = h
                    }
                    if (C.length > 0 && p.unshift(C),
                    m.length > 0)
                        for (d.length > 0 && (p.unshift(d),
                        d = ""); m.length > 0; )
                            p.unshift(m.shift());
                    p.length > 0 ? d = this.calPostfixExpression(p) : d += C
                }
                u++
            }
            return this.checkSpecialFunctionRange(d, t, r, a, n, o),
            d
        },
        isFunctionRangeSaveChange: function(e, t, r, a, n) {
            if (null != t && null != r) {
                var o = this.getcellrange($.trim(e), a);
                if (null == o)
                    return;
                var l = o.row
                  , i = o.column
                  , s = o.sheetIndex;
                if (!(t + "_" + r in n) || a != s && null != a)
                    t >= l[0] && t <= l[1] && r >= i[0] && r <= i[1] && (a == s || null == a) ? this.isFunctionRangeSave = this.isFunctionRangeSave || !0 : this.isFunctionRangeSave = this.isFunctionRangeSave || !1;
                else {
                    for (var c = !1, u = l[0]; u <= l[1]; u++)
                        for (var h = i[0]; h <= i[1]; h++)
                            u + "_" + h in n && n[u + "_" + h].r == t && n[u + "_" + h].c == r && (c = !0);
                    this.isFunctionRangeSave = c ? this.isFunctionRangeSave || !0 : this.isFunctionRangeSave || !1
                }
            } else
                this.isFunctionRangeSave = this.isFunctionRangeSave || !1
        },
        checkSpecialFunctionRange: function checkSpecialFunctionRange(function_str, r, c, index, dynamicArray_compute, cellRangeFunction) {
            if ("luckysheet_getSpecialReference" == function_str.substr(0, 30) || "luckysheet_function." == function_str.substr(0, 20)) {
                if ("luckysheet_function." == function_str.substr(0, 20)) {
                    var funcName = function_str.split(".")[1];
                    if (null != funcName && (funcName = funcName.toUpperCase(),
                    "INDIRECT" != funcName && "OFFSET" != funcName && "INDEX" != funcName))
                        return
                }
                try {
                    Store.calculateSheetIndex = index;
                    var str = eval(function_str);
                    str instanceof Object && null != str.startCell && (str = str.startCell);
                    var str_nb = $.trim(str);
                    this.iscelldata(str_nb) && ("function" == typeof cellRangeFunction && cellRangeFunction(str_nb),
                    this.isFunctionRangeSaveChange(str, r, c, index, dynamicArray_compute))
                } catch (e) {}
            }
        },
        execvertex: {},
        execFunctionGroupData: null,
        execFunctionExist: null,
        formulaContainSheetList: {},
        formulaContainCellList: {},
        cellTextToIndexList: {},
        addToCellList: function(e, t) {
            null != e && 0 != e.length && null != t && 0 != t.length && (null == this.formulaContainCellList && (this.formulaContainCellList = {}),
            null == this.formulaContainCellList[e] && (this.formulaContainCellList[e] = {}),
            this.formulaContainCellList[e][t] = 1)
        },
        addToCellIndexList: function(e, t) {
            null != e && 0 != e.length && null != t && (null == this.cellTextToIndexList && (this.cellTextToIndexList = {}),
            e.indexOf("!") > -1 ? (e = e.replace(/\\'/g, "'"),
            this.cellTextToIndexList[e] = t) : this.cellTextToIndexList[e + "_" + t.sheetIndex] = t)
        },
        addToSheetIndexList: function(e, t, r) {
            null != e && 0 != e.length && (null != t && 0 != t.length || (t = Store.currentSheetIndex),
            null != r && 0 != r.length || (r = ""),
            null == this.formulaContainSheetList && (this.formulaContainSheetList = {}),
            null == this.formulaContainSheetList[e] && (this.formulaContainSheetList[e] = {}),
            this.formulaContainSheetList[e][t] = r)
        },
        execFunctionGlobalData: {},
        execFunctionGroupForce: function(e) {
            e ? this.execFunctionGroup(void 0, void 0, void 0, void 0, void 0, !0) : this.execFunctionGroup()
        },
        execFunctionGroup: function execFunctionGroup(origin_r, origin_c, value, index, data) {
            var isForce = arguments.length > 5 && void 0 !== arguments[5] && arguments[5]
              , _this = this;
            null == data && (data = Store.flowdata),
            window.luckysheet_compareWith || (window.luckysheet_compareWith = luckysheet_compareWith,
            window.luckysheet_getarraydata = luckysheet_getarraydata,
            window.luckysheet_getcelldata = luckysheet_getcelldata,
            window.luckysheet_parseData = luckysheet_parseData,
            window.luckysheet_getValue = luckysheet_getValue,
            window.luckysheet_indirect_check = luckysheet_indirect_check,
            window.luckysheet_indirect_check_return = luckysheet_indirect_check_return,
            window.luckysheet_offset_check = luckysheet_offset_check,
            window.luckysheet_calcADPMM = luckysheet_calcADPMM$1,
            window.luckysheet_getSpecialReference = luckysheet_getSpecialReference),
            null == _this.execFunctionGlobalData && (_this.execFunctionGlobalData = {});
            var luckysheetfile = getluckysheetfile()
              , dynamicArray_compute = null == luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray_compute ? {} : luckysheetfile[getSheetIndex(Store.currentSheetIndex)].dynamicArray_compute;
            if (null == index && (index = Store.currentSheetIndex),
            null != value) {
                var cellCache = [[{
                    v: null
                }]];
                setcellvalue(0, 0, cellCache, value),
                _this.execFunctionGlobalData[origin_r + "_" + origin_c + "_" + index] = cellCache[0][0]
            }
            var group = _this.getAllFunctionGroup()
              , vertex1 = {}
              , stack = []
              , count = 0;
            if (_this.execvertex = {},
            null == _this.execFunctionExist)
                for (var _i14 = 0; _i14 < group.length; _i14++) {
                    var item = group[_i14]
                      , file = luckysheetfile[getSheetIndex(item.index)];
                    if (null != file) {
                        var cell = file.data[item.r][item.c]
                          , calc_funcStr = getcellFormula(item.r, item.c, item.index);
                        null != cell && null != cell.f && cell.f == calc_funcStr && (item instanceof Object || (item = eval("(" + item + ")")),
                        item.color = "w",
                        item.parent = null,
                        item.chidren = {},
                        item.times = 0,
                        vertex1["r" + item.r + "c" + item.c + "i" + item.index] = item,
                        _this.isFunctionRangeSave = !1,
                        isForce ? _this.isFunctionRangeSave = !0 : null != origin_r && null != origin_c && _this.isFunctionRangeSelect(calc_funcStr, origin_r, origin_c, index, dynamicArray_compute),
                        _this.isFunctionRangeSave && (stack.push(item),
                        _this.execvertex["r" + item.r + "c" + item.c + "i" + item.index] = item,
                        count++))
                    }
                }
            else
                for (var x = 0; x < _this.execFunctionExist.length; x++) {
                    var _cell3 = _this.execFunctionExist[x];
                    if (!("r" + _cell3.r + "c" + _cell3.c + "i" + _cell3.i in vertex1))
                        for (var _i15 = 0; _i15 < group.length; _i15++) {
                            var _item2 = group[_i15]
                              , _calc_funcStr = getcellFormula(_item2.r, _item2.c, _item2.index);
                            _item2.color = "w",
                            _item2.parent = null,
                            _item2.chidren = {},
                            _item2.times = 0,
                            vertex1["r" + _item2.r + "c" + _item2.c + "i" + _item2.index] = _item2,
                            _this.isFunctionRangeSave = !1,
                            isForce ? _this.isFunctionRangeSave = !0 : _this.isFunctionRangeSelect(_calc_funcStr, _cell3.r, _cell3.c, _cell3.i, dynamicArray_compute),
                            _this.isFunctionRangeSave && (stack.push(_item2),
                            _this.execvertex["r" + _item2.r + "c" + _item2.c + "i" + _item2.index] = _item2,
                            count++)
                        }
                }
            for (; stack.length > 0; ) {
                var u = stack.shift()
                  , excludeList = {};
                for (var name in _this.getChildrenVertex(u, vertex1, excludeList),
                vertex1) {
                    var _item3 = vertex1[name];
                    if (null != _item3) {
                        var ukey = "r" + u.r + "c" + u.c + "i" + u.index;
                        if (!(name in excludeList)) {
                            _this.isFunctionRangeSave = !1;
                            var _calc_funcStr2 = getcellFormula(_item3.r, _item3.c, _item3.index);
                            _this.isFunctionRangeSelect(_calc_funcStr2, u.r, u.c, u.index, dynamicArray_compute),
                            _this.isFunctionRangeSave && (name in _this.execvertex || (stack.push(_item3),
                            _this.execvertex[name] = _item3),
                            count++,
                            _this.execvertex[name].chidren[ukey] = 1)
                        }
                    }
                }
            }
            _this.groupValuesRefreshData = [];
            for (var i = 0; i < count; )
                for (var _name in _this.execvertex) {
                    var _u = _this.execvertex[_name];
                    "w" == _u.color ? _this.functionDFS(_u) : "b" == _u.color && i++
                }
            _this.execFunctionExist = null
        },
        getChildrenVertex: function(e, t, r) {
            if (r["r" + e.r + "c" + e.c + "i" + e.index] = 1,
            null != e.chidren)
                for (var a in e.chidren)
                    t[a] && !(a in r) && this.getChildrenVertex(t[a], t, r)
        },
        functionDFS: function(e) {
            for (var t in e.color = "g",
            e.times += 1,
            e.chidren) {
                var r = this.execvertex[t];
                "w" == r.color && (r.parent = "r" + e.r.toString() + "c" + e.c.toString() + "i" + e.index,
                this.functionDFS(r))
            }
            e.color = "b",
            window.luckysheet_getcelldata_cache = null;
            var a = getcellFormula(e.r, e.c, e.index)
              , n = this.execfunction(a, e.r, e.c, e.index);
            this.groupValuesRefreshData.push({
                r: e.r,
                c: e.c,
                v: n[1],
                f: n[2],
                spe: n[3],
                index: e.index
            }),
            this.execFunctionGlobalData[e.r + "_" + e.c + "_" + e.index] = {
                v: n[1],
                f: n[2]
            }
        },
        groupValuesRefreshData: [],
        groupValuesRefresh: function() {
            var e = getluckysheetfile();
            if (this.groupValuesRefreshData.length > 0) {
                for (var t = 0; t < this.groupValuesRefreshData.length; t++) {
                    var r = this.groupValuesRefreshData[t]
                      , a = e[getSheetIndex(r.index)]
                      , n = a.data;
                    if (null != n) {
                        var o = {};
                        null != r.spe && ("sparklines" == r.spe.type ? o.spl = r.spe.data : "dynamicArrayItem" == r.spe.type && (a.dynamicArray = this.insertUpdateDynamicArray(r.spe.data))),
                        o.v = r.v,
                        o.f = r.f,
                        setcellvalue(r.r, r.c, n, o),
                        server.saveParam("v", r.index, r.v, {
                            r: r.r,
                            c: r.c
                        })
                    }
                }
                editor.webWorkerFlowDataCache(Store.flowdata),
                this.groupValuesRefreshData = []
            }
        },
        delFunctionGroup: function(e, t, r) {
            null == r && (r = Store.currentSheetIndex);
            var a = getluckysheetfile()
              , n = a[getSheetIndex(r)]
              , o = n.calcChain;
            if (null != o)
                for (var l = 0; l < o.length; l++) {
                    var i = o[l];
                    if (i.r == e && i.c == t && i.index == r) {
                        o.splice(l, 1),
                        server.saveParam("fc", r, null, {
                            op: "del",
                            pos: l
                        });
                        break
                    }
                }
            var s = n.dynamicArray;
            if (null != s)
                for (var c = 0; c < s.length; c++) {
                    var u = s[c];
                    if (u.r == e && u.c == t && (null == u.index || u.index == r)) {
                        s.splice(c, 1),
                        server.saveParam("ac", r, null, {
                            op: "del",
                            pos: c
                        });
                        break
                    }
                }
            setluckysheetfile(a)
        },
        execfunction: function execfunction(txt, r, c, index, isrefresh, notInsertFunc) {
            var _this = this
              , _locale = locale()
              , locale_formulaMore = _locale.formulaMore;
            if (txt.indexOf(_this.error.r) > -1)
                return [!1, _this.error.r, txt];
            _this.checkBracketNum(txt) || (txt += ")"),
            null == index && (index = Store.currentSheetIndex),
            Store.calculateSheetIndex = index;
            var fp = $.trim(_this.functionParserExe(txt));
            if ("luckysheet_function." != fp.substr(0, 20) && "luckysheet_compareWith" != fp.substr(0, 22) || (_this.functionHTMLIndex = 0),
            !_this.testFunction(txt, fp) || "" == fp)
                return tooltip.info("", locale_formulaMore.execfunctionError),
                [!1, _this.error.n, txt];
            var result = null;
            window.luckysheetCurrentRow = r,
            window.luckysheetCurrentColumn = c,
            window.luckysheetCurrentIndex = index,
            window.luckysheetCurrentFunction = txt;
            var sparklines = null;
            try {
                if (fp.indexOf("luckysheet_getcelldata") > -1)
                    for (var funcg = fp.split("luckysheet_getcelldata('"), i = 1; i < funcg.length; i++) {
                        var funcgStr = funcg[i].split("')")[0]
                          , funcgRange = _this.getcellrange(funcgStr);
                        if (funcgRange.row[0] < 0 || funcgRange.column[0] < 0)
                            return [!0, _this.error.r, txt];
                        if (funcgRange.sheetIndex == Store.calculateSheetIndex && r >= funcgRange.row[0] && r <= funcgRange.row[1] && c >= funcgRange.column[0] && c <= funcgRange.column[1])
                            return isEditMode() ? alert(locale_formulaMore.execfunctionSelfError) : tooltip.info("", locale_formulaMore.execfunctionSelfErrorResult),
                            [!1, 0, txt]
                    }
                result = eval(fp),
                fp.indexOf("SPLINES") > -1 && (sparklines = result,
                result = "")
            } catch (e) {
                var err = e;
                console.log(e, fp),
                err = _this.errorInfo(err),
                result = [_this.error.n, err]
            }
            "object" == getObjType(result) && null != result.startCell && (result = "array" == getObjType(result.data) ? _this.error.v : "object" != getObjType(result.data) || isRealNull(result.data.v) ? isRealNull(result.data) ? 0 : result.data : result.data.v);
            var dynamicArrayItem = null;
            if ("array" == getObjType(result)) {
                var isErr = !1;
                "array" != getObjType(result[0]) && 2 == result.length && (isErr = valueIsError(result[0])),
                isErr ? result = result[0] : "array" == getObjType(result[0]) && 1 == result.length && 1 == result[0].length ? result = result[0][0] : (dynamicArrayItem = {
                    r: r,
                    c: c,
                    f: txt,
                    index: index,
                    data: result
                },
                result = "")
            }
            return window.luckysheetCurrentRow = null,
            window.luckysheetCurrentColumn = null,
            window.luckysheetCurrentIndex = null,
            window.luckysheetCurrentFunction = null,
            null != r && null != c && (isrefresh && _this.execFunctionGroup(r, c, result, index),
            notInsertFunc || _this.insertUpdateFunctionGroup(r, c, index)),
            sparklines ? [!0, result, txt, {
                type: "sparklines",
                data: sparklines
            }] : dynamicArrayItem ? [!0, result, txt, {
                type: "dynamicArrayItem",
                data: dynamicArrayItem
            }] : [!0, result, txt]
        },
        testFunction: function(e, t) {
            return "=" == e.substr(0, 1)
        },
        functionResizeData: {},
        functionResizeStatus: !1,
        functionResizeTimeout: null,
        data_parm_index: 0
    };
    function seletedHighlistByindex(e, t, r, a, n) {
        var o = Store.visibledatarow[r]
          , l = t - 1 == -1 ? 0 : Store.visibledatarow[t - 1]
          , i = Store.visibledatacolumn[n]
          , s = a - 1 == -1 ? 0 : Store.visibledatacolumn[a - 1];
        $("#" + e).css({
            left: s,
            width: i - s - 1,
            top: l,
            height: o - l - 1
        })
    }
    function selectHightlightShow() {
        if ($("#luckysheet-cell-selected-boxs").show(),
        $("#luckysheet-cell-selected-boxs #luckysheet-cell-selected").siblings(".luckysheet-cell-selected").remove(),
        Store.luckysheet_select_save.length > 0) {
            for (var e = 0; e < Store.luckysheet_select_save.length; e++) {
                var t = Store.luckysheet_select_save[e].row[0]
                  , r = Store.luckysheet_select_save[e].row[1]
                  , a = Store.luckysheet_select_save[e].column[0]
                  , n = Store.luckysheet_select_save[e].column[1]
                  , o = void 0
                  , l = void 0;
                o = null == Store.luckysheet_select_save[e].row_focus ? t : Store.luckysheet_select_save[e].row_focus,
                l = null == Store.luckysheet_select_save[e].column_focus ? a : Store.luckysheet_select_save[e].column_focus;
                var i = Store.visibledatarow[r]
                  , s = t - 1 == -1 ? 0 : Store.visibledatarow[t - 1]
                  , c = Store.visibledatacolumn[n]
                  , u = a - 1 == -1 ? 0 : Store.visibledatacolumn[a - 1]
                  , h = Store.visibledatarow[o]
                  , d = o - 1 == -1 ? 0 : Store.visibledatarow[o - 1]
                  , f = Store.visibledatacolumn[l]
                  , m = l - 1 == -1 ? 0 : Store.visibledatacolumn[l - 1]
                  , p = menuButton.mergeborer(Store.flowdata, o, l);
                p && (h = p.row[1],
                d = p.row[0],
                f = p.column[1],
                m = p.column[0]),
                Store.luckysheet_select_save[e].row = [t, r],
                Store.luckysheet_select_save[e].column = [a, n],
                Store.luckysheet_select_save[e].row_focus = o,
                Store.luckysheet_select_save[e].column_focus = l,
                Store.luckysheet_select_save[e].left = m,
                Store.luckysheet_select_save[e].width = f - m - 1,
                Store.luckysheet_select_save[e].top = d,
                Store.luckysheet_select_save[e].height = h - d - 1,
                Store.luckysheet_select_save[e].left_move = u,
                Store.luckysheet_select_save[e].width_move = c - u - 1,
                Store.luckysheet_select_save[e].top_move = s,
                Store.luckysheet_select_save[e].height_move = i - s - 1,
                0 == e ? 1 == Store.luckysheet_select_save.length ? browser.mobilecheck() ? $("#luckysheet-cell-selected-boxs #luckysheet-cell-selected").css({
                    left: Store.luckysheet_select_save[e].left_move,
                    width: Store.luckysheet_select_save[e].width_move,
                    top: Store.luckysheet_select_save[e].top_move,
                    height: Store.luckysheet_select_save[e].height_move,
                    display: "block",
                    border: "1px solid #0188fb"
                }).find(".luckysheet-cs-draghandle").css("display", "block").end().find(".luckysheet-cs-fillhandle").css("display", "none").end().find(".luckysheet-cs-touchhandle").css("display", "block") : $("#luckysheet-cell-selected-boxs #luckysheet-cell-selected").css({
                    left: Store.luckysheet_select_save[e].left_move,
                    width: Store.luckysheet_select_save[e].width_move,
                    top: Store.luckysheet_select_save[e].top_move,
                    height: Store.luckysheet_select_save[e].height_move,
                    display: "block",
                    border: "1px solid #0188fb"
                }).find(".luckysheet-cs-draghandle").css("display", "block").end().find(".luckysheet-cs-fillhandle").css("display", "block").end().find(".luckysheet-cs-touchhandle").css("display", "none") : $("#luckysheet-cell-selected-boxs #luckysheet-cell-selected").css({
                    left: Store.luckysheet_select_save[e].left_move,
                    width: Store.luckysheet_select_save[e].width_move,
                    top: Store.luckysheet_select_save[e].top_move,
                    height: Store.luckysheet_select_save[e].height_move,
                    display: "block",
                    border: "1px solid rgba(1, 136, 251, 0.15)"
                }).find(".luckysheet-cs-draghandle").css("display", "none").end().find(".luckysheet-cs-fillhandle").css("display", "none") : $("#luckysheet-cell-selected-boxs").append('<div class="luckysheet-cell-selected" style="left: ' + Store.luckysheet_select_save[e].left_move + "px; width: " + Store.luckysheet_select_save[e].width_move + "px; top: " + Store.luckysheet_select_save[e].top_move + "px; height: " + Store.luckysheet_select_save[e].height_move + 'px; border: 1px solid rgba(1, 136, 251, 0.15); display: block;"></div>'),
                e == Store.luckysheet_select_save.length - 1 && ($("#luckysheet-cell-selected-focus").css({
                    left: Store.luckysheet_select_save[e].left,
                    width: Store.luckysheet_select_save[e].width,
                    top: Store.luckysheet_select_save[e].top,
                    height: Store.luckysheet_select_save[e].height,
                    display: "block"
                }),
                luckysheet_count_show(Store.luckysheet_select_save[e].left_move, Store.luckysheet_select_save[e].top_move, Store.luckysheet_select_save[e].width_move, Store.luckysheet_select_save[e].height_move, [t, r], [a, n]),
                luckysheetformula.fucntionboxshow(o, l),
                dataVerificationCtrl.cellFocus(o, l))
            }
            selectTitlesShow(Store.luckysheet_select_save),
            selectHelpboxFill(),
            1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] && dynamicArrayHightShow(Store.luckysheet_select_save[0].row[0], Store.luckysheet_select_save[0].column[0])
        }
        Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_select_save = Store.luckysheet_select_save
    }
    function selectTitlesShow(e) {
        for (var t = $.extend(!0, [], e), r = {}, a = {}, n = 0; n < t.length; n++) {
            var o = t[n].row[0]
              , l = t[n].row[1]
              , i = t[n].column[0]
              , s = t[n].column[1];
            r = selectTitlesMap(r, o, l),
            a = selectTitlesMap(a, i, s)
        }
        $("#luckysheet-rows-h-selected").empty();
        for (var c = selectTitlesRange(r), u = 0; u < c.length; u++) {
            var h = c[u][0]
              , d = rowLocationByIndex(c[u][c[u].length - 1])[1]
              , f = rowLocationByIndex(h)[0] - 12;
            $("#luckysheet-rows-h-selected").append('<div class="luckysheet-rows-h-selected" style="top: ' + f + "px; height: " + (d - f - 1 - 12) + 'px; display: block; background-color: rgba(76, 76, 76, 0.1);"></div>')
        }
        $("#luckysheet-cols-h-selected").empty();
        for (var m = selectTitlesRange(a), p = 0; p < m.length; p++) {
            var g = m[p][0]
              , y = colLocationByIndex(m[p][m[p].length - 1])[1]
              , v = colLocationByIndex(g)[0];
            $("#luckysheet-cols-h-selected").append('<div class="luckysheet-cols-h-selected" style="left: ' + v + "px; width: " + (y - v - 1) + 'px; display: block; background-color: rgba(76, 76, 76, 0.1);"></div>')
        }
    }
    function selectTitlesMap(e, t, r) {
        for (var a = $.extend(!0, {}, e), n = t; n <= r; n++)
            n in a || (a[n] = 0);
        return a
    }
    function selectTitlesRange(e) {
        var t = [];
        for (var r in e)
            t.push(r);
        t.sort((function(e, t) {
            return e - t
        }
        ));
        var a = []
          , n = [];
        if (t.length > 1)
            for (var o = 1; o < t.length; o++)
                t[o] - t[o - 1] == 1 ? (n.push(t[o - 1]),
                o == t.length - 1 && (n.push(t[o]),
                a.push(n))) : 1 == o ? o == t.length - 1 ? (n.push(t[o - 1]),
                a.push(n),
                a.push([t[o]])) : a.push(t[0]) : o == t.length - 1 ? (n.push(t[o - 1]),
                a.push(n),
                a.push([t[o]])) : (n.push(t[o - 1]),
                a.push(n),
                n = []);
        else
            a.push([t[0]]);
        return a
    }
    function selectIsOverlap(e) {
        null == e && (e = Store.luckysheet_select_save);
        for (var t = !1, r = {}, a = 0; a < e.length; a++)
            for (var n = e[a].row[0], o = e[a].row[1], l = e[a].column[0], i = e[a].column[1], s = n; s <= o; s++)
                for (var c = l; c <= i; c++) {
                    if (s + "_" + c in r) {
                        t = !0;
                        break
                    }
                    r[s + "_" + c] = 0
                }
        return t
    }
    function selectionCopyShow(e) {
        if ($("#luckysheet-selection-copy").empty(),
        null == e && (e = Store.luckysheet_selection_range),
        e.length > 0)
            for (var t = 0; t < e.length; t++) {
                var r = e[t].row[0]
                  , a = e[t].row[1]
                  , n = e[t].column[0]
                  , o = e[t].column[1]
                  , l = Store.visibledatarow[a]
                  , i = r - 1 == -1 ? 0 : Store.visibledatarow[r - 1]
                  , s = Store.visibledatacolumn[o]
                  , c = n - 1 == -1 ? 0 : Store.visibledatacolumn[n - 1]
                  , u = '<div class="luckysheet-selection-copy" style="display: block; left: ' + c + "px; width: " + (s - c - 1) + "px; top: " + i + "px; height: " + (l - i - 1) + 'px;"><div class="luckysheet-selection-copy-top luckysheet-copy"></div><div class="luckysheet-selection-copy-right luckysheet-copy"></div><div class="luckysheet-selection-copy-bottom luckysheet-copy"></div><div class="luckysheet-selection-copy-left luckysheet-copy"></div><div class="luckysheet-selection-copy-hc"></div></div>';
                $("#luckysheet-selection-copy").append(u)
            }
    }
    function luckysheet_count_show(e, t, r, a, n, o) {
        var l = n[1] - n[0] + 1
          , i = o[1] - o[0] + 1
          , s = Store.luckysheetTableContentHW[0]
          , c = Store.luckysheetTableContentHW[1]
          , u = $("#luckysheet-cell-main").scrollLeft()
          , h = $("#luckysheet-cell-main").scrollTop()
          , d = locale().info;
        if (l >= 4) {
            var f = e - 25;
            f < 0 && (f = e + 5),
            f < u && (f = u + 10);
            var m = t + a / 2;
            a > c && (m = h + c / 2),
            $("#luckysheet-row-count-show").css({
                left: f,
                top: m,
                display: "block",
                width: "11px"
            }).html("<div>" + l.toString().split("").join("</div><div>") + "</div><div>" + d.row + "</div>")
        } else
            $("#luckysheet-row-count-show").hide();
        if (i >= 4) {
            var p = t - 25;
            p < 0 && (p = t + 5),
            p < h && (p = h + 10);
            var g = e + r / 2;
            r > s && (g = u + s / 2),
            $("#luckysheet-column-count-show").css({
                left: g,
                top: p,
                display: "block"
            }).text(i + d.column)
        } else
            $("#luckysheet-column-count-show").hide()
    }
    function selectHelpboxFill() {
        var e = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
          , t = e.row_focus
          , r = e.column_focus;
        null != Store.config.merge && t + "_" + r in Store.config.merge ? $("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, {
            column: [r, r],
            row: [t, t]
        })) : $("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, e))
    }
    var luckysheetMoreFormat = {
        moneyFmtList: [{
            name: "人民币",
            pos: "before",
            value: "¥"
        }, {
            name: "美元",
            pos: "before",
            value: "$"
        }, {
            name: "欧元",
            pos: "before",
            value: "€"
        }, {
            name: "英镑",
            pos: "before",
            value: "￡"
        }, {
            name: "港元",
            pos: "before",
            value: "$"
        }, {
            name: "日元",
            pos: "before",
            value: "￥"
        }, {
            name: "阿尔巴尼亚列克",
            pos: "before",
            value: "Lek"
        }, {
            name: "阿尔及利亚第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "阿富汗尼",
            pos: "after",
            value: "Af"
        }, {
            name: "阿根廷比索",
            pos: "before",
            value: "$"
        }, {
            name: "阿拉伯联合酋长国迪拉姆",
            pos: "before",
            value: "dh"
        }, {
            name: "阿鲁巴弗罗林",
            pos: "before",
            value: "Afl"
        }, {
            name: "阿曼里亚尔",
            pos: "before",
            value: "Rial"
        }, {
            name: "阿塞拜疆马纳特",
            pos: "before",
            value: "?"
        }, {
            name: "埃及镑",
            pos: "before",
            value: "￡"
        }, {
            name: "埃塞俄比亚比尔",
            pos: "before",
            value: "Birr"
        }, {
            name: "安哥拉宽扎",
            pos: "before",
            value: "Kz"
        }, {
            name: "澳大利亚元",
            pos: "before",
            value: "$"
        }, {
            name: "澳门元",
            pos: "before",
            value: "MOP"
        }, {
            name: "巴巴多斯元",
            pos: "before",
            value: "$"
        }, {
            name: "巴布亚新几内亚基那",
            pos: "before",
            value: "PGK"
        }, {
            name: "巴哈马元",
            pos: "before",
            value: "$"
        }, {
            name: "巴基斯坦卢比",
            pos: "before",
            value: "Rs"
        }, {
            name: "巴拉圭瓜拉尼",
            pos: "after",
            value: "Gs"
        }, {
            name: "巴林第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "巴拿马巴波亚",
            pos: "before",
            value: "B/"
        }, {
            name: "巴西里亚伊",
            pos: "before",
            value: "R$"
        }, {
            name: "白俄罗斯卢布",
            pos: "after",
            value: "р"
        }, {
            name: "百慕大元",
            pos: "before",
            value: "$"
        }, {
            name: "保加利亚列弗",
            pos: "before",
            value: "lev"
        }, {
            name: "冰岛克朗",
            pos: "before",
            value: "kr"
        }, {
            name: "波黑可兑换马克",
            pos: "before",
            value: "KM"
        }, {
            name: "波兰兹罗提",
            pos: "after",
            value: "z?"
        }, {
            name: "玻利维亚诺",
            pos: "before",
            value: "Bs"
        }, {
            name: "伯利兹元",
            pos: "before",
            value: "$"
        }, {
            name: "博茨瓦纳普拉",
            pos: "before",
            value: "P"
        }, {
            name: "不丹努扎姆",
            pos: "before",
            value: "Nu"
        }, {
            name: "布隆迪法郎",
            pos: "before",
            value: "FBu"
        }, {
            name: "朝鲜圆",
            pos: "before",
            value: "?KP"
        }, {
            name: "丹麦克朗",
            pos: "after",
            value: "kr"
        }, {
            name: "东加勒比元",
            pos: "before",
            value: "$"
        }, {
            name: "多米尼加比索",
            pos: "before",
            value: "RD$"
        }, {
            name: "俄国卢布",
            pos: "after",
            value: "?"
        }, {
            name: "厄立特里亚纳克法",
            pos: "before",
            value: "Nfk"
        }, {
            name: "非洲金融共同体法郎",
            pos: "before",
            value: "CFA"
        }, {
            name: "菲律宾比索",
            pos: "before",
            value: "?"
        }, {
            name: "斐济元",
            pos: "before",
            value: "$"
        }, {
            name: "佛得角埃斯库多",
            pos: "before",
            value: "CVE"
        }, {
            name: "福克兰群岛镑",
            pos: "before",
            value: "￡"
        }, {
            name: "冈比亚达拉西",
            pos: "before",
            value: "GMD"
        }, {
            name: "刚果法郎",
            pos: "before",
            value: "FrCD"
        }, {
            name: "哥伦比亚比索",
            pos: "before",
            value: "$"
        }, {
            name: "哥斯达黎加科朗",
            pos: "before",
            value: "?"
        }, {
            name: "古巴比索",
            pos: "before",
            value: "$"
        }, {
            name: "古巴可兑换比索",
            pos: "before",
            value: "$"
        }, {
            name: "圭亚那元",
            pos: "before",
            value: "$"
        }, {
            name: "哈萨克斯坦坚戈",
            pos: "before",
            value: "?"
        }, {
            name: "海地古德",
            pos: "before",
            value: "HTG"
        }, {
            name: "韩元",
            pos: "before",
            value: "?"
        }, {
            name: "荷属安的列斯盾",
            pos: "before",
            value: "NAf."
        }, {
            name: "洪都拉斯拉伦皮拉",
            pos: "before",
            value: "L"
        }, {
            name: "吉布提法郎",
            pos: "before",
            value: "Fdj"
        }, {
            name: "吉尔吉斯斯坦索姆",
            pos: "before",
            value: "KGS"
        }, {
            name: "几内亚法郎",
            pos: "before",
            value: "FG"
        }, {
            name: "加拿大元",
            pos: "before",
            value: "$"
        }, {
            name: "加纳塞地",
            pos: "before",
            value: "GHS"
        }, {
            name: "柬埔寨瑞尔",
            pos: "before",
            value: "Riel"
        }, {
            name: "捷克克朗",
            pos: "after",
            value: "K?"
        }, {
            name: "津巴布韦元",
            pos: "before",
            value: "$"
        }, {
            name: "卡塔尔里亚尔",
            pos: "before",
            value: "Rial"
        }, {
            name: "开曼群岛元",
            pos: "before",
            value: "$"
        }, {
            name: "科摩罗法郎",
            pos: "before",
            value: "CF"
        }, {
            name: "科威特第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "克罗地亚库纳",
            pos: "before",
            value: "kn"
        }, {
            name: "肯尼亚先令",
            pos: "before",
            value: "Ksh"
        }, {
            name: "莱索托洛蒂",
            pos: "before",
            value: "LSL"
        }, {
            name: "老挝基普",
            pos: "before",
            value: "?"
        }, {
            name: "黎巴嫩镑",
            pos: "before",
            value: "L￡"
        }, {
            name: "立陶宛立特",
            pos: "before",
            value: "Lt"
        }, {
            name: "利比亚第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "利比亚元",
            pos: "before",
            value: "$"
        }, {
            name: "卢旺达法郎",
            pos: "before",
            value: "RF"
        }, {
            name: "罗马尼亚列伊",
            pos: "before",
            value: "RON"
        }, {
            name: "马达加斯加阿里亚里",
            pos: "before",
            value: "Ar"
        }, {
            name: "马尔代夫拉菲亚",
            pos: "before",
            value: "Rf"
        }, {
            name: "马拉维克瓦查",
            pos: "before",
            value: "MWK"
        }, {
            name: "马来西亚林吉特",
            pos: "before",
            value: "RM"
        }, {
            name: "马其顿戴第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "毛里求斯卢比",
            pos: "before",
            value: "MURs"
        }, {
            name: "毛里塔尼亚乌吉亚",
            pos: "before",
            value: "MRO"
        }, {
            name: "蒙古图格里克",
            pos: "before",
            value: "?"
        }, {
            name: "孟加拉塔卡",
            pos: "before",
            value: "?"
        }, {
            name: "秘鲁新索尔",
            pos: "before",
            value: "S/"
        }, {
            name: "缅甸开亚特",
            pos: "before",
            value: "K"
        }, {
            name: "摩尔多瓦列伊",
            pos: "before",
            value: "MDL"
        }, {
            name: "摩洛哥迪拉姆",
            pos: "before",
            value: "dh"
        }, {
            name: "莫桑比克梅蒂卡尔",
            pos: "before",
            value: "MTn"
        }, {
            name: "墨西哥比索",
            pos: "before",
            value: "$"
        }, {
            name: "纳米比亚元",
            pos: "before",
            value: "$"
        }, {
            name: "南非兰特",
            pos: "before",
            value: "R"
        }, {
            name: "南苏丹镑",
            pos: "before",
            value: "￡"
        }, {
            name: "尼加拉瓜科多巴",
            pos: "before",
            value: "C$"
        }, {
            name: "尼泊尔卢比",
            pos: "before",
            value: "Rs"
        }, {
            name: "尼日利亚奈拉",
            pos: "before",
            value: "?"
        }, {
            name: "挪威克朗",
            pos: "after",
            value: "kr"
        }, {
            name: "乔治亚拉瑞",
            pos: "before",
            value: "GEL"
        }, {
            name: "人民币（离岸）",
            pos: "before",
            value: "￥"
        }, {
            name: "瑞典克朗",
            pos: "after",
            value: "kr"
        }, {
            name: "瑞士法郎",
            pos: "before",
            value: "CHF"
        }, {
            name: "塞尔维亚第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "塞拉利昂利昂",
            pos: "before",
            value: "SLL"
        }, {
            name: "塞舌尔卢比",
            pos: "before",
            value: "SCR"
        }, {
            name: "沙特里亚尔",
            pos: "before",
            value: "Rial"
        }, {
            name: "圣多美多布拉",
            pos: "before",
            value: "Db"
        }, {
            name: "圣赫勒拿群岛磅",
            pos: "before",
            value: "￡"
        }, {
            name: "斯里兰卡卢比",
            pos: "before",
            value: "Rs"
        }, {
            name: "斯威士兰里兰吉尼",
            pos: "before",
            value: "SZL"
        }, {
            name: "苏丹镑",
            pos: "before",
            value: "SDG"
        }, {
            name: "苏里南元",
            pos: "before",
            value: "$"
        }, {
            name: "所罗门群岛元",
            pos: "before",
            value: "$"
        }, {
            name: "索马里先令",
            pos: "before",
            value: "SOS"
        }, {
            name: "塔吉克斯坦索莫尼",
            pos: "before",
            value: "Som"
        }, {
            name: "太平洋法郎",
            pos: "after",
            value: "FCFP"
        }, {
            name: "泰国铢",
            pos: "before",
            value: "?"
        }, {
            name: "坦桑尼亚先令",
            pos: "before",
            value: "TSh"
        }, {
            name: "汤加潘加",
            pos: "before",
            value: "T$"
        }, {
            name: "特立尼达和多巴哥元",
            pos: "before",
            value: "$"
        }, {
            name: "突尼斯第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "土耳其里拉",
            pos: "before",
            value: "?"
        }, {
            name: "瓦努阿图瓦图",
            pos: "before",
            value: "VUV"
        }, {
            name: "危地马拉格查尔",
            pos: "before",
            value: "Q"
        }, {
            name: "委内瑞拉博利瓦",
            pos: "before",
            value: "Bs"
        }, {
            name: "文莱元",
            pos: "before",
            value: "$"
        }, {
            name: "乌干达先令",
            pos: "before",
            value: "UGX"
        }, {
            name: "乌克兰格里夫尼亚",
            pos: "before",
            value: "грн."
        }, {
            name: "乌拉圭比索",
            pos: "before",
            value: "$"
        }, {
            name: "乌兹别克斯坦苏姆",
            pos: "before",
            value: "so?m"
        }, {
            name: "西萨摩亚塔拉",
            pos: "before",
            value: "WST"
        }, {
            name: "新加坡元",
            pos: "before",
            value: "$"
        }, {
            name: "新台币",
            pos: "before",
            value: "NT$"
        }, {
            name: "新西兰元",
            pos: "before",
            value: "$"
        }, {
            name: "匈牙利福林",
            pos: "before",
            value: "Ft"
        }, {
            name: "叙利亚镑",
            pos: "before",
            value: "￡"
        }, {
            name: "牙买加元",
            pos: "before",
            value: "$"
        }, {
            name: "亚美尼亚德拉姆",
            pos: "before",
            value: "Dram"
        }, {
            name: "也门里亚尔",
            pos: "before",
            value: "Rial"
        }, {
            name: "伊拉克第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "伊朗里亚尔",
            pos: "before",
            value: "Rial"
        }, {
            name: "以色列新谢克尔",
            pos: "before",
            value: "?"
        }, {
            name: "印度卢比",
            pos: "before",
            value: "?"
        }, {
            name: "印度尼西亚卢比",
            pos: "before",
            value: "Rp"
        }, {
            name: "约旦第纳尔",
            pos: "before",
            value: "din"
        }, {
            name: "越南盾",
            pos: "after",
            value: "?"
        }, {
            name: "赞比亚克瓦查",
            pos: "before",
            value: "ZMW"
        }, {
            name: "直布罗陀镑",
            pos: "before",
            value: "￡"
        }, {
            name: "智利比索",
            pos: "before",
            value: "$"
        }, {
            name: "中非金融合作法郎",
            pos: "before",
            value: "FCFA"
        }],
        dateFmtList: [{
            name: "1930-08-05",
            value: "yyyy-MM-dd"
        }, {
            name: "1930/8/5",
            value: "yyyy/MM/dd"
        }, {
            name: "1930年8月5日",
            value: 'yyyy"年"M"月"d"日"'
        }, {
            name: "08-05",
            value: "MM-dd"
        }, {
            name: "8-5",
            value: "M-d"
        }, {
            name: "8月5日",
            value: 'M"月"d"日"'
        }, {
            name: "13:30:30",
            value: "h:mm:ss"
        }, {
            name: "13:30",
            value: "h:mm"
        }, {
            name: "下午01:30",
            value: "上午/下午 hh:mm"
        }, {
            name: "下午1:30",
            value: "上午/下午 h:mm"
        }, {
            name: "下午1:30:30",
            value: "上午/下午 h:mm:ss"
        }, {
            name: "08-05 下午01:30",
            value: "MM-dd 上午/下午 hh:mm"
        }],
        numFmtList: [{
            name: "1235",
            value: "0"
        }, {
            name: "1234.56",
            value: "0.00"
        }, {
            name: "1,235",
            value: "#,##0"
        }, {
            name: "1,234.56",
            value: "#,##0.00"
        }, {
            name: "1,235",
            value: "#,##0_);(#,##0)"
        }, {
            name: "1,235",
            value: "#,##0_);[Red](#,##0)"
        }, {
            name: "1,234.56",
            value: "#,##0.00_);(#,##0.00)"
        }, {
            name: "1,234.56",
            value: "#,##0.00_);[Red](#,##0.00)"
        }, {
            name: "$1,235",
            value: "$#,##0_);($#,##0)"
        }, {
            name: "$1,235",
            value: "$#,##0_);[Red]($#,##0)"
        }, {
            name: "$1,234.56",
            value: "$#,##0.00_);($#,##0.00)"
        }, {
            name: "$1,234.56",
            value: "$#,##0.00_);[Red]($#,##0.00)"
        }, {
            name: "1234.56",
            value: "@"
        }, {
            name: "123456%",
            value: "0%"
        }, {
            name: "123456.00%",
            value: "0.00%"
        }, {
            name: "1.23E+03",
            value: "0.00E+00"
        }, {
            name: "1.2E+3",
            value: "##0.0E+0"
        }, {
            name: "1234 5/9",
            value: "# ?/?"
        }, {
            name: "1234 14/25",
            value: "# ??/??"
        }, {
            name: "$ 1,235",
            value: '_($* #,##0_);_(...($* "-"_);_(@_)'
        }, {
            name: "1,235",
            value: '_(* #,##0_);_(*..._(* "-"_);_(@_)'
        }, {
            name: "$ 1,234.56",
            value: '_($* #,##0.00_);_(...($* "-"_);_(@_)'
        }, {
            name: "1,234.56",
            value: '_(* #,##0.00_);...* "-"??_);_(@_)'
        }],
        createDialog: function(e) {
            var t = locale().currencyDetail
              , r = locale().format
              , a = locale().button;
            this.moneyFmtList = [{
                name: t.RMB,
                pos: "before",
                value: "¥"
            }, {
                name: t.USdollar,
                pos: "before",
                value: "$"
            }, {
                name: t.EUR,
                pos: "before",
                value: "€"
            }, {
                name: t.GBP,
                pos: "before",
                value: "￡"
            }, {
                name: t.HK,
                pos: "before",
                value: "$"
            }, {
                name: t.JPY,
                pos: "before",
                value: "￥"
            }, {
                name: t.AlbanianLek,
                pos: "before",
                value: "Lek"
            }, {
                name: t.AlgerianDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.Afghani,
                pos: "after",
                value: "Af"
            }, {
                name: t.ArgentinePeso,
                pos: "before",
                value: "$"
            }, {
                name: t.UnitedArabEmiratesDirham,
                pos: "before",
                value: "dh"
            }, {
                name: t.ArubanFlorin,
                pos: "before",
                value: "Afl"
            }, {
                name: t.OmaniRial,
                pos: "before",
                value: "Rial"
            }, {
                name: t.Azerbaijanimanat,
                pos: "before",
                value: "?"
            }, {
                name: t.EgyptianPound,
                pos: "before",
                value: "￡"
            }, {
                name: t.EthiopianBirr,
                pos: "before",
                value: "Birr"
            }, {
                name: t.AngolaKwanza,
                pos: "before",
                value: "Kz"
            }, {
                name: t.AustralianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.Patacas,
                pos: "before",
                value: "MOP"
            }, {
                name: t.BarbadosDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.PapuaNewGuineaKina,
                pos: "before",
                value: "PGK"
            }, {
                name: t.BahamianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.PakistanRupee,
                pos: "before",
                value: "Rs"
            }, {
                name: t.ParaguayanGuarani,
                pos: "after",
                value: "Gs"
            }, {
                name: t.BahrainiDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.PanamanianBalboa,
                pos: "before",
                value: "B/"
            }, {
                name: t.Brazilianreal,
                pos: "before",
                value: "R$"
            }, {
                name: t.Belarusianruble,
                pos: "after",
                value: "р"
            }, {
                name: t.BermudianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.BulgarianLev,
                pos: "before",
                value: "lev"
            }, {
                name: t.IcelandKrona,
                pos: "before",
                value: "kr"
            }, {
                name: t.BosniaHerzegovinaConvertibleMark,
                pos: "before",
                value: "KM"
            }, {
                name: t.PolishZloty,
                pos: "after",
                value: "z?"
            }, {
                name: t.Boliviano,
                pos: "before",
                value: "Bs"
            }, {
                name: t.BelizeDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.BotswanaPula,
                pos: "before",
                value: "P"
            }, {
                name: t.NotDannuzhamu,
                pos: "before",
                value: "Nu"
            }, {
                name: t.BurundiFranc,
                pos: "before",
                value: "FBu"
            }, {
                name: t.NorthKoreanWon,
                pos: "before",
                value: "?KP"
            }, {
                name: t.DanishKrone,
                pos: "after",
                value: "kr"
            }, {
                name: t.EastCaribbeanDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.DominicaPeso,
                pos: "before",
                value: "RD$"
            }, {
                name: t.RussianRuble,
                pos: "after",
                value: "?"
            }, {
                name: t.EritreanNakfa,
                pos: "before",
                value: "Nfk"
            }, {
                name: t.CFAfranc,
                pos: "before",
                value: "CFA"
            }, {
                name: t.PhilippinePeso,
                pos: "before",
                value: "?"
            }, {
                name: t.FijiDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.CapeVerdeEscudo,
                pos: "before",
                value: "CVE"
            }, {
                name: t.FalklandIslandsPound,
                pos: "before",
                value: "￡"
            }, {
                name: t.GambianDalasi,
                pos: "before",
                value: "GMD"
            }, {
                name: t.Congolesefranc,
                pos: "before",
                value: "FrCD"
            }, {
                name: t.ColombianPeso,
                pos: "before",
                value: "$"
            }, {
                name: t.CostaRicanColon,
                pos: "before",
                value: "?"
            }, {
                name: t.CubanPeso,
                pos: "before",
                value: "$"
            }, {
                name: t.Cubanconvertiblepeso,
                pos: "before",
                value: "$"
            }, {
                name: t.GuyanaDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.KazakhstanTenge,
                pos: "before",
                value: "?"
            }, {
                name: t.Haitiangourde,
                pos: "before",
                value: "HTG"
            }, {
                name: t.won,
                pos: "before",
                value: "?"
            }, {
                name: t.NetherlandsAntillesGuilder,
                pos: "before",
                value: "NAf."
            }, {
                name: t.Honduraslempiras,
                pos: "before",
                value: "L"
            }, {
                name: t.DjiboutiFranc,
                pos: "before",
                value: "Fdj"
            }, {
                name: t.KyrgyzstanSom,
                pos: "before",
                value: "KGS"
            }, {
                name: t.GuineaFranc,
                pos: "before",
                value: "FG"
            }, {
                name: t.CanadianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.GhanaianCedi,
                pos: "before",
                value: "GHS"
            }, {
                name: t.Cambodianriel,
                pos: "before",
                value: "Riel"
            }, {
                name: t.CzechKoruna,
                pos: "after",
                value: "K?"
            }, {
                name: t.ZimbabweDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.QatariRiyal,
                pos: "before",
                value: "Rial"
            }, {
                name: t.CaymanIslandsDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.Comorianfranc,
                pos: "before",
                value: "CF"
            }, {
                name: t.KuwaitiDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.CroatianKuna,
                pos: "before",
                value: "kn"
            }, {
                name: t.KenyanShilling,
                pos: "before",
                value: "Ksh"
            }, {
                name: t.LesothoLoti,
                pos: "before",
                value: "LSL"
            }, {
                name: t.LaoKip,
                pos: "before",
                value: "?"
            }, {
                name: t.LebanesePound,
                pos: "before",
                value: "L￡"
            }, {
                name: t.Lithuanianlitas,
                pos: "before",
                value: "Lt"
            }, {
                name: t.LibyanDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.LiberianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.RwandaFranc,
                pos: "before",
                value: "RF"
            }, {
                name: t.RomanianLeu,
                pos: "before",
                value: "RON"
            }, {
                name: t.MalagasyAriary,
                pos: "before",
                value: "Ar"
            }, {
                name: t.MaldivianRufiyaa,
                pos: "before",
                value: "Rf"
            }, {
                name: t.MalawiKwacha,
                pos: "before",
                value: "MWK"
            }, {
                name: t.MalaysianRinggit,
                pos: "before",
                value: "RM"
            }, {
                name: t.MacedoniawearingDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.MauritiusRupee,
                pos: "before",
                value: "MURs"
            }, {
                name: t.MauritanianOuguiya,
                pos: "before",
                value: "MRO"
            }, {
                name: t.MongolianTugrik,
                pos: "before",
                value: "?"
            }, {
                name: t.BangladeshiTaka,
                pos: "before",
                value: "?"
            }, {
                name: t.PeruvianNuevoSol,
                pos: "before",
                value: "S/"
            }, {
                name: t.MyanmarKyat,
                pos: "before",
                value: "K"
            }, {
                name: t.MoldovanLeu,
                pos: "before",
                value: "MDL"
            }, {
                name: t.MoroccanDirham,
                pos: "before",
                value: "dh"
            }, {
                name: t.MozambiqueMetical,
                pos: "before",
                value: "MTn"
            }, {
                name: t.MexicanPeso,
                pos: "before",
                value: "$"
            }, {
                name: t.NamibianDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.SouthAfricanRand,
                pos: "before",
                value: "R"
            }, {
                name: t.SouthSudanesePound,
                pos: "before",
                value: "￡"
            }, {
                name: t.NicaraguaCordoba,
                pos: "before",
                value: "C$"
            }, {
                name: t.NepaleseRupee,
                pos: "before",
                value: "Rs"
            }, {
                name: t.NigerianNaira,
                pos: "before",
                value: "?"
            }, {
                name: t.NorwegianKrone,
                pos: "after",
                value: "kr"
            }, {
                name: t.GeorgianLari,
                pos: "before",
                value: "GEL"
            }, {
                name: t.RenminbiOffshore,
                pos: "before",
                value: "￥"
            }, {
                name: t.SwedishKrona,
                pos: "after",
                value: "kr"
            }, {
                name: t.SwissFranc,
                pos: "before",
                value: "CHF"
            }, {
                name: t.SerbianDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.SierraLeone,
                pos: "before",
                value: "SLL"
            }, {
                name: t.SeychellesRupee,
                pos: "before",
                value: "SCR"
            }, {
                name: t.SaudiRiyal,
                pos: "before",
                value: "Rial"
            }, {
                name: t.SaoTomeDobra,
                pos: "before",
                value: "Db"
            }, {
                name: t.SaintHelenapound,
                pos: "before",
                value: "￡"
            }, {
                name: t.SriLankaRupee,
                pos: "before",
                value: "Rs"
            }, {
                name: t.SwazilandLilangeni,
                pos: "before",
                value: "SZL"
            }, {
                name: t.SudanesePound,
                pos: "before",
                value: "SDG"
            }, {
                name: t.Surinamesedollar,
                pos: "before",
                value: "$"
            }, {
                name: t.SolomonIslandsDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.SomaliShilling,
                pos: "before",
                value: "SOS"
            }, {
                name: t.TajikistanSomoni,
                pos: "before",
                value: "Som"
            }, {
                name: t.PacificFranc,
                pos: "after",
                value: "FCFP"
            }, {
                name: t.ThaiBaht,
                pos: "before",
                value: "?"
            }, {
                name: t.TanzanianShilling,
                pos: "before",
                value: "TSh"
            }, {
                name: t.TonganPaanga,
                pos: "before",
                value: "T$"
            }, {
                name: t.TrinidadandTobagoDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.TunisianDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.TurkishLira,
                pos: "before",
                value: "?"
            }, {
                name: t.VanuatuVatu,
                pos: "before",
                value: "VUV"
            }, {
                name: t.GuatemalanQuetzal,
                pos: "before",
                value: "Q"
            }, {
                name: t.CommissionBolivar,
                pos: "before",
                value: "Bs"
            }, {
                name: t.BruneiDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.UgandanShilling,
                pos: "before",
                value: "UGX"
            }, {
                name: t.UkrainianHryvnia,
                pos: "before",
                value: "грн."
            }, {
                name: t.UruguayanPeso,
                pos: "before",
                value: "$"
            }, {
                name: t.Uzbekistansom,
                pos: "before",
                value: "so?m"
            }, {
                name: t.WesternSamoaTala,
                pos: "before",
                value: "WST"
            }, {
                name: t.SingaporeDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.NT,
                pos: "before",
                value: "NT$"
            }, {
                name: t.NewZealandDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.HungarianForint,
                pos: "before",
                value: "Ft"
            }, {
                name: t.SyrianPound,
                pos: "before",
                value: "￡"
            }, {
                name: t.JamaicanDollar,
                pos: "before",
                value: "$"
            }, {
                name: t.ArmenianDram,
                pos: "before",
                value: "Dram"
            }, {
                name: t.YemeniRial,
                pos: "before",
                value: "Rial"
            }, {
                name: t.IraqiDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.IranianRial,
                pos: "before",
                value: "Rial"
            }, {
                name: t.NewIsraeliShekel,
                pos: "before",
                value: "?"
            }, {
                name: t.IndianRupee,
                pos: "before",
                value: "?"
            }, {
                name: t.IndonesianRupiah,
                pos: "before",
                value: "Rp"
            }, {
                name: t.JordanianDinar,
                pos: "before",
                value: "din"
            }, {
                name: t.VND,
                pos: "after",
                value: "?"
            }, {
                name: t.ZambianKwacha,
                pos: "before",
                value: "ZMW"
            }, {
                name: t.GibraltarPound,
                pos: "before",
                value: "￡"
            }, {
                name: t.ChileanPeso,
                pos: "before",
                value: "$"
            }, {
                name: t.CFAFrancBEAC,
                pos: "before",
                value: "FCFA"
            }],
            this.dateFmtList = locale().dateFmtList,
            this.numFmtList = [{
                name: "1235",
                value: "0"
            }, {
                name: "1234.56",
                value: "0.00"
            }, {
                name: "1,235",
                value: "#,##0"
            }, {
                name: "1,234.56",
                value: "#,##0.00"
            }, {
                name: "1,235",
                value: "#,##0_);(#,##0)"
            }, {
                name: "1,235",
                value: "#,##0_);[Red](#,##0)"
            }, {
                name: "1,234.56",
                value: "#,##0.00_);(#,##0.00)"
            }, {
                name: "1,234.56",
                value: "#,##0.00_);[Red](#,##0.00)"
            }, {
                name: "$1,235",
                value: "$#,##0_);($#,##0)"
            }, {
                name: "$1,235",
                value: "$#,##0_);[Red]($#,##0)"
            }, {
                name: "$1,234.56",
                value: "$#,##0.00_);($#,##0.00)"
            }, {
                name: "$1,234.56",
                value: "$#,##0.00_);[Red]($#,##0.00)"
            }, {
                name: "1234.56",
                value: "@"
            }, {
                name: "123456%",
                value: "0%"
            }, {
                name: "123456.00%",
                value: "0.00%"
            }, {
                name: "1.23E+03",
                value: "0.00E+00"
            }, {
                name: "1.2E+3",
                value: "##0.0E+0"
            }, {
                name: "1234 5/9",
                value: "# ?/?"
            }, {
                name: "1234 14/25",
                value: "# ??/??"
            }, {
                name: "$ 1,235",
                value: '_($* #,##0_);_(...($* "-"_);_(@_)'
            }, {
                name: "1,235",
                value: '_(* #,##0_);_(*..._(* "-"_);_(@_)'
            }, {
                name: "$ 1,234.56",
                value: '_($* #,##0.00_);_(...($* "-"_);_(@_)'
            }, {
                name: "1,234.56",
                value: '_(* #,##0.00_);...* "-"??_);_(@_)'
            }],
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-moreFormat-dialog").remove();
            var n = ""
              , o = "";
            if ("morecurrency" == e) {
                n = r.titleCurrency;
                for (var l = "", i = 0; i < this.moneyFmtList.length; i++) {
                    var s = this.moneyFmtList[i].name
                      , c = this.moneyFmtList[i].pos;
                    l += '<div class="listItem"><div class="name">' + s + '</div><div class="value">' + this.moneyFmtList[i].value + '</div><input type="hidden" value="' + c + '"/></div>'
                }
                o = '<div class="box" id="morecurrency"><div class="decimal"><label>' + r.decimalPlaces + '：</label><input type="number" class="formulaInputFocus" value="2" min="0" max="9"/></div><div class="listbox">' + l + "</div></div>"
            } else if ("moredatetime" == e) {
                n = r.titleDateTime;
                for (var u = "", h = 0; h < this.dateFmtList.length; h++) {
                    u += '<div class="listItem"><div class="name">' + this.dateFmtList[h].name + '</div><div class="value">' + this.dateFmtList[h].value + "</div></div>"
                }
                o = '<div class="box" id="moredatetime"><div class="listbox">' + u + "</div></div>"
            } else if ("moredigit" == e) {
                n = r.titleNumber;
                for (var d = "", f = 0; f < this.numFmtList.length; f++) {
                    d += '<div class="listItem"><div class="name">' + this.numFmtList[f].name + '</div><div class="value">' + this.numFmtList[f].value + "</div></div>"
                }
                o = '<div class="box" id="moredigit"><div class="listbox">' + d + "</div></div>"
            }
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-moreFormat-dialog",
                addclass: "luckysheet-moreFormat-dialog",
                title: n,
                content: o,
                botton: '<button id="luckysheet-moreFormat-dialog-confirm" class="btn btn-primary">' + a.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + a.cancel + "</button>",
                style: "z-index:100003"
            }));
            var m = $("#luckysheet-moreFormat-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , p = m.outerHeight()
              , g = m.outerWidth()
              , y = $(window).width()
              , v = $(window).height()
              , A = $(document).scrollLeft()
              , b = $(document).scrollTop();
            $("#luckysheet-moreFormat-dialog").css({
                left: (y + A - g) / 2,
                top: (v + b - p) / 3
            }).show(),
            $("#luckysheet-moreFormat-dialog .listbox .listItem").eq(0).addClass("on")
        },
        init: function() {
            $(document).on("click", "#luckysheet-moreFormat-dialog .listbox .listItem", (function() {
                $(this).addClass("on").siblings().removeClass("on")
            }
            )),
            $(document).off("click.moreFormatConfirm").on("click.moreFormatConfirm", "#luckysheet-moreFormat-dialog #luckysheet-moreFormat-dialog-confirm", (function() {
                $("#luckysheet-moreFormat-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").hide();
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = $("#luckysheet-moreFormat-dialog .listbox .listItem.on .value").text()
                  , r = $(this).parents("#luckysheet-moreFormat-dialog").find(".box").attr("id");
                if ("morecurrency" == r) {
                    if (-1 != t.indexOf("?"))
                        return;
                    var a = parseInt($("#luckysheet-moreFormat-dialog .decimal input").val().trim());
                    if ("NaN" == a.toString() || a < 0 || a > 9)
                        return void (isEditMode() ? alert("小数位数必须在0-9之间！") : tooltip.info("小数位数必须在0-9之间！", ""));
                    var n = "";
                    if (a > 0) {
                        for (var o = 1; o <= a; o++)
                            n += "0";
                        n = "0." + n
                    } else
                        n = "#";
                    var l = $("#luckysheet-moreFormat-dialog .listbox .listItem.on input:hidden").val();
                    "before" == l ? n = '"' + t + '" ' + n : "after" == l && (n = n + ' "' + t + '"'),
                    menuButton.updateFormat(e, "ct", n)
                } else
                    ("moredatetime" == r || "moredigit" == r) && menuButton.updateFormat(e, "ct", t)
            }
            ))
        }
    }
      , luckysheetSearchReplace = {
        createDialog: function(e) {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-search-replace").remove();
            var t = locale()
              , r = t.findAndReplace
              , a = t.button
              , n = '<div class="tabBox"><span id="searchTab">' + r.find + '</span><span id="replaceTab">' + r.replace + '</span></div><div class="ctBox"><div class="inputBox"><div class="textboxs" id="searchInput">' + r.findTextbox + '：<input class="formulaInputFocus" spellcheck="false" value=""/></div><div class="textboxs" id="replaceInput">' + r.replaceTextbox + '：<input class="formulaInputFocus" spellcheck="false" value=""/></div><div class="checkboxs"><div id="regCheck"><input type="checkbox"/><span>' + r.regexTextbox + '</span></div><div id="wordCheck"><input type="checkbox"/><span>' + r.wholeTextbox + '</span></div><div id="caseCheck"><input type="checkbox"/><span>' + r.distinguishTextbox + '</span></div></div></div><div class="btnBox"><button id="replaceAllBtn" class="btn btn-default">' + r.allReplaceBtn + '</button><button id="replaceBtn" class="btn btn-default">' + r.replaceBtn + '</button><button id="searchAllBtn" class="btn btn-default">' + r.allFindBtn + '</button><button id="searchNextBtn" class="btn btn-default">' + r.findBtn + "</button></div></div>";
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-search-replace",
                addclass: "luckysheet-search-replace",
                title: "",
                content: n,
                botton: '<button class="btn btn-default luckysheet-model-close-btn">' + a.close + "</button>",
                style: "z-index:100003",
                close: a.close
            }));
            var o = $("#luckysheet-search-replace").find(".luckysheet-modal-dialog-content").css("min-width", 500).end()
              , l = o.outerHeight()
              , i = o.outerWidth()
              , s = $(window).width()
              , c = $(window).height()
              , u = $(document).scrollLeft()
              , h = $(document).scrollTop();
            $("#luckysheet-search-replace").css({
                left: (s + u - i) / 2,
                top: (c + h - l) / 3
            }).show(),
            "0" == e ? ($("#luckysheet-search-replace #searchTab").addClass("on").siblings().removeClass("on"),
            $("#luckysheet-search-replace #replaceInput").hide(),
            $("#luckysheet-search-replace #replaceAllBtn").hide(),
            $("#luckysheet-search-replace #replaceBtn").hide()) : "1" == e && ($("#luckysheet-search-replace #replaceTab").addClass("on").siblings().removeClass("on"),
            $("#luckysheet-search-replace #replaceInput").show(),
            $("#luckysheet-search-replace #replaceAllBtn").show(),
            $("#luckysheet-search-replace #replaceBtn").show())
        },
        init: function() {
            var e = this;
            $(document).off("click.SRtabBoxspan").on("click.SRtabBoxspan", "#luckysheet-search-replace .tabBox span", (function() {
                $(this).addClass("on").siblings().removeClass("on");
                var e = $(this).attr("id");
                "searchTab" == e ? ($("#luckysheet-search-replace #replaceInput").hide(),
                $("#luckysheet-search-replace #replaceAllBtn").hide(),
                $("#luckysheet-search-replace #replaceBtn").hide(),
                $("#luckysheet-search-replace #searchInput input").focus()) : "replaceTab" == e && ($("#luckysheet-search-replace #replaceInput").show(),
                $("#luckysheet-search-replace #replaceAllBtn").show(),
                $("#luckysheet-search-replace #replaceBtn").show(),
                $("#luckysheet-search-replace #replaceInput input").focus())
            }
            )),
            $(document).off("keyup.SRsearchInput").on("keyup.SRsearchInput", "#luckysheet-search-replace #searchInput input", (function(t) {
                t.keyCode == keycode.ENTER && e.searchNext()
            }
            )),
            $(document).off("click.SRsearchNextBtn").on("click.SRsearchNextBtn", "#luckysheet-search-replace #searchNextBtn", (function() {
                e.searchNext()
            }
            )),
            $(document).off("click.SRsearchAllBtn").on("click.SRsearchAllBtn", "#luckysheet-search-replace #searchAllBtn", (function() {
                e.searchAll()
            }
            )),
            $(document).off("click.SRsearchAllboxItem").on("click.SRsearchAllboxItem", "#luckysheet-search-replace #searchAllbox .boxItem", (function() {
                $(this).addClass("on").siblings().removeClass("on");
                var e = $(this).attr("data-row")
                  , t = $(this).attr("data-col")
                  , r = $(this).attr("data-sheetIndex");
                r != Store.currentSheetIndex && sheetmanage.changeSheetExec(r),
                Store.luckysheet_select_save = [{
                    row: [e, e],
                    column: [t, t]
                }],
                selectHightlightShow();
                var a = $("#luckysheet-cell-main").scrollLeft()
                  , n = $("#luckysheet-cell-main").scrollTop()
                  , o = $("#luckysheet-cell-main").height()
                  , l = $("#luckysheet-cell-main").width()
                  , i = Store.visibledatarow[e]
                  , s = e - 1 == -1 ? 0 : Store.visibledatarow[e - 1]
                  , c = Store.visibledatacolumn[t]
                  , u = t - 1 == -1 ? 0 : Store.visibledatacolumn[t - 1];
                c - a - l + 20 > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(c - l + 20) : u - a - 20 < 0 && $("#luckysheet-scrollbar-x").scrollLeft(u - 20),
                i - n - o + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(i - o + 20) : s - n - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(s - 20)
            }
            )),
            $(document).off("click.SRreplaceBtn").on("click.SRreplaceBtn", "#luckysheet-search-replace #replaceBtn", (function() {
                e.replace()
            }
            )),
            $(document).off("click.SRreplaceAllBtn").on("click.SRreplaceAllBtn", "#luckysheet-search-replace #replaceAllBtn", (function() {
                e.replaceAll()
            }
            ))
        },
        searchNext: function() {
            var e = $("#luckysheet-search-replace #searchInput input").val();
            if ("" != e && null != e) {
                var t, r = locale().findAndReplace;
                t = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                    row: [0, Store.flowdata.length - 1],
                    column: [0, Store.flowdata[0].length - 1]
                }] : $.extend(!0, [], Store.luckysheet_select_save);
                var a = this.getSearchIndexArr(e, t);
                if (0 != a.length) {
                    var n = 0;
                    if (0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1]) {
                        if (0 == Store.luckysheet_select_save.length)
                            n = 0;
                        else
                            for (var o = 0; o < a.length; o++)
                                if (a[o].r == Store.luckysheet_select_save[0].row[0] && a[o].c == Store.luckysheet_select_save[0].column[0]) {
                                    n = o == a.length - 1 ? 0 : o + 1;
                                    break
                                }
                        Store.luckysheet_select_save = [{
                            row: [a[n].r, a[n].r],
                            column: [a[n].c, a[n].c]
                        }]
                    } else {
                        for (var l = t[t.length - 1].row_focus, i = t[t.length - 1].column_focus, s = 0; s < a.length; s++)
                            if (a[s].r == l && a[s].c == i) {
                                n = s == a.length - 1 ? 0 : s + 1;
                                break
                            }
                        for (var c = 0; c < t.length; c++) {
                            var u = t[c].row[0]
                              , h = t[c].row[1]
                              , d = t[c].column[0]
                              , f = t[c].column[1];
                            if (a[n].r >= u && a[n].r <= h && a[n].c >= d && a[n].c <= f) {
                                var m = t[c];
                                m.row_focus = a[n].r,
                                m.column_focus = a[n].c,
                                t.splice(c, 1),
                                t.push(m);
                                break
                            }
                        }
                        Store.luckysheet_select_save = t
                    }
                    selectHightlightShow();
                    var p = $("#luckysheet-cell-main").scrollLeft()
                      , g = $("#luckysheet-cell-main").scrollTop()
                      , y = $("#luckysheet-cell-main").height()
                      , v = $("#luckysheet-cell-main").width()
                      , A = Store.visibledatarow[a[n].r]
                      , b = a[n].r - 1 == -1 ? 0 : Store.visibledatarow[a[n].r - 1]
                      , k = Store.visibledatacolumn[a[n].c]
                      , w = a[n].c - 1 == -1 ? 0 : Store.visibledatacolumn[a[n].c - 1];
                    k - p - v + 20 > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(k - v + 20) : w - p - 20 < 0 && $("#luckysheet-scrollbar-x").scrollLeft(w - 20),
                    A - g - y + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(A - y + 20) : b - g - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(b - 20),
                    $("#searchAllbox").is(":visible") && $("#luckysheet-search-replace #searchAllbox .boxItem").removeClass("on")
                } else
                    isEditMode() ? alert(r.noFindTip) : tooltip.info(r.noFindTip, "")
            }
        },
        searchAll: function() {
            var e = locale().findAndReplace;
            $("#luckysheet-search-replace #searchAllbox").remove();
            var t = $("#luckysheet-search-replace #searchInput input").val();
            if ("" != t && null != t) {
                var r;
                r = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                    row: [0, Store.flowdata.length - 1],
                    column: [0, Store.flowdata[0].length - 1]
                }] : $.extend(!0, [], Store.luckysheet_select_save);
                var a = this.getSearchIndexArr(t, r);
                if (0 != a.length) {
                    for (var n = "", o = 0; o < a.length; o++) {
                        var l = valueShowEs(a[o].r, a[o].c, Store.flowdata).toString();
                        l.indexOf("</") > -1 && l.indexOf(">") > -1 ? n += '<div class="boxItem" data-row="' + a[o].r + '" data-col="' + a[o].c + '" data-sheetIndex="' + Store.currentSheetIndex + '"><span>' + Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].name + "</span><span>" + chatatABC(a[o].c) + (a[o].r + 1) + "</span><span>" + l + "</span></div>" : n += '<div class="boxItem" data-row="' + a[o].r + '" data-col="' + a[o].c + '" data-sheetIndex="' + Store.currentSheetIndex + '"><span>' + Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].name + "</span><span>" + chatatABC(a[o].c) + (a[o].r + 1) + '</span><span title="' + l + '">' + l + "</span></div>"
                    }
                    $('<div id="searchAllbox"><div class="boxTitle"><span>' + e.searchTargetSheet + "</span><span>" + e.searchTargetCell + "</span><span>" + e.searchTargetValue + '</span></div><div class="boxMain">' + n + "</div></div>").appendTo($("#luckysheet-search-replace")),
                    $("#luckysheet-search-replace #searchAllbox .boxItem").eq(0).addClass("on").siblings().removeClass("on"),
                    Store.luckysheet_select_save = [{
                        row: [a[0].r, a[0].r],
                        column: [a[0].c, a[0].c]
                    }],
                    selectHightlightShow()
                } else
                    isEditMode() ? alert(e.noFindTip) : tooltip.info(e.noFindTip, "")
            }
        },
        getSearchIndexArr: function(e, t) {
            var r = []
              , a = {}
              , n = !1;
            $("#luckysheet-search-replace #regCheck input[type='checkbox']").is(":checked") && (n = !0);
            var o = !1;
            $("#luckysheet-search-replace #wordCheck input[type='checkbox']").is(":checked") && (o = !0);
            var l = !1;
            $("#luckysheet-search-replace #caseCheck input[type='checkbox']").is(":checked") && (l = !0);
            for (var i = 0; i < t.length; i++)
                for (var s = t[i].row[0], c = t[i].row[1], u = t[i].column[0], h = t[i].column[1], d = s; d <= c; d++)
                    for (var f = u; f <= h; f++) {
                        if (null != Store.flowdata[d][f]) {
                            var m = valueShowEs(d, f, Store.flowdata);
                            if (0 == m && (m = m.toString()),
                            null != m && "" != m)
                                if (m = m.toString(),
                                o)
                                    if (l)
                                        e == m && (d + "_" + f in a || (a[d + "_" + f] = 0,
                                        r.push({
                                            r: d,
                                            c: f
                                        })));
                                    else
                                        e.toLowerCase() == m.toLowerCase() && (d + "_" + f in a || (a[d + "_" + f] = 0,
                                        r.push({
                                            r: d,
                                            c: f
                                        })));
                                else if (n) {
                                    (l ? new RegExp(func_methods.getRegExpStr(e),"g") : new RegExp(func_methods.getRegExpStr(e),"ig")).test(m) && (d + "_" + f in a || (a[d + "_" + f] = 0,
                                    r.push({
                                        r: d,
                                        c: f
                                    })))
                                } else if (l) {
                                    new RegExp(func_methods.getRegExpStr(e),"g").test(m) && (d + "_" + f in a || (a[d + "_" + f] = 0,
                                    r.push({
                                        r: d,
                                        c: f
                                    })))
                                } else {
                                    new RegExp(func_methods.getRegExpStr(e),"ig").test(m) && (d + "_" + f in a || (a[d + "_" + f] = 0,
                                    r.push({
                                        r: d,
                                        c: f
                                    })))
                                }
                        }
                    }
            return r
        },
        replace: function() {
            var e = locale().findAndReplace;
            if (Store.allowEdit) {
                var t = $("#luckysheet-search-replace #searchInput input").val();
                if ("" != t && null != t) {
                    var r;
                    r = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                        row: [0, Store.flowdata.length - 1],
                        column: [0, Store.flowdata[0].length - 1]
                    }] : $.extend(!0, [], Store.luckysheet_select_save);
                    var a = this.getSearchIndexArr(t, r);
                    if (0 != a.length) {
                        for (var n = null, o = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1], l = o.row_focus, i = o.column_focus, s = 0; s < a.length; s++)
                            if (a[s].r == l && a[s].c == i) {
                                n = s;
                                break
                            }
                        if (null == n) {
                            if (0 == a.length)
                                return void (isEditMode() ? alert(e.noMatchTip) : tooltip.info(e.noMatchTip, ""));
                            n = 0
                        }
                        $("#luckysheet-search-replace #regCheck input[type='checkbox']").is(":checked");
                        var c = !1;
                        $("#luckysheet-search-replace #wordCheck input[type='checkbox']").is(":checked") && (c = !0);
                        var u = !1;
                        $("#luckysheet-search-replace #caseCheck input[type='checkbox']").is(":checked") && (u = !0);
                        var h, d, f, m = $("#luckysheet-search-replace #replaceInput input").val(), p = editor.deepCopyFlowData(Store.flowdata);
                        if (c)
                            setcellvalue(h = a[n].r, d = a[n].c, p, m);
                        else
                            f = u ? new RegExp(func_methods.getRegExpStr(t),"g") : new RegExp(func_methods.getRegExpStr(t),"ig"),
                            setcellvalue(h = a[n].r, d = a[n].c, p, valueShowEs(h, d, p).toString().replace(f, m));
                        Store.luckysheet_select_save = [{
                            row: [h, h],
                            column: [d, d]
                        }],
                        $("#luckysheet-search-replace #searchAllbox").is(":visible") && $("#luckysheet-search-replace #searchAllbox").hide(),
                        jfrefreshgrid(p, Store.luckysheet_select_save),
                        selectHightlightShow();
                        var g = $("#luckysheet-cell-main").scrollLeft()
                          , y = $("#luckysheet-cell-main").scrollTop()
                          , v = $("#luckysheet-cell-main").height()
                          , A = $("#luckysheet-cell-main").width()
                          , b = Store.visibledatarow[h]
                          , k = h - 1 == -1 ? 0 : Store.visibledatarow[h - 1]
                          , w = Store.visibledatacolumn[d]
                          , x = d - 1 == -1 ? 0 : Store.visibledatacolumn[d - 1];
                        w - g - A + 20 > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(w - A + 20) : x - g - 20 < 0 && $("#luckysheet-scrollbar-x").scrollLeft(x - 20),
                        b - y - v + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(b - v + 20) : k - y - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(k - 20)
                    } else
                        isEditMode() ? alert(e.noReplceTip) : tooltip.info(e.noReplceTip, "")
                } else
                    isEditMode() ? alert(e.searchInputTip) : tooltip.info(e.searchInputTip, "")
            } else
                tooltip.info(e.modeTip, "")
        },
        replaceAll: function() {
            var e = locale().findAndReplace;
            if (Store.allowEdit) {
                var t = $("#luckysheet-search-replace #searchInput input").val();
                if ("" != t && null != t) {
                    var r;
                    r = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                        row: [0, Store.flowdata.length - 1],
                        column: [0, Store.flowdata[0].length - 1]
                    }] : $.extend(!0, [], Store.luckysheet_select_save);
                    var a = this.getSearchIndexArr(t, r);
                    if (0 != a.length) {
                        $("#luckysheet-search-replace #regCheck input[type='checkbox']").is(":checked");
                        var n = !1;
                        $("#luckysheet-search-replace #wordCheck input[type='checkbox']").is(":checked") && (n = !0);
                        var o = !1;
                        $("#luckysheet-search-replace #caseCheck input[type='checkbox']").is(":checked") && (o = !0);
                        var l = $("#luckysheet-search-replace #replaceInput input").val()
                          , i = editor.deepCopyFlowData(Store.flowdata);
                        if (n)
                            for (var s = 0; s < a.length; s++) {
                                var c = a[s].r
                                  , u = a[s].c;
                                setcellvalue(c, u, i, l),
                                r.push({
                                    row: [c, c],
                                    column: [u, u]
                                })
                            }
                        else {
                            var h;
                            h = o ? new RegExp(func_methods.getRegExpStr(t),"g") : new RegExp(func_methods.getRegExpStr(t),"ig");
                            for (var d = 0; d < a.length; d++) {
                                var f = a[d].r
                                  , m = a[d].c;
                                setcellvalue(f, m, i, valueShowEs(f, m, i).toString().replace(h, l)),
                                r.push({
                                    row: [f, f],
                                    column: [m, m]
                                })
                            }
                        }
                        $("#luckysheet-search-replace #searchAllbox").is(":visible") && $("#luckysheet-search-replace #searchAllbox").hide(),
                        jfrefreshgrid(i, r),
                        Store.luckysheet_select_save = $.extend(!0, [], r),
                        selectHightlightShow();
                        var p = replaceHtml$1(e.successTip, {
                            xlength: a.length
                        });
                        isEditMode() ? alert(p) : tooltip.info(p, "")
                    } else
                        isEditMode() ? alert(e.noReplceTip) : tooltip.info(e.noReplceTip, "")
                } else
                    isEditMode() ? alert(e.searchInputTip) : tooltip.info(e.searchInputTip, "")
            } else
                tooltip.info(e.modeTip, "")
        }
    }
      , luckysheetLocationCell = {
        createDialog: function() {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-locationCell-dialog").remove();
            var e = locale()
              , t = e.findAndReplace
              , r = e.button
              , a = '<div class="listbox"><div class="listItem"><input type="radio" name="locationType" checked="checked" id="locationConstant"><label for="locationConstant">' + t.locationConstant + '</label><div class="subbox"><div class="subItem"><input type="checkbox" checked="checked" class="date" id="locationConstantDate"><label for="locationConstantDate">' + t.locationDate + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="number" id="locationConstantNumber"><label for="locationConstantNumber">' + t.locationDigital + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="string" id="locationConstantString"><label for="locationConstantString">' + t.locationString + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="boolean" id="locationConstantBoolean"><label for="locationConstantBoolean">' + t.locationBool + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="error" id="locationConstantError"><label for="locationConstantError">' + t.locationBool + '</label></div></div></div><div class="listItem"><input type="radio" name="locationType" id="locationFormula"><label for="locationFormula">' + t.locationFormula + '</label><div class="subbox"><div class="subItem"><input type="checkbox" checked="checked" class="date" id="locationFormulaDate" disabled="true"><label for="locationFormulaDate" style="color: #666">' + t.locationDate + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="number" id="locationFormulaNumber" disabled="true"><label for="locationFormulaNumber" style="color: #666">' + t.locationDigital + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="string" id="locationFormulaString" disabled="true"><label for="locationFormulaString" style="color: #666">' + t.locationString + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="boolean" id="locationFormulaBoolean" disabled="true"><label for="locationFormulaBoolean" style="color: #666">' + t.locationBool + '</label></div><div class="subItem"><input type="checkbox" checked="checked" class="error" id="locationFormulaError" disabled="true"><label for="locationFormulaError" style="color: #666">' + t.locationError + '</label></div></div></div><div class="listItem"><input type="radio" name="locationType" id="locationNull"><label for="locationNull">' + t.locationNull + '</label></div><div class="listItem"><input type="radio" name="locationType" id="locationCF"><label for="locationCF">' + t.locationCondition + '</label></div><div class="listItem"><input type="radio" name="locationType" id="locationStepRow"><label for="locationStepRow">' + t.locationRowSpan + '</label></div><div class="listItem"><input type="radio" name="locationType" id="locationStepColumn"><label for="locationStepColumn">' + t.locationColumnSpan + "</label></div></div>";
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-locationCell-dialog",
                addclass: "luckysheet-locationCell-dialog",
                title: t.location,
                content: a,
                botton: '<button id="luckysheet-locationCell-dialog-confirm" class="btn btn-primary">' + r.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + r.cancel + "</button>",
                style: "z-index:100003"
            }));
            var n = $("#luckysheet-locationCell-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-locationCell-dialog").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show()
        },
        init: function() {
            var e = this
              , t = locale().findAndReplace;
            $(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", (function(e) {
                $("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", !0),
                $("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666"),
                $(this).siblings(".subbox").find("input:checkbox").removeAttr("disabled"),
                $(this).siblings(".subbox").find("label").css("color", "#000")
            }
            )),
            $(document).off("click.locationCellConfirm").on("click.locationCellConfirm", "#luckysheet-locationCell-dialog #luckysheet-locationCell-dialog-confirm", (function() {
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-locationCell-dialog").hide();
                var r = $("#luckysheet-locationCell-dialog .listItem input:radio:checked")
                  , a = r.attr("id");
                if ("locationConstant" == a || "locationFormula" == a) {
                    var n, o, l = r.siblings(".subbox").find("input:checkbox:checked");
                    if (0 == l.length)
                        return;
                    if (5 == l.length)
                        n = "all";
                    else {
                        for (var i = [], s = 0; s < l.length; s++)
                            $(l[s]).hasClass("date") ? i.push("d") : $(l[s]).hasClass("number") ? i.push("n") : $(l[s]).hasClass("string") ? i.push("s,g") : $(l[s]).hasClass("boolean") ? i.push("b") : $(l[s]).hasClass("error") && i.push("e");
                        n = i.join(",")
                    }
                    o = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                        row: [0, Store.flowdata.length - 1],
                        column: [0, Store.flowdata[0].length - 1]
                    }] : $.extend(!0, [], Store.luckysheet_select_save),
                    e.apply(o, a, n)
                } else if ("locationStepRow" == a) {
                    if (0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1])
                        return void (isEditMode() ? alert(t.locationTiplessTwoRow) : tooltip.info("", t.locationTiplessTwoRow));
                    var c = $.extend(!0, [], Store.luckysheet_select_save);
                    e.apply(c, "locationStepRow")
                } else if ("locationStepColumn" == a) {
                    if (0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1])
                        return void (isEditMode() ? alert(t.locationTiplessTwoColumn) : tooltip.info("", t.locationTiplessTwoColumn));
                    var u = $.extend(!0, [], Store.luckysheet_select_save);
                    e.apply(u, "locationStepColumn")
                } else {
                    var h;
                    h = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? [{
                        row: [0, Store.flowdata.length - 1],
                        column: [0, Store.flowdata[0].length - 1]
                    }] : $.extend(!0, [], Store.luckysheet_select_save),
                    e.apply(h, a)
                }
            }
            ))
        },
        apply: function(e, t, r) {
            var a = locale().findAndReplace
              , n = [];
            if ("locationFormula" == t || "locationConstant" == t || "locationNull" == t) {
                for (var o = null, l = null, i = null, s = null, c = {}, u = 0; u < e.length; u++) {
                    var h = e[u].row[0]
                      , d = e[u].row[1]
                      , f = e[u].column[0]
                      , m = e[u].column[1];
                    (null == o || o < h) && (o = h),
                    (null == l || l > d) && (l = d),
                    (null == i || i < f) && (i = f),
                    (null == s || s > m) && (s = m);
                    for (var p = h; p <= d; p++)
                        for (var g = f; g <= m; g++) {
                            var y = Store.flowdata[p][g];
                            null != y && null != y.mc && (y = Store.flowdata[y.mc.r][y.mc.c]),
                            "locationFormula" == t && null != y && !isRealNull(y.v) && null != y.f && ("all" == r || null != y.ct && r.indexOf(y.ct.t) > -1) || "locationConstant" == t && null != y && !isRealNull(y.v) && ("all" == r || null != y.ct && r.indexOf(y.ct.t) > -1) ? c[p + "_" + g] = 0 : "locationNull" != t || null != y && !isRealNull(y.v) || (c[p + "_" + g] = 0)
                        }
                }
                n = this.getRangeArr(o, l, i, s, c, n)
            } else if ("locationCF" == t) {
                var v = getSheetIndex(Store.currentSheetIndex)
                  , A = Store.luckysheetfile[v].luckysheet_conditionformat_save
                  , b = Store.luckysheetfile[v].data;
                if (null == A || 0 == A.length)
                    return void (isEditMode() ? alert(a.locationTipNotFindCell) : tooltip.info("", a.locationTipNotFindCell));
                if (computeMap = conditionformat.compute(A, b),
                0 == Object.keys(computeMap).length)
                    return void (isEditMode() ? alert(a.locationTipNotFindCell) : tooltip.info("", a.locationTipNotFindCell));
                for (var k = null, w = null, x = null, S = null, _ = {}, C = 0; C < e.length; C++) {
                    var T = e[C].row[0]
                      , E = e[C].row[1]
                      , I = e[C].column[0]
                      , R = e[C].column[1];
                    (null == k || k < T) && (k = T),
                    (null == w || w > E) && (w = E),
                    (null == x || x < I) && (x = I),
                    (null == S || S > R) && (S = R);
                    for (var B = T; B <= E; B++)
                        for (var N = I; N <= R; N++)
                            B + "_" + N in computeMap && (_[B + "_" + N] = 0)
                }
                n = this.getRangeArr(k, w, x, S, _, n)
            } else if ("locationStepRow" == t) {
                for (var F = 0; F < e.length; F++)
                    if (e[F].row[0] != e[F].row[1])
                        for (var P = e[F].row[0], L = e[F].row[1], O = e[F].column[0], D = e[F].column[1], M = P; M <= L; M++)
                            (M - P) % 2 == 0 && n.push({
                                row: [M, M],
                                column: [O, D]
                            })
            } else if ("locationStepColumn" == t)
                for (var U = 0; U < e.length; U++)
                    if (e[U].column[0] != e[U].column[1])
                        for (var H = e[U].row[0], q = e[U].row[1], z = e[U].column[0], j = e[U].column[1], V = z; V <= j; V++)
                            (V - z) % 2 == 0 && n.push({
                                row: [H, q],
                                column: [V, V]
                            });
            if (0 == n.length)
                isEditMode() ? alert(a.locationTipNotFindCell) : tooltip.info("", a.locationTipNotFindCell);
            else {
                Store.luckysheet_select_save = n,
                selectHightlightShow();
                var Q = $("#luckysheet-cell-main").scrollLeft()
                  , G = $("#luckysheet-cell-main").scrollTop()
                  , K = $("#luckysheet-cell-main").height()
                  , W = $("#luckysheet-cell-main").width()
                  , Y = Store.luckysheet_select_save[0].row[0]
                  , X = Store.luckysheet_select_save[0].row[1]
                  , J = Store.luckysheet_select_save[0].column[0]
                  , Z = Store.luckysheet_select_save[0].column[1]
                  , ee = Store.visibledatarow[X]
                  , te = Y - 1 == -1 ? 0 : Store.visibledatarow[Y - 1]
                  , re = Store.visibledatacolumn[Z]
                  , ae = J - 1 == -1 ? 0 : Store.visibledatacolumn[J - 1];
                re - Q - W + 20 > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(re - W + 20) : ae - Q - 20 < 0 && $("#luckysheet-scrollbar-x").scrollLeft(ae - 20),
                ee - G - K + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(ee - K + 20) : te - G - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(te - 20)
            }
        },
        getRangeArr: function(e, t, r, a, n, o) {
            if (0 == Object.keys(n).length)
                return o;
            for (var l = null, i = null, s = null, c = null, u = e; u <= t; u++)
                for (var h = r; h <= a; h++) {
                    var d = Store.flowdata[u][h];
                    if (u + "_" + h in n) {
                        if (null != d && null != d.mc) {
                            if (null == s) {
                                var f = {
                                    row: [d.mc.r, d.mc.r + d.mc.rs - 1],
                                    column: [d.mc.c, d.mc.c + d.mc.cs - 1]
                                };
                                return o.push(f),
                                n = this.deleteCellInSave(n, f),
                                this.getRangeArr(e, t, r, a, n, o)
                            }
                            if (h < c) {
                                var m = {
                                    row: [l, i],
                                    column: [s, c]
                                };
                                return o.push(m),
                                n = this.deleteCellInSave(n, m),
                                this.getRangeArr(e, t, r, a, n, o)
                            }
                            break
                        }
                        null == s ? (s = h,
                        c = h,
                        l = u,
                        i = u) : h > c && (c = h)
                    } else if (null != s) {
                        if (null != d && null != d.mc)
                            break;
                        if (h < s)
                            ;
                        else {
                            if (h <= c) {
                                var p = {
                                    row: [l, i],
                                    column: [s, c]
                                };
                                return o.push(p),
                                n = this.deleteCellInSave(n, p),
                                this.getRangeArr(e, t, r, a, n, o)
                            }
                            i = u
                        }
                    }
                }
            if (null != s) {
                var g = {
                    row: [l, i],
                    column: [s, c]
                };
                return o.push(g),
                n = this.deleteCellInSave(n, g),
                this.getRangeArr(e, t, r, a, n, o)
            }
        },
        deleteCellInSave: function(e, t) {
            for (var r = t.row[0]; r <= t.row[1]; r++)
                for (var a = t.column[0]; a <= t.column[1]; a++)
                    delete e[r + "_" + a];
            return e
        }
    }
      , cellDatePickerCtrl = {
        cellFocus: function(e, t, r) {
            var a = Store.visibledatarow[e]
              , n = 0 == e ? 0 : Store.visibledatarow[e - 1]
              , o = Store.visibledatacolumn[t]
              , l = 0 == t ? 0 : Store.visibledatacolumn[t - 1]
              , i = menuButton.mergeborer(Store.flowdata, e, t);
            i && (a = i.row[1],
            n = i.row[0],
            o = i.column[1],
            l = i.column[0]),
            $(".cell-date-picker").show().css({
                width: o - l + 1,
                height: a - n + 1,
                left: l,
                top: n
            }),
            $("#cellDatePickerBtn").daterangepicker({
                singleDatePicker: !0,
                startDate: moment(r),
                endDate: moment(r)
            }, (function(e) {
                $("#luckysheet-rich-text-editor").html(e.format("YYYY-MM-DD")),
                luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1])
            }
            )),
            $("#cellDatePickerBtn").click()
        }
    };
    function luckysheetupdateCell(e, t, r, a, n) {
        if (checkProtectionLocked(e, t, Store.currentSheetIndex)) {
            if (!isEditMode() && !1 !== Store.allowEdit) {
                if (null != dataVerificationCtrl.dataVerification && null != dataVerificationCtrl.dataVerification[e + "_" + t]) {
                    var o = dataVerificationCtrl.dataVerification[e + "_" + t];
                    if ("dropdown" == o.type)
                        dataVerificationCtrl.dropdownListShow();
                    else if ("checkbox" == o.type)
                        return
                }
                var l = getColumnAndRowSize(e, t, r)
                  , i = l.row
                  , s = l.row_pre
                  , c = l.col
                  , u = l.col_pre
                  , h = l.row_index
                  , d = l.col_index;
                $("#luckysheet-dropCell-icon").is(":visible") && $("#luckysheet-dropCell-icon").remove();
                var f = $(window).height()
                  , m = $(window).width()
                  , p = $("#" + Store.container).offset()
                  , g = $("#luckysheet-cell-main").scrollLeft()
                  , y = $("#luckysheet-cell-main").scrollTop();
                if (!pivotTable.isPivotRange(h, d)) {
                    var v = u + p.left + Store.rowHeaderWidth - g - 2;
                    null != luckysheetFreezen.freezenverticaldata && t <= luckysheetFreezen.freezenverticaldata[1] && (v = u + p.left + Store.rowHeaderWidth - 2);
                    var A = s + p.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - y - 2;
                    null != luckysheetFreezen.freezenhorizontaldata && e <= luckysheetFreezen.freezenhorizontaldata[1] && (A = s + p.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - 2);
                    var b = {
                        "min-width": c - u + 1 - 8,
                        "min-height": i - s + 1 - 4,
                        "max-width": m + g - u - 20 - Store.rowHeaderWidth,
                        "max-height": f + y - s - 20 - 15 - Store.toolbarHeight - Store.infobarHeight - Store.calculatebarHeight - Store.sheetBarHeight - Store.statisticBarHeight,
                        left: v,
                        top: A
                    }
                      , k = {
                        transform: "scale(" + Store.zoomRatio + ")",
                        "transform-origin": "left top",
                        width: 100 / Store.zoomRatio + "%",
                        height: 100 / Store.zoomRatio + "%"
                    };
                    Store.luckysheetCellUpdate = [h, d],
                    n || $("#luckysheet-rich-text-editor").focus().select(),
                    $("#luckysheet-input-box").removeAttr("style").css({
                        "background-color": "rgb(255, 255, 255)",
                        padding: "0px 2px",
                        "font-size": "13px",
                        right: "auto",
                        "overflow-y": "auto",
                        "box-sizing": "initial",
                        display: "flex"
                    }),
                    null == luckysheetFreezen.freezenverticaldata && null == luckysheetFreezen.freezenhorizontaldata || $("#luckysheet-input-box").css("z-index", 10002),
                    $("#luckysheet-input-box-index").html(chatatABC(d) + (h + 1)).hide(),
                    $("#luckysheet-wa-functionbox-cancel, #luckysheet-wa-functionbox-confirm").addClass("luckysheet-wa-calculate-active");
                    var w = ""
                      , x = !1;
                    if (null != r[h] && null != r[h][d]) {
                        var S = r[h][d]
                          , _ = S.ht
                          , C = "left"
                          , T = "top";
                        "0" == _ ? (b = {
                            "min-width": c - u + 1 - 8,
                            "min-height": i - s + 1 - 4,
                            "max-width": 2 * m / 3,
                            "max-height": f + y - s - 20 - 15 - Store.toolbarHeight - Store.infobarHeight - Store.calculatebarHeight - Store.sheetBarHeight - Store.statisticBarHeight,
                            left: u + p.left + Store.rowHeaderWidth - g - 2,
                            top: s + p.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - y - 2
                        },
                        Store.zoomRatio < 1 && (C = "center"),
                        x = !0) : "2" == _ && (b = {
                            "min-width": c - u + 1 - 8,
                            "min-height": i - s + 1 - 4,
                            "max-width": c + p.left - g - 8,
                            "max-height": f + y - s - 20 - 15 - Store.toolbarHeight - Store.infobarHeight - Store.calculatebarHeight - Store.sheetBarHeight - Store.statisticBarHeight,
                            right: m - (p.left + (Store.rowHeaderWidth - 1) - g) - c,
                            top: s + p.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - y - 2
                        },
                        Store.zoomRatio < 1 && (C = "right")),
                        "0" == S.vt ? T = "center" : "2" == S.vt && (T = "bottom"),
                        k["transform-origin"] = C + " " + T,
                        a || (isInlineStringCell(S) ? w = getInlineStringStyle(h, d, r) : null != S.f ? w = getcellvalue(h, d, r, "f") : (w = valueShowEs(h, d, r),
                        "1" == S.qp && (w = "'" + w)));
                        var E = menuButton.getStyleByCell(r, h, d);
                        E = $("#luckysheet-input-box").get(0).style.cssText + E,
                        $("#luckysheet-input-box").get(0).style.cssText = E,
                        "rgba(0, 0, 0, 0)" == $("#luckysheet-input-box").get(0).style.backgroundColor && ($("#luckysheet-input-box").get(0).style.background = "rgb(255,255,255)")
                    } else {
                        var I = alternateformat.getComputeMap()
                          , R = alternateformat.checksAF(h, d, I)
                          , B = conditionformat.getComputeMap()
                          , N = conditionformat.checksCF(h, d, B);
                        null != N && null != N.cellColor ? $("#luckysheet-input-box").get(0).style.background = N.cellColor : null != R && ($("#luckysheet-input-box").get(0).style.background = R[1])
                    }
                    if (b["min-height"] > b["max-height"] && (b["min-height"] = b["max-height"]),
                    b["min-width"] > b["max-width"] && (b["min-width"] = b["max-width"]),
                    null != w && "" != w.toString() || a || (w = "<br/>"),
                    !checkProtectionCellHidden(h, d, Store.currentSheetIndex) && w.length > 0 && '<span dir="auto" class="luckysheet-formula-text-color">=</span>' == w.substr(0, 63) ? $("#luckysheet-rich-text-editor").html("") : ($("#luckysheet-rich-text-editor").html(w),
                    n || luckysheetRangeLast($("#luckysheet-rich-text-editor")[0])),
                    x) {
                        var F = $("#luckysheet-input-box").width();
                        F > b["max-width"] && (F = b["max-width"]),
                        F < b["min-width"] && (F = b["min-width"]);
                        var P = b.left - F / 2 + (c - u) / 2;
                        P < 2 && (P = 2),
                        b.left = P - 2
                    }
                    $("#luckysheet-input-box").css(b),
                    $("#luckysheet-rich-text-editor").css(k),
                    r[e][t] && r[e][t].ct && "d" == r[e][t].ct.t && cellDatePickerCtrl.cellFocus(e, t, r[e][t].m),
                    luckysheetformula.rangetosheet = Store.currentSheetIndex,
                    luckysheetformula.createRangeHightlight(),
                    luckysheetformula.rangeResizeTo = $("#luckysheet-rich-text-editor"),
                    cleargridelement()
                }
            }
        } else
            $("#luckysheet-functionbox-cell").blur()
    }
    function setCenterInputPosition(e, t, r) {
        if (null != e && null != t) {
            var a = r[e][t];
            if (null != a) {
                var n = a.ht;
                if (null == a || "0" == n) {
                    var o = getColumnAndRowSize(e, t, r)
                      , l = o.col
                      , i = o.col_pre
                      , s = ($(window).height(),
                    $(window).width())
                      , c = $("#" + Store.container).offset()
                      , u = $("#luckysheet-cell-main").scrollLeft()
                      , h = ($("#luckysheet-cell-main").scrollTop(),
                    {
                        "min-width": l - i + 1 - 8,
                        "max-width": 2 * s / 3,
                        left: i + c.left + Store.rowHeaderWidth - u - 2
                    })
                      , d = $("#luckysheet-input-box").width();
                    d > h["max-width"] && (d = h["max-width"]),
                    d < h["min-width"] && (d = h["min-width"]);
                    var f = h.left - d / 2 + (l - i) / 2;
                    f < 2 && (f = 2),
                    h.left = f - 2,
                    $("#luckysheet-input-box").css(h)
                }
            }
        }
    }
    function getColumnAndRowSize(e, t, r) {
        var a = Store.visibledatarow[e]
          , n = e - 1 == -1 ? 0 : Store.visibledatarow[e - 1]
          , o = Store.visibledatacolumn[t]
          , l = t - 1 == -1 ? 0 : Store.visibledatacolumn[t - 1];
        null == r && (r = Store.flowdata);
        var i = menuButton.mergeborer(r, e, t);
        return i && (a = i.row[1],
        n = i.row[0],
        e = i.row[2],
        o = i.column[1],
        l = i.column[0],
        t = i.column[2]),
        {
            row: a,
            row_pre: n,
            row_index: e,
            col: o,
            col_pre: l,
            col_index: t
        }
    }
    var ifFormulaGenerator = {
        singleRangeFocus: !1,
        init: function() {
            var e = this
              , t = locale()
              , r = t.formula;
            t.button;
            $(document).off("focus.IFcompareValue").on("focus.IFcompareValue", "#luckysheet-ifFormulaGenerator-dialog #compareValue", (function() {
                $("#luckysheet-modal-dialog-mask").hide(),
                e.singleRangeFocus = !0
            }
            )),
            $(document).off("click.IFsingRange").on("click.IFsingRange", "#luckysheet-ifFormulaGenerator-dialog .singRange", (function() {
                var t = $("#luckysheet-ifFormulaGenerator-dialog #compareValue").val().trim();
                luckysheetformula.iscelldata(t) ? e.singleRangeDialog(t) : e.singleRangeDialog()
            }
            )),
            $(document).off("click.IFsingRangeConfirm").on("click.IFsingRangeConfirm", "#luckysheet-ifFormulaGenerator-singleRange-confirm", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-ifFormulaGenerator-singleRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show();
                var t = $(this).parents("#luckysheet-ifFormulaGenerator-singleRange-dialog").find("input").val().trim();
                $("#luckysheet-ifFormulaGenerator-dialog #compareValue").val(t),
                e.singleRangeFocus = !1
            }
            )),
            $(document).off("click.IFsingRangeCancel").on("click.IFsingRangeCancel", "#luckysheet-ifFormulaGenerator-singleRange-cancel", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-ifFormulaGenerator-singleRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show(),
                e.singleRangeFocus = !1
            }
            )),
            $(document).off("click.IFsingRangeClose").on("click.IFsingRangeClose", "#luckysheet-ifFormulaGenerator-singleRange-dialog .luckysheet-modal-dialog-title-close", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show(),
                e.singleRangeFocus = !1
            }
            )),
            $(document).off("click.IFmultiRange").on("click.IFmultiRange", "#luckysheet-ifFormulaGenerator-dialog .multiRange", (function() {
                e.multiRangeDialog(),
                e.singleRangeFocus = !1
            }
            )),
            $(document).off("click.IFmultiRangeConfirm").on("click.IFmultiRangeConfirm", "#luckysheet-ifFormulaGenerator-multiRange-confirm", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide(),
                $("#luckysheet-ifFormulaGenerator-multiRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show();
                for (var e = $(this).parents("#luckysheet-ifFormulaGenerator-multiRange-dialog").find("input").val().trim(), t = luckysheetformula.getcellrange(e), r = t.row[0], a = t.row[1], n = t.column[0], o = t.column[1], l = editor.deepCopyFlowData(Store.flowdata), i = [], s = r; s <= a; s++)
                    for (var c = n; c <= o; c++)
                        null != l[s] && null != l[s][c] && null != l[s][c].ct && "n" == l[s][c].ct.t && i.push(l[s][c].v);
                for (var u = 0; u < i.length; u++)
                    for (var h = 0; h < i.length - 1 - u; h++)
                        if (i[h] < i[h + 1]) {
                            var d = i[h];
                            i[h] = i[h + 1],
                            i[h + 1] = d
                        }
                var f = i[0]
                  , m = i[i.length - 1];
                $("#luckysheet-ifFormulaGenerator-dialog #smallRange").val(m),
                $("#luckysheet-ifFormulaGenerator-dialog #largeRange").val(f)
            }
            )),
            $(document).off("click.IFmultiRangeCancel").on("click.IFmultiRangeCancel", "#luckysheet-ifFormulaGenerator-multiRange-cancel", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide(),
                $("#luckysheet-ifFormulaGenerator-multiRange-dialog").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show()
            }
            )),
            $(document).off("click.IFmultiRangeClose").on("click.IFmultiRangeClose", "#luckysheet-ifFormulaGenerator-multiRange-dialog .luckysheet-modal-dialog-title-close", (function() {
                $("#luckysheet-formula-functionrange-select").hide(),
                $("#luckysheet-row-count-show").hide(),
                $("#luckysheet-column-count-show").hide(),
                $("#luckysheet-modal-dialog-mask").show(),
                $("#luckysheet-ifFormulaGenerator-dialog").show()
            }
            )),
            $(document).on("change", "#DivisionMethod", (function() {
                "2" == $(this).find("option:selected").val() ? $("#DivisionMethodVal").hide() : $("#DivisionMethodVal").show(),
                $("#luckysheet-ifFormulaGenerator-dialog .ifList").empty()
            }
            )),
            $(document).off("click.IFcreateBtn").on("click.IFcreateBtn", "#luckysheet-ifFormulaGenerator-dialog #createBtn", (function() {
                var t = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find("#compareValue").val().trim();
                if ("" != t) {
                    var a = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find("#DivisionMethod option:selected").val();
                    if ("2" == a) {
                        var n = '<div class="item"><input type="number" class="smallNum formulaInputFocus"/><select class="operator"><option value="0"> <= </option><option value="1"> < </option></select><span class="compareValue">' + t + '</span><select class="operator2"><option value="0"> <= </option><option value="1" selected="selected"> < </option></select><input type="number" class="largeNum formulaInputFocus"/><span>' + r.ifGenTipLableTitile + '：</span><input type="text" class="markText formulaInputFocus" value=""><i class="fa fa-remove" aria-hidden="true"></i></div>';
                        $("#luckysheet-ifFormulaGenerator-dialog .ifList").append(n)
                    } else {
                        var o = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find("#smallRange").val().trim()
                          , l = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find("#largeRange").val().trim()
                          , i = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find("#DivisionMethodVal").val().trim();
                        if ("" == o || "" == l)
                            return void e.info(r.ifGenTipRangeNotforNull);
                        if ("" == i)
                            return void e.info(r.ifGenTipCutValueNotforNull);
                        e.getIfList(t, o, l, a, i)
                    }
                } else
                    e.info(r.ifGenTipNotNullValue)
            }
            )),
            $(document).on("click", "#luckysheet-ifFormulaGenerator-dialog .item .fa-remove", (function() {
                $(this).parents(".item").remove()
            }
            )),
            $(document).off("click.IFconfirmBtn").on("click.IFconfirmBtn", "#luckysheet-ifFormulaGenerator-dialog-confirm", (function() {
                var t = $(this).parents("#luckysheet-ifFormulaGenerator-dialog").find(".ifList .item")
                  , a = "";
                if ($(t.toArray().reverse()).each((function(e, n) {
                    var o, l, i, s = $(n).find(".smallNum").val().trim(), c = $(n).find(".largeNum").val().trim(), u = $(n).find(".operator option:selected").val(), h = $(n).find(".operator2 option:selected").val(), d = $(n).find(".compareValue").text(), f = $(n).find(".markText").val().trim();
                    if ("" == f && (f = r.ifGenTipLableTitile + (e + 1)),
                    "" == s && "" == c)
                        return !0;
                    o = "0" == u ? d + ">=" + s : d + ">" + s,
                    l = "0" == h ? d + "<=" + c : d + "<" + c,
                    i = 0 == e && "" == c ? o : e == t.length - 1 && "" == s ? l : "and(" + o + "," + l + ")",
                    a = 0 == e ? "if(" + i + ',"' + f + '")' : "if(" + i + ',"' + f + '",' + a + ")"
                }
                )),
                0 != a.length) {
                    $("#luckysheet-modal-dialog-mask").hide(),
                    $("#luckysheet-ifFormulaGenerator-dialog").hide();
                    var n = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
                    luckysheetupdateCell(n.row_focus, n.column_focus, Store.flowdata),
                    $("#luckysheet-rich-text-editor").html("=" + a),
                    $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
                    $("#luckysheet-wa-functionbox-confirm").click()
                } else
                    e.info(r.ifGenTipNotGenCondition)
            }
            )),
            $(document).on("click", "#luckysheet-ifFormulaGenerator-info .luckysheet-model-close-btn", (function() {
                $("#luckysheet-modal-dialog-mask").show()
            }
            )),
            $(document).on("click", "#luckysheet-ifFormulaGenerator-info .luckysheet-modal-dialog-title-close", (function() {
                $("#luckysheet-modal-dialog-mask").show()
            }
            ))
        },
        ifFormulaDialog: function(e) {
            var t = locale()
              , r = t.formula
              , a = t.button;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-ifFormulaGenerator-dialog").remove();
            var n = ""
              , o = "";
            if (e)
                for (var l = e.split("if("), i = 1; i < l.length; i++) {
                    var s = l[i].replace("and(", "").replace(/\)/g, "").replace(/\"/g, "").split(",");
                    s = this.clearArr(s),
                    n = this.splitTxt(s[0])[0];
                    var c = void 0
                      , u = void 0
                      , h = void 0;
                    3 == s.length ? (c = this.splitTxt(s[0])[1],
                    u = this.splitTxt(s[1])[2],
                    h = s[2]) : (c = this.splitTxt(s[0])[1],
                    u = this.splitTxt(s[0])[2],
                    h = s[1]),
                    o += '<div class="item"><input type="number" class="smallNum formulaInputFocus" value="' + c + '"/><select class="operator"><option value="0"> <= </option><option value="1"> < </option></select><span class="compareValue">' + n + '</span><select class="operator2"><option value="0"> <= </option><option value="1" selected="selected"> < </option></select><input type="number" class="largeNum formulaInputFocus" value="' + u + '"/><span>' + r.ifGenTipLableTitile + '：</span><input type="text" class="markText formulaInputFocus" value="' + h + '"><i class="fa fa-remove" aria-hidden="true"></i></div>'
                }
            var d = '<div class="ifAttr"><div class="attrBox"><label for="compareValue"> ' + r.ifGenCompareValueTitle + ' </label><div class="inpBox"><input id="compareValue" class="formulaInputFocus" value="' + n + '"/><i class="singRange fa fa-table" aria-hidden="true" title="' + r.ifGenSelectCellTitle + '"></i></div></div><div class="attrBox"><label for="smallRange"> ' + r.ifGenRangeTitle + ' </label><input type="number" id="smallRange" class="formulaInputFocus"/><span class="text"> ' + r.ifGenRangeTo + ' </span><input type="number" id="largeRange" class="formulaInputFocus"/><div id="rangeAssess"><span> ' + r.ifGenRangeEvaluate + ' </span><i class="multiRange fa fa-table" aria-hidden="true" title="' + r.ifGenSelectRangeTitle + '"></i></div></div><div class="attrBox"><label for="DivisionMethod"> ' + r.ifGenCutWay + ' </label><select id="DivisionMethod"><option value="0"> ' + r.ifGenCutSame + ' </option><option value="1"> ' + r.ifGenCutNpiece + ' </option><option value="2"> ' + r.ifGenCutCustom + ' </option></select><input id="DivisionMethodVal" class="formulaInputFocus"/><div id="createBtn"> ' + r.ifGenCutSame + ' </div></div></div><div class="ifList">' + o + "</div>";
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-ifFormulaGenerator-dialog",
                addclass: "luckysheet-ifFormulaGenerator-dialog",
                title: r.ifGenerate,
                content: d,
                botton: '<button id="luckysheet-ifFormulaGenerator-dialog-confirm" class="btn btn-primary">' + a.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + a.cancel + "</button>",
                style: "z-index:100003"
            }));
            var f = $("#luckysheet-ifFormulaGenerator-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 590).end()
              , m = f.outerHeight()
              , p = f.outerWidth()
              , g = $(window).width()
              , y = $(window).height()
              , v = $(document).scrollLeft()
              , A = $(document).scrollTop();
            $("#luckysheet-ifFormulaGenerator-dialog").css({
                left: (g + v - p) / 2,
                top: (y + A - m) / 3
            }).show()
        },
        clearArr: function(e) {
            for (var t = 0; t < e.length; t++)
                "" != e[t] && null != e[t] && null != e[t] || e.splice(t, 1);
            return e
        },
        splitTxt: function(e) {
            var t, r;
            return -1 != e.indexOf(">=") ? [e.split(">=")[0], t = e.split(">=")[1], r] : -1 != e.indexOf(">") ? [e.split(">")[0], t = e.split(">")[1], r] : -1 != e.indexOf("<=") ? [e.split("<=")[0], t, r = e.split("<=")[1]] : -1 != e.indexOf("<") ? [e.split("<")[0], t, r = e.split("<")[1]] : void 0
        },
        singleRangeDialog: function(e) {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-ifFormulaGenerator-dialog").hide(),
            $("#luckysheet-ifFormulaGenerator-singleRange-dialog").remove();
            var t = locale()
              , r = t.formula
              , a = t.button;
            null == e && (e = ""),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-ifFormulaGenerator-singleRange-dialog",
                addclass: "luckysheet-ifFormulaGenerator-singleRange-dialog",
                title: r.ifGenTipSelectCell,
                content: '<input readonly="readonly" placeholder="' + r.ifGenTipSelectCellPlace + '" value="' + e + '">',
                botton: '<button id="luckysheet-ifFormulaGenerator-singleRange-confirm" class="btn btn-primary">' + a.confirm + '</button><button id="luckysheet-ifFormulaGenerator-singleRange-cancel" class="btn btn-default">' + a.cancel + "</button>",
                style: "z-index:100003"
            }));
            var n = $("#luckysheet-ifFormulaGenerator-singleRange-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , o = n.outerHeight()
              , l = n.outerWidth()
              , i = $(window).width()
              , s = $(window).height()
              , c = $(document).scrollLeft()
              , u = $(document).scrollTop();
            $("#luckysheet-ifFormulaGenerator-singleRange-dialog").css({
                left: (i + c - l) / 2,
                top: (s + u - o) / 3
            }).show()
        },
        multiRangeDialog: function() {
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-ifFormulaGenerator-dialog").hide(),
            $("#luckysheet-ifFormulaGenerator-multiRange-dialog").remove();
            var e = locale()
              , t = e.formula
              , r = e.button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-ifFormulaGenerator-multiRange-dialog",
                addclass: "luckysheet-ifFormulaGenerator-multiRange-dialog",
                title: t.ifGenTipSelectRange,
                content: '<input readonly="readonly" placeholder="' + t.ifGenTipSelectRangePlace + '" value="">',
                botton: '<button id="luckysheet-ifFormulaGenerator-multiRange-confirm" class="btn btn-primary">' + r.confirm + '</button><button id="luckysheet-ifFormulaGenerator-multiRange-cancel" class="btn btn-default">' + r.cancel + "</button>",
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-ifFormulaGenerator-multiRange-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-ifFormulaGenerator-multiRange-dialog").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3
            }).show()
        },
        getIfList: function(e, t, r, a, n) {
            var o = locale().formula;
            $("#luckysheet-ifFormulaGenerator-dialog .ifList").empty(),
            t = parseInt(t),
            r = parseInt(r),
            n = parseInt(n);
            var l = [];
            if ("0" == a)
                for (var i = Math.ceil((r - t) / n), s = 0; s <= i; s++) {
                    var c = t + n * s;
                    0 == s || c >= r ? l.push("") : l.push(c)
                }
            else if ("1" == a)
                for (var u = Math.ceil((r - t) / n), h = 0; h <= n; h++) {
                    var d = t + u * h;
                    0 == h || d >= r ? l.push("") : l.push(d)
                }
            for (var f = 0; f < l.length - 1; f++) {
                var m = void 0;
                m = 0 == f ? "小于" + l[f + 1] : f == l.length - 2 ? "大于等于" + l[f] : l[f] + "到" + l[f + 1];
                var p = '<div class="item"><input type="number" class="smallNum formulaInputFocus" value="' + l[f] + '"/><select class="operator"><option value="0"> <= </option><option value="1"> < </option></select><span class="compareValue">' + e + '</span><select class="operator2"><option value="0"> <= </option><option value="1" selected="selected"> < </option></select><input type="number" class="largeNum formulaInputFocus" value="' + l[f + 1] + '"/><span>' + o.ifGenTipLableTitile + '：</span><input type="text" class="markText formulaInputFocus" value="' + m + '"><i class="fa fa-remove" aria-hidden="true"></i></div>';
                $("#luckysheet-ifFormulaGenerator-dialog .ifList").append(p)
            }
        },
        info: function(e) {
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-ifFormulaGenerator-info").remove();
            var t = locale().button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-ifFormulaGenerator-info",
                addclass: "",
                title: e,
                content: "",
                botton: '<button class="btn btn-default luckysheet-model-close-btn">&nbsp;&nbsp;' + t.close + "&nbsp;&nbsp;</button>",
                style: "z-index:100003"
            }));
            var r = $("#luckysheet-ifFormulaGenerator-info").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , a = r.outerHeight()
              , n = r.outerWidth()
              , o = $(window).width()
              , l = $(window).height()
              , i = $(document).scrollLeft()
              , s = $(document).scrollTop();
            $("#luckysheet-ifFormulaGenerator-info").css({
                left: (o + i - n) / 2,
                top: (l + s - a) / 3
            }).show()
        }
    }
      , insertFormula = {
        init: function() {
            var e = this
              , t = locale()
              , r = t.formulaMore
              , a = t.button;
            $(document).off("keyup.fxSFLI").on("keyup.fxSFLI", "#searchFormulaListInput", (function() {
                $("#formulaTypeList").empty();
                var t = $(this).val().toUpperCase()
                  , r = Store.functionlist;
                if ("" == t)
                    e.formulaListByType($("#formulaTypeSelect option:selected").val());
                else
                    for (var a = 0; a < r.length; a++)
                        /^[a-zA-Z]+$/.test(t) ? "-1" != r[a].n.indexOf(t) && $('<div class="listBox" name="' + r[a].n + '"><span>' + r[a].n + "</span><span>" + r[a].a + "</span></div>").appendTo($("#formulaTypeList")) : "-1" != r[a].a.indexOf(t) && $('<div class="listBox" name="' + r[a].n + '"><span>' + r[a].n + "</span><span>" + r[a].a + "</span></div>").appendTo($("#formulaTypeList"));
                $("#formulaTypeList .listBox:first-child").addClass("on")
            }
            )),
            $(document).off("change.fxFormulaTS").on("change.fxFormulaTS", "#formulaTypeSelect", (function() {
                var t = $("#formulaTypeSelect option:selected").val();
                e.formulaListByType(t)
            }
            )),
            $(document).off("click.fxListbox").on("click.fxListbox", "#formulaTypeList .listBox", (function() {
                $(this).addClass("on").siblings().removeClass("on")
            }
            )),
            $(document).off("click.fxFormulaCf").on("click.fxFormulaCf", "#luckysheet-search-formula-confirm", (function() {
                var t = $("#luckysheet-search-formula .listBox.on").attr("name")
                  , r = '<span dir="auto" class="luckysheet-formula-text-color">=</span><span dir="auto" class="luckysheet-formula-text-color">' + t.toUpperCase() + '</span><span dir="auto" class="luckysheet-formula-text-color">(</span><span dir="auto" class="luckysheet-formula-text-color">)</span>';
                $("#luckysheet-rich-text-editor").html(r),
                $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
                e.formulaParmDialog(t)
            }
            )),
            $(document).off("focus.fxParamInput").on("focus.fxParamInput", "#luckysheet-search-formula-parm .parmBox input", (function() {
                var t = $(this).parents(".parmBox").index();
                luckysheetformula.data_parm_index = t;
                var a, n, o = $(this).parents("#luckysheet-search-formula-parm").find(".luckysheet-modal-dialog-title-text").text(), l = Store.luckysheet_function[o].p.length;
                t >= l ? (a = Store.luckysheet_function[o].p[l - 1].detail,
                n = Store.luckysheet_function[o].p[l - 1].repeat) : (a = Store.luckysheet_function[o].p[t].detail,
                n = Store.luckysheet_function[o].p[t].repeat),
                e.parmTxtShow($(this).val()),
                e.functionStrCompute(),
                $("#luckysheet-search-formula-parm .parmDetailsBox").empty();
                var i = $(this).parents(".parmBox").find(".name").text();
                if ($("<span>" + i + ":</span><span>" + a + "</span>").appendTo($("#luckysheet-search-formula-parm .parmDetailsBox")),
                "y" == n) {
                    var s = $("#luckysheet-search-formula-parm .parmBox").length;
                    s < 5 && t == s - 1 && $('<div class="parmBox"><div class="name">' + r.valueTitle + (s + 1) + '</div><div class="txt"><input class="formulaInputFocus" /><i class="fa fa-table" aria-hidden="true" title="' + r.tipSelectDataRange + '"></i></div><div class="val">=</div></div>').appendTo($("#luckysheet-search-formula-parm .parmListBox"))
                }
            }
            )),
            $(document).off("blur.fxParamInput").on("blur.fxParamInput", "#luckysheet-search-formula-parm .parmBox input", (function() {
                var t = $(this).val();
                null != luckysheetformula.getfunctionParam(t).fn || luckysheetformula.iscelldata(t) || !isRealNum(t) && "" != t && t.length <= 2 && 0 != t.indexOf('"') && 0 != t.lastIndexOf('"') && (t = '"' + t + '"',
                $(this).val(t),
                e.parmTxtShow(t),
                e.functionStrCompute())
            }
            )),
            $(document).off("keyup.fxParamInput").on("keyup.fxParamInput", "#luckysheet-search-formula-parm .parmBox input", (function() {
                e.parmTxtShow($(this).val()),
                e.functionStrCompute()
            }
            )),
            $(document).off("click.fxParamI").on("click.fxParamI", "#luckysheet-search-formula-parm .parmBox i", (function() {
                luckysheetformula.data_parm_index = $(this).parents(".parmBox").index(),
                $("#luckysheet-search-formula-parm").hide(),
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-search-formula-parm-select").remove(),
                "" == $(this).parents(".parmBox").find(".txt input").val() ? $("body").append(replaceHtml$1(modelHTML, {
                    id: "luckysheet-search-formula-parm-select",
                    addclass: "luckysheet-search-formula-parm-select",
                    title: r.tipSelectDataRange,
                    content: "<input id='luckysheet-search-formula-parm-select-input' class='luckysheet-datavisual-range-container' style='font-size: 14px;padding:5px;max-width:none;' spellcheck='false' aria-label='" + r.tipDataRangeTile + "' readonly='true' placeholder='" + r.tipDataRangeTile + "'>",
                    botton: '<button id="luckysheet-search-formula-parm-select-confirm" class="btn btn-primary">' + a.confirm + "</button>",
                    style: "z-index:100003"
                })) : $("body").append(replaceHtml$1(modelHTML, {
                    id: "luckysheet-search-formula-parm-select",
                    addclass: "luckysheet-search-formula-parm-select",
                    title: r.tipSelectDataRange,
                    content: "<input id='luckysheet-search-formula-parm-select-input' class='luckysheet-datavisual-range-container' style='font-size: 14px;padding:5px;max-width:none;' spellcheck='false' aria-label='" + r.tipDataRangeTile + "' readonly='true' value='" + $(this).parents(".parmBox").find(".txt input").val() + "'>",
                    botton: '<button id="luckysheet-search-formula-parm-select-confirm" class="btn btn-primary">' + a.confirm + "</button>",
                    style: "z-index:100003"
                }));
                var t = $("#luckysheet-search-formula-parm-select").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
                  , n = t.outerHeight()
                  , o = t.outerWidth()
                  , l = $(window).width()
                  , i = $(window).height()
                  , s = $(document).scrollLeft()
                  , c = $(document).scrollTop();
                $("#luckysheet-search-formula-parm-select").css({
                    left: (l + s - o) / 2,
                    top: (i + c - n) / 3
                }).show(),
                e.parmTxtShow($(this).parents(".parmBox").find(".txt input").val())
            }
            )),
            $(document).off("click.fxParamCf").on("click.fxParamCf", "#luckysheet-search-formula-parm-confirm", (function() {
                $("#luckysheet-wa-functionbox-confirm").click()
            }
            )),
            $(document).off("click.fxParamSelectCf").on("click.fxParamSelectCf", "#luckysheet-search-formula-parm-select-confirm", (function() {
                var e = $("#luckysheet-search-formula-parm-select-input").attr("data_parm_index");
                $("#luckysheet-search-formula-parm-select").hide(),
                $("#luckysheet-search-formula-parm").show(),
                $("#luckysheet-search-formula-parm .parmBox").eq(e).find(".txt input").focus()
            }
            ))
        },
        formulaListDialog: function() {
            var e = locale()
              , t = e.formulaMore
              , r = e.button;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-search-formula").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-search-formula",
                addclass: "luckysheet-search-formula",
                title: "",
                content: "<div class='inpbox'><label for='searchFormulaListInput'>" + t.findFunctionTitle + "：</label><input class='formulaInputFocus' id='searchFormulaListInput' placeholder='" + t.tipInputFunctionName + "' spellcheck='false'/></div><div class='selbox'><label>" + t.selectCategory + "：</label><select id='formulaTypeSelect'><option value='0'>" + t.Math + "</option><option value='1'>" + t.Statistical + "</option><option value='2'>" + t.Lookup + "</option><option value='3'>" + t.luckysheet + "</option><option value='4'>" + t.dataMining + "</option><option value='5'>" + t.Database + "</option><option value='6'>" + t.Date + "</option><option value='7'>" + t.Filter + "</option><option value='8'>" + t.Financial + "</option><option value='9'>" + t.Engineering + "</option><option value='10'>" + t.Logical + "</option><option value='11'>" + t.Operator + "</option><option value='12'>" + t.Text + "</option><option value='13'>" + t.Parser + "</option><option value='14'>" + t.Array + "</option><option value='-1'>" + t.other + "</option></select></div><div class='listbox'><label>" + t.selectFunctionTitle + "：</label><div id='formulaTypeList'></div></div>",
                botton: '<button id="luckysheet-search-formula-confirm" class="btn btn-primary">' + r.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + r.cancel + "</button>",
                style: "z-index:100003"
            }));
            var a = $("#luckysheet-search-formula").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , n = a.outerHeight()
              , o = a.outerWidth()
              , l = $(window).width()
              , i = $(window).height()
              , s = $(document).scrollLeft()
              , c = $(document).scrollTop();
            $("#luckysheet-search-formula").css({
                left: (l + s - o) / 2,
                top: (i + c - n) / 3,
                "user-select": "none"
            }).show(),
            this.formulaListByType("0"),
            $("#searchFormulaListInput").focus()
        },
        formulaListByType: function(e) {
            $("#formulaTypeList").empty();
            for (var t = Store.functionlist, r = 0; r < t.length; r++)
                ("-1" == e && t[r].t > 14 || t[r].t == e) && $('<div class="listBox" name="' + t[r].n + '"><span>' + t[r].n + "</span><span>" + t[r].a + "</span></div>").appendTo($("#formulaTypeList"));
            $("#formulaTypeList .listBox:first-child").addClass("on")
        },
        formulaParmDialog: function formulaParmDialog(formulaTxt, parm) {
            for (var parm_title = "", parm_content = "", parm_list_content = "", _locale = locale(), locale_formulaMore = _locale.formulaMore, locale_button = _locale.button, functionlist = Store.functionlist, i = 0; i < functionlist.length; i++)
                if (functionlist[i].n == formulaTxt.toUpperCase()) {
                    parm_title = functionlist[i].n;
                    for (var j = 0; j < functionlist[i].p.length; j++)
                        null == parm ? parm_list_content += '<div class="parmBox"><div class="name">' + functionlist[i].p[j].name + '</div><div class="txt"><input class="formulaInputFocus" spellcheck="false"/><i class="fa fa-table" aria-hidden="true" title="' + locale_formulaMore.tipSelectDataRange + '"></i></div><div class="val">=</div></div>' : (null == parm[j] && (parm[j] = ""),
                        parm_list_content += '<div class="parmBox"><div class="name">' + functionlist[i].p[j].name + '</div><div class="txt"><input class="formulaInputFocus" value="' + parm[j] + '" spellcheck="false"/><i class="fa fa-table" aria-hidden="true" title="' + locale_formulaMore.tipSelectDataRange + '"></i></div><div class="val">=</div></div>');
                    parm_content = '<div><div class="parmListBox">' + parm_list_content + '</div><div class="formulaDetails">' + functionlist[i].d + '</div><div class="parmDetailsBox"></div><div class="result">' + locale_formulaMore.calculationResult + " = <span></span></div></div>"
                }
            $("#luckysheet-search-formula").hide(),
            $("#luckysheet-modal-dialog-mask").hide(),
            $("#luckysheet-search-formula-parm").remove(),
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-search-formula-parm",
                addclass: "luckysheet-search-formula-parm",
                title: parm_title,
                content: parm_content,
                botton: '<button id="luckysheet-search-formula-parm-confirm" class="btn btn-primary">' + locale_button.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + locale_button.cancel + "</button>",
                style: "z-index:100003"
            }));
            var $t = $("#luckysheet-search-formula-parm").find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
              , myh = $t.outerHeight()
              , myw = $t.outerWidth()
              , winw = $(window).width()
              , winh = $(window).height()
              , scrollLeft = $(document).scrollLeft()
              , scrollTop = $(document).scrollTop();
            $("#luckysheet-search-formula-parm").css({
                left: (winw + scrollLeft - myw) / 2,
                top: (winh + scrollTop - myh) / 3
            }).show(),
            $("#luckysheet-search-formula-parm .parmBox:eq(0) input").focus(),
            $("#luckysheet-search-formula-parm .parmBox").each((function(index, e) {
                var parmtxt = $(e).find(".txt input").val();
                if (null == luckysheetformula.getfunctionParam(parmtxt).fn)
                    if (luckysheetformula.iscelldata(parmtxt)) {
                        var txtdata = luckysheet_getcelldata(parmtxt).data;
                        if ("array" == getObjType(txtdata)) {
                            for (var txtArr = [], _i = 0; _i < txtdata.length; _i++)
                                for (var _j = 0; _j < txtdata[_i].length; _j++) {
                                    var cell = txtdata[_i][_j];
                                    null == cell || isRealNull(cell.v) ? txtArr.push(null) : txtArr.push(cell.v)
                                }
                            $("#luckysheet-search-formula-parm .parmBox").eq(index).find(".val").text(" = {" + txtArr.join(",") + "}")
                        } else
                            $("#luckysheet-search-formula-parm .parmBox").eq(index).find(".val").text(" = {" + txtdata.v + "}")
                    } else
                        $("#luckysheet-search-formula-parm .parmBox").eq(index).find(".val").text(" = {" + parmtxt + "}");
                else
                    $("#luckysheet-search-formula-parm .parmBox").eq(index).find(".val").text(" = {" + eval($.trim(luckysheetformula.functionParserExe("=" + parmtxt))) + "}")
            }
            )),
            $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight").remove(),
            luckysheetformula.data_parm_index = 0,
            luckysheetformula.rangestart = !0
        },
        parmTxtShow: function parmTxtShow(parmtxt) {
            if (null == luckysheetformula.getfunctionParam(parmtxt).fn)
                if (luckysheetformula.iscelldata(parmtxt)) {
                    var cellrange = luckysheetformula.getcellrange(parmtxt)
                      , r1 = cellrange.row[0]
                      , r2 = cellrange.row[1]
                      , c1 = cellrange.column[0]
                      , c2 = cellrange.column[1]
                      , row = Store.visibledatarow[r2]
                      , row_pre = r1 - 1 == -1 ? 0 : Store.visibledatarow[r1 - 1]
                      , col = Store.visibledatacolumn[c2]
                      , col_pre = c1 - 1 == -1 ? 0 : Store.visibledatacolumn[c1 - 1];
                    $("#luckysheet-formula-functionrange-select").css({
                        left: col_pre,
                        width: col - col_pre - 1,
                        top: row_pre,
                        height: row - row_pre - 1
                    }).show(),
                    $("#luckysheet-formula-help-c").hide(),
                    luckysheet_count_show(col_pre, row_pre, col - col_pre - 1, row - row_pre - 1, cellrange.row, cellrange.column);
                    var txtdata = luckysheet_getcelldata(parmtxt).data;
                    if ("array" == getObjType(txtdata)) {
                        for (var txtArr = [], i = 0; i < txtdata.length; i++)
                            for (var j = 0; j < txtdata[i].length; j++) {
                                var cell = txtdata[i][j];
                                null == cell || isRealNull(cell.v) ? txtArr.push(null) : txtArr.push(cell.v)
                            }
                        $("#luckysheet-search-formula-parm .parmBox").eq(luckysheetformula.data_parm_index).find(".val").text(" = {" + txtArr.join(",") + "}")
                    } else
                        $("#luckysheet-search-formula-parm .parmBox").eq(luckysheetformula.data_parm_index).find(".val").text(" = {" + txtdata.v + "}")
                } else
                    $("#luckysheet-search-formula-parm .parmBox").eq(luckysheetformula.data_parm_index).find(".val").text(" = {" + parmtxt + "}"),
                    $("#luckysheet-formula-functionrange-select").hide();
            else {
                for (var txt, k = 0; k < luckysheetformula.getfunctionParam(parmtxt).param.length; k++)
                    if (luckysheetformula.iscelldata(luckysheetformula.getfunctionParam(parmtxt).param[k])) {
                        txt = luckysheetformula.getfunctionParam(parmtxt).param[k];
                        break
                    }
                var _cellrange = luckysheetformula.getcellrange(txt)
                  , _r = _cellrange.row[0]
                  , _r2 = _cellrange.row[1]
                  , _c = _cellrange.column[0]
                  , _c2 = _cellrange.column[1]
                  , _row = Store.visibledatarow[_r2]
                  , _row_pre = _r - 1 == -1 ? 0 : Store.visibledatarow[_r - 1]
                  , _col = Store.visibledatacolumn[_c2]
                  , _col_pre = _c - 1 == -1 ? 0 : Store.visibledatacolumn[_c - 1];
                $("#luckysheet-formula-functionrange-select").css({
                    left: _col_pre,
                    width: _col - _col_pre - 1,
                    top: _row_pre,
                    height: _row - _row_pre - 1
                }).show(),
                $("#luckysheet-formula-help-c").hide(),
                luckysheet_count_show(_col_pre, _row_pre, _col - _col_pre - 1, _row - _row_pre - 1, _cellrange.row, _cellrange.column),
                $("#luckysheet-search-formula-parm .parmBox").eq(luckysheetformula.data_parm_index).find(".val").text(" = {" + eval($.trim(luckysheetformula.functionParserExe("=" + parmtxt))) + "}")
            }
        },
        functionStrCompute: function functionStrCompute() {
            var isVal = !0, parmValArr = [], lvi = -1, formulatxt = $("#luckysheet-search-formula-parm").find(".luckysheet-modal-dialog-title-text").text(), p = Store.luckysheet_function[formulatxt].p, functionHtmlTxt;
            if ($("#luckysheet-search-formula-parm .parmBox").each((function(e, t) {
                var r, a = $(t).find(".txt input").val();
                r = e < p.length ? p[e].require : p[p.length - 1].require,
                "" == a && "m" == r && (isVal = !1),
                "" != a && (lvi = e)
            }
            )),
            -1 == lvi)
                functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "()";
            else if (0 == lvi)
                functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "(" + $("#luckysheet-search-formula-parm .parmBox").eq(0).find(".txt input").val() + ")";
            else {
                for (var j = 0; j <= lvi; j++)
                    parmValArr.push($("#luckysheet-search-formula-parm .parmBox").eq(j).find(".txt input").val());
                functionHtmlTxt = "=" + $("#luckysheet-search-formula-parm .luckysheet-modal-dialog-title-text").text() + "(" + parmValArr.join(",") + ")"
            }
            var function_str = luckysheetformula.functionHTMLGenerate(functionHtmlTxt);
            if ($("#luckysheet-rich-text-editor").html(function_str),
            $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
            isVal) {
                var fp = $.trim(luckysheetformula.functionParserExe($("#luckysheet-rich-text-editor").text()))
                  , result = null;
                try {
                    result = eval(fp)
                } catch (e) {
                    result = luckysheetformula.error.n
                }
                $("#luckysheet-search-formula-parm .result span").text(result)
            }
        }
    }
      , menuButton = {
        menu: '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-menuButton ${subclass} luckysheet-mousedown-cancel" id="luckysheet-icon-${id}-menuButton">${item}</div>',
        item: '<div itemvalue="${value}" itemname="${name}" class="luckysheet-cols-menuitem ${sub} luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 0px 3px 1px;"><span style="margin-right:3px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span> ${name} <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel ${iconClass}" style="user-select: none;">${example}</span></div></div>',
        split: '<div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>',
        color: '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel luckysheet-menuButton ${sub}" id="${id}"><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel luckysheet-color-reset"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${resetColor}</div></div> <div class="luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <input type="text" class="luckysheet-color-selected" /> </div> </div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> ${coloritem}</div>',
        coloritem: '<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel ${class}"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${name}</div></div>',
        subcolor: '<div id="luckysheet-icon-${id}-menuButton" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-menuButton-sub luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <input type="text" class="luckysheet-color-selected" /> </div> </div></div>',
        rightclickmenu: null,
        submenuhide: null,
        focus: function(e, t) {
            "luckysheet-icon-font-family-menuButton" == e.attr("id") && (isdatatypemulti(t).num && null == (t = locale().fontarray[parseInt(t)]) && (t = this.defualtFont[itemvalue]));
            e.find(".luckysheet-cols-menuitem").find("span.icon").html(""),
            null == t ? e.find(".luckysheet-cols-menuitem").eq(0).find("span.icon").html('<i class="fa fa-check luckysheet-mousedown-cancel"></i>') : e.find(".luckysheet-cols-menuitem[itemvalue='" + t + "']").find("span.icon").html('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
        },
        createButtonMenu: function(e) {
            for (var t = "", r = 0; r < e.length; r++) {
                var a = e[r];
                "split" == a.value ? t += this.split : "more" == a.example ? t += replaceHtml$1(this.item, {
                    value: a.value,
                    name: a.text,
                    example: "",
                    sub: "luckysheet-cols-submenu",
                    iconClass: "iconfont icon-youjiantou"
                }) : t += replaceHtml$1(this.item, {
                    value: a.value,
                    name: a.text,
                    example: a.example,
                    sub: "",
                    iconClass: ""
                })
            }
            return t
        },
        cancelPaintModel: function() {
            $("#luckysheet-sheettable_0").removeClass("luckysheetPaintCursor"),
            Store.luckysheet_copy_save.dataSheetIndex == Store.currentSheetIndex ? (Store.luckysheet_selection_range = [],
            selectionCopyShow()) : Store.luckysheetfile[getSheetIndex(Store.luckysheet_copy_save.dataSheetIndex)].luckysheet_selection_range = [],
            Store.luckysheet_copy_save = {},
            this.luckysheetPaintModelOn = !1,
            $("#luckysheetpopover").fadeOut(200, (function() {
                $("#luckysheetpopover").remove()
            }
            ))
        },
        luckysheetPaintModelOn: !1,
        luckysheetPaintSingle: !1,
        initialMenuButton: function initialMenuButton() {
            var _this = this;
            $("#luckysheet-icon-paintformat").click((function() {
                var e = locale().paint;
                if (null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length)
                    if (Store.luckysheet_select_save.length > 1)
                        isEditMode() ? alert(e.tipNotMulti) : tooltip.info("", e.tipNotMulti);
                    else {
                        tooltip.popover("<i class='fa fa-paint-brush'></i> " + e.start, "topCenter", !0, null, e.end, (function() {
                            _this.cancelPaintModel()
                        }
                        )),
                        $("#luckysheet-sheettable_0").addClass("luckysheetPaintCursor"),
                        Store.luckysheet_selection_range = [{
                            row: Store.luckysheet_select_save[0].row,
                            column: Store.luckysheet_select_save[0].column
                        }],
                        selectionCopyShow();
                        for (var t = !1, r = !1, a = Store.luckysheet_select_save[0].row[0]; a <= Store.luckysheet_select_save[0].row[1]; a++)
                            if (null == Store.config.rowhidden || null == Store.config.rowhidden[a]) {
                                null != Store.config.rowlen && a in Store.config.rowlen && (t = !0);
                                for (var n = Store.luckysheet_select_save[0].column[0]; n <= Store.luckysheet_select_save[0].column[1]; n++) {
                                    var o = Store.flowdata[a][n];
                                    "object" == getObjType(o) && "mc"in o && null != o.mc.rs && (r = !0)
                                }
                            }
                        Store.luckysheet_copy_save = {
                            dataSheetIndex: Store.currentSheetIndex,
                            copyRange: [{
                                row: Store.luckysheet_select_save[0].row,
                                column: Store.luckysheet_select_save[0].column
                            }],
                            RowlChange: t,
                            HasMC: r
                        },
                        _this.luckysheetPaintModelOn = !0,
                        _this.luckysheetPaintSingle = !0
                    }
                else
                    isEditMode() ? alert(e.tipSelectRange) : tooltip.info("", e.tipSelectRange)
            }
            )),
            $("#luckysheet-icon-paintformat").dblclick((function() {
                var e = locale().paint;
                if (null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length)
                    if (Store.luckysheet_select_save.length > 1)
                        isEditMode() ? alert(e.tipNotMulti) : tooltip.info("", e.tipNotMulti);
                    else {
                        tooltip.popover("<i class='fa fa-paint-brush'></i> " + e.start, "topCenter", !0, null, e.end, (function() {
                            _this.cancelPaintModel()
                        }
                        )),
                        $("#luckysheet-sheettable_0").addClass("luckysheetPaintCursor"),
                        Store.luckysheet_selection_range = [{
                            row: Store.luckysheet_select_save[0].row,
                            column: Store.luckysheet_select_save[0].column
                        }],
                        selectionCopyShow();
                        for (var t = !1, r = !1, a = Store.luckysheet_select_save[0].row[0]; a <= Store.luckysheet_select_save[0].row[1]; a++)
                            if (null == Store.config.rowhidden || null == Store.config.rowhidden[a]) {
                                null != Store.config.rowlen && a in Store.config.rowlen && (t = !0);
                                for (var n = Store.luckysheet_select_save[0].column[0]; n <= Store.luckysheet_select_save[0].column[1]; n++) {
                                    var o = Store.flowdata[a][n];
                                    "object" == getObjType(o) && "mc"in o && null != o.mc.rs && (r = !0)
                                }
                            }
                        Store.luckysheet_copy_save = {
                            dataSheetIndex: Store.currentSheetIndex,
                            copyRange: [{
                                row: Store.luckysheet_select_save[0].row,
                                column: Store.luckysheet_select_save[0].column
                            }],
                            RowlChange: t,
                            HasMC: r
                        },
                        _this.luckysheetPaintModelOn = !0,
                        _this.luckysheetPaintSingle = !1
                    }
                else
                    isEditMode() ? alert(e.tipSelectRange) : tooltip.info("", e.tipSelectRange)
            }
            )),
            $("#luckysheet-icon-currency").click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata);
                _this.updateFormat(e, "ct", "¥ #.00")
            }
            )),
            $("#luckysheet-icon-percent").click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata);
                _this.updateFormat(e, "ct", "0.00%")
            }
            )),
            $("#luckysheet-icon-fmt-decimal-decrease").click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = Store.luckysheet_select_save[0].row_focus
                  , r = Store.luckysheet_select_save[0].column_focus
                  , a = _this.checkstatus(e, t, r, "ct")
                  , n = e[t][r];
                if (null != a && "n" == a.t) {
                    if ("General" == a.fa)
                        a = genarate(n.v)[1];
                    if (/^(w|W)((0?)|(0\.0+))$/.test(a.fa))
                        a.fa.indexOf(".") > -1 ? ".0" == a.fa.substr(-2) ? _this.updateFormat(e, "ct", a.fa.split(".")[0]) : _this.updateFormat(e, "ct", a.fa.substr(0, a.fa.length - 1)) : _this.updateFormat(e, "ct", a.fa);
                    else {
                        var o = ""
                          , l = "";
                        if (a.fa.indexOf(".") > -1) {
                            o = (i = a.fa.split("."))[0];
                            for (var i = (l = i[1]).split(""), s = "", c = i.length - 1; c >= 0; c--) {
                                var u = i[c];
                                if ("#" == u || "0" == u || "," == u || !isNaN(parseInt(u)))
                                    break;
                                s = u + s
                            }
                            var h = "";
                            if (a.fa.indexOf(".") > -1) {
                                var d = l;
                                s.length > 0 && (d = l.replace(s, ""));
                                var f = d.replace(/#/g, "0");
                                h = "" == (f = f.substr(0, f.length - 1)) ? o + s : o + "." + f + s
                            }
                            _this.updateFormat(e, "ct", h)
                        }
                    }
                }
            }
            )),
            $("#luckysheet-icon-fmt-decimal-increase").click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = Store.luckysheet_select_save[0].row_focus
                  , r = Store.luckysheet_select_save[0].column_focus
                  , a = _this.checkstatus(e, t, r, "ct")
                  , n = e[t][r];
                if (null != a && "n" == a.t) {
                    if ("General" == a.fa)
                        a = genarate(n.v)[1];
                    if ("General" != a.fa) {
                        if (/^(w|W)((0?)|(0\.0+))$/.test(a.fa))
                            a.fa.indexOf(".") > -1 ? _this.updateFormat(e, "ct", a.fa + "0") : "0" == a.fa.substr(-1) ? _this.updateFormat(e, "ct", a.fa + ".0") : _this.updateFormat(e, "ct", a.fa + "0.0");
                        else {
                            var o = ""
                              , l = "";
                            a.fa.indexOf(".") > -1 ? (o = (i = a.fa.split("."))[0],
                            l = i[1]) : l = a.fa;
                            for (var i = l.split(""), s = "", c = i.length - 1; c >= 0; c--) {
                                var u = i[c];
                                if ("#" == u || "0" == u || "," == u || !isNaN(parseInt(u)))
                                    break;
                                s = u + s
                            }
                            var h = "";
                            if (a.fa.indexOf(".") > -1) {
                                var d = l;
                                s.length > 0 && (d = l.replace(s, ""));
                                var f = d.replace(/#/g, "0");
                                h = o + "." + (f += "0") + s
                            } else
                                h = s.length > 0 ? l.replace(s, "") + ".0" + s : l + ".0" + s;
                            _this.updateFormat(e, "ct", h)
                        }
                    } else
                        _this.updateFormat(e, "ct", "#.0")
                }
            }
            )),
            $("#luckysheet-icon-fmt-other").click((function() {
                var e = locale()
                  , t = e.format
                  , r = e.defaultFmt
                  , a = $(this).attr("id") + "-menuButton"
                  , n = $("#" + a);
                if (0 == n.length) {
                    var o = r
                      , l = _this.createButtonMenu(o)
                      , i = replaceHtml$1(_this.menu, {
                        id: "fmt-other",
                        item: l,
                        subclass: "",
                        sub: ""
                    })
                      , s = [{
                        text: t.moreCurrency + "...",
                        value: "morecurrency",
                        example: ""
                    }, {
                        text: t.moreDateTime + "...",
                        value: "moredatetime",
                        example: ""
                    }, {
                        text: t.moreNumber + "...",
                        value: "moredigit",
                        example: ""
                    }]
                      , c = _this.createButtonMenu(s)
                      , u = replaceHtml$1(_this.menu, {
                        id: "fmtOtherSelf",
                        item: c,
                        subclass: "luckysheet-menuButton-sub"
                    });
                    $("body").append(i + u),
                    (n = $("#" + a).width(250)).find(".luckysheet-cols-menuitem").click((function() {
                        n.hide(),
                        luckysheetContainerFocus();
                        var e = $(this)
                          , t = e.attr("itemvalue")
                          , r = e.attr("itemname");
                        if ($("#luckysheet-icon-fmt-other").find(".luckysheet-toolbar-menu-button-caption").html(" " + r + " "),
                        "fmtOtherSelf" != t) {
                            var a = editor.deepCopyFlowData(Store.flowdata);
                            _this.focus(n, t),
                            _this.updateFormat(a, "ct", t)
                        }
                    }
                    )),
                    $("#luckysheet-icon-fmtOtherSelf-menuButton").find(".luckysheet-cols-menuitem").click((function() {
                        n.hide(),
                        $("#luckysheet-icon-fmtOtherSelf-menuButton").hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        luckysheetMoreFormat.createDialog(e),
                        luckysheetMoreFormat.init()
                    }
                    ))
                } else {
                    var h = $(this).find(".luckysheet-toolbar-menu-button-caption").text().trim()
                      , d = r.find((function(e) {
                        return e.text === h
                    }
                    ));
                    d && _this.focus(n, d.value)
                }
                var f = $(this).outerWidth()
                  , m = n.outerWidth()
                  , p = $(this).offset().left;
                m > f && m + p > $("#" + Store.container).width() && (p = p - m + f),
                mouseclickposition(n, p, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-font-family").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = _this.createButtonMenu(_this.fontSelectList)
                      , a = replaceHtml$1(_this.menu, {
                        id: "font-family",
                        item: r,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(a),
                    t = $("#" + e).width(200),
                    _this.focus(t),
                    t.on("click", ".luckysheet-cols-menuitem", (function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this)
                          , r = e.attr("itemvalue")
                          , a = e.attr("itemname");
                        _this.focus(t, r),
                        $("#luckysheet-icon-font-family").find(".luckysheet-toolbar-menu-button-caption").html(" " + a + " ");
                        var n = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(n, "ff", r)
                    }
                    ))
                }
                var n = $(this).outerWidth()
                  , o = t.outerWidth()
                  , l = $(this).offset().left;
                o > n && o + l > $("#" + Store.container).width() && (l = l - o + n),
                mouseclickposition(t, l, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-text-color").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = $(this).attr("color");
                null == t && (t = "#000000"),
                _this.updateFormat(e, "fc", t)
            }
            )),
            $("#luckysheet-icon-text-color-menu").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale()
                      , a = r.toolbar
                      , n = r.button
                      , o = r.alternatingColors
                      , l = [{
                        name: a.alternatingColors + "...",
                        id: "luckysheet-color-alternate",
                        example: ""
                    }]
                      , i = (_this.createButtonMenu(l),
                    replaceHtml$1(_this.coloritem, {
                        class: "luckysheet-icon-alternateformat",
                        name: a.alternatingColors + "..."
                    }))
                      , s = replaceHtml$1(_this.color, {
                        id: e,
                        coloritem: i,
                        colorself: "text-color-self",
                        sub: "",
                        resetColor: a.resetColor
                    });
                    $("body").append(s),
                    t = $("#" + e),
                    $("#" + e).find(".luckysheet-color-selected").spectrum({
                        showPalette: !0,
                        showPaletteOnly: !0,
                        preferredFormat: "hex",
                        clickoutFiresChange: !1,
                        showInitial: !0,
                        showInput: !0,
                        flat: !0,
                        hideAfterPaletteSelect: !0,
                        showSelectionPalette: !0,
                        maxPaletteSize: 8,
                        maxSelectionSize: 8,
                        cancelText: n.cancel,
                        chooseText: n.confirm,
                        togglePaletteMoreText: a.customColor,
                        togglePaletteLessText: a.collapse,
                        togglePaletteOnly: !0,
                        clearText: a.clearText,
                        color: "#000",
                        noColorSelectedText: a.noColorSelectedText,
                        localStorageKey: "spectrum.textcolor" + server.gridKey,
                        palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                        change: function(e) {
                            $(this);
                            e = null != e ? e.toHexString() : "#000",
                            $("#luckysheet-icon-text-color .text-color-bar").css("background-color", e),
                            $("#luckysheet-icon-text-color").attr("color", e);
                            var r = editor.deepCopyFlowData(Store.flowdata);
                            _this.updateFormat(r, "fc", e),
                            t.hide(),
                            luckysheetContainerFocus()
                        }
                    }),
                    t.find(".luckysheet-color-reset").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var r = $("#" + e).find(".luckysheet-color-selected");
                        r.val("#000000"),
                        $("#luckysheet-icon-text-color").attr("color", null),
                        r.spectrum("set", "#000000"),
                        $("#luckysheet-icon-text-color .luckysheet-color-menu-button-indicator").css("border-bottom-color", "#000000");
                        var a = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(a, "fc", null)
                    }
                    )),
                    t.find(".luckysheet-icon-alternateformat").click((function() {
                        if (t.hide(),
                        luckysheetContainerFocus(),
                        Store.luckysheet_select_save.length > 1)
                            isEditMode() ? alert(o.errorInfo) : tooltip.info(o.errorInfo, "");
                        else {
                            var e = $.extend(!0, {}, Store.luckysheet_select_save[0]);
                            alternateformat.rangeIsExists(e)[0] || (alternateformat.modelfocusIndex = 0,
                            alternateformat.new(e)),
                            alternateformat.init(),
                            alternateformat.perfect()
                        }
                    }
                    ))
                }
                var c = $(this).outerWidth()
                  , u = t.outerWidth()
                  , h = $(this).offset().left;
                u > c && u + h > $("#" + Store.container).width() && (h = h - u + c);
                var d = $(this).offset().top + 26;
                setTimeout((function() {
                    var r = $("#" + e).find(".luckysheet-color-selected");
                    r.spectrum("set", r.val()),
                    mouseclickposition(t, h - 28, d, "lefttop")
                }
                ), 1)
            }
            )),
            $("#luckysheet-icon-cell-color").click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = $(this).attr("color");
                null == t && (t = "#ffffff"),
                _this.updateFormat(e, "bg", t)
            }
            )),
            $("#luckysheet-icon-cell-color-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale()
                      , a = r.toolbar
                      , n = r.button
                      , o = r.alternatingColors
                      , l = replaceHtml$1(_this.coloritem, {
                        class: "luckysheet-icon-alternateformat",
                        name: a.alternatingColors + "..."
                    })
                      , i = replaceHtml$1(_this.color, {
                        id: e,
                        coloritem: l,
                        colorself: "cell-color-self",
                        sub: "",
                        resetColor: a.resetColor
                    });
                    $("body").append(i),
                    t = $("#" + e),
                    $("#" + e).find(".luckysheet-color-selected").spectrum({
                        showPalette: !0,
                        showPaletteOnly: !0,
                        preferredFormat: "hex",
                        clickoutFiresChange: !1,
                        showInitial: !0,
                        showInput: !0,
                        flat: !0,
                        hideAfterPaletteSelect: !0,
                        showSelectionPalette: !0,
                        maxPaletteSize: 8,
                        maxSelectionSize: 8,
                        color: "#fff",
                        cancelText: n.cancel,
                        chooseText: n.confirm,
                        togglePaletteMoreText: a.customColor,
                        togglePaletteLessText: a.collapse,
                        togglePaletteOnly: !0,
                        clearText: a.clearText,
                        noColorSelectedText: a.noColorSelectedText,
                        localStorageKey: "spectrum.bgcolor" + server.gridKey,
                        palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                        change: function(e) {
                            $(this);
                            e = null != e ? e.toHexString() : "#fff",
                            $("#luckysheet-icon-cell-color .text-color-bar").css("background-color", e),
                            $("#luckysheet-icon-cell-color").attr("color", e);
                            var r = editor.deepCopyFlowData(Store.flowdata);
                            _this.updateFormat(r, "bg", e),
                            t.hide(),
                            luckysheetContainerFocus()
                        }
                    }),
                    t.find(".luckysheet-color-reset").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var r = $("#" + e).find(".luckysheet-color-selected");
                        r.val("#ffffff"),
                        $("#luckysheet-icon-cell-color").attr("color", null),
                        r.spectrum("set", "#ffffff"),
                        $("#luckysheet-icon-cell-color .luckysheet-color-menu-button-indicator").css("border-bottom-color", "#ffffff");
                        var a = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(a, "bg", null)
                    }
                    )),
                    t.find(".luckysheet-icon-alternateformat").click((function() {
                        if (t.hide(),
                        luckysheetContainerFocus(),
                        Store.luckysheet_select_save.length > 1)
                            isEditMode() ? alert(o.errorInfo) : tooltip.info(o.errorInfo, "");
                        else {
                            var e = $.extend(!0, {}, Store.luckysheet_select_save[0]);
                            alternateformat.rangeIsExists(e)[0] || (alternateformat.modelfocusIndex = 0,
                            alternateformat.new(e)),
                            alternateformat.init(),
                            alternateformat.perfect()
                        }
                    }
                    )),
                    $("#" + e).find(".luckysheet-color-selected").val("#fff")
                }
                var s = $(this).outerWidth()
                  , c = t.outerWidth()
                  , u = $(this).offset().left;
                c > s && c + u > $("#" + Store.container).width() && (u = u - c + s);
                var h = $(this).offset().top + 26;
                setTimeout((function() {
                    var r = $("#" + e).find(".luckysheet-color-selected");
                    r.spectrum("set", r.val()),
                    mouseclickposition(t, u - 28, h, "lefttop")
                }
                ), 1)
            }
            ));
            var luckysheet_fs_setTimeout = null;
            $("#luckysheet-icon-font-size").mousedown((function(e) {
                if (parseInt($("#luckysheet-input-box").css("top")) > 0) {
                    var t = window.getSelection();
                    if ("None" != t.type) {
                        var r = t.getRangeAt(0);
                        r.collapsed || (Store.inlineStringEditRange = r.cloneRange())
                    }
                }
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = _this.createButtonMenu([{
                        text: "9",
                        value: "9",
                        example: ""
                    }, {
                        text: "10",
                        value: "10",
                        example: ""
                    }, {
                        text: "11",
                        value: "11",
                        example: ""
                    }, {
                        text: "12",
                        value: "12",
                        example: ""
                    }, {
                        text: "14",
                        value: "14",
                        example: ""
                    }, {
                        text: "16",
                        value: "16",
                        example: ""
                    }, {
                        text: "18",
                        value: "18",
                        example: ""
                    }, {
                        text: "20",
                        value: "20",
                        example: ""
                    }, {
                        text: "22",
                        value: "22",
                        example: ""
                    }, {
                        text: "24",
                        value: "24",
                        example: ""
                    }, {
                        text: "26",
                        value: "26",
                        example: ""
                    }, {
                        text: "28",
                        value: "28",
                        example: ""
                    }, {
                        text: "36",
                        value: "36",
                        example: ""
                    }, {
                        text: "48",
                        value: "48",
                        example: ""
                    }, {
                        text: "72",
                        value: "72",
                        example: ""
                    }])
                      , a = replaceHtml$1(_this.menu, {
                        id: "font-size",
                        item: r,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(a),
                    t = $("#" + e).width(150),
                    _this.focus(t, 10),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue")
                          , r = $("#luckysheet-icon-font-size input");
                        $("#luckysheet-icon-font-size").attr("itemvalue", e),
                        _this.focus(t, e),
                        r.val(e);
                        var a = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(a, "fs", e),
                        clearTimeout(luckysheet_fs_setTimeout)
                    }
                    ))
                }
                var n = $(this).outerWidth()
                  , o = t.outerWidth()
                  , l = $("#luckysheet-icon-font-size").attr("itemvalue");
                null == l && (l = 10),
                _this.focus(t, l);
                var i = $(this).offset().left;
                o > n && o + i > $("#" + Store.container).width() && (i = i - o + n),
                mouseclickposition(t, i, $(this).offset().top + 25, "lefttop")
            }
            )).find("input.luckysheet-toolbar-textinput").keydown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).keyup((function(e) {
                if (13 == e.keyCode) {
                    var t = $(this)
                      , r = parseInt(t.val())
                      , a = $("#luckysheet-icon-font-size-menuButton");
                    _this.focus(a, r);
                    var n = editor.deepCopyFlowData(Store.flowdata);
                    _this.updateFormat(n, "fs", r),
                    luckysheet_fs_setTimeout = setTimeout((function() {
                        a.hide(),
                        t.blur()
                    }
                    ), 200)
                }
            }
            )),
            $("#luckysheet-icon-border-all").click((function() {
                if (checkProtectionFormatCells(Store.currentSheetIndex)) {
                    editor.deepCopyFlowData(Store.flowdata);
                    var e = $(this).attr("type");
                    null == e && (e = "border-all");
                    var t = $("#luckysheet-icon-borderColor-menuButton").find(".luckysheet-color-selected").val()
                      , r = $("#luckysheetborderSizepreview").attr("itemvalue");
                    null != t && "" != t || (t = "#000"),
                    null != r && "" != r || (r = "1");
                    var a = $.extend(!0, {}, Store.config);
                    null == a.borderInfo && (a.borderInfo = []);
                    var n = {
                        rangeType: "range",
                        borderType: e,
                        color: t,
                        style: r,
                        range: Store.luckysheet_select_save
                    };
                    if (a.borderInfo.push(n),
                    Store.clearjfundo) {
                        Store.jfundo = [];
                        var o = [];
                        o.type = "borderChange",
                        o.config = $.extend(!0, {}, Store.config),
                        o.curconfig = $.extend(!0, {}, a),
                        o.sheetIndex = Store.currentSheetIndex,
                        Store.jfredo.push(o)
                    }
                    server.saveParam("cg", Store.currentSheetIndex, a.borderInfo, {
                        k: "borderInfo"
                    }),
                    Store.config = a,
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1)
                }
            }
            )),
            $("#luckysheet-icon-border-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale()
                      , a = r.border
                      , n = r.toolbar
                      , o = r.button
                      , l = [{
                        text: a.borderTop,
                        value: "border-top",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-top iconfont icon-shangbiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderBottom,
                        value: "border-bottom",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-bottom iconfont icon-xiabiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderLeft,
                        value: "border-left",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-left iconfont icon-zuobiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderRight,
                        value: "border-right",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-right iconfont icon-youbiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: a.borderNone,
                        value: "border-none",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-none iconfont icon-wubiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderAll,
                        value: "border-all",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-all iconfont icon-quanjiabiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderOutside,
                        value: "border-outside",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-outside iconfont icon-sizhoujiabiankuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: a.borderInside,
                        value: "border-inside",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-inside iconfont icon-neikuangxian" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderHorizontal,
                        value: "border-horizontal",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-horizontal iconfont icon-neikuanghengxian" style="user-select: none;"> </div> </div>'
                    }, {
                        text: a.borderVertical,
                        value: "border-vertical",
                        example: '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-vertical iconfont icon-neikuangshuxian" style="user-select: none;"> </div> </div>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: "<span id='luckysheet-icon-borderColor-linecolor' class='luckysheet-mousedown-cancel' style='border-bottom:3px solid #000;'>" + a.borderColor + "</span>",
                        value: "borderColor",
                        example: "more"
                    }, {
                        text: a.borderSize + "<img id='luckysheetborderSizepreview' width=100 height=10 src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==' style='position:absolute;bottom:-5px;right:0px;width:100px;height:10px;'>",
                        value: "borderSize",
                        example: "more"
                    }]
                      , i = iconfontObjects.border
                      , s = _this.createButtonMenu(l)
                      , c = replaceHtml$1(_this.menu, {
                        id: "border-menu",
                        item: s,
                        subclass: "",
                        sub: ""
                    })
                      , u = [{
                        text: a.borderNone,
                        value: "0",
                        example: ""
                    }, {
                        text: "<canvas type='Thin' class='border-Thin' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "1",
                        example: ""
                    }, {
                        text: "<canvas type='Hair' class='border-Hair' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "2",
                        example: ""
                    }, {
                        text: "<canvas type='Dotted' class='border-Dotted' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "3",
                        example: ""
                    }, {
                        text: "<canvas type='Dashed' class='border-Dashed' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "4",
                        example: ""
                    }, {
                        text: "<canvas type='DashDot' class='border-DashDot' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "5",
                        example: ""
                    }, {
                        text: "<canvas type='DashDotDot' class='border-DashDotDot' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "6",
                        example: ""
                    }, {
                        text: "<canvas type='Medium' class='border-Medium' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "8",
                        example: ""
                    }, {
                        text: "<canvas type='MediumDashed' class='border-MediumDashed' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "9",
                        example: ""
                    }, {
                        text: "<canvas type='MediumDashDot' class='border-MediumDashDot' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "10",
                        example: ""
                    }, {
                        text: "<canvas type='MediumDashDotDot' class='border-MediumDashDotDot' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "11",
                        example: ""
                    }, {
                        text: "<canvas type='Thick' class='border-Thick' width=120 height=10 style='width:120px;height:10px;position:static;'></canvas>",
                        value: "13",
                        example: ""
                    }]
                      , h = _this.createButtonMenu(u)
                      , d = replaceHtml$1(_this.menu, {
                        id: "borderSize",
                        item: h,
                        subclass: "luckysheet-menuButton-sub"
                    })
                      , f = "luckysheet-icon-borderSize-menuButton"
                      , m = "luckysheet-icon-borderColor-menuButton"
                      , p = replaceHtml$1(_this.color, {
                        id: m,
                        coloritem: "",
                        colorself: "",
                        sub: "luckysheet-menuButton-sub",
                        resetColor: n.resetColor
                    });
                    $("body").append(c + p + d),
                    t = $("#" + e).width(170),
                    _this.focus(t, "border-all"),
                    $("#" + f + " canvas").each((function(e) {
                        $(this).attr("type");
                        var t = $(this).closest(".luckysheet-cols-menuitem").attr("itemvalue")
                          , r = $(this).addClass("luckysheet-mousedown-cancel").get(0).getContext("2d");
                        r.translate(.5, .5),
                        _this.setLineDash(r, t, "h", 0, 5, 100, 5),
                        r.strokeStyle = "#000000",
                        r.stroke(),
                        r.closePath()
                    }
                    )),
                    $("#" + f + " .luckysheet-cols-menuitem").click((function() {
                        $("#" + f).hide();
                        var e = $(this)
                          , t = e.attr("itemvalue");
                        if (0 == t)
                            $("#luckysheetborderSizepreview").attr("src", "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==").attr("itemvalue", null);
                        else {
                            var r = e.find("canvas").get(0).toDataURL("image/png");
                            $("#luckysheetborderSizepreview").attr("src", r).attr("itemvalue", t)
                        }
                        _this.focus($("#" + f), t)
                    }
                    )),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if ("borderColor" != e && "borderSize" != e && checkProtectionFormatCells(Store.currentSheetIndex)) {
                            editor.deepCopyFlowData(Store.flowdata);
                            var r = $("#" + m).find(".luckysheet-color-selected").val()
                              , a = $("#luckysheetborderSizepreview").attr("itemvalue");
                            null != r && "" != r || (r = "#000"),
                            null != a && "" != a || (a = "1");
                            var n = $.extend(!0, {}, Store.config);
                            null == n.borderInfo && (n.borderInfo = []);
                            var o = {
                                rangeType: "range",
                                borderType: e,
                                color: r,
                                style: a,
                                range: Store.luckysheet_select_save
                            };
                            if (n.borderInfo.push(o),
                            Store.clearjfundo) {
                                Store.jfundo = [];
                                var l = [];
                                l.type = "borderChange",
                                l.config = $.extend(!0, {}, Store.config),
                                l.curconfig = $.extend(!0, {}, n),
                                l.sheetIndex = Store.currentSheetIndex,
                                Store.jfredo.push(l)
                            }
                            server.saveParam("cg", Store.currentSheetIndex, n.borderInfo, {
                                k: "borderInfo"
                            }),
                            Store.config = n,
                            Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                            setTimeout((function() {
                                luckysheetrefreshgrid()
                            }
                            ), 1),
                            $("#luckysheet-icon-border-all").attr("type", e),
                            $("#luckysheet-icon-border-all").find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-" + e + i[e]),
                            _this.focus(t, e)
                        }
                    }
                    )),
                    $("#" + m).find(".luckysheet-color-selected").spectrum({
                        showPalette: !0,
                        showPaletteOnly: !0,
                        preferredFormat: "hex",
                        clickoutFiresChange: !1,
                        showInitial: !0,
                        showInput: !0,
                        flat: !0,
                        hideAfterPaletteSelect: !0,
                        showSelectionPalette: !0,
                        maxPaletteSize: 8,
                        maxSelectionSize: 8,
                        color: "#000",
                        cancelText: o.cancel,
                        chooseText: o.confirm,
                        togglePaletteMoreText: n.customColor,
                        togglePaletteLessText: n.collapse,
                        togglePaletteOnly: !0,
                        clearText: n.clearText,
                        noColorSelectedText: n.noColorSelectedText,
                        localStorageKey: "spectrum.bordercolor" + server.gridKey,
                        palette: [["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], ["#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f", "#f0f"], ["#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3", "#cfe2f3", "#d9d2e9", "#ead1dc"], ["#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#9fc5e8", "#b4a7d6", "#d5a6bd"], ["#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6fa8dc", "#8e7cc3", "#c27ba0"], ["#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3d85c6", "#674ea7", "#a64d79"], ["#900", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#0b5394", "#351c75", "#741b47"], ["#600", "#783f04", "#7f6000", "#274e13", "#0c343d", "#073763", "#20124d", "#4c1130"]],
                        change: function(e) {
                            $(this);
                            e = null != e ? e.toHexString() : "#000",
                            $("#luckysheet-icon-borderColor-linecolor").css("border-bottom-color", e),
                            $("#" + m).find(".luckysheet-color-selected").val(e)
                        }
                    }),
                    $("#" + m).find(".luckysheet-color-reset").click((function() {
                        var e = $("#" + m).find(".luckysheet-color-selected");
                        e.val("#000"),
                        $("#luckysheet-icon-cell-color").attr("color", null),
                        e.spectrum("set", "#000"),
                        $("#luckysheet-icon-borderColor-linecolor").css("border-bottom-color", "#000")
                    }
                    ))
                }
                var g = $(this).outerWidth()
                  , y = t.outerWidth()
                  , v = $(this).offset().left;
                y > g && y + v > $("#" + Store.container).width() && (v = v - y + g),
                mouseclickposition(t, v - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-merge-button").click((function() {
                if (checkProtectionNotEnable(Store.currentSheetIndex))
                    if (selectIsOverlap())
                        isEditMode() ? alert("不能合并重叠区域") : tooltip.info("不能合并重叠区域", "");
                    else {
                        if (null != Store.config.merge) {
                            for (var e = !1, t = 0; t < Store.luckysheet_select_save.length; t++) {
                                var r = Store.luckysheet_select_save[t].row[0]
                                  , a = Store.luckysheet_select_save[t].row[1]
                                  , n = Store.luckysheet_select_save[t].column[0]
                                  , o = Store.luckysheet_select_save[t].column[1];
                                if (e = hasPartMC(Store.config, r, a, n, o))
                                    break
                            }
                            if (e)
                                return void (isEditMode() ? alert("无法对部分合并单元格执行此操作") : tooltip.info("无法对部分合并单元格执行此操作", ""))
                        }
                        var l = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat_mc(l, "mergeAll")
                    }
            }
            )),
            $("#luckysheet-icon-merge-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale().merge
                      , a = [{
                        text: r.mergeAll,
                        value: "mergeAll",
                        example: ""
                    }, {
                        text: r.mergeV,
                        value: "mergeV",
                        example: ""
                    }, {
                        text: r.mergeH,
                        value: "mergeH",
                        example: ""
                    }, {
                        text: r.mergeCancel,
                        value: "mergeCancel",
                        example: ""
                    }]
                      , n = _this.createButtonMenu(a)
                      , o = replaceHtml$1(_this.menu, {
                        id: "merge-menu",
                        item: n,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(o),
                    t = $("#" + e).width(110),
                    _this.focus(t),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        if (t.hide(),
                        luckysheetContainerFocus(),
                        selectIsOverlap())
                            isEditMode() ? alert(r.overlappingError) : tooltip.info(r.overlappingError, "");
                        else {
                            if (null != Store.config.merge) {
                                for (var e = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                                    var n = Store.luckysheet_select_save[a].row[0]
                                      , o = Store.luckysheet_select_save[a].row[1]
                                      , l = Store.luckysheet_select_save[a].column[0]
                                      , i = Store.luckysheet_select_save[a].column[1];
                                    if (e = hasPartMC(Store.config, n, o, l, i))
                                        break
                                }
                                if (e)
                                    return void (isEditMode() ? alert(r.partiallyError) : tooltip.info(r.partiallyError, ""))
                            }
                            var s = $(this).attr("itemvalue");
                            _this.focus(t, s);
                            var c = editor.deepCopyFlowData(Store.flowdata);
                            _this.updateFormat_mc(c, s)
                        }
                    }
                    ))
                }
                var l = $(this).outerWidth()
                  , i = t.outerWidth()
                  , s = $(this).offset().left;
                i > l && i + s > $("#" + Store.container).width() && (s = s - i + l),
                mouseclickposition(t, s - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-align").click((function() {
                var e = $("#luckysheet-icon-align").attr("type");
                null == e && (e = "left");
                var t = editor.deepCopyFlowData(Store.flowdata);
                _this.updateFormat(t, "ht", e)
            }
            )),
            $("#luckysheet-icon-align-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale().align
                      , a = [{
                        text: r.left,
                        value: "left",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-left iconfont icon-wenbenzuoduiqi" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.center,
                        value: "center",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-center iconfont icon-wenbenjuzhongduiqi" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.right,
                        value: "right",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-right iconfont icon-wenbenyouduiqi" style="user-select: none;"> </div> </div>'
                    }]
                      , n = iconfontObjects.align
                      , o = _this.createButtonMenu(a)
                      , l = replaceHtml$1(_this.menu, {
                        id: "align-menu",
                        item: o,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(l),
                    t = $("#" + e).width(120),
                    _this.focus(t),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        _this.focus(t, e),
                        $("#luckysheet-icon-align").attr("type", e).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-" + e + n[e]);
                        var r = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(r, "ht", e)
                    }
                    ))
                }
                var i = $(this).outerWidth()
                  , s = t.outerWidth()
                  , c = $(this).offset().left;
                s > i && s + c > $("#" + Store.container).width() && (c = c - s + i),
                mouseclickposition(t, c - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-valign").click((function() {
                var e = $("#luckysheet-icon-valign").attr("type");
                null == e && (e = "bottom");
                var t = editor.deepCopyFlowData(Store.flowdata);
                _this.updateFormat(t, "vt", e)
            }
            )),
            $("#luckysheet-icon-valign-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e)
                  , r = locale().align;
                if (0 == t.length) {
                    var a = [{
                        text: r.top,
                        value: "top",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-top iconfont icon-dingbuduiqi" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.middle,
                        value: "middle",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-middle iconfont icon-shuipingduiqi" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.bottom,
                        value: "bottom",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-bottom iconfont icon-dibuduiqi" style="user-select: none;"> </div> </div>'
                    }]
                      , n = iconfontObjects.align
                      , o = _this.createButtonMenu(a)
                      , l = replaceHtml$1(_this.menu, {
                        id: "valign-menu",
                        item: o,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(l),
                    t = $("#" + e).width(120),
                    _this.focus(t, "bottom"),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        _this.focus(t, e),
                        $("#luckysheet-icon-valign").attr("type", e).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-" + e + n[e]);
                        var r = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(r, "vt", e)
                    }
                    ))
                }
                var i = $(this).outerWidth()
                  , s = t.outerWidth()
                  , c = $(this).offset().left;
                s > i && s + c > $("#" + Store.container).width() && (c = c - s + i),
                mouseclickposition(t, c - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-textwrap-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale().textWrap
                      , a = [{
                        text: r.overflow,
                        value: "overflow",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-overflow iconfont icon-yichu1" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.wrap,
                        value: "wrap",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-wrap iconfont icon-zidonghuanhang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.clip,
                        value: "clip",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-clip iconfont icon-jieduan" style="user-select: none;"> </div> </div>'
                    }]
                      , n = iconfontObjects.textWrap
                      , o = _this.createButtonMenu(a)
                      , l = replaceHtml$1(_this.menu, {
                        id: "textwrap-menu",
                        item: o,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(l),
                    t = $("#" + e).width(120),
                    _this.focus(t, "clip"),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        _this.focus(t, e),
                        $("#luckysheet-icon-textwrap").attr("type", e).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-" + e + n[e]);
                        var r = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(r, "tb", e)
                    }
                    ))
                }
                var i = $(this).outerWidth()
                  , s = t.outerWidth()
                  , c = $(this).offset().left;
                s > i && s + c > $("#" + Store.container).width() && (c = c - s + i),
                mouseclickposition(t, c - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-rotation-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale().rotation
                      , a = [{
                        text: r.none,
                        value: "none",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-wuxuanzhuang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.angleup,
                        value: "angleup",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angleup iconfont icon-xiangshangqingxie" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.angledown,
                        value: "angledown",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angledown iconfont icon-xiangxiaqingxie" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.vertical,
                        value: "vertical",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-vertical iconfont icon-shupaiwenzi" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.rotationUp,
                        value: "rotation-up",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-up iconfont icon-wenbenxiangshang" style="user-select: none;"> </div> </div>'
                    }, {
                        text: r.rotationDown,
                        value: "rotation-down",
                        example: '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-down iconfont icon-xiangxia90" style="user-select: none;"> </div> </div>'
                    }]
                      , n = iconfontObjects.rotation
                      , o = _this.createButtonMenu(a)
                      , l = replaceHtml$1(_this.menu, {
                        id: "rotation-menu",
                        item: o,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(l),
                    t = $("#" + e).width(160),
                    _this.focus(t),
                    t.find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        _this.focus(t, e),
                        $("#luckysheet-icon-rotation").attr("type", e).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-" + e + n[e]);
                        var r = editor.deepCopyFlowData(Store.flowdata);
                        _this.updateFormat(r, "tr", e)
                    }
                    ))
                }
                var i = $(this).outerWidth()
                  , s = t.outerWidth()
                  , c = $(this).offset().left;
                s > i && s + c > $("#" + Store.container).width() && (c = c - s + i),
                mouseclickposition(t, c - 28, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-freezen-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale().freezen
                      , a = [{
                        text: r.freezenRow,
                        value: "freezenRow",
                        example: ""
                    }, {
                        text: r.freezenColumn,
                        value: "freezenColumn",
                        example: ""
                    }, {
                        text: r.freezenRC,
                        value: "freezenRC",
                        example: ""
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: r.freezenRowRange,
                        value: "freezenRowRange",
                        example: ""
                    }, {
                        text: r.freezenColumnRange,
                        value: "freezenColumnRange",
                        example: ""
                    }, {
                        text: r.freezenRCRange,
                        value: "freezenRCRange",
                        example: ""
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: r.freezenCancel,
                        value: "freezenCancel",
                        example: ""
                    }]
                      , n = _this.createButtonMenu(a)
                      , o = replaceHtml$1(_this.menu, {
                        id: "freezen-menu",
                        item: n,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(o),
                    (t = $("#" + e).width(170)).find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if (_this.focus(t, e),
                        luckysheetFreezen.saveFrozen(e),
                        "freezenRow" == e) {
                            var a = $("#luckysheet-cell-main").scrollTop()
                              , n = luckysheet_searcharray(Store.visibledatarow, a);
                            -1 == n && (n = 0);
                            var o = Store.visibledatarow[n] - 2 - a + Store.columnHeaderHeight
                              , l = [Store.visibledatarow[n], n + 1, a, luckysheetFreezen.cutVolumn(Store.visibledatarow, n + 1), o];
                            luckysheetFreezen.saveFreezen(l, o, null, null),
                            null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            luckysheetFreezen.createFreezenHorizontal(l, o),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else if ("freezenColumn" == e) {
                            var i = $("#luckysheet-cell-main").scrollLeft()
                              , s = luckysheet_searcharray(Store.visibledatacolumn, i);
                            -1 == s && (s = 0);
                            var c = Store.visibledatacolumn[s] - 2 - i + Store.rowHeaderWidth
                              , u = [Store.visibledatacolumn[s], s + 1, i, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, s + 1), c];
                            luckysheetFreezen.saveFreezen(null, null, u, c),
                            null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            luckysheetFreezen.createFreezenVertical(u, c),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else if ("freezenRC" == e) {
                            var h = $("#luckysheet-cell-main").scrollTop()
                              , d = luckysheet_searcharray(Store.visibledatarow, h);
                            -1 == d && (d = 0);
                            var f = Store.visibledatarow[d] - 2 - h + Store.columnHeaderHeight
                              , m = [Store.visibledatarow[d], d + 1, h, luckysheetFreezen.cutVolumn(Store.visibledatarow, d + 1), f];
                            luckysheetFreezen.saveFreezen(m, f, null, null),
                            luckysheetFreezen.createFreezenHorizontal(m, f);
                            var p = $("#luckysheet-cell-main").scrollLeft()
                              , g = luckysheet_searcharray(Store.visibledatacolumn, p);
                            -1 == g && (g = 0);
                            var y = Store.visibledatacolumn[g] - 2 - p + Store.rowHeaderWidth
                              , v = [Store.visibledatacolumn[g], g + 1, p, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, g + 1), y];
                            luckysheetFreezen.saveFreezen(null, null, v, y),
                            luckysheetFreezen.createFreezenVertical(v, y),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else if ("freezenRowRange" == e) {
                            if (null == Store.luckysheet_select_save || 0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(r.noSeletionError) : tooltip.info(r.noSeletionError, ""));
                            var A = $("#luckysheet-cell-main").scrollTop()
                              , b = luckysheet_searcharray(Store.visibledatarow, A)
                              , k = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                              , w = null == k.row_focus ? k.row[0] : k.row_focus;
                            w > b && (b = w),
                            -1 == b && (b = 0);
                            var x = Store.visibledatarow[b] - 2 - A + Store.columnHeaderHeight
                              , S = [Store.visibledatarow[b], b + 1, A, luckysheetFreezen.cutVolumn(Store.visibledatarow, b + 1), x];
                            luckysheetFreezen.saveFreezen(S, x, null, null),
                            null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            luckysheetFreezen.createFreezenHorizontal(S, x),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else if ("freezenColumnRange" == e) {
                            if (null == Store.luckysheet_select_save || 0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(r.noSeletionError) : tooltip.info(r.noSeletionError, ""));
                            var _ = $("#luckysheet-cell-main").scrollLeft()
                              , C = luckysheet_searcharray(Store.visibledatacolumn, _)
                              , T = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                              , E = null == T.column_focus ? T.column[0] : T.column_focus;
                            E > C && (C = E),
                            -1 == C && (C = 0);
                            var I = Store.visibledatacolumn[C] - 2 - _ + Store.rowHeaderWidth
                              , R = [Store.visibledatacolumn[C], C + 1, _, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, C + 1), I];
                            luckysheetFreezen.saveFreezen(null, null, R, I),
                            null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            luckysheetFreezen.createFreezenVertical(R, I),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else if ("freezenRCRange" == e) {
                            if (null == Store.luckysheet_select_save || 0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(r.noSeletionError) : tooltip.info(r.noSeletionError, ""));
                            var B = $("#luckysheet-cell-main").scrollTop()
                              , N = luckysheet_searcharray(Store.visibledatarow, B)
                              , F = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                              , P = null == F.row_focus ? F.row[0] : F.row_focus;
                            P > N && (N = P),
                            -1 == N && (N = 0);
                            var L = Store.visibledatarow[N] - 2 - B + Store.columnHeaderHeight
                              , O = [Store.visibledatarow[N], N + 1, B, luckysheetFreezen.cutVolumn(Store.visibledatarow, N + 1), L];
                            luckysheetFreezen.saveFreezen(O, L, null, null),
                            luckysheetFreezen.createFreezenHorizontal(O, L);
                            var D = $("#luckysheet-cell-main").scrollLeft()
                              , M = luckysheet_searcharray(Store.visibledatacolumn, D)
                              , U = null == F.column_focus ? F.column[0] : F.column_focus;
                            U > M && (M = U),
                            -1 == M && (M = 0);
                            var H = Store.visibledatacolumn[M] - 2 - D + Store.rowHeaderWidth
                              , q = [Store.visibledatacolumn[M], M + 1, D, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, M + 1), H];
                            luckysheetFreezen.saveFreezen(null, null, q, H),
                            luckysheetFreezen.createFreezenVertical(q, H),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()
                        } else
                            "freezenCancel" == e && (null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
                            luckysheetFreezen.createAssistCanvas(),
                            luckysheetrefreshgrid()),
                            luckysheetFreezen.scrollAdapt());
                        setTimeout((function() {
                            luckysheetsizeauto()
                        }
                        ), 0)
                    }
                    ))
                }
                var l = $(this).outerWidth()
                  , i = t.outerWidth()
                  , s = $(this).offset().left;
                i > l && i + s > $("#" + Store.container).width() && (s = s - i + l),
                mouseclickposition(t, s - 68, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-autofilter").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e);
                if (0 == t.length) {
                    var r = locale()
                      , a = r.sort
                      , n = r.filter
                      , o = [{
                        text: a.asc,
                        value: "asc",
                        example: '<i class="iconfont icon-shengxu" aria-hidden="true"></i>'
                    }, {
                        text: a.desc,
                        value: "desc",
                        example: '<i class="iconfont icon-jiangxu" aria-hidden="true"></i>'
                    }, {
                        text: a.custom + "...",
                        value: "diysort",
                        example: '<i class="iconfont icon-zidingyipaixu" aria-hidden="true"></i>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: n.filter,
                        value: "filter",
                        example: '<i class="iconfont icon-shaixuan2" aria-hidden="true"></i>'
                    }, {
                        text: n.clearFilter,
                        value: "clearfilter",
                        example: '<i class="iconfont icon-qingchushaixuan" aria-hidden="true"></i>'
                    }]
                      , l = _this.createButtonMenu(o)
                      , i = replaceHtml$1(_this.menu, {
                        id: "autofilter",
                        item: l,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(i),
                    (t = $("#" + e).width(150)).find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        "diysort" == e ? $("#luckysheetorderby").click() : "asc" == e ? sortSelection(!0) : "desc" == e ? sortSelection(!1) : "filter" == e ? $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex).length > 0 ? $("#luckysheet-filter-initial").click() : createFilter() : "clearfilter" == e && $("#luckysheet-filter-initial").click()
                    }
                    ))
                }
                var s = $(this).outerWidth()
                  , c = t.outerWidth()
                  , u = $(this).offset().left;
                c > s && c + u > $("#" + Store.container).width() && (u = u - c + s),
                mouseclickposition(t, u, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-seachmore").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e)
                  , r = locale().findAndReplace;
                if (0 == t.length) {
                    var a = [{
                        text: r.find + " ...",
                        value: "search",
                        example: '<i class="iconfont icon-sousuo" aria-hidden="true"></i>'
                    }, {
                        text: r.replace + " ...",
                        value: "replace",
                        example: '<i class="iconfont icon-tihuan" aria-hidden="true"></i>'
                    }, {
                        text: r.goto + " ...",
                        value: "goto",
                        example: '<i class="iconfont icon-zhuandao1" aria-hidden="true"></i>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: r.location + " ...",
                        value: "location",
                        example: '<i class="iconfont icon-dingwei" aria-hidden="true"></i>'
                    }, {
                        text: r.formula,
                        value: "locationFormula",
                        example: r.locationExample
                    }, {
                        text: r.date,
                        value: "locationConstantDate",
                        example: r.locationExample
                    }, {
                        text: r.number,
                        value: "locationConstantNumber",
                        example: r.locationExample
                    }, {
                        text: r.string,
                        value: "locationConstantString",
                        example: r.locationExample
                    }, {
                        text: r.error,
                        value: "locationConstantError",
                        example: r.locationExample
                    }, {
                        text: r.condition,
                        value: "locationCF",
                        example: r.locationExample
                    }, {
                        text: r.rowSpan,
                        value: "locationStepRow",
                        example: r.locationExample
                    }, {
                        text: r.columnSpan,
                        value: "locationStepColumn",
                        example: r.locationExample
                    }]
                      , n = _this.createButtonMenu(a)
                      , o = replaceHtml$1(_this.menu, {
                        id: "seachmore",
                        item: n,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(o),
                    (t = $("#" + e).width(180)).find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if ("search" == e || "replace" == e)
                            "search" == e ? luckysheetSearchReplace.createDialog(0) : "replace" == e && luckysheetSearchReplace.createDialog(1),
                            luckysheetSearchReplace.init(),
                            $("#luckysheet-search-replace #searchInput input").focus();
                        else if ("location" == e)
                            luckysheetLocationCell.createDialog(),
                            luckysheetLocationCell.init();
                        else if ("locationFormula" == e || "locationConstantDate" == e || "locationConstantNumber" == e || "locationConstantString" == e || "locationConstantError" == e || "locationCF" == e) {
                            var a, n = Store.luckysheet_select_save[0];
                            a = 0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && n.row[0] == n.row[1] && n.column[0] == n.column[1] ? [{
                                row: [0, Store.flowdata.length - 1],
                                column: [0, Store.flowdata[0].length - 1]
                            }] : $.extend(!0, [], Store.luckysheet_select_save),
                            "locationFormula" == e ? luckysheetLocationCell.apply(a, "locationFormula", "all") : "locationConstantDate" == e ? luckysheetLocationCell.apply(a, "locationConstant", "d") : "locationConstantNumber" == e ? luckysheetLocationCell.apply(a, "locationConstant", "n") : "locationConstantString" == e ? luckysheetLocationCell.apply(a, "locationConstant", "s,g") : "locationConstantError" == e ? luckysheetLocationCell.apply(a, "locationConstant", "e") : "locationCF" == e && luckysheetLocationCell.apply(a, "locationCF")
                        } else if ("locationStepRow" == e) {
                            if (0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1])
                                return void (isEditMode() ? alert(r.lessTwoRowTip) : tooltip.info("", r.lessTwoRowTip));
                            var o = $.extend(!0, [], Store.luckysheet_select_save);
                            luckysheetLocationCell.apply(o, "locationStepRow")
                        } else if ("locationStepColumn" == e) {
                            if (0 == Store.luckysheet_select_save.length || 1 == Store.luckysheet_select_save.length && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1])
                                return void (isEditMode() ? alert(r.lessTwoColumnTip) : tooltip.info("", r.lessTwoColumnTip));
                            var l = $.extend(!0, [], Store.luckysheet_select_save);
                            luckysheetLocationCell.apply(l, "locationStepColumn")
                        }
                    }
                    ))
                }
                var l = $(this).outerWidth()
                  , i = t.outerWidth()
                  , s = $(this).offset().left;
                i > l && i + s > $("#" + Store.container).width() && (s = s - i + l),
                mouseclickposition(t, s, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-function").click((function() {
                _this.autoSelectionFormula("SUM")
            }
            )),
            $("#luckysheet-icon-function-menu").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e)
                  , r = locale().formula;
                if (0 == t.length) {
                    var a = [{
                        text: r.sum,
                        value: "SUM",
                        example: "SUM"
                    }, {
                        text: r.average,
                        value: "AVERAGE",
                        example: "AVERAGE"
                    }, {
                        text: r.count,
                        value: "COUNT",
                        example: "COUNT"
                    }, {
                        text: r.max,
                        value: "MAX",
                        example: "MAX"
                    }, {
                        text: r.min,
                        value: "MIN",
                        example: "MIN"
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: r.ifGenerate,
                        value: "if",
                        example: "IF"
                    }, {
                        text: r.find + " ...",
                        value: "formula",
                        example: ""
                    }]
                      , n = _this.createButtonMenu(a)
                      , o = replaceHtml$1(_this.menu, {
                        id: "function-menu",
                        item: n,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(o),
                    (t = $("#" + e).width(180)).find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if ("if" == e) {
                            var a = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                              , n = null == a.row_focus ? a.row[0] : a.row_focus
                              , o = null == a.column_focus ? a.column[0] : a.column_focus;
                            if (Store.flowdata[n] && Store.flowdata[n][o] && Store.flowdata[n][o].f) {
                                var l = Store.flowdata[n][o].f.toString();
                                if (-1 == l.indexOf("=if("))
                                    return void (isEditMode() ? alert(r.tipNotBelongToIf) : tooltip.info(r.tipNotBelongToIf, ""));
                                ifFormulaGenerator.ifFormulaDialog(l)
                            } else
                                ifFormulaGenerator.ifFormulaDialog();
                            ifFormulaGenerator.init()
                        } else if ("formula" == e) {
                            if (0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(r.tipSelectCell) : tooltip.info(r.tipSelectCell, ""));
                            var i = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                              , s = i.row_focus
                              , c = i.column_focus;
                            luckysheetupdateCell(s, c, Store.flowdata);
                            var u = Store.flowdata[s][c];
                            if (null != u && null != u.f) {
                                var h = luckysheetformula.getfunctionParam(u.f);
                                null != h.fn ? insertFormula.formulaParmDialog(h.fn, h.param) : insertFormula.formulaListDialog()
                            } else
                                $("#luckysheet-rich-text-editor").html('<span dir="auto" class="luckysheet-formula-text-color">=</span>'),
                                $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
                                insertFormula.formulaListDialog();
                            insertFormula.init()
                        } else
                            _this.autoSelectionFormula(e)
                    }
                    ))
                }
                var l = $(this).outerWidth()
                  , i = t.outerWidth()
                  , s = $(this).offset().left;
                i > l && i + s > $("#" + Store.container).width() && (s = s - i + l),
                mouseclickposition(t, s - 48, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-bold").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function(e) {
                var t = editor.deepCopyFlowData(Store.flowdata)
                  , r = Store.luckysheet_select_save[0].row_focus
                  , a = Store.luckysheet_select_save[0].column_focus
                  , n = _this.checkstatus(t, r, a, "bl");
                n = 1 == n ? 0 : 1,
                _this.updateFormat(t, "bl", n),
                _this.menuButtonFocus(t, r, a)
            }
            )),
            $("#luckysheet-icon-italic").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = Store.luckysheet_select_save[0].row_focus
                  , r = Store.luckysheet_select_save[0].column_focus
                  , a = _this.checkstatus(e, t, r, "it");
                a = 1 == a ? 0 : 1,
                _this.updateFormat(e, "it", a),
                _this.menuButtonFocus(e, t, r)
            }
            )),
            $("#luckysheet-icon-strikethrough").mousedown((function(e) {
                hideMenuByCancel(e),
                e.stopPropagation()
            }
            )).click((function() {
                var e = editor.deepCopyFlowData(Store.flowdata)
                  , t = Store.luckysheet_select_save[0].row_focus
                  , r = Store.luckysheet_select_save[0].column_focus
                  , a = _this.checkstatus(e, t, r, "cl");
                a = 1 == a ? 0 : 1,
                _this.updateFormat(e, "cl", a),
                _this.menuButtonFocus(e, t, r)
            }
            )),
            $("#luckysheet-icon-conditionformat").click((function() {
                var menuButtonId = $(this).attr("id") + "-menuButton"
                  , $menuButton = $("#" + menuButtonId)
                  , conditionformat_text = locale().conditionformat;
                if (0 == $menuButton.length) {
                    var itemdata = [{
                        text: conditionformat_text.highlightCellRules,
                        value: "highlightCellRule",
                        example: "more"
                    }, {
                        text: conditionformat_text.itemSelectionRules,
                        value: "projectSelectRule",
                        example: "more"
                    }, {
                        text: conditionformat_text.dataBar,
                        value: "dataBar",
                        example: "more"
                    }, {
                        text: conditionformat_text.colorGradation,
                        value: "colorGradation",
                        example: "more"
                    }, {
                        text: conditionformat_text.icons,
                        value: "icons",
                        example: ""
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: conditionformat_text.newRule,
                        value: "newRule",
                        example: ""
                    }, {
                        text: conditionformat_text.deleteRule,
                        value: "deleteRule",
                        example: "more"
                    }, {
                        text: conditionformat_text.manageRules,
                        value: "administerRule",
                        example: ""
                    }]
                      , itemset = _this.createButtonMenu(itemdata)
                      , menu = replaceHtml$1(_this.menu, {
                        id: "conditionformat",
                        item: itemset,
                        subclass: "",
                        sub: ""
                    })
                      , subitemdata = [{
                        text: conditionformat_text.greaterThan,
                        value: "greaterThan",
                        example: ">"
                    }, {
                        text: conditionformat_text.lessThan,
                        value: "lessThan",
                        example: "<"
                    }, {
                        text: conditionformat_text.between,
                        value: "betweenness",
                        example: "[]"
                    }, {
                        text: conditionformat_text.equal,
                        value: "equal",
                        example: "="
                    }, {
                        text: conditionformat_text.textContains,
                        value: "textContains",
                        example: "()"
                    }, {
                        text: conditionformat_text.occurrence,
                        value: "occurrenceDate",
                        example: conditionformat_text.yesterday
                    }, {
                        text: conditionformat_text.duplicateValue,
                        value: "duplicateValue",
                        example: "##"
                    }]
                      , subitemset = _this.createButtonMenu(subitemdata)
                      , submenu = replaceHtml$1(_this.menu, {
                        id: "highlightCellRule",
                        item: subitemset,
                        subclass: "luckysheet-menuButton-sub"
                    })
                      , subitemdata2 = [{
                        text: conditionformat_text.top10,
                        value: "top10",
                        example: conditionformat_text.top10
                    }, {
                        text: conditionformat_text.top10_percent,
                        value: "top10%",
                        example: conditionformat_text.top10_percent
                    }, {
                        text: conditionformat_text.last10,
                        value: "last10",
                        example: conditionformat_text.last10
                    }, {
                        text: conditionformat_text.last10_percent,
                        value: "last10%",
                        example: conditionformat_text.last10_percent
                    }, {
                        text: conditionformat_text.aboveAverage,
                        value: "AboveAverage",
                        example: conditionformat_text.above
                    }, {
                        text: conditionformat_text.belowAverage,
                        value: "SubAverage",
                        example: conditionformat_text.below
                    }]
                      , subitemset2 = _this.createButtonMenu(subitemdata2)
                      , submenu2 = replaceHtml$1(_this.menu, {
                        id: "projectSelectRule",
                        item: subitemset2,
                        subclass: "luckysheet-menuButton-sub"
                    })
                      , submenu3 = '<div id="luckysheet-icon-dataBar-menuButton" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-menuButton luckysheet-menuButton-sub luckysheet-mousedown-cancel" style="width: 126px;padding: 5px;top: 118.5px;left: 1321.48px;display: none;">\n                                    <div itemvalue="0" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 0;" title="'.concat(conditionformat_text.gradientDataBar_1, '"></div>\n                                    </div>\n                                    <div itemvalue="1" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px 0;" title="').concat(conditionformat_text.gradientDataBar_2, '"></div>\n                                    </div>\n                                    <div itemvalue="2" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px 0;" title="').concat(conditionformat_text.gradientDataBar_3, '"></div>\n                                    </div>\n                                    <div itemvalue="3" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 -36px;" title="').concat(conditionformat_text.gradientDataBar_4, '"></div>\n                                    </div>\n                                    <div itemvalue="4" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px -36px;" title="').concat(conditionformat_text.gradientDataBar_5, '"></div>\n                                    </div>\n                                    <div itemvalue="5" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px -36px;" title="').concat(conditionformat_text.gradientDataBar_6, '"></div>\n                                    </div>\n                                    <div itemvalue="6" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 -72px;" title="').concat(conditionformat_text.solidColorDataBar_1, '"></div>\n                                    </div>\n                                    <div itemvalue="7" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px -72px;" title="').concat(conditionformat_text.solidColorDataBar_2, '"></div>\n                                    </div>\n                                    <div itemvalue="8" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px -72px;" title="').concat(conditionformat_text.solidColorDataBar_3, '"></div>\n                                    </div>\n                                    <div itemvalue="9" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 -108px;" title="').concat(conditionformat_text.solidColorDataBar_4, '"></div>\n                                    </div>\n                                    <div itemvalue="10" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px -108px;" title="').concat(conditionformat_text.solidColorDataBar_5, '"></div>\n                                    </div>\n                                    <div itemvalue="11" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px -108px;" title="').concat(conditionformat_text.solidColorDataBar_6, '"></div>\n                                    </div>\n                                </div>')
                      , submenu4 = '<div id="luckysheet-icon-colorGradation-menuButton" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-menuButton luckysheet-menuButton-sub luckysheet-mousedown-cancel" style="width: 126px;padding: 5px;top: 143.5px;left: 1321.48px;display: none;">\n                                    <div itemvalue="0" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 0;" title="'.concat(conditionformat_text.colorGradation_1, '"></div>\n                                    </div>\n                                    <div itemvalue="1" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px 0;" title="').concat(conditionformat_text.colorGradation_2, '"></div>\n                                    </div>\n                                    <div itemvalue="2" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px 0;" title="').concat(conditionformat_text.colorGradation_3, '"></div>\n                                    </div>\n                                    <div itemvalue="3" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -114px 0;" title="').concat(conditionformat_text.colorGradation_4, '"></div>\n                                    </div>\n                                    <div itemvalue="4" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 -36px;" title="').concat(conditionformat_text.colorGradation_5, '"></div>\n                                    </div>\n                                    <div itemvalue="5" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px -36px;" title="').concat(conditionformat_text.colorGradation_6, '"></div>\n                                    </div>\n                                    <div itemvalue="6" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px -36px;" title="').concat(conditionformat_text.colorGradation_7, '"></div>\n                                    </div>\n                                    <div itemvalue="7" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -114px -36px;" title="').concat(conditionformat_text.colorGradation_8, '"></div>\n                                    </div>\n                                    <div itemvalue="8" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: 0 -72px;" title="').concat(conditionformat_text.colorGradation_9, '"></div>\n                                    </div>\n                                    <div itemvalue="9" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -38px -72px;" title="').concat(conditionformat_text.colorGradation_10, '"></div>\n                                    </div>\n                                    <div itemvalue="10" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -76px -72px;" title="').concat(conditionformat_text.colorGradation_11, '"></div>\n                                    </div>\n                                    <div itemvalue="11" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel" style="width: 28px; height: 26px;padding: 5px;float: left;">\n                                        <div class="luckysheet-mousedown-cancel bgImgBox" style="background-position: -114px -72px;" title="').concat(conditionformat_text.colorGradation_12, '"></div>\n                                    </div>\n                                </div>')
                      , subitemdata6 = [{
                        text: conditionformat_text.deleteSheetRule,
                        value: "delSheet",
                        example: ""
                    }]
                      , subitemset6 = _this.createButtonMenu(subitemdata6)
                      , submenu6 = replaceHtml$1(_this.menu, {
                        id: "deleteRule",
                        item: subitemset6,
                        subclass: "luckysheet-menuButton-sub"
                    });
                    $("body").append(menu + submenu + submenu2 + submenu3 + submenu4 + submenu6),
                    $menuButton = $("#" + menuButtonId).width(190),
                    $("#luckysheet-icon-highlightCellRule-menuButton").width(160),
                    $("#luckysheet-icon-projectSelectRule-menuButton").width(180),
                    $menuButton.find(".luckysheet-cols-menuitem").click((function() {
                        $menuButton.hide(),
                        luckysheetContainerFocus();
                        var $t = $(this)
                          , itemvalue = $t.attr("itemvalue");
                        if ("icons" == itemvalue) {
                            if (0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(conditionformat_text.pleaseSelectRange) : tooltip.info(conditionformat_text.pleaseSelectRange, ""));
                            conditionformat.CFiconsDialog(),
                            conditionformat.init()
                        } else if ("newRule" == itemvalue) {
                            if (0 == Store.luckysheet_select_save.length)
                                return void (isEditMode() ? alert(conditionformat_text.pleaseSelectRange) : tooltip.info(conditionformat_text.pleaseSelectRange, ""));
                            conditionformat.newConditionRuleDialog(0),
                            conditionformat.init()
                        } else if ("administerRule" == itemvalue) {
                            var loadSheetUrl = server.loadSheetUrl
                              , file = getluckysheetfile();
                            if ("" != loadSheetUrl && null != loadSheetUrl) {
                                for (var sheetindex = [], i = 0; i < file.length; i++)
                                    sheetindex.push(file[i].index);
                                $.post(loadSheetUrl, {
                                    gridKey: server.gridKey,
                                    index: sheetindex.join(",")
                                }, (function(d) {
                                    var dataset = eval("(" + d + ")");
                                    for (var item in setTimeout((function() {
                                        $("#luckysheetloadingdata").fadeOut().remove()
                                    }
                                    ), 500),
                                    dataset)
                                        if (item != Store.currentSheetIndex) {
                                            var otherfile = file[getSheetIndex(item)];
                                            otherfile.celldata = dataset[item.toString()],
                                            otherfile.data = sheetmanage.buildGridData(otherfile)
                                        }
                                    setluckysheetfile(file),
                                    conditionformat.fileClone = $.extend(!0, [], file),
                                    conditionformat.administerRuleDialog(),
                                    conditionformat.init()
                                }
                                ))
                            } else
                                conditionformat.fileClone = $.extend(!0, [], file),
                                conditionformat.administerRuleDialog(),
                                conditionformat.init()
                        }
                    }
                    )),
                    $(document).off("click.CFhighlightCellRule").on("click.CFhighlightCellRule", "#luckysheet-icon-highlightCellRule-menuButton .luckysheet-cols-menuitem", (function() {
                        $menuButton.hide(),
                        $("#luckysheet-icon-highlightCellRule-menuButton").hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if (0 != Store.luckysheet_select_save.length) {
                            var t, r, a = conditionformat.textCellColorHtml();
                            switch (e) {
                            case "greaterThan":
                                t = conditionformat_text.conditionformat_greaterThan,
                                r = '<div class="box" data-itemvalue="greaterThan">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_greaterThan_title, '：</div>\n                                                <div class="inpbox range">\n                                                    <input id="conditionVal" class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div> \n                                                ").concat(a, " \n                                            </div>");
                                break;
                            case "lessThan":
                                t = conditionformat_text.conditionformat_lessThan,
                                r = '<div class="box" data-itemvalue="lessThan">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_lessThan_title, '：</div>\n                                                <div class="inpbox range">\n                                                    <input id="conditionVal" class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "betweenness":
                                t = conditionformat_text.conditionformat_betweenness,
                                r = '<div class="box" data-itemvalue="betweenness">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_betweenness_title, '：</div>\n                                                <div style="height: 30px;line-height: 30px;">\n                                                    <div class="inpbox2 range">\n                                                        <input id="conditionVal" class="formulaInputFocus"/>\n                                                        <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                    </div>\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.to, '</div>\n                                                    <div class="inpbox2 range">\n                                                        <input id="conditionVal2" class="formulaInputFocus"/>\n                                                        <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                    </div>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "equal":
                                t = conditionformat_text.conditionformat_equal,
                                r = '<div class="box" data-itemvalue="equal">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_equal_title, '：</div>\n                                                <div class="inpbox range">\n                                                    <input id="conditionVal" class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "textContains":
                                t = conditionformat_text.conditionformat_textContains,
                                r = '<div class="box" data-itemvalue="textContains">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_textContains_title, '：</div>\n                                                <div class="inpbox range">\n                                                    <input id="conditionVal" class="formulaInputFocus"/>\n                                                    <i class="fa fa-table" aria-hidden="true" title="').concat(conditionformat_text.selectCell, '"></i>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "occurrenceDate":
                                t = conditionformat_text.conditionformat_occurrenceDate,
                                r = '<div class="box" data-itemvalue="occurrenceDate">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_occurrenceDate_title, '：</div>\n                                                <div class="inpbox">\n                                                    <input id="daterange-btn" class="formulaInputFocus" readonly="readonly" placeholder="').concat(conditionformat_text.pleaseSelectADate, '"/>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "duplicateValue":
                                t = conditionformat_text.conditionformat_duplicateValue,
                                r = '<div class="box" data-itemvalue="duplicateValue">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_duplicateValue_title, '：</div>\n                                                <select id="conditionVal" class="selectbox">\n                                                    <option value="0">').concat(conditionformat_text.duplicateValue, '</option>\n                                                    <option value="1">').concat(conditionformat_text.uniqueValue, '</option>\n                                                </select>\n                                                <div style="margin:5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>")
                            }
                            conditionformat.conditionformatDialog(t, r)
                        } else
                            isEditMode() ? alert(conditionformat_text.pleaseSelectRange) : tooltip.info(conditionformat_text.pleaseSelectRange, "")
                    }
                    )),
                    $(document).off("click.CFprojectSelectRule").on("click.CFprojectSelectRule", "#luckysheet-icon-projectSelectRule-menuButton .luckysheet-cols-menuitem", (function() {
                        $menuButton.hide(),
                        $("#luckysheet-icon-projectSelectRule-menuButton").hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if (0 != Store.luckysheet_select_save.length) {
                            var t, r, a = conditionformat.textCellColorHtml();
                            switch (e) {
                            case "top10":
                                t = conditionformat_text.conditionformat_top10,
                                r = '<div class="box" data-itemvalue="top10">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_top10_title, '：</div>\n                                                <div style="height: 30px;line-height: 30px;">\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.top, '</div>\n                                                    <div class="inpbox2">\n                                                        <input id="conditionVal" class="formulaInputFocus" type="number" value="10"/>\n                                                    </div>\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.oneself, '</div>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "top10%":
                                t = conditionformat_text.conditionformat_top10_percent,
                                r = '<div class="box" data-itemvalue="top10%">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_top10_title, '：</div>\n                                                <div style="height: 30px;line-height: 30px;">\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.top, '</div>\n                                                    <div class="inpbox2">\n                                                        <input id="conditionVal" class="formulaInputFocus" type="number" value="10"/>\n                                                    </div>\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">%</div>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "last10":
                                t = conditionformat_text.conditionformat_last10,
                                r = '<div class="box" data-itemvalue="last10">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_last10_title, '：</div>\n                                                <div style="height: 30px;line-height: 30px;">\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.last, '</div>\n                                                    <div class="inpbox2">\n                                                        <input id="conditionVal" class="formulaInputFocus" type="number" value="10"/>\n                                                    </div>\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.oneself, '</div>\n                                                </div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAs, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "last10%":
                                t = conditionformat_text.conditionformat_last10_percent,
                                r = '<div class="box" data-itemvalue="last10%">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_last10_title, '：</div>\n                                                <div style="height: 30px;line-height: 30px;">\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">').concat(conditionformat_text.last, '</div>\n                                                    <div class="inpbox2">\n                                                        <input id="conditionVal" class="formulaInputFocus" type="number" value="10"/>\n                                                    </div>\n                                                    <div style="float: left;height: 30px;line-height: 30px;margin: 0 5px;">%</div>\n                                                </div>\n                                                <div style="margin:5px 0;">设置为：</div>\n                                                ').concat(a, "\n                                            </div>");
                                break;
                            case "AboveAverage":
                                t = conditionformat_text.conditionformat_AboveAverage,
                                r = '<div class="box" data-itemvalue="AboveAverage">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_AboveAverage_title, '：</div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAsByArea, "：</div>\n                                                ").concat(a, "\n                                            </div>");
                                break;
                            case "SubAverage":
                                t = conditionformat_text.conditionformat_SubAverage,
                                r = '<div class="box" data-itemvalue="SubAverage">\n                                                <div class="boxTitleOne">'.concat(conditionformat_text.conditionformat_SubAverage_title, '：</div>\n                                                <div style="margin: 5px 0;">').concat(conditionformat_text.setAsByArea, "：</div>\n                                                ").concat(a, "\n                                            </div>")
                            }
                            conditionformat.conditionformatDialog(t, r)
                        } else
                            isEditMode() ? alert(conditionformat_text.pleaseSelectRange) : tooltip.info(conditionformat_text.pleaseSelectRange, "")
                    }
                    )),
                    $(document).off("click.CFdataBar").on("click.CFdataBar", "#luckysheet-icon-dataBar-menuButton .luckysheet-cols-menuitem", (function() {
                        $menuButton.hide(),
                        $("#luckysheet-icon-dataBar-menuButton").hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if (Store.luckysheet_select_save.length > 0) {
                            var t = $.extend(!0, [], Store.luckysheet_select_save)
                              , r = conditionformat.dataBarList[e].format;
                            conditionformat.updateItem("dataBar", t, r)
                        }
                    }
                    )),
                    $(document).off("click.CFcolorGradation").on("click.CFcolorGradation", "#luckysheet-icon-colorGradation-menuButton .luckysheet-cols-menuitem", (function() {
                        $menuButton.hide(),
                        $("#luckysheet-icon-colorGradation-menuButton").hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        if (Store.luckysheet_select_save.length > 0) {
                            var t = $.extend(!0, [], Store.luckysheet_select_save)
                              , r = conditionformat.colorGradationList[e].format;
                            conditionformat.updateItem("colorGradation", t, r)
                        }
                    }
                    )),
                    $(document).off("click.CFdeleteRule").on("click.CFdeleteRule", "#luckysheet-icon-deleteRule-menuButton .luckysheet-cols-menuitem", (function() {
                        $menuButton.hide(),
                        $("#luckysheet-icon-deleteRule-menuButton").hide(),
                        luckysheetContainerFocus(),
                        "delSheet" == $(this).attr("itemvalue") && conditionformat.updateItem("delSheet")
                    }
                    ))
                }
                var userlen = $(this).outerWidth()
                  , tlen = $menuButton.outerWidth()
                  , menuleft = $(this).offset().left;
                tlen > userlen && tlen + menuleft > $("#" + Store.container).width() && (menuleft = menuleft - tlen + userlen),
                mouseclickposition($menuButton, menuleft, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-postil").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e)
                  , r = locale().comment;
                t.remove(),
                luckysheetPostil.removeActivePs();
                var a = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , n = a.row_focus;
                null == n && (n = a.row[0]);
                var o, l = a.column_focus;
                null == l && (l = a.column[0]),
                o = null != Store.flowdata[n][l] && null != Store.flowdata[n][l].ps ? [{
                    text: r.edit,
                    value: "editPs",
                    example: ""
                }, {
                    text: r.delete,
                    value: "delPs",
                    example: ""
                }, {
                    text: "",
                    value: "split",
                    example: ""
                }, {
                    text: r.showOne,
                    value: "showHidePs",
                    example: ""
                }, {
                    text: r.showAll,
                    value: "showHideAllPs",
                    example: ""
                }] : [{
                    text: r.insert,
                    value: "newPs",
                    example: ""
                }, {
                    text: "",
                    value: "split",
                    example: ""
                }, {
                    text: r.showAll,
                    value: "showHideAllPs",
                    example: ""
                }];
                var i = _this.createButtonMenu(o)
                  , s = replaceHtml$1(_this.menu, {
                    id: "postil",
                    item: i,
                    subclass: "",
                    sub: ""
                });
                $("body").append(s),
                (t = $("#" + e).width(150)).find(".luckysheet-cols-menuitem").click((function() {
                    t.hide(),
                    luckysheetContainerFocus();
                    var e = $(this).attr("itemvalue");
                    "newPs" == e ? luckysheetPostil.newPs(n, l) : "editPs" == e ? luckysheetPostil.editPs(n, l) : "delPs" == e ? luckysheetPostil.delPs(n, l) : "showHidePs" == e ? luckysheetPostil.showHidePs(n, l) : "showHideAllPs" == e && luckysheetPostil.showHideAllPs()
                }
                ));
                var c = $(this).outerWidth()
                  , u = t.outerWidth()
                  , h = $(this).offset().left;
                u > c && u + h > $("#" + Store.container).width() && (h = h - u + c),
                mouseclickposition(t, h, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("#luckysheet-icon-protection").click((function() {
                openProtectionModal(sheetmanage.getSheetByIndex())
            }
            )),
            $("#luckysheet-icon-print").click((function() {
                var e = $(this).attr("id") + "-menuButton"
                  , t = $("#" + e)
                  , r = locale().print;
                if (0 == t.length) {
                    var a = [{
                        text: r.menuItemPrint,
                        value: "print",
                        example: '<i class="iconfont icon-dayin" aria-hidden="true"></i>'
                    }, {
                        text: "",
                        value: "split",
                        example: ""
                    }, {
                        text: r.menuItemAreas,
                        value: "areas",
                        example: '<i class="iconfont icon-tihuan" aria-hidden="true"></i>'
                    }, {
                        text: r.menuItemRows,
                        value: "rows",
                        example: '<i class="iconfont icon-zhuandao1" aria-hidden="true"></i>'
                    }, {
                        text: r.menuItemColumns,
                        value: "columns",
                        example: '<i class="iconfont icon-dingwei" aria-hidden="true"></i>'
                    }]
                      , n = _this.createButtonMenu(a)
                      , o = replaceHtml$1(_this.menu, {
                        id: "print",
                        item: n,
                        subclass: "",
                        sub: ""
                    });
                    $("body").append(o),
                    (t = $("#" + e).width(180)).find(".luckysheet-cols-menuitem").click((function() {
                        t.hide(),
                        luckysheetContainerFocus();
                        var e = $(this).attr("itemvalue");
                        "print" == e ? alert("print") : "areas" != e && "rows" != e && "columns" != e || alert("areas")
                    }
                    ))
                }
                var l = $(this).outerWidth()
                  , i = t.outerWidth()
                  , s = $(this).offset().left;
                i > l && i + s > $("#" + Store.container).width() && (s = s - i + l),
                mouseclickposition(t, s, $(this).offset().top + 25, "lefttop")
            }
            )),
            $("body").on("mouseover mouseleave", ".luckysheet-menuButton .luckysheet-cols-submenu", (function(e) {
                var t = $(this)
                  , r = t.attr("itemvalue")
                  , a = $("#luckysheet-icon-" + r + "-menuButton");
                if ("mouseover" === e.type) {
                    var n = t.parent()
                      , o = $(window).width()
                      , l = $(window).height()
                      , i = n.width()
                      , s = a.height() + 25
                      , c = a.width() + 5
                      , u = t.offset()
                      , h = u.top
                      , d = u.left + i;
                    d + c > o && (d = u.left - c),
                    h + s > l && (h = l - s),
                    a.css({
                        top: h,
                        left: d
                    }).show(),
                    _this.rightclickmenu = t
                } else
                    clearTimeout(_this.submenuhide),
                    _this.submenuhide = setTimeout((function() {
                        a.hide()
                    }
                    ), 200)
            }
            )).on("mouseover mouseleave", ".luckysheet-menuButton-sub", (function(e) {
                "mouseover" === e.type ? (_this.rightclickmenu.addClass("luckysheet-cols-menuitem-hover"),
                clearTimeout(_this.submenuhide)) : (_this.rightclickmenu.removeClass("luckysheet-cols-menuitem-hover"),
                $(this).hide())
            }
            ))
        },
        getQKBorder: function(e, t, r) {
            var a = "";
            e.indexOf("pt") > -1 ? (e = parseFloat(e)) < 1 || (a = e < 1.5 ? "Medium" : "Thick") : (e = parseFloat(e)) < 2 || (a = e < 3 ? "Medium" : "Thick");
            var n = 0;
            return "double" == (t = t.toLowerCase()) ? n = 2 : "dotted" == t ? n = "Medium" == a || "Thick" == a ? 3 : 10 : "dashed" == t ? n = "Medium" == a || "Thick" == a ? 4 : 9 : "solid" == t && (n = "Medium" == a ? 8 : "Thick" == a ? 13 : 1),
            [n, r]
        },
        updateFormatCell: function(e, t, r, a, n, o, l) {
            if (null != e && null != t)
                if ("ct" == t) {
                    for (var i = a; i <= n; i++)
                        if (null == Store.config.rowhidden || null == Store.config.rowhidden[i])
                            for (var s = o; s <= l; s++) {
                                var c = e[i][s]
                                  , u = null;
                                u = "object" == getObjType(c) ? e[i][s].v : e[i][s],
                                "@" != r && isRealNum(u) && (u = parseFloat(u));
                                var h = update(r, u)
                                  , d = "n";
                                is_date(r) || 14 === r || 15 === r || 16 === r || 17 === r || 18 === r || 19 === r || 20 === r || 21 === r || 22 === r || 45 === r || 46 === r || 47 === r ? d = "d" : "@" == r || 49 === r ? d = "s" : "General" != r && 0 !== r || (d = "g"),
                                "object" == getObjType(c) ? (e[i][s].m = h,
                                null == e[i][s].ct && (e[i][s].ct = {}),
                                e[i][s].ct.fa = r,
                                e[i][s].ct.t = d) : e[i][s] = {
                                    ct: {
                                        fa: r,
                                        t: d
                                    },
                                    v: u,
                                    m: h
                                }
                            }
                } else {
                    "ht" == t ? "left" == r ? r = "1" : "center" == r ? r = "0" : "right" == r && (r = "2") : "vt" == t ? "top" == r ? r = "1" : "middle" == r ? r = "0" : "bottom" == r && (r = "2") : "tb" == t ? "overflow" == r ? r = "1" : "clip" == r ? r = "0" : "wrap" == r && (r = "2") : "tr" == t && ("none" == r ? r = "0" : "angleup" == r ? r = "1" : "angledown" == r ? r = "2" : "vertical" == r ? r = "3" : "rotation-up" == r ? r = "4" : "rotation-down" == r && (r = "5"));
                    for (var f = a; f <= n; f++)
                        if (null == Store.config.rowhidden || null == Store.config.rowhidden[f])
                            for (var m = o; m <= l; m++) {
                                var p = e[f][m];
                                "object" == getObjType(p) ? (updateInlineStringFormatOutside(p, t, r),
                                e[f][m][t] = r) : (e[f][m] = {
                                    v: p
                                },
                                e[f][m][t] = r)
                            }
                }
        },
        updateFormat: function(e, t, r) {
            if (checkProtectionFormatCells(Store.currentSheetIndex) && !1 !== Store.allowEdit) {
                document.createElement("canvas").getContext("2d");
                if (t in inlineStyleAffectAttribute)
                    if (parseInt($("#luckysheet-input-box").css("top")) > 0)
                        if ("=" != $("#luckysheet-input-box").text().substr(0, 1))
                            updateInlineStringFormat(e[Store.luckysheetCellUpdate[0]][Store.luckysheetCellUpdate[1]], t, r);
                var a = $.extend(!0, {}, Store.config);
                null == a.rowlen && (a.rowlen = {});
                for (var n = 0; n < Store.luckysheet_select_save.length; n++) {
                    var o = Store.luckysheet_select_save[n].row[0]
                      , l = Store.luckysheet_select_save[n].row[1]
                      , i = Store.luckysheet_select_save[n].column[0]
                      , s = Store.luckysheet_select_save[n].column[1];
                    this.updateFormatCell(e, t, r, o, l, i, s),
                    "tb" != t && "tr" != t && "fs" != t || (a = rowlenByRange(e, o, l, a))
                }
                var c = {};
                "tb" != t && "tr" != t && "fs" != t || (c = {
                    cfg: a,
                    RowlChange: !0
                }),
                jfrefreshgrid(e, Store.luckysheet_select_save, c, !1)
            }
        },
        updateFormat_mc: function(e, t) {
            var r = $.extend(!0, {}, Store.config);
            if (null == r.merge && (r.merge = {}),
            checkProtectionNotEnable(Store.currentSheetIndex)) {
                if ("mergeCancel" == t)
                    for (var a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a]
                          , o = n.row[0]
                          , l = n.row[1]
                          , i = n.column[0]
                          , s = n.column[1];
                        if (o != l || i != s)
                            for (var c = {}, u = o; u <= l; u++)
                                for (var h = i; h <= s; h++) {
                                    var d = e[u][h];
                                    if (null != d && null != d.mc) {
                                        var f = d.mc.r
                                          , m = d.mc.c;
                                        if ("rs"in d.mc)
                                            delete d.mc,
                                            delete r.merge[f + "_" + m],
                                            c[f + "_" + m] = $.extend(!0, {}, d);
                                        else {
                                            var p = c[f + "_" + m];
                                            delete p.v,
                                            delete p.m,
                                            delete p.ct,
                                            delete p.f,
                                            delete p.spl,
                                            e[u][h] = p
                                        }
                                    }
                                }
                    }
                else {
                    for (var g = !1, y = 0; y < Store.luckysheet_select_save.length; y++)
                        for (var v = Store.luckysheet_select_save[y], A = v.row[0], b = v.row[1], k = v.column[0], w = v.column[1], x = A; x <= b; x++)
                            for (var S = k; S <= w; S++) {
                                var _ = e[x][S];
                                if ("object" == getObjType(_) && "mc"in _) {
                                    g = !0;
                                    break
                                }
                            }
                    if (g)
                        for (var C = 0; C < Store.luckysheet_select_save.length; C++) {
                            var T = Store.luckysheet_select_save[C]
                              , E = T.row[0]
                              , I = T.row[1]
                              , R = T.column[0]
                              , B = T.column[1];
                            if (E != I || R != B)
                                for (var N = {}, F = E; F <= I; F++)
                                    for (var P = R; P <= B; P++) {
                                        var L = e[F][P];
                                        if (null != L && null != L.mc) {
                                            var O = L.mc.r
                                              , D = L.mc.c;
                                            if ("rs"in L.mc)
                                                delete L.mc,
                                                delete r.merge[O + "_" + D],
                                                N[O + "_" + D] = $.extend(!0, {}, L);
                                            else {
                                                var M = N[O + "_" + D];
                                                delete M.v,
                                                delete M.m,
                                                delete M.ct,
                                                delete M.f,
                                                delete M.spl,
                                                e[F][P] = M
                                            }
                                        }
                                    }
                        }
                    else
                        for (var U = 0; U < Store.luckysheet_select_save.length; U++) {
                            var H = Store.luckysheet_select_save[U]
                              , q = H.row[0]
                              , z = H.row[1]
                              , j = H.column[0]
                              , V = H.column[1];
                            if (q != z || j != V)
                                if ("mergeAll" == t) {
                                    for (var Q = {}, G = !1, K = q; K <= z; K++)
                                        for (var W = j; W <= V; W++) {
                                            var Y = e[K][W];
                                            null == Y || isRealNull(Y.v) && null == Y.f || G || (Q = $.extend(!0, {}, Y),
                                            G = !0),
                                            e[K][W] = {
                                                mc: {
                                                    r: q,
                                                    c: j
                                                }
                                            }
                                        }
                                    e[q][j] = Q,
                                    e[q][j].mc = {
                                        r: q,
                                        c: j,
                                        rs: z - q + 1,
                                        cs: V - j + 1
                                    },
                                    r.merge[q + "_" + j] = {
                                        r: q,
                                        c: j,
                                        rs: z - q + 1,
                                        cs: V - j + 1
                                    }
                                } else if ("mergeV" == t)
                                    for (var X = j; X <= V; X++) {
                                        for (var J = {}, Z = !1, ee = q; ee <= z; ee++) {
                                            var te = e[ee][X];
                                            null == te || isRealNull(te.v) && null == te.f || Z || (J = $.extend(!0, {}, te),
                                            Z = !0),
                                            e[ee][X] = {
                                                mc: {
                                                    r: q,
                                                    c: X
                                                }
                                            }
                                        }
                                        e[q][X] = J,
                                        e[q][X].mc = {
                                            r: q,
                                            c: X,
                                            rs: z - q + 1,
                                            cs: 1
                                        },
                                        r.merge[q + "_" + X] = {
                                            r: q,
                                            c: X,
                                            rs: z - q + 1,
                                            cs: 1
                                        }
                                    }
                                else if ("mergeH" == t)
                                    for (var re = q; re <= z; re++) {
                                        for (var ae = {}, ne = !1, oe = j; oe <= V; oe++) {
                                            var le = e[re][oe];
                                            null == le || isRealNull(le.v) && null == le.f || ne || (ae = $.extend(!0, {}, le),
                                            ne = !0),
                                            e[re][oe] = {
                                                mc: {
                                                    r: re,
                                                    c: j
                                                }
                                            }
                                        }
                                        e[re][j] = ae,
                                        e[re][j].mc = {
                                            r: re,
                                            c: j,
                                            rs: 1,
                                            cs: V - j + 1
                                        },
                                        r.merge[re + "_" + j] = {
                                            r: re,
                                            c: j,
                                            rs: 1,
                                            cs: V - j + 1
                                        }
                                    }
                        }
                }
                Store.clearjfundo && (Store.jfundo = [],
                Store.jfredo.push({
                    type: "mergeChange",
                    sheetIndex: Store.currentSheetIndex,
                    data: Store.flowdata,
                    curData: e,
                    range: $.extend(!0, [], Store.luckysheet_select_save),
                    config: $.extend(!0, {}, Store.config),
                    curConfig: r
                })),
                Store.clearjfundo = !1,
                jfrefreshgrid(e, Store.luckysheet_select_save, {
                    cfg: r
                }),
                Store.clearjfundo = !0
            }
        },
        borderfix: function(e, t, r) {
            return null == e[t][r] || null == e[t][r].bg || "" == e[t][r].bg ? [-1, 0, 0, -1] : [-2, -1, 1, 0]
        },
        changeMenuButtonDom: function(e, t, r) {
            null == r && (r = locale());
            var a = r.fontarray;
            r.fontjson;
            if ("bl" == e)
                "0" != t ? $("#luckysheet-icon-bold").addClass("luckysheet-toolbar-button-hover") : $("#luckysheet-icon-bold").removeClass("luckysheet-toolbar-button-hover");
            else if ("it" == e)
                "0" != t ? $("#luckysheet-icon-italic").addClass("luckysheet-toolbar-button-hover") : $("#luckysheet-icon-italic").removeClass("luckysheet-toolbar-button-hover");
            else if ("cl" == e)
                "0" != t ? $("#luckysheet-icon-strikethrough").addClass("luckysheet-toolbar-button-hover") : $("#luckysheet-icon-strikethrough").removeClass("luckysheet-toolbar-button-hover");
            else if ("ff" == e) {
                var n = $("#luckysheet-icon-font-family-menuButton")
                  , o = a[0]
                  , l = 0;
                null != t && (isdatatypemulti(t).num ? null == (o = a[l = parseInt(t)]) && (o = l = this.defualtFont[l],
                null != l && this.addFontTolist(l)) : (l = t = t.replace(/"/g, "").replace(/'/g, ""),
                o = t,
                this.addFontTolist(l))),
                this.focus(n, l),
                $("#luckysheet-icon-font-family").find(".luckysheet-toolbar-menu-button-caption").html(" " + o + " ")
            } else if ("fs" == e) {
                var i = $("#luckysheet-icon-font-size-menuButton")
                  , s = t
                  , c = $("#luckysheet-icon-font-size input");
                this.focus(i, s),
                $("#luckysheet-icon-font-size").attr("itemvalue", s),
                c.val(s)
            } else if ("ht" == e) {
                var u = $("#luckysheet-icon-align-menu-menuButton")
                  , h = ($("luckysheet-icon-align"),
                "left");
                "0" == t ? h = "center" : "2" == t && (h = "right"),
                this.focus(u, h);
                var d = iconfontObjects.align;
                $("#luckysheet-icon-align").attr("type", h).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-" + h + d[h]),
                u.hide()
            } else if ("vt" == e) {
                var f = $("#luckysheet-icon-valign-menu-menuButton")
                  , m = ($("luckysheet-icon-valign"),
                "bottom");
                "1" == t ? m = "top" : "0" == t && (m = "middle"),
                this.focus(f, m);
                var p = iconfontObjects.align;
                $("#luckysheet-icon-valign").attr("type", m).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-" + m + p[m]),
                f.hide()
            } else if ("tb" == e) {
                var g = $("#luckysheet-icon-textwrap-menu-menuButton")
                  , y = ($("luckysheet-icon-textwrap"),
                "clip");
                "1" == t ? y = "overflow" : "2" == t && (y = "wrap"),
                this.focus(g, y);
                var v = iconfontObjects.textWrap;
                $("#luckysheet-icon-textwrap").attr("type", y).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-" + y + v[y]),
                g.hide()
            } else if ("tr" == e) {
                var A = $("#luckysheet-icon-rotation-menu-menuButton")
                  , b = ($("luckysheet-icon-rotation"),
                "none");
                "1" == t ? b = "angleup" : "2" == t ? b = "angledown" : "3" == t ? b = "vertical" : "4" == t ? b = "rotation-up" : "5" == t && (b = "rotation-down"),
                this.focus(A, b);
                var k = iconfontObjects.rotation;
                $("#luckysheet-icon-rotation").attr("type", b).find(".luckysheet-icon-img-container").removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-" + b + k[b]),
                A.hide()
            } else if ("ct" == e) {
                var w = $("#luckysheet-icon-fmt-other")
                  , x = locale().defaultFmt;
                if (!t)
                    return void w.find(".luckysheet-toolbar-menu-button-caption").html(" " + x[0].text + " ");
                var S = t.fa
                  , _ = x.find((function(e) {
                    return e.value === S
                }
                ));
                if (_)
                    w.find(".luckysheet-toolbar-menu-button-caption").html(" " + _.text + " ");
                else {
                    var C = x.find((function(e) {
                        return "fmtOtherSelf" === e.value
                    }
                    ));
                    w.find(".luckysheet-toolbar-menu-button-caption").html(" " + C.text + " ")
                }
            }
        },
        inputMenuButtonFocus: function(e) {
            var t = window.getSelection().getRangeAt(0).startContainer;
            Store.inlineStringEditRange = null;
            var r = locale();
            if ("SPAN" == t.parentNode.tagName) {
                var a = convertCssToStyleList(t.parentNode.style.cssText);
                for (var n in a)
                    this.changeMenuButtonDom(n, a[n], r)
            }
        },
        menuButtonFocus: function(e, t, r) {
            for (var a = ["bl", "it", "cl", "ff", "ht", "vt", "fs", "tb", "tr", "ct"], n = locale(), o = 0; o < a.length; o++) {
                var l = a[o]
                  , i = this.checkstatus(e, t, r, l);
                this.changeMenuButtonDom(l, i, n)
            }
        },
        checkstatus: function(e, t, r, a) {
            return null == e || null == e[t] ? (console.warn("It's incorrect data", t, r),
            null) : checkstatusByCell(e[t][r], a)
        },
        setLineDash: function(e, t, r, a, n, o, l) {
            t = {
                0: "none",
                1: "Thin",
                2: "Hair",
                3: "Dotted",
                4: "Dashed",
                5: "DashDot",
                6: "DashDotDot",
                7: "Double",
                8: "Medium",
                9: "MediumDashed",
                10: "MediumDashDot",
                11: "MediumDashDotDot",
                12: "SlantedDashDot",
                13: "Thick"
            }[t.toString()];
            try {
                "Hair" == t ? e.setLineDash([1, 2]) : t.indexOf("DashDotDot") > -1 ? e.setLineDash([2, 2, 5, 2, 2]) : t.indexOf("DashDot") > -1 ? e.setLineDash([2, 5, 2]) : t.indexOf("Dotted") > -1 ? e.setLineDash([2]) : t.indexOf("Dashed") > -1 ? e.setLineDash([3]) : e.setLineDash([0])
            } catch (e) {
                console.log(e)
            }
            e.beginPath(),
            t.indexOf("Medium") > -1 ? ("h" == r ? (e.moveTo(a, n - .5),
            e.lineTo(o, l - .5)) : (e.moveTo(a - .5, n),
            e.lineTo(o - .5, l)),
            e.lineWidth = 2) : "Thick" == t ? (e.moveTo(a, n),
            e.lineTo(o, l),
            e.lineWidth = 3) : (e.moveTo(a, n),
            e.lineTo(o, l),
            e.lineWidth = 1)
        },
        moveMergeData: function(e, t, r) {
            if (isRealNull(e))
                return e;
            for (var a = [], n = [], o = !1, l = 0; l < e.length; l++)
                for (var i = 0; i < e[0].length; i++) {
                    var s = e[l][i];
                    "object" == getObjType(s) && "mc"in s && (null != s.mc.rs && (a.push({
                        rs: s.mc.rs,
                        cs: s.mc.cs,
                        r: s.mc.r,
                        c: s.mc.c
                    }),
                    n.push({
                        rs: s.mc.rs,
                        cs: s.mc.cs,
                        r: s.mc.r + t,
                        c: s.mc.c + r
                    }),
                    o = !0),
                    e[l][i].mc.r += t,
                    e[l][i].mc.c += r)
                }
            return {
                deleMC: a,
                insertMC: n,
                hasMC: o
            }
        },
        getRangeInMerge: function(e, t, r, a, n) {
            var o = []
              , l = null;
            if (null != (l = null != n ? $.extend(!0, {}, this.getSheetConfig()) : $.extend(!0, {}, Store.config)) && null != l.merge)
                for (var i in l.merge) {
                    var s = l.merge[i];
                    e + t - 1 < s.r || e > s.r + s.rs - 1 || r + a - 1 < s.c || r > s.c + s.cs - 1 || o.push(s)
                }
            return o
        },
        mergeborer: function(e, t, r) {
            if (null == e || null == e[t])
                return console.warn("Merge info is null", t, r),
                null;
            var a = e[t][r];
            if ("object" == getObjType(a) && "mc"in a) {
                var n = a.mc;
                if (null == n)
                    return console.warn("Merge info is null", t, r),
                    null;
                if (r = n.c,
                null == e[t = n.r][r])
                    return console.warn("Main merge Cell info is null", t, r),
                    null;
                for (var o, l, i, s, c, u, h, d, f = e[t][r].mc.cs, m = e[t][r].mc.rs, p = e[t][r].mc, g = t; g < p.rs + t; g++)
                    o = 0 == g ? -1 : Store.visibledatarow[g - 1] - 1,
                    l = Store.visibledatarow[g],
                    null == s ? (s = o,
                    i = l) : i += l - o - 1;
                for (var y = r; y < p.cs + r; y++)
                    c = 0 == y ? 0 : Store.visibledatacolumn[y - 1],
                    u = Store.visibledatacolumn[y],
                    null == d ? (d = c,
                    h = u) : h += u - c;
                return {
                    row: [s, i, t, t + m - 1],
                    column: [d, h, r, r + f - 1]
                }
            }
            return null
        },
        mergeMoveData: {},
        mergeMoveMain: function(e, t, r, a, n, o, l) {
            var i = sheetmanage.getSheetMerge();
            if (null != i) {
                var s = [];
                for (var c in i)
                    s.push(c);
                t[0] > t[1] && (t[1] = t[0]),
                e[0] > e[1] && (e[1] = e[0]);
                var u = !0;
                for (this.mergeMoveData = {}; u; ) {
                    u = !1;
                    for (var h = 0; h < s.length; h++) {
                        var d = s[h]
                          , f = i[d];
                        if (!(d in this.mergeMoveData)) {
                            var m = this.mergeMove(f, e, t, r, a, n, o, l);
                            null != m ? (this.mergeMoveData[d] = f,
                            e = m[0],
                            t = m[1],
                            a = m[2],
                            n = m[3],
                            o = m[4],
                            l = m[5],
                            u = !0) : delete this.mergeMoveData[d]
                        }
                    }
                }
                return [e, t, a, n, o, l]
            }
        },
        mergeMove: function(e, t, r, a, n, o, l, i) {
            var s = e.r
              , c = e.r + e.rs - 1
              , u = e.c
              , h = e.c + e.cs - 1
              , d = !1;
            if (t[1] < t[0] && (t[0] = t[1]),
            r[1] < r[0] && (r[0] = r[1]),
            t[0] <= u && t[1] >= h && r[0] <= s && r[1] >= c || !(t[1] < u || t[0] > h) && !(r[1] < s || r[0] > c)) {
                var f = this.mergeborer(Store.flowdata, e.r, e.c);
                if (f) {
                    var m = f.row[1]
                      , p = f.row[0]
                      , g = (f.row[2],
                    f.column[1])
                      , y = f.column[0];
                    f.column[2];
                    t[1] < u || t[0] > h || (r[0] <= c && r[0] >= s && (o += n - p,
                    n = p,
                    r[0] = s),
                    r[1] >= s && r[1] <= c && (o = (a.row_focus >= s && a.row_focus,
                    m - n),
                    r[1] = c)),
                    r[1] < s || r[0] > c || (t[0] <= h && t[0] >= u && (i += l - y,
                    l = y,
                    t[0] = u),
                    t[1] >= u && t[1] <= h && (i = (a.column_focus >= u && a.column_focus,
                    g - l),
                    t[1] = h)),
                    d = !0
                }
            }
            return d ? [t, r, n, o, l, i] : null
        },
        getCellRealSize: function(e, t, r) {
            var a = Store.defaultcollen
              , n = Store.defaultrowlen
              , o = e[t][r];
            if (o && null != o.mc) {
                var l = o.mc
                  , i = this.mergeborer(e, l.r, l.c);
                if (i) {
                    var s = i.row[1]
                      , c = i.row[0]
                      , u = (i.row[2],
                    i.row[3],
                    i.column[1])
                      , h = i.column[0];
                    i.column[2],
                    i.column[3];
                    a = u - h - 1,
                    n = s - c - 1
                }
            } else {
                var d = getluckysheetfile()[getSheetIndex(Store.currentSheetIndex)].config;
                null != d.columnlen && null != d.columnlen[r] && (a = d.columnlen[r]),
                null != d.rowlen && null != d.rowlen[t] && (n = d.rowlen[t])
            }
            return [a, n]
        },
        getTextHeightCache: {},
        getTextSize: function(e, t) {
            var r = locale().fontarray
              , a = t || "10pt " + r[0];
            if (a in this.getTextHeightCache)
                return this.getTextHeightCache[a];
            0 == $("#luckysheetTextSizeTest").length && $('<span id="luckysheetTextSizeTest" style="float:left;white-space:nowrap;visibility:hidden;margin:0;padding:0;">' + e + "</span>").appendTo($("body"));
            var n = $("#luckysheetTextSizeTest").text(e).css({
                font: a
            })
              , o = n.innerWidth()
              , l = n.innerHeight();
            return this.getTextHeightCache[a] = [o, l],
            [o, l]
        },
        activeFormulaInput: function(e, t, r, a, n, o) {
            if (null == o && (o = !1),
            luckysheetupdateCell(e, t, Store.flowdata, !0),
            o) {
                var l = '<span dir="auto" class="luckysheet-formula-text-color">=</span><span dir="auto" class="luckysheet-formula-text-color">' + n.toUpperCase() + '</span><span dir="auto" class="luckysheet-formula-text-color">(</span><span dir="auto" class="luckysheet-formula-text-color">)</span>';
                $("#luckysheet-rich-text-editor").html(l);
                window.getSelection();
                var i = $("#luckysheet-rich-text-editor").find("span");
                luckysheetformula.setCaretPosition(i.get(i.length - 2), 0, 1)
            } else {
                var s = rowLocationByIndex(r[0])[0]
                  , c = rowLocationByIndex(r[1])[1]
                  , u = colLocationByIndex(a[0])[0]
                  , h = colLocationByIndex(a[1])[1]
                  , d = '<span dir="auto" class="luckysheet-formula-text-color">=</span><span dir="auto" class="luckysheet-formula-text-color">' + n.toUpperCase() + '</span><span dir="auto" class="luckysheet-formula-text-color">(</span><span class="luckysheet-formula-functionrange-cell" rangeindex="0" dir="auto" style="color:' + luckyColor[0] + ';">' + getRangetxt(Store.currentSheetIndex, {
                    row: r,
                    column: a
                }, Store.currentSheetIndex) + '</span><span dir="auto" class="luckysheet-formula-text-color">)</span>';
                $("#luckysheet-rich-text-editor").html(d),
                luckysheetformula.israngeseleciton(),
                luckysheetformula.rangestart = !0,
                luckysheetformula.rangedrag_column_start = !1,
                luckysheetformula.rangedrag_row_start = !1,
                luckysheetformula.rangechangeindex = 0,
                luckysheetformula.rangeSetValue({
                    row: r,
                    column: a
                }),
                luckysheetformula.func_selectedrange = {
                    left: u,
                    width: h - u - 1,
                    top: s,
                    height: c - s - 1,
                    left_move: u,
                    width_move: h - u - 1,
                    top_move: s,
                    height_move: c - s - 1,
                    row: [e, e],
                    column: [t, t]
                },
                $("#luckysheet-formula-functionrange-select").css({
                    left: u,
                    width: h - u - 1,
                    top: s,
                    height: c - s - 1
                }).show(),
                $("#luckysheet-formula-help-c").hide()
            }
        },
        backFormulaInput: function(e, t, r, a, n, o) {
            var l = "=" + o.toUpperCase() + "(" + getRangetxt(Store.currentSheetIndex, {
                row: a,
                column: n
            }, Store.currentSheetIndex) + ")"
              , i = luckysheetformula.execfunction(l, t, r);
            setcellvalue(t, r, e, {
                v: i[1],
                f: i[2]
            }),
            luckysheetformula.execFunctionExist.push({
                r: t,
                c: r,
                i: Store.currentSheetIndex
            }),
            server.historyParam(e, Store.currentSheetIndex, {
                row: [t, t],
                column: [r, r]
            })
        },
        checkNoNullValue: function(e) {
            var t = e;
            return "object" == getObjType(t) && (t = t.v),
            !(isRealNull(t) || !isdatatypemulti(t).num || null != e.ct && null != e.ct.t && "n" != e.ct.t && "g" != e.ct.t)
        },
        checkNoNullValueAll: function(e) {
            var t = e;
            return "object" == getObjType(t) && (t = t.v),
            !isRealNull(t)
        },
        getNoNullValue: function(e, t, r, a) {
            for (var n = null, o = 0, l = 0, i = r - 1; i >= 0; i--) {
                var s = void 0;
                if (s = "c" == a ? e[t][i] : e[i][t],
                this.checkNoNullValue(s))
                    n = i;
                else {
                    if (null != s && null != s.v && "" != s.v)
                        break;
                    if (++o >= 40) {
                        if (!(l <= 0))
                            break;
                        l = 1
                    }
                }
            }
            return n
        },
        singleFormulaInput: function(e, t, r, a, n, o, l, i, s) {
            null == l && (l = "r"),
            null == i && (i = !0),
            null == s && (s = !0);
            for (var c = !0, u = !1, h = a; h <= n; h++) {
                var d = null;
                d = "c" == l ? e[h][r] : e[r][h],
                this.checkNoNullValue(d) ? (c = !1,
                u = !0) : this.checkNoNullValueAll(d) && (c = !1)
            }
            if (c && s) {
                if (null == this.getNoNullValue(e, t, r, l))
                    "c" == l ? this.activeFormulaInput(t, r, null, null, o, !0) : this.activeFormulaInput(r, t, null, null, o, !0);
                else if (t == a)
                    for (var f = a; f <= n; f++) {
                        var m = this.getNoNullValue(e, f, r, l);
                        if (null == m)
                            break;
                        "c" == l ? this.backFormulaInput(e, f, r, [f, f], [m, r - 1], o) : this.backFormulaInput(e, r, f, [m, r - 1], [f, f], o)
                    }
                else
                    for (var p = n; p >= a; p--) {
                        var g = this.getNoNullValue(e, p, r, l);
                        if (null == g)
                            break;
                        "c" == l ? this.backFormulaInput(e, p, r, [p, p], [g, r - 1], o) : this.backFormulaInput(e, r, p, [g, r - 1], [p, p], o)
                    }
            } else {
                if (!u || !i)
                    return !0;
                var y = null;
                if (null != (y = "c" == l ? e[n][r] : e[r][n]) && null != y.v && y.v.toString().length > 0) {
                    var v = n;
                    for (y = "c" == l ? e[n][r] : e[r][n]; null != y && null != y.v && y.v.toString().length > 0; ) {
                        if (++v >= ("c" == l ? e.length : e[0].length))
                            return;
                        y = "c" == l ? e[v][r] : e[r][v]
                    }
                    "c" == l ? this.backFormulaInput(e, v, r, [a, n], [r, r], o) : this.backFormulaInput(e, r, v, [r, r], [a, n], o)
                } else
                    "c" == l ? this.backFormulaInput(e, n, r, [a, n], [r, r], o) : this.backFormulaInput(e, r, n, [r, r], [a, n], o)
            }
        },
        autoSelectionFormula: function(e) {
            var t = this
              , r = editor.deepCopyFlowData(Store.flowdata)
              , a = !0;
            luckysheetformula.execFunctionExist = [];
            for (var n = function(e, r, a, n, o, l) {
                var i = t.getNoNullValue(e, r, o, "c");
                null == i ? t.activeFormulaInput(r, n, null, null, l, !0) : t.activeFormulaInput(r, n, [r, a], [i, o - 1], l)
            }, o = function(e, r, a, o, l, i) {
                var s = t.getNoNullValue(e, o, a, "r");
                null == s ? n(e, r, a, o, l, i) : t.activeFormulaInput(r, o, [s, a - 1], [o, l], i)
            }, l = 0; l < Store.luckysheet_select_save.length; l++) {
                var i = Store.luckysheet_select_save[l].row[0]
                  , s = Store.luckysheet_select_save[l].row[1]
                  , c = Store.luckysheet_select_save[l].column[0]
                  , u = Store.luckysheet_select_save[l].column[1]
                  , h = Store.luckysheet_select_save[l].row_focus
                  , d = Store.luckysheet_select_save[l].column_focus;
                if (i == s && c == u) {
                    if (s - 1 < 0 && u - 1 < 0)
                        return void t.activeFormulaInput(i, c, null, null, e, !0);
                    s - 1 >= 0 && t.checkNoNullValue(r[s - 1][c]) ? o(r, i, s, c, u, e) : u - 1 >= 0 && t.checkNoNullValue(r[i][u - 1]) ? n(r, i, s, c, u, e) : o(r, i, s, c, u, e)
                } else if (i == s)
                    a = t.singleFormulaInput(r, d, i, c, u, e, "r");
                else if (c == u)
                    a = t.singleFormulaInput(r, h, c, i, s, e, "c");
                else {
                    for (var f = !0, m = i; m <= s; m++)
                        f = t.singleFormulaInput(r, d, m, c, u, e, "r", !0, !1) && f;
                    for (var p = !0, g = c; g <= u; g++)
                        p = t.singleFormulaInput(r, h, g, i, s, e, "c", !0, !1) && p;
                    a = !!f && !!p
                }
                a = a && a
            }
            a || (luckysheetformula.execFunctionExist.reverse(),
            luckysheetformula.execFunctionGroup(null, null, null, null, r),
            jfrefreshgrid(r, Store.luckysheet_select_save),
            clearTimeout(Store.jfcountfuncTimeout),
            Store.jfcountfuncTimeout = setTimeout((function() {
                countfunc()
            }
            ), 500))
        },
        getStyleByCell: function(e, t, r) {
            var a = ""
              , n = alternateformat.getComputeMap()
              , o = alternateformat.checksAF(t, r, n)
              , l = conditionformat.getComputeMap()
              , i = conditionformat.checksCF(t, r, l)
              , s = (locale().fontarray,
            e[t][r])
              , c = (s.ct,
            !1);
            for (var u in isInlineStringCell(s) && (c = !0),
            s) {
                var h = this.checkstatus(e, t, r, u);
                (null != o || null != i && null != i.cellColor) && (null != i && null != i.cellColor ? a += "background: " + i.cellColor + ";" : null != o && (a += "background: " + o[1] + ";")),
                "object" != getObjType(h) && (("bg" == u || null != o || null != i && null != i.cellColor) && (null != i && null != i.cellColor ? a += "background: " + i.cellColor + ";" : a += null != o ? "background: " + o[1] + ";" : "background: " + h + ";"),
                "ht" == u && "1" != h && ("0" == h ? a += "text-align: center;" : "2" == h && (a += "text-align: right;")),
                "vt" == u && "1" != h && ("0" == h ? a += "align-items: center;" : "2" == h && (a += "align-items: flex-end;")))
            }
            return c || (a += getFontStyleByCell(s, o, i)),
            a
        },
        fontSelectList: [],
        defualtFont: ["Times New Roman", "Arial", "Tahoma", "Verdana", "微软雅黑", "宋体", "黑体", "楷体", "仿宋", "新宋体", "华文新魏", "华文行楷", "华文隶书"],
        addFontTolist: function(e) {
            e = e.replace(/"/g, "").replace(/'/g, "");
            for (var t = !0, r = 0; r < this.fontSelectList.length; r++) {
                if (this.fontSelectList[r].value == e) {
                    t = !1;
                    break
                }
            }
            if (e in locale().fontjson && (t = !1),
            t) {
                var a = {};
                a.value = e,
                a.index = this.fontSelectList.length,
                a.type = "userDefined",
                a.text = "<span class='luckysheet-mousedown-cancel' style='font-size:11px;font-family:" + e + "'>" + e + "</span>",
                a.example = "",
                this.fontSelectList.push(a);
                var n = $("#luckysheet-icon-font-family-menuButton")
                  , o = this.createButtonMenu(this.fontSelectList);
                n.html(o)
            }
        },
        fontInitial: function(e) {
            for (var t = [], r = locale().fontarray, a = 0; a < r.length; a++) {
                var n = r[a]
                  , o = {};
                o.value = n,
                o.index = a,
                o.type = "inner",
                o.text = "<span class='luckysheet-mousedown-cancel' style='font-size:11px;font-family:" + n + "'>" + n + "</span>",
                o.example = "",
                t.push(o)
            }
            if (null != e) {
                for (var l = 0; l < e.length; l++) {
                    var i = e[l]
                      , s = {};
                    if (s.value = i.fontName,
                    s.index = l,
                    s.type = "userDefined",
                    s.text = "<span class='luckysheet-mousedown-cancel' style='font-size:11px;font-family:" + i.fontName + "'>" + i.fontName + "</span>",
                    s.example = "",
                    t.push(s),
                    document.fonts && !document.fonts.check("12px " + i.fontName) && i.url) {
                        var c = new FontFace(i.fontName,"url(".concat(i.url, ")"));
                        document.fonts.add(c),
                        c.load()
                    }
                }
                document.fonts && document.fonts.ready.then((function() {
                    console.log("font ready")
                }
                ))
            }
            this.fontSelectList = t
        }
    };
    function common_extend(e, t) {
        var r = {};
        for (var a in e)
            r[a] = e[a];
        for (var n in t)
            r[n] = t[n];
        return r
    }
    function replaceHtml$1(e, t) {
        return e.replace(/\$\{([\w]+)\}/g, (function(e, r) {
            var a = t[r];
            return void 0 !== a ? a : e
        }
        ))
    }
    function getObjType(e) {
        return {
            "[object Boolean]": "boolean",
            "[object Number]": "number",
            "[object String]": "string",
            "[object Function]": "function",
            "[object Array]": "array",
            "[object Date]": "date",
            "[object RegExp]": "regExp",
            "[object Undefined]": "undefined",
            "[object Null]": "null",
            "[object Object]": "object"
        }[Object.prototype.toString.call(e)]
    }
    function rgbTohex(e) {
        var t;
        return t = e.indexOf("rgba") > -1 ? e.replace("rgba(", "").replace(")", "").split(",") : e.replace("rgb(", "").replace(")", "").split(","),
        "#" + ((1 << 24) + (parseInt(t[0]) << 16) + (parseInt(t[1]) << 8) + parseInt(t[2])).toString(16).slice(1)
    }
    function ABCatNum(e) {
        if (null == e || 0 == e.length)
            return NaN;
        for (var t = e.toLowerCase().split(""), r = t.length, a = 0, n = 0; n < r; n++)
            a += (t[n].charCodeAt() - 96) * Math.pow(26, r - n - 1);
        return 0 == a ? NaN : a - 1
    }
    function chatatABC(e) {
        for (var t = "a".charCodeAt(0), r = "z".charCodeAt(0) - t + 1, a = ""; e >= 0; )
            a = String.fromCharCode(e % r + t) + a,
            e = Math.floor(e / r) - 1;
        return a.toUpperCase()
    }
    function getByteLen(e) {
        if (null == e)
            return 0;
        for (var t = 0, r = 0; r < e.length; r++) {
            null != e.charAt(r).match(/[^\x00-\xff]/gi) ? t += 2 : t += 1
        }
        return t
    }
    function ArrayUnique(e) {
        var t = []
          , r = {};
        if (e.length > 0)
            for (var a = 0; a < e.length; a++) {
                var n = e[a];
                r[n] || (t.push(n),
                r[n] = 1)
            }
        return t
    }
    function luckysheetfontformat(e) {
        var t = locale().fontarray;
        if ("object" == getObjType(e)) {
            var r = "";
            if ("0" == e.it || null == e.it ? r += "normal " : r += "italic ",
            r += "normal ",
            "0" == e.bl || null == e.bl ? r += "normal " : r += "bold ",
            e.fs ? r += Math.ceil(e.fs) + "pt " : r += Store.defaultFontSize + "pt ",
            e.ff) {
                var a = null;
                locale().fontjson;
                isdatatypemulti(e.ff).num ? a = t[parseInt(e.ff)] : ((a = (a = e.ff).replace(/"/g, "").replace(/'/g, "")).indexOf(" ") > -1 && (a = '"' + a + '"'),
                null != a && document.fonts && !document.fonts.check("12px " + a) && menuButton.addFontTolist(a)),
                null == a && (a = t[0]),
                r += a + ', "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif'
            } else
                r += t[0] + ', "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';
            return r
        }
        return luckysheetdefaultFont()
    }
    function showrightclickmenu(e, t, r) {
        var a = $(window).height()
          , n = $(window).width()
          , o = e.width()
          , l = e.height()
          , i = r
          , s = t;
        t + o > n && (s = t - o),
        r + l > a && (i = r - l),
        i < 0 && (i = 0),
        e.css({
            top: i,
            left: s
        }).show()
    }
    function luckysheetactiveCell() {
        Store.fullscreenmode && setTimeout((function() {
            $("#luckysheet-rich-text-editor").focus().select()
        }
        ), 50)
    }
    function luckysheetContainerFocus() {
        $("#" + Store.container).attr("tabindex", 0).focus()
    }
    function numFormat$1(e, t) {
        if (null == e || isNaN(parseFloat(e)) || hasChinaword(e) || e == -1 / 0 || e == 1 / 0)
            return null;
        var r = 6
          , a = !1;
        null == t || "auto" == t ? r = e < 1 ? 6 : 1 : "num" == isdatatype(t) ? (r = parseInt(t),
        a = !0) : r = 6;
        for (var n = "", o = 0; o < r; o++)
            n += "0";
        return a || (n = "[" + n + "]"),
        e >= 1e21 ? parseFloat(numeral(e).value()) : parseFloat(numeral(e).format("0." + n))
    }
    function numfloatlen(e) {
        if (null == e || isNaN(parseFloat(e)) || hasChinaword(e))
            return null;
        var t = numeral(e).value().toString().split(".");
        return t = 1 == t.length ? 0 : t[1].length
    }
    function mouseclickposition(e, t, r, a) {
        var n = $(window).height()
          , o = ($(window).width(),
        e.width());
        e.height();
        null == a && (a = "lefttop"),
        "lefttop" == a ? e.css({
            top: r,
            left: t
        }).show() : "righttop" == a ? e.css({
            top: r,
            left: t - o
        }).show() : "leftbottom" == a ? e.css({
            bottom: n - r - 12,
            left: t
        }).show() : "rightbottom" == a && e.css({
            bottom: n - r - 12,
            left: t - o
        }).show()
    }
    function $$(e, t) {
        var r = (t = t || document).querySelectorAll(e);
        return 1 == r.length ? Array.prototype.slice.call(r)[0] : Array.prototype.slice.call(r)
    }
    function seriesLoadScripts(e, t, r) {
        if ("object" !== _typeof(e))
            e = [e];
        var a = document.getElementsByTagName("head")[0] || document.documentElement
          , n = []
          , o = e.length - 1;
        !function l(i) {
            if (n[i] = document.createElement("script"),
            n[i].setAttribute("type", "text/javascript"),
            n[i].onload = n[i].onreadystatechange = function() {
                this.onload = this.onreadystatechange = null,
                this.parentNode.removeChild(this),
                i !== o ? l(i + 1) : "function" == typeof r && r()
            }
            ,
            n[i].setAttribute("src", e[i]),
            "object" === _typeof(t))
                for (var s in t)
                    n[i].setAttribute(s, t[s]);
            a.appendChild(n[i])
        }(0)
    }
    function loadLink(e) {
        var t = document
          , r = t.createElement("link");
        r.setAttribute("rel", "stylesheet"),
        r.setAttribute("type", "text/css"),
        r.setAttribute("href", e)
        var a = t.getElementsByTagName("head")
        a.length ? a[0].appendChild(r) : t.documentElement.appendChild(r)
    }
    function loadLinks(e) {
        "object" !== _typeof(e) && (e = [e]),
        e.length && e.forEach((function(e) {
            loadLink(e)
        }
        ))
    }
    function transformRangeToAbsolute(e) {
        if (null == e || 0 == e.length)
            return null;
        for (var t = e.split(","), r = "", a = 0; a < t.length; a++) {
            var n = t[a].split("!")
              , o = ""
              , l = "";
            n.length > 1 ? (o = n[0],
            l = n[1]) : l = n[0];
            for (var i = l.split(":"), s = "", c = 0; c < i.length; c++) {
                var u = i[c]
                  , h = u.replace(/[^0-9]/g, "")
                  , d = u.replace(/[^A-Za-z]/g, "")
                  , f = "";
                "" != d && (f += "$" + d),
                "" != h && (f += "$" + h),
                s += f + ":"
            }
            r += o + (s = s.substr(0, s.length - 1)) + ","
        }
        return r.substr(0, r.length - 1)
    }
    function openSelfModel(e) {
        var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
          , r = $("#" + e).find(".luckysheet-modal-dialog-content").css("min-width", 300).end()
          , a = r.outerHeight()
          , n = r.outerWidth()
          , o = $(window).width()
          , l = $(window).height()
          , i = $(document).scrollLeft()
          , s = $(document).scrollTop();
        r.css({
            left: (o + i - n) / 2,
            top: (l + s - a) / 3
        }).show(),
        t && $("#luckysheet-modal-dialog-mask").show()
    }
    var arrayBufferNative = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView, defineProperty$7 = objectDefineProperty.f, Int8Array$1 = global_1.Int8Array, Int8ArrayPrototype = Int8Array$1 && Int8Array$1.prototype, Uint8ClampedArray$1 = global_1.Uint8ClampedArray, Uint8ClampedArrayPrototype = Uint8ClampedArray$1 && Uint8ClampedArray$1.prototype, TypedArray = Int8Array$1 && objectGetPrototypeOf(Int8Array$1), TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype), ObjectPrototype$1 = Object.prototype, isPrototypeOf = ObjectPrototype$1.isPrototypeOf, TO_STRING_TAG$4 = wellKnownSymbol("toStringTag"), TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG"), NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && "Opera" !== classof(global_1.opera), TYPED_ARRAY_TAG_REQIRED = !1, NAME$1, TypedArrayConstructorsList = {
        Int8Array: 1,
        Uint8Array: 1,
        Uint8ClampedArray: 1,
        Int16Array: 2,
        Uint16Array: 2,
        Int32Array: 4,
        Uint32Array: 4,
        Float32Array: 4,
        Float64Array: 8
    }, isView = function(e) {
        var t = classof(e);
        return "DataView" === t || has(TypedArrayConstructorsList, t)
    }, isTypedArray = function(e) {
        return isObject(e) && has(TypedArrayConstructorsList, classof(e))
    }, aTypedArray = function(e) {
        if (isTypedArray(e))
            return e;
        throw TypeError("Target is not a typed array")
    }, aTypedArrayConstructor = function(e) {
        if (objectSetPrototypeOf) {
            if (isPrototypeOf.call(TypedArray, e))
                return e
        } else
            for (var t in TypedArrayConstructorsList)
                if (has(TypedArrayConstructorsList, NAME$1)) {
                    var r = global_1[t];
                    if (r && (e === r || isPrototypeOf.call(r, e)))
                        return e
                }
        throw TypeError("Target is not a typed array constructor")
    }, exportTypedArrayMethod = function(e, t, r) {
        if (descriptors) {
            if (r)
                for (var a in TypedArrayConstructorsList) {
                    var n = global_1[a];
                    n && has(n.prototype, e) && delete n.prototype[e]
                }
            TypedArrayPrototype[e] && !r || redefine(TypedArrayPrototype, e, r ? t : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[e] || t)
        }
    }, exportTypedArrayStaticMethod = function(e, t, r) {
        var a, n;
        if (descriptors) {
            if (objectSetPrototypeOf) {
                if (r)
                    for (a in TypedArrayConstructorsList)
                        (n = global_1[a]) && has(n, e) && delete n[e];
                if (TypedArray[e] && !r)
                    return;
                try {
                    return redefine(TypedArray, e, r ? t : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array$1[e] || t)
                } catch (e) {}
            }
            for (a in TypedArrayConstructorsList)
                !(n = global_1[a]) || n[e] && !r || redefine(n, e, t)
        }
    };
    for (NAME$1 in TypedArrayConstructorsList)
        global_1[NAME$1] || (NATIVE_ARRAY_BUFFER_VIEWS = !1);
    if ((!NATIVE_ARRAY_BUFFER_VIEWS || "function" != typeof TypedArray || TypedArray === Function.prototype) && (TypedArray = function() {
        throw TypeError("Incorrect invocation")
    }
    ,
    NATIVE_ARRAY_BUFFER_VIEWS))
        for (NAME$1 in TypedArrayConstructorsList)
            global_1[NAME$1] && objectSetPrototypeOf(global_1[NAME$1], TypedArray);
    if ((!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype$1) && (TypedArrayPrototype = TypedArray.prototype,
    NATIVE_ARRAY_BUFFER_VIEWS))
        for (NAME$1 in TypedArrayConstructorsList)
            global_1[NAME$1] && objectSetPrototypeOf(global_1[NAME$1].prototype, TypedArrayPrototype);
    if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype && objectSetPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype),
    descriptors && !has(TypedArrayPrototype, TO_STRING_TAG$4))
        for (NAME$1 in TYPED_ARRAY_TAG_REQIRED = !0,
        defineProperty$7(TypedArrayPrototype, TO_STRING_TAG$4, {
            get: function() {
                return isObject(this) ? this[TYPED_ARRAY_TAG] : void 0
            }
        }),
        TypedArrayConstructorsList)
            global_1[NAME$1] && createNonEnumerableProperty(global_1[NAME$1], TYPED_ARRAY_TAG, NAME$1);
    var arrayBufferViewCore = {
        NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
        TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
        aTypedArray: aTypedArray,
        aTypedArrayConstructor: aTypedArrayConstructor,
        exportTypedArrayMethod: exportTypedArrayMethod,
        exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
        isView: isView,
        isTypedArray: isTypedArray,
        TypedArray: TypedArray,
        TypedArrayPrototype: TypedArrayPrototype
    }
      , NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS
      , ArrayBuffer$1 = global_1.ArrayBuffer
      , Int8Array$2 = global_1.Int8Array
      , typedArrayConstructorsRequireWrappers = !NATIVE_ARRAY_BUFFER_VIEWS$1 || !fails((function() {
        Int8Array$2(1)
    }
    )) || !fails((function() {
        new Int8Array$2(-1)
    }
    )) || !checkCorrectnessOfIteration((function(e) {
        new Int8Array$2,
        new Int8Array$2(null),
        new Int8Array$2(1.5),
        new Int8Array$2(e)
    }
    ), !0) || fails((function() {
        return 1 !== new Int8Array$2(new ArrayBuffer$1(2),1,void 0).length
    }
    ))
      , toIndex = function(e) {
        if (void 0 === e)
            return 0;
        var t = toInteger(e)
          , r = toLength(t);
        if (t !== r)
            throw RangeError("Wrong length or index");
        return r
    }
      , Infinity$1 = 1 / 0
      , abs = Math.abs
      , pow$1 = Math.pow
      , floor$3 = Math.floor
      , log$1 = Math.log
      , LN2 = Math.LN2
      , pack = function(e, t, r) {
        var a, n, o, l = new Array(r), i = 8 * r - t - 1, s = (1 << i) - 1, c = s >> 1, u = 23 === t ? pow$1(2, -24) - pow$1(2, -77) : 0, h = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0, d = 0;
        for ((e = abs(e)) != e || e === Infinity$1 ? (n = e != e ? 1 : 0,
        a = s) : (a = floor$3(log$1(e) / LN2),
        e * (o = pow$1(2, -a)) < 1 && (a--,
        o *= 2),
        (e += a + c >= 1 ? u / o : u * pow$1(2, 1 - c)) * o >= 2 && (a++,
        o /= 2),
        a + c >= s ? (n = 0,
        a = s) : a + c >= 1 ? (n = (e * o - 1) * pow$1(2, t),
        a += c) : (n = e * pow$1(2, c - 1) * pow$1(2, t),
        a = 0)); t >= 8; l[d++] = 255 & n,
        n /= 256,
        t -= 8)
            ;
        for (a = a << t | n,
        i += t; i > 0; l[d++] = 255 & a,
        a /= 256,
        i -= 8)
            ;
        return l[--d] |= 128 * h,
        l
    }
      , unpack = function(e, t) {
        var r, a = e.length, n = 8 * a - t - 1, o = (1 << n) - 1, l = o >> 1, i = n - 7, s = a - 1, c = e[s--], u = 127 & c;
        for (c >>= 7; i > 0; u = 256 * u + e[s],
        s--,
        i -= 8)
            ;
        for (r = u & (1 << -i) - 1,
        u >>= -i,
        i += t; i > 0; r = 256 * r + e[s],
        s--,
        i -= 8)
            ;
        if (0 === u)
            u = 1 - l;
        else {
            if (u === o)
                return r ? NaN : c ? -Infinity$1 : Infinity$1;
            r += pow$1(2, t),
            u -= l
        }
        return (c ? -1 : 1) * r * pow$1(2, u - t)
    }
      , ieee754 = {
        pack: pack,
        unpack: unpack
    }
      , getOwnPropertyNames$2 = objectGetOwnPropertyNames.f
      , defineProperty$8 = objectDefineProperty.f
      , getInternalState$2 = internalState.get
      , setInternalState$4 = internalState.set
      , ARRAY_BUFFER = "ArrayBuffer"
      , DATA_VIEW = "DataView"
      , PROTOTYPE$1 = "prototype"
      , WRONG_LENGTH = "Wrong length"
      , WRONG_INDEX = "Wrong index"
      , NativeArrayBuffer = global_1[ARRAY_BUFFER]
      , $ArrayBuffer = NativeArrayBuffer
      , $DataView = global_1[DATA_VIEW]
      , $DataViewPrototype = $DataView && $DataView[PROTOTYPE$1]
      , ObjectPrototype$2 = Object.prototype
      , RangeError$1 = global_1.RangeError
      , packIEEE754 = ieee754.pack
      , unpackIEEE754 = ieee754.unpack
      , packInt8 = function(e) {
        return [255 & e]
    }
      , packInt16 = function(e) {
        return [255 & e, e >> 8 & 255]
    }
      , packInt32 = function(e) {
        return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255]
    }
      , unpackInt32 = function(e) {
        return e[3] << 24 | e[2] << 16 | e[1] << 8 | e[0]
    }
      , packFloat32 = function(e) {
        return packIEEE754(e, 23, 4)
    }
      , packFloat64 = function(e) {
        return packIEEE754(e, 52, 8)
    }
      , addGetter = function(e, t) {
        defineProperty$8(e[PROTOTYPE$1], t, {
            get: function() {
                return getInternalState$2(this)[t]
            }
        })
    }
      , get$1 = function(e, t, r, a) {
        var n = toIndex(r)
          , o = getInternalState$2(e);
        if (n + t > o.byteLength)
            throw RangeError$1(WRONG_INDEX);
        var l = getInternalState$2(o.buffer).bytes
          , i = n + o.byteOffset
          , s = l.slice(i, i + t);
        return a ? s : s.reverse()
    }
      , set$1 = function(e, t, r, a, n, o) {
        var l = toIndex(r)
          , i = getInternalState$2(e);
        if (l + t > i.byteLength)
            throw RangeError$1(WRONG_INDEX);
        for (var s = getInternalState$2(i.buffer).bytes, c = l + i.byteOffset, u = a(+n), h = 0; h < t; h++)
            s[c + h] = u[o ? h : t - h - 1]
    };
    if (arrayBufferNative) {
        if (!fails((function() {
            NativeArrayBuffer(1)
        }
        )) || !fails((function() {
            new NativeArrayBuffer(-1)
        }
        )) || fails((function() {
            return new NativeArrayBuffer,
            new NativeArrayBuffer(1.5),
            new NativeArrayBuffer(NaN),
            NativeArrayBuffer.name != ARRAY_BUFFER
        }
        ))) {
            $ArrayBuffer = function(e) {
                return anInstance(this, $ArrayBuffer),
                new NativeArrayBuffer(toIndex(e))
            }
            ;
            for (var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE$1] = NativeArrayBuffer[PROTOTYPE$1], keys$3 = getOwnPropertyNames$2(NativeArrayBuffer), j$1 = 0, key$1; keys$3.length > j$1; )
                (key$1 = keys$3[j$1++])in $ArrayBuffer || createNonEnumerableProperty($ArrayBuffer, key$1, NativeArrayBuffer[key$1]);
            ArrayBufferPrototype.constructor = $ArrayBuffer
        }
        objectSetPrototypeOf && objectGetPrototypeOf($DataViewPrototype) !== ObjectPrototype$2 && objectSetPrototypeOf($DataViewPrototype, ObjectPrototype$2);
        var testView = new $DataView(new $ArrayBuffer(2))
          , nativeSetInt8 = $DataViewPrototype.setInt8;
        testView.setInt8(0, 2147483648),
        testView.setInt8(1, 2147483649),
        !testView.getInt8(0) && testView.getInt8(1) || redefineAll($DataViewPrototype, {
            setInt8: function(e, t) {
                nativeSetInt8.call(this, e, t << 24 >> 24)
            },
            setUint8: function(e, t) {
                nativeSetInt8.call(this, e, t << 24 >> 24)
            }
        }, {
            unsafe: !0
        })
    } else
        $ArrayBuffer = function(e) {
            anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
            var t = toIndex(e);
            setInternalState$4(this, {
                bytes: arrayFill.call(new Array(t), 0),
                byteLength: t
            }),
            descriptors || (this.byteLength = t)
        }
        ,
        $DataView = function(e, t, r) {
            anInstance(this, $DataView, DATA_VIEW),
            anInstance(e, $ArrayBuffer, DATA_VIEW);
            var a = getInternalState$2(e).byteLength
              , n = toInteger(t);
            if (n < 0 || n > a)
                throw RangeError$1("Wrong offset");
            if (n + (r = void 0 === r ? a - n : toLength(r)) > a)
                throw RangeError$1(WRONG_LENGTH);
            setInternalState$4(this, {
                buffer: e,
                byteLength: r,
                byteOffset: n
            }),
            descriptors || (this.buffer = e,
            this.byteLength = r,
            this.byteOffset = n)
        }
        ,
        descriptors && (addGetter($ArrayBuffer, "byteLength"),
        addGetter($DataView, "buffer"),
        addGetter($DataView, "byteLength"),
        addGetter($DataView, "byteOffset")),
        redefineAll($DataView[PROTOTYPE$1], {
            getInt8: function(e) {
                return get$1(this, 1, e)[0] << 24 >> 24
            },
            getUint8: function(e) {
                return get$1(this, 1, e)[0]
            },
            getInt16: function(e) {
                var t = get$1(this, 2, e, arguments.length > 1 ? arguments[1] : void 0);
                return (t[1] << 8 | t[0]) << 16 >> 16
            },
            getUint16: function(e) {
                var t = get$1(this, 2, e, arguments.length > 1 ? arguments[1] : void 0);
                return t[1] << 8 | t[0]
            },
            getInt32: function(e) {
                return unpackInt32(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0))
            },
            getUint32: function(e) {
                return unpackInt32(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0)) >>> 0
            },
            getFloat32: function(e) {
                return unpackIEEE754(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0), 23)
            },
            getFloat64: function(e) {
                return unpackIEEE754(get$1(this, 8, e, arguments.length > 1 ? arguments[1] : void 0), 52)
            },
            setInt8: function(e, t) {
                set$1(this, 1, e, packInt8, t)
            },
            setUint8: function(e, t) {
                set$1(this, 1, e, packInt8, t)
            },
            setInt16: function(e, t) {
                set$1(this, 2, e, packInt16, t, arguments.length > 2 ? arguments[2] : void 0)
            },
            setUint16: function(e, t) {
                set$1(this, 2, e, packInt16, t, arguments.length > 2 ? arguments[2] : void 0)
            },
            setInt32: function(e, t) {
                set$1(this, 4, e, packInt32, t, arguments.length > 2 ? arguments[2] : void 0)
            },
            setUint32: function(e, t) {
                set$1(this, 4, e, packInt32, t, arguments.length > 2 ? arguments[2] : void 0)
            },
            setFloat32: function(e, t) {
                set$1(this, 4, e, packFloat32, t, arguments.length > 2 ? arguments[2] : void 0)
            },
            setFloat64: function(e, t) {
                set$1(this, 8, e, packFloat64, t, arguments.length > 2 ? arguments[2] : void 0)
            }
        });
    setToStringTag($ArrayBuffer, ARRAY_BUFFER),
    setToStringTag($DataView, DATA_VIEW);
    var arrayBuffer = {
        ArrayBuffer: $ArrayBuffer,
        DataView: $DataView
    }
      , toPositiveInteger = function(e) {
        var t = toInteger(e);
        if (t < 0)
            throw RangeError("The argument can't be less than 0");
        return t
    }
      , toOffset = function(e, t) {
        var r = toPositiveInteger(e);
        if (r % t)
            throw RangeError("Wrong offset");
        return r
    }
      , aTypedArrayConstructor$1 = arrayBufferViewCore.aTypedArrayConstructor
      , typedArrayFrom = function(e) {
        var t, r, a, n, o, l, i = toObject(e), s = arguments.length, c = s > 1 ? arguments[1] : void 0, u = void 0 !== c, h = getIteratorMethod(i);
        if (null != h && !isArrayIteratorMethod(h))
            for (l = (o = h.call(i)).next,
            i = []; !(n = l.call(o)).done; )
                i.push(n.value);
        for (u && s > 2 && (c = functionBindContext(c, arguments[2], 2)),
        r = toLength(i.length),
        a = new (aTypedArrayConstructor$1(this))(r),
        t = 0; r > t; t++)
            a[t] = u ? c(i[t], t) : i[t];
        return a
    }
      , typedArrayConstructor = createCommonjsModule((function(e) {
        var t = objectGetOwnPropertyNames.f
          , r = arrayIteration.forEach
          , a = internalState.get
          , n = internalState.set
          , o = objectDefineProperty.f
          , l = objectGetOwnPropertyDescriptor.f
          , i = Math.round
          , s = global_1.RangeError
          , c = arrayBuffer.ArrayBuffer
          , u = arrayBuffer.DataView
          , h = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS
          , d = arrayBufferViewCore.TYPED_ARRAY_TAG
          , f = arrayBufferViewCore.TypedArray
          , m = arrayBufferViewCore.TypedArrayPrototype
          , p = arrayBufferViewCore.aTypedArrayConstructor
          , g = arrayBufferViewCore.isTypedArray
          , y = function(e, t) {
            for (var r = 0, a = t.length, n = new (p(e))(a); a > r; )
                n[r] = t[r++];
            return n
        }
          , v = function(e, t) {
            o(e, t, {
                get: function() {
                    return a(this)[t]
                }
            })
        }
          , A = function(e) {
            var t;
            return e instanceof c || "ArrayBuffer" == (t = classof(e)) || "SharedArrayBuffer" == t
        }
          , b = function(e, t) {
            return g(e) && "symbol" != typeof t && t in e && String(+t) == String(t)
        }
          , k = function(e, t) {
            return b(e, t = toPrimitive(t, !0)) ? createPropertyDescriptor(2, e[t]) : l(e, t)
        }
          , w = function(e, t, r) {
            return !(b(e, t = toPrimitive(t, !0)) && isObject(r) && has(r, "value")) || has(r, "get") || has(r, "set") || r.configurable || has(r, "writable") && !r.writable || has(r, "enumerable") && !r.enumerable ? o(e, t, r) : (e[t] = r.value,
            e)
        };
        descriptors ? (h || (objectGetOwnPropertyDescriptor.f = k,
        objectDefineProperty.f = w,
        v(m, "buffer"),
        v(m, "byteOffset"),
        v(m, "byteLength"),
        v(m, "length")),
        _export({
            target: "Object",
            stat: !0,
            forced: !h
        }, {
            getOwnPropertyDescriptor: k,
            defineProperty: w
        }),
        e.exports = function(e, l, p) {
            var v = e.match(/\d+$/)[0] / 8
              , b = e + (p ? "Clamped" : "") + "Array"
              , k = "get" + e
              , w = "set" + e
              , x = global_1[b]
              , S = x
              , _ = S && S.prototype
              , C = {}
              , T = function(e, t) {
                o(e, t, {
                    get: function() {
                        return function(e, t) {
                            var r = a(e);
                            return r.view[k](t * v + r.byteOffset, !0)
                        }(this, t)
                    },
                    set: function(e) {
                        return function(e, t, r) {
                            var n = a(e);
                            p && (r = (r = i(r)) < 0 ? 0 : r > 255 ? 255 : 255 & r),
                            n.view[w](t * v + n.byteOffset, r, !0)
                        }(this, t, e)
                    },
                    enumerable: !0
                })
            };
            h ? typedArrayConstructorsRequireWrappers && (S = l((function(e, t, r, a) {
                return anInstance(e, S, b),
                inheritIfRequired(isObject(t) ? A(t) ? void 0 !== a ? new x(t,toOffset(r, v),a) : void 0 !== r ? new x(t,toOffset(r, v)) : new x(t) : g(t) ? y(S, t) : typedArrayFrom.call(S, t) : new x(toIndex(t)), e, S)
            }
            )),
            objectSetPrototypeOf && objectSetPrototypeOf(S, f),
            r(t(x), (function(e) {
                e in S || createNonEnumerableProperty(S, e, x[e])
            }
            )),
            S.prototype = _) : (S = l((function(e, t, r, a) {
                anInstance(e, S, b);
                var o, l, i, h = 0, d = 0;
                if (isObject(t)) {
                    if (!A(t))
                        return g(t) ? y(S, t) : typedArrayFrom.call(S, t);
                    o = t,
                    d = toOffset(r, v);
                    var f = t.byteLength;
                    if (void 0 === a) {
                        if (f % v)
                            throw s("Wrong length");
                        if ((l = f - d) < 0)
                            throw s("Wrong length")
                    } else if ((l = toLength(a) * v) + d > f)
                        throw s("Wrong length");
                    i = l / v
                } else
                    i = toIndex(t),
                    o = new c(l = i * v);
                for (n(e, {
                    buffer: o,
                    byteOffset: d,
                    byteLength: l,
                    length: i,
                    view: new u(o)
                }); h < i; )
                    T(e, h++)
            }
            )),
            objectSetPrototypeOf && objectSetPrototypeOf(S, f),
            _ = S.prototype = objectCreate(m)),
            _.constructor !== S && createNonEnumerableProperty(_, "constructor", S),
            d && createNonEnumerableProperty(_, d, b),
            C[b] = S,
            _export({
                global: !0,
                forced: S != x,
                sham: !h
            }, C),
            "BYTES_PER_ELEMENT"in S || createNonEnumerableProperty(S, "BYTES_PER_ELEMENT", v),
            "BYTES_PER_ELEMENT"in _ || createNonEnumerableProperty(_, "BYTES_PER_ELEMENT", v),
            setSpecies(b)
        }
        ) : e.exports = function() {}
    }
    ));
    typedArrayConstructor("Uint8", (function(e) {
        return function(t, r, a) {
            return e(this, t, r, a)
        }
    }
    ));
    var min$6 = Math.min
      , arrayCopyWithin = [].copyWithin || function(e, t) {
        var r = toObject(this)
          , a = toLength(r.length)
          , n = toAbsoluteIndex(e, a)
          , o = toAbsoluteIndex(t, a)
          , l = arguments.length > 2 ? arguments[2] : void 0
          , i = min$6((void 0 === l ? a : toAbsoluteIndex(l, a)) - o, a - n)
          , s = 1;
        for (o < n && n < o + i && (s = -1,
        o += i - 1,
        n += i - 1); i-- > 0; )
            o in r ? r[n] = r[o] : delete r[n],
            n += s,
            o += s;
        return r
    }
      , aTypedArray$1 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$1("copyWithin", (function(e, t) {
        return arrayCopyWithin.call(aTypedArray$1(this), e, t, arguments.length > 2 ? arguments[2] : void 0)
    }
    ));
    var $every = arrayIteration.every
      , aTypedArray$2 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$2("every", (function(e) {
        return $every(aTypedArray$2(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var aTypedArray$3 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$3 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$3("fill", (function(e) {
        return arrayFill.apply(aTypedArray$3(this), arguments)
    }
    ));
    var $filter$1 = arrayIteration.filter
      , aTypedArray$4 = arrayBufferViewCore.aTypedArray
      , aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor
      , exportTypedArrayMethod$4 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$4("filter", (function(e) {
        for (var t = $filter$1(aTypedArray$4(this), e, arguments.length > 1 ? arguments[1] : void 0), r = speciesConstructor(this, this.constructor), a = 0, n = t.length, o = new (aTypedArrayConstructor$2(r))(n); n > a; )
            o[a] = t[a++];
        return o
    }
    ));
    var $find$1 = arrayIteration.find
      , aTypedArray$5 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$5 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$5("find", (function(e) {
        return $find$1(aTypedArray$5(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var $findIndex$1 = arrayIteration.findIndex
      , aTypedArray$6 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$6("findIndex", (function(e) {
        return $findIndex$1(aTypedArray$6(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var $forEach$1 = arrayIteration.forEach
      , aTypedArray$7 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$7("forEach", (function(e) {
        $forEach$1(aTypedArray$7(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var $includes$1 = arrayIncludes.includes
      , aTypedArray$8 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$8("includes", (function(e) {
        return $includes$1(aTypedArray$8(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var $indexOf$1 = arrayIncludes.indexOf
      , aTypedArray$9 = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$9 = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$9("indexOf", (function(e) {
        return $indexOf$1(aTypedArray$9(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var ITERATOR$6 = wellKnownSymbol("iterator")
      , Uint8Array$1 = global_1.Uint8Array
      , arrayValues = es_array_iterator.values
      , arrayKeys = es_array_iterator.keys
      , arrayEntries = es_array_iterator.entries
      , aTypedArray$a = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$a = arrayBufferViewCore.exportTypedArrayMethod
      , nativeTypedArrayIterator = Uint8Array$1 && Uint8Array$1.prototype[ITERATOR$6]
      , CORRECT_ITER_NAME = !!nativeTypedArrayIterator && ("values" == nativeTypedArrayIterator.name || null == nativeTypedArrayIterator.name)
      , typedArrayValues = function() {
        return arrayValues.call(aTypedArray$a(this))
    };
    exportTypedArrayMethod$a("entries", (function() {
        return arrayEntries.call(aTypedArray$a(this))
    }
    )),
    exportTypedArrayMethod$a("keys", (function() {
        return arrayKeys.call(aTypedArray$a(this))
    }
    )),
    exportTypedArrayMethod$a("values", typedArrayValues, !CORRECT_ITER_NAME),
    exportTypedArrayMethod$a(ITERATOR$6, typedArrayValues, !CORRECT_ITER_NAME);
    var aTypedArray$b = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$b = arrayBufferViewCore.exportTypedArrayMethod
      , $join = [].join;
    exportTypedArrayMethod$b("join", (function(e) {
        return $join.apply(aTypedArray$b(this), arguments)
    }
    ));
    var aTypedArray$c = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$c = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$c("lastIndexOf", (function(e) {
        return arrayLastIndexOf.apply(aTypedArray$c(this), arguments)
    }
    ));
    var $map$1 = arrayIteration.map
      , aTypedArray$d = arrayBufferViewCore.aTypedArray
      , aTypedArrayConstructor$3 = arrayBufferViewCore.aTypedArrayConstructor
      , exportTypedArrayMethod$d = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$d("map", (function(e) {
        return $map$1(aTypedArray$d(this), e, arguments.length > 1 ? arguments[1] : void 0, (function(e, t) {
            return new (aTypedArrayConstructor$3(speciesConstructor(e, e.constructor)))(t)
        }
        ))
    }
    ));
    var createMethod$4 = function(e) {
        return function(t, r, a, n) {
            aFunction$1(r);
            var o = toObject(t)
              , l = indexedObject(o)
              , i = toLength(o.length)
              , s = e ? i - 1 : 0
              , c = e ? -1 : 1;
            if (a < 2)
                for (; ; ) {
                    if (s in l) {
                        n = l[s],
                        s += c;
                        break
                    }
                    if (s += c,
                    e ? s < 0 : i <= s)
                        throw TypeError("Reduce of empty array with no initial value")
                }
            for (; e ? s >= 0 : i > s; s += c)
                s in l && (n = r(n, l[s], s, o));
            return n
        }
    }
      , arrayReduce = {
        left: createMethod$4(!1),
        right: createMethod$4(!0)
    }
      , $reduce = arrayReduce.left
      , aTypedArray$e = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$e = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$e("reduce", (function(e) {
        return $reduce(aTypedArray$e(this), e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var $reduceRight = arrayReduce.right
      , aTypedArray$f = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$f = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$f("reduceRight", (function(e) {
        return $reduceRight(aTypedArray$f(this), e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var aTypedArray$g = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$g = arrayBufferViewCore.exportTypedArrayMethod
      , floor$4 = Math.floor;
    exportTypedArrayMethod$g("reverse", (function() {
        for (var e, t = aTypedArray$g(this).length, r = floor$4(t / 2), a = 0; a < r; )
            e = this[a],
            this[a++] = this[--t],
            this[t] = e;
        return this
    }
    ));
    var aTypedArray$h = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$h = arrayBufferViewCore.exportTypedArrayMethod
      , FORCED$5 = fails((function() {
        new Int8Array(1).set({})
    }
    ));
    exportTypedArrayMethod$h("set", (function(e) {
        aTypedArray$h(this);
        var t = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1)
          , r = this.length
          , a = toObject(e)
          , n = toLength(a.length)
          , o = 0;
        if (n + t > r)
            throw RangeError("Wrong length");
        for (; o < n; )
            this[t + o] = a[o++]
    }
    ), FORCED$5);
    var aTypedArray$i = arrayBufferViewCore.aTypedArray
      , aTypedArrayConstructor$4 = arrayBufferViewCore.aTypedArrayConstructor
      , exportTypedArrayMethod$i = arrayBufferViewCore.exportTypedArrayMethod
      , $slice = [].slice
      , FORCED$6 = fails((function() {
        new Int8Array(1).slice()
    }
    ));
    exportTypedArrayMethod$i("slice", (function(e, t) {
        for (var r = $slice.call(aTypedArray$i(this), e, t), a = speciesConstructor(this, this.constructor), n = 0, o = r.length, l = new (aTypedArrayConstructor$4(a))(o); o > n; )
            l[n] = r[n++];
        return l
    }
    ), FORCED$6);
    var $some = arrayIteration.some
      , aTypedArray$j = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$j = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$j("some", (function(e) {
        return $some(aTypedArray$j(this), e, arguments.length > 1 ? arguments[1] : void 0)
    }
    ));
    var aTypedArray$k = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$k = arrayBufferViewCore.exportTypedArrayMethod
      , $sort = [].sort;
    exportTypedArrayMethod$k("sort", (function(e) {
        return $sort.call(aTypedArray$k(this), e)
    }
    ));
    var aTypedArray$l = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$l = arrayBufferViewCore.exportTypedArrayMethod;
    exportTypedArrayMethod$l("subarray", (function(e, t) {
        var r = aTypedArray$l(this)
          , a = r.length
          , n = toAbsoluteIndex(e, a);
        return new (speciesConstructor(r, r.constructor))(r.buffer,r.byteOffset + n * r.BYTES_PER_ELEMENT,toLength((void 0 === t ? a : toAbsoluteIndex(t, a)) - n))
    }
    ));
    var Int8Array$3 = global_1.Int8Array
      , aTypedArray$m = arrayBufferViewCore.aTypedArray
      , exportTypedArrayMethod$m = arrayBufferViewCore.exportTypedArrayMethod
      , $toLocaleString = [].toLocaleString
      , $slice$1 = [].slice
      , TO_LOCALE_STRING_BUG = !!Int8Array$3 && fails((function() {
        $toLocaleString.call(new Int8Array$3(1))
    }
    ))
      , FORCED$7 = fails((function() {
        return [1, 2].toLocaleString() != new Int8Array$3([1, 2]).toLocaleString()
    }
    )) || !fails((function() {
        Int8Array$3.prototype.toLocaleString.call([1, 2])
    }
    ));
    exportTypedArrayMethod$m("toLocaleString", (function() {
        return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice$1.call(aTypedArray$m(this)) : aTypedArray$m(this), arguments)
    }
    ), FORCED$7);
    var exportTypedArrayMethod$n = arrayBufferViewCore.exportTypedArrayMethod
      , Uint8Array$2 = global_1.Uint8Array
      , Uint8ArrayPrototype = Uint8Array$2 && Uint8Array$2.prototype || {}
      , arrayToString = [].toString
      , arrayJoin = [].join;
    fails((function() {
        arrayToString.call({})
    }
    )) && (arrayToString = function() {
        return arrayJoin.call(this)
    }
    );
    var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
    exportTypedArrayMethod$n("toString", arrayToString, IS_NOT_ARRAY_METHOD);
    var ITERATOR$7 = wellKnownSymbol("iterator")
      , nativeUrl = !fails((function() {
        var e = new URL("b?a=1&b=2&c=3","http://a")
          , t = e.searchParams
          , r = "";
        return e.pathname = "c%20d",
        t.forEach((function(e, a) {
            t.delete("b"),
            r += a + e
        }
        )),
        isPure && !e.toJSON || !t.sort || "http://a/c%20d?a=1&c=3" !== e.href || "3" !== t.get("c") || "a=1" !== String(new URLSearchParams("?a=1")) || !t[ITERATOR$7] || "a" !== new URL("https://a@b").username || "b" !== new URLSearchParams(new URLSearchParams("a=b")).get("a") || "xn--e1aybc" !== new URL("http://тест").host || "#%D0%B1" !== new URL("http://a#б").hash || "a1c3" !== r || "x" !== new URL("http://x",void 0).host
    }
    ))
      , arrayFrom = function(e) {
        var t, r, a, n, o, l, i = toObject(e), s = "function" == typeof this ? this : Array, c = arguments.length, u = c > 1 ? arguments[1] : void 0, h = void 0 !== u, d = getIteratorMethod(i), f = 0;
        if (h && (u = functionBindContext(u, c > 2 ? arguments[2] : void 0, 2)),
        null == d || s == Array && isArrayIteratorMethod(d))
            for (r = new s(t = toLength(i.length)); t > f; f++)
                l = h ? u(i[f], f) : i[f],
                createProperty(r, f, l);
        else
            for (o = (n = d.call(i)).next,
            r = new s; !(a = o.call(n)).done; f++)
                l = h ? callWithSafeIterationClosing(n, u, [a.value, f], !0) : a.value,
                createProperty(r, f, l);
        return r.length = f,
        r
    }
      , maxInt = 2147483647
      , base = 36
      , tMin = 1
      , tMax = 26
      , skew = 38
      , damp = 700
      , initialBias = 72
      , initialN = 128
      , delimiter = "-"
      , regexNonASCII = /[^\0-\u007E]/
      , regexSeparators = /[.\u3002\uFF0E\uFF61]/g
      , OVERFLOW_ERROR = "Overflow: input needs wider integers to process"
      , baseMinusTMin = base - tMin
      , floor$5 = Math.floor
      , stringFromCharCode = String.fromCharCode
      , ucs2decode = function(e) {
        for (var t = [], r = 0, a = e.length; r < a; ) {
            var n = e.charCodeAt(r++);
            if (n >= 55296 && n <= 56319 && r < a) {
                var o = e.charCodeAt(r++);
                56320 == (64512 & o) ? t.push(((1023 & n) << 10) + (1023 & o) + 65536) : (t.push(n),
                r--)
            } else
                t.push(n)
        }
        return t
    }
      , digitToBasic = function(e) {
        return e + 22 + 75 * (e < 26)
    }
      , adapt = function(e, t, r) {
        var a = 0;
        for (e = r ? floor$5(e / damp) : e >> 1,
        e += floor$5(e / t); e > baseMinusTMin * tMax >> 1; a += base)
            e = floor$5(e / baseMinusTMin);
        return floor$5(a + (baseMinusTMin + 1) * e / (e + skew))
    }
      , encode = function(e) {
        var t, r, a = [], n = (e = ucs2decode(e)).length, o = initialN, l = 0, i = initialBias;
        for (t = 0; t < e.length; t++)
            (r = e[t]) < 128 && a.push(stringFromCharCode(r));
        var s = a.length
          , c = s;
        for (s && a.push(delimiter); c < n; ) {
            var u = maxInt;
            for (t = 0; t < e.length; t++)
                (r = e[t]) >= o && r < u && (u = r);
            var h = c + 1;
            if (u - o > floor$5((maxInt - l) / h))
                throw RangeError(OVERFLOW_ERROR);
            for (l += (u - o) * h,
            o = u,
            t = 0; t < e.length; t++) {
                if ((r = e[t]) < o && ++l > maxInt)
                    throw RangeError(OVERFLOW_ERROR);
                if (r == o) {
                    for (var d = l, f = base; ; f += base) {
                        var m = f <= i ? tMin : f >= i + tMax ? tMax : f - i;
                        if (d < m)
                            break;
                        var p = d - m
                          , g = base - m;
                        a.push(stringFromCharCode(digitToBasic(m + p % g))),
                        d = floor$5(p / g)
                    }
                    a.push(stringFromCharCode(digitToBasic(d))),
                    i = adapt(l, h, c == s),
                    l = 0,
                    ++c
                }
            }
            ++l,
            ++o
        }
        return a.join("")
    }
      , stringPunycodeToAscii = function(e) {
        var t, r, a = [], n = e.toLowerCase().replace(regexSeparators, ".").split(".");
        for (t = 0; t < n.length; t++)
            r = n[t],
            a.push(regexNonASCII.test(r) ? "xn--" + encode(r) : r);
        return a.join(".")
    }
      , getIterator = function(e) {
        var t = getIteratorMethod(e);
        if ("function" != typeof t)
            throw TypeError(String(e) + " is not iterable");
        return anObject(t.call(e))
    }
      , $fetch = getBuiltIn("fetch")
      , Headers = getBuiltIn("Headers")
      , ITERATOR$8 = wellKnownSymbol("iterator")
      , URL_SEARCH_PARAMS = "URLSearchParams"
      , URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + "Iterator"
      , setInternalState$5 = internalState.set
      , getInternalParamsState = internalState.getterFor(URL_SEARCH_PARAMS)
      , getInternalIteratorState = internalState.getterFor(URL_SEARCH_PARAMS_ITERATOR)
      , plus = /\+/g
      , sequences = Array(4)
      , percentSequence = function(e) {
        return sequences[e - 1] || (sequences[e - 1] = RegExp("((?:%[\\da-f]{2}){" + e + "})", "gi"))
    }
      , percentDecode = function(e) {
        try {
            return decodeURIComponent(e)
        } catch (t) {
            return e
        }
    }
      , deserialize = function(e) {
        var t = e.replace(plus, " ")
          , r = 4;
        try {
            return decodeURIComponent(t)
        } catch (e) {
            for (; r; )
                t = t.replace(percentSequence(r--), percentDecode);
            return t
        }
    }
      , find = /[!'()~]|%20/g
      , replace = {
        "!": "%21",
        "'": "%27",
        "(": "%28",
        ")": "%29",
        "~": "%7E",
        "%20": "+"
    }
      , replacer = function(e) {
        return replace[e]
    }
      , serialize = function(e) {
        return encodeURIComponent(e).replace(find, replacer)
    }
      , parseSearchParams = function(e, t) {
        if (t)
            for (var r, a, n = t.split("&"), o = 0; o < n.length; )
                (r = n[o++]).length && (a = r.split("="),
                e.push({
                    key: deserialize(a.shift()),
                    value: deserialize(a.join("="))
                }))
    }
      , updateSearchParams = function(e) {
        this.entries.length = 0,
        parseSearchParams(this.entries, e)
    }
      , validateArgumentsLength = function(e, t) {
        if (e < t)
            throw TypeError("Not enough arguments")
    }
      , URLSearchParamsIterator = createIteratorConstructor((function(e, t) {
        setInternalState$5(this, {
            type: URL_SEARCH_PARAMS_ITERATOR,
            iterator: getIterator(getInternalParamsState(e).entries),
            kind: t
        })
    }
    ), "Iterator", (function() {
        var e = getInternalIteratorState(this)
          , t = e.kind
          , r = e.iterator.next()
          , a = r.value;
        return r.done || (r.value = "keys" === t ? a.key : "values" === t ? a.value : [a.key, a.value]),
        r
    }
    ))
      , URLSearchParamsConstructor = function() {
        anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
        var e, t, r, a, n, o, l, i, s, c = arguments.length > 0 ? arguments[0] : void 0, u = this, h = [];
        if (setInternalState$5(u, {
            type: URL_SEARCH_PARAMS,
            entries: h,
            updateURL: function() {},
            updateSearchParams: updateSearchParams
        }),
        void 0 !== c)
            if (isObject(c))
                if ("function" == typeof (e = getIteratorMethod(c)))
                    for (r = (t = e.call(c)).next; !(a = r.call(t)).done; ) {
                        if ((l = (o = (n = getIterator(anObject(a.value))).next).call(n)).done || (i = o.call(n)).done || !o.call(n).done)
                            throw TypeError("Expected sequence with length 2");
                        h.push({
                            key: l.value + "",
                            value: i.value + ""
                        })
                    }
                else
                    for (s in c)
                        has(c, s) && h.push({
                            key: s,
                            value: c[s] + ""
                        });
            else
                parseSearchParams(h, "string" == typeof c ? "?" === c.charAt(0) ? c.slice(1) : c : c + "")
    }
      , URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
    redefineAll(URLSearchParamsPrototype, {
        append: function(e, t) {
            validateArgumentsLength(arguments.length, 2);
            var r = getInternalParamsState(this);
            r.entries.push({
                key: e + "",
                value: t + ""
            }),
            r.updateURL()
        },
        delete: function(e) {
            validateArgumentsLength(arguments.length, 1);
            for (var t = getInternalParamsState(this), r = t.entries, a = e + "", n = 0; n < r.length; )
                r[n].key === a ? r.splice(n, 1) : n++;
            t.updateURL()
        },
        get: function(e) {
            validateArgumentsLength(arguments.length, 1);
            for (var t = getInternalParamsState(this).entries, r = e + "", a = 0; a < t.length; a++)
                if (t[a].key === r)
                    return t[a].value;
            return null
        },
        getAll: function(e) {
            validateArgumentsLength(arguments.length, 1);
            for (var t = getInternalParamsState(this).entries, r = e + "", a = [], n = 0; n < t.length; n++)
                t[n].key === r && a.push(t[n].value);
            return a
        },
        has: function(e) {
            validateArgumentsLength(arguments.length, 1);
            for (var t = getInternalParamsState(this).entries, r = e + "", a = 0; a < t.length; )
                if (t[a++].key === r)
                    return !0;
            return !1
        },
        set: function(e, t) {
            validateArgumentsLength(arguments.length, 1);
            for (var r, a = getInternalParamsState(this), n = a.entries, o = !1, l = e + "", i = t + "", s = 0; s < n.length; s++)
                (r = n[s]).key === l && (o ? n.splice(s--, 1) : (o = !0,
                r.value = i));
            o || n.push({
                key: l,
                value: i
            }),
            a.updateURL()
        },
        sort: function() {
            var e, t, r, a = getInternalParamsState(this), n = a.entries, o = n.slice();
            for (n.length = 0,
            r = 0; r < o.length; r++) {
                for (e = o[r],
                t = 0; t < r; t++)
                    if (n[t].key > e.key) {
                        n.splice(t, 0, e);
                        break
                    }
                t === r && n.push(e)
            }
            a.updateURL()
        },
        forEach: function(e) {
            for (var t, r = getInternalParamsState(this).entries, a = functionBindContext(e, arguments.length > 1 ? arguments[1] : void 0, 3), n = 0; n < r.length; )
                a((t = r[n++]).value, t.key, this)
        },
        keys: function() {
            return new URLSearchParamsIterator(this,"keys")
        },
        values: function() {
            return new URLSearchParamsIterator(this,"values")
        },
        entries: function() {
            return new URLSearchParamsIterator(this,"entries")
        }
    }, {
        enumerable: !0
    }),
    redefine(URLSearchParamsPrototype, ITERATOR$8, URLSearchParamsPrototype.entries),
    redefine(URLSearchParamsPrototype, "toString", (function() {
        for (var e, t = getInternalParamsState(this).entries, r = [], a = 0; a < t.length; )
            e = t[a++],
            r.push(serialize(e.key) + "=" + serialize(e.value));
        return r.join("&")
    }
    ), {
        enumerable: !0
    }),
    setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS),
    _export({
        global: !0,
        forced: !nativeUrl
    }, {
        URLSearchParams: URLSearchParamsConstructor
    }),
    nativeUrl || "function" != typeof $fetch || "function" != typeof Headers || _export({
        global: !0,
        enumerable: !0,
        forced: !0
    }, {
        fetch: function(e) {
            var t, r, a, n = [e];
            return arguments.length > 1 && (isObject(t = arguments[1]) && (r = t.body,
            classof(r) === URL_SEARCH_PARAMS && ((a = t.headers ? new Headers(t.headers) : new Headers).has("content-type") || a.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"),
            t = objectCreate(t, {
                body: createPropertyDescriptor(0, String(r)),
                headers: createPropertyDescriptor(0, a)
            }))),
            n.push(t)),
            $fetch.apply(this, n)
        }
    });
    var web_urlSearchParams = {
        URLSearchParams: URLSearchParamsConstructor,
        getState: getInternalParamsState
    }, codeAt = stringMultibyte.codeAt, NativeURL = global_1.URL, URLSearchParams$1 = web_urlSearchParams.URLSearchParams, getInternalSearchParamsState = web_urlSearchParams.getState, setInternalState$6 = internalState.set, getInternalURLState = internalState.getterFor("URL"), floor$6 = Math.floor, pow$2 = Math.pow, INVALID_AUTHORITY = "Invalid authority", INVALID_SCHEME = "Invalid scheme", INVALID_HOST = "Invalid host", INVALID_PORT = "Invalid port", ALPHA = /[A-Za-z]/, ALPHANUMERIC = /[\d+-.A-Za-z]/, DIGIT = /\d/, HEX_START = /^(0x|0X)/, OCT = /^[0-7]+$/, DEC = /^\d+$/, HEX = /^[\dA-Fa-f]+$/, FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/, FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g, TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g, EOF, parseHost = function(e, t) {
        var r, a, n;
        if ("[" == t.charAt(0)) {
            if ("]" != t.charAt(t.length - 1))
                return INVALID_HOST;
            if (!(r = parseIPv6(t.slice(1, -1))))
                return INVALID_HOST;
            e.host = r
        } else if (isSpecial(e)) {
            if (t = stringPunycodeToAscii(t),
            FORBIDDEN_HOST_CODE_POINT.test(t))
                return INVALID_HOST;
            if (null === (r = parseIPv4(t)))
                return INVALID_HOST;
            e.host = r
        } else {
            if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(t))
                return INVALID_HOST;
            for (r = "",
            a = arrayFrom(t),
            n = 0; n < a.length; n++)
                r += percentEncode(a[n], C0ControlPercentEncodeSet);
            e.host = r
        }
    }, parseIPv4 = function(e) {
        var t, r, a, n, o, l, i, s = e.split(".");
        if (s.length && "" == s[s.length - 1] && s.pop(),
        (t = s.length) > 4)
            return e;
        for (r = [],
        a = 0; a < t; a++) {
            if ("" == (n = s[a]))
                return e;
            if (o = 10,
            n.length > 1 && "0" == n.charAt(0) && (o = HEX_START.test(n) ? 16 : 8,
            n = n.slice(8 == o ? 1 : 2)),
            "" === n)
                l = 0;
            else {
                if (!(10 == o ? DEC : 8 == o ? OCT : HEX).test(n))
                    return e;
                l = parseInt(n, o)
            }
            r.push(l)
        }
        for (a = 0; a < t; a++)
            if (l = r[a],
            a == t - 1) {
                if (l >= pow$2(256, 5 - t))
                    return null
            } else if (l > 255)
                return null;
        for (i = r.pop(),
        a = 0; a < r.length; a++)
            i += r[a] * pow$2(256, 3 - a);
        return i
    }, parseIPv6 = function(e) {
        var t, r, a, n, o, l, i, s = [0, 0, 0, 0, 0, 0, 0, 0], c = 0, u = null, h = 0, d = function() {
            return e.charAt(h)
        };
        if (":" == d()) {
            if (":" != e.charAt(1))
                return;
            h += 2,
            u = ++c
        }
        for (; d(); ) {
            if (8 == c)
                return;
            if (":" != d()) {
                for (t = r = 0; r < 4 && HEX.test(d()); )
                    t = 16 * t + parseInt(d(), 16),
                    h++,
                    r++;
                if ("." == d()) {
                    if (0 == r)
                        return;
                    if (h -= r,
                    c > 6)
                        return;
                    for (a = 0; d(); ) {
                        if (n = null,
                        a > 0) {
                            if (!("." == d() && a < 4))
                                return;
                            h++
                        }
                        if (!DIGIT.test(d()))
                            return;
                        for (; DIGIT.test(d()); ) {
                            if (o = parseInt(d(), 10),
                            null === n)
                                n = o;
                            else {
                                if (0 == n)
                                    return;
                                n = 10 * n + o
                            }
                            if (n > 255)
                                return;
                            h++
                        }
                        s[c] = 256 * s[c] + n,
                        2 != ++a && 4 != a || c++
                    }
                    if (4 != a)
                        return;
                    break
                }
                if (":" == d()) {
                    if (h++,
                    !d())
                        return
                } else if (d())
                    return;
                s[c++] = t
            } else {
                if (null !== u)
                    return;
                h++,
                u = ++c
            }
        }
        if (null !== u)
            for (l = c - u,
            c = 7; 0 != c && l > 0; )
                i = s[c],
                s[c--] = s[u + l - 1],
                s[u + --l] = i;
        else if (8 != c)
            return;
        return s
    }, findLongestZeroSequence = function(e) {
        for (var t = null, r = 1, a = null, n = 0, o = 0; o < 8; o++)
            0 !== e[o] ? (n > r && (t = a,
            r = n),
            a = null,
            n = 0) : (null === a && (a = o),
            ++n);
        return n > r && (t = a,
        r = n),
        t
    }, serializeHost = function(e) {
        var t, r, a, n;
        if ("number" == typeof e) {
            for (t = [],
            r = 0; r < 4; r++)
                t.unshift(e % 256),
                e = floor$6(e / 256);
            return t.join(".")
        }
        if ("object" == typeof e) {
            for (t = "",
            a = findLongestZeroSequence(e),
            r = 0; r < 8; r++)
                n && 0 === e[r] || (n && (n = !1),
                a === r ? (t += r ? ":" : "::",
                n = !0) : (t += e[r].toString(16),
                r < 7 && (t += ":")));
            return "[" + t + "]"
        }
        return e
    }, C0ControlPercentEncodeSet = {}, fragmentPercentEncodeSet = objectAssign({}, C0ControlPercentEncodeSet, {
        " ": 1,
        '"': 1,
        "<": 1,
        ">": 1,
        "`": 1
    }), pathPercentEncodeSet = objectAssign({}, fragmentPercentEncodeSet, {
        "#": 1,
        "?": 1,
        "{": 1,
        "}": 1
    }), userinfoPercentEncodeSet = objectAssign({}, pathPercentEncodeSet, {
        "/": 1,
        ":": 1,
        ";": 1,
        "=": 1,
        "@": 1,
        "[": 1,
        "\\": 1,
        "]": 1,
        "^": 1,
        "|": 1
    }), percentEncode = function(e, t) {
        var r = codeAt(e, 0);
        return r > 32 && r < 127 && !has(t, e) ? e : encodeURIComponent(e)
    }, specialSchemes = {
        ftp: 21,
        file: null,
        http: 80,
        https: 443,
        ws: 80,
        wss: 443
    }, isSpecial = function(e) {
        return has(specialSchemes, e.scheme)
    }, includesCredentials = function(e) {
        return "" != e.username || "" != e.password
    }, cannotHaveUsernamePasswordPort = function(e) {
        return !e.host || e.cannotBeABaseURL || "file" == e.scheme
    }, isWindowsDriveLetter = function(e, t) {
        var r;
        return 2 == e.length && ALPHA.test(e.charAt(0)) && (":" == (r = e.charAt(1)) || !t && "|" == r)
    }, startsWithWindowsDriveLetter = function(e) {
        var t;
        return e.length > 1 && isWindowsDriveLetter(e.slice(0, 2)) && (2 == e.length || "/" === (t = e.charAt(2)) || "\\" === t || "?" === t || "#" === t)
    }, shortenURLsPath = function(e) {
        var t = e.path
          , r = t.length;
        !r || "file" == e.scheme && 1 == r && isWindowsDriveLetter(t[0], !0) || t.pop()
    }, isSingleDot = function(e) {
        return "." === e || "%2e" === e.toLowerCase()
    }, isDoubleDot = function(e) {
        return ".." === (e = e.toLowerCase()) || "%2e." === e || ".%2e" === e || "%2e%2e" === e
    }, SCHEME_START = {}, SCHEME = {}, NO_SCHEME = {}, SPECIAL_RELATIVE_OR_AUTHORITY = {}, PATH_OR_AUTHORITY = {}, RELATIVE = {}, RELATIVE_SLASH = {}, SPECIAL_AUTHORITY_SLASHES = {}, SPECIAL_AUTHORITY_IGNORE_SLASHES = {}, AUTHORITY = {}, HOST = {}, HOSTNAME = {}, PORT = {}, FILE = {}, FILE_SLASH = {}, FILE_HOST = {}, PATH_START = {}, PATH = {}, CANNOT_BE_A_BASE_URL_PATH = {}, QUERY = {}, FRAGMENT = {}, parseURL = function(e, t, r, a) {
        var n, o, l, i, s = r || SCHEME_START, c = 0, u = "", h = !1, d = !1, f = !1;
        for (r || (e.scheme = "",
        e.username = "",
        e.password = "",
        e.host = null,
        e.port = null,
        e.path = [],
        e.query = null,
        e.fragment = null,
        e.cannotBeABaseURL = !1,
        t = t.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, "")),
        t = t.replace(TAB_AND_NEW_LINE, ""),
        n = arrayFrom(t); c <= n.length; ) {
            switch (o = n[c],
            s) {
            case SCHEME_START:
                if (!o || !ALPHA.test(o)) {
                    if (r)
                        return INVALID_SCHEME;
                    s = NO_SCHEME;
                    continue
                }
                u += o.toLowerCase(),
                s = SCHEME;
                break;
            case SCHEME:
                if (o && (ALPHANUMERIC.test(o) || "+" == o || "-" == o || "." == o))
                    u += o.toLowerCase();
                else {
                    if (":" != o) {
                        if (r)
                            return INVALID_SCHEME;
                        u = "",
                        s = NO_SCHEME,
                        c = 0;
                        continue
                    }
                    if (r && (isSpecial(e) != has(specialSchemes, u) || "file" == u && (includesCredentials(e) || null !== e.port) || "file" == e.scheme && !e.host))
                        return;
                    if (e.scheme = u,
                    r)
                        return void (isSpecial(e) && specialSchemes[e.scheme] == e.port && (e.port = null));
                    u = "",
                    "file" == e.scheme ? s = FILE : isSpecial(e) && a && a.scheme == e.scheme ? s = SPECIAL_RELATIVE_OR_AUTHORITY : isSpecial(e) ? s = SPECIAL_AUTHORITY_SLASHES : "/" == n[c + 1] ? (s = PATH_OR_AUTHORITY,
                    c++) : (e.cannotBeABaseURL = !0,
                    e.path.push(""),
                    s = CANNOT_BE_A_BASE_URL_PATH)
                }
                break;
            case NO_SCHEME:
                if (!a || a.cannotBeABaseURL && "#" != o)
                    return INVALID_SCHEME;
                if (a.cannotBeABaseURL && "#" == o) {
                    e.scheme = a.scheme,
                    e.path = a.path.slice(),
                    e.query = a.query,
                    e.fragment = "",
                    e.cannotBeABaseURL = !0,
                    s = FRAGMENT;
                    break
                }
                s = "file" == a.scheme ? FILE : RELATIVE;
                continue;
            case SPECIAL_RELATIVE_OR_AUTHORITY:
                if ("/" != o || "/" != n[c + 1]) {
                    s = RELATIVE;
                    continue
                }
                s = SPECIAL_AUTHORITY_IGNORE_SLASHES,
                c++;
                break;
            case PATH_OR_AUTHORITY:
                if ("/" == o) {
                    s = AUTHORITY;
                    break
                }
                s = PATH;
                continue;
            case RELATIVE:
                if (e.scheme = a.scheme,
                o == EOF)
                    e.username = a.username,
                    e.password = a.password,
                    e.host = a.host,
                    e.port = a.port,
                    e.path = a.path.slice(),
                    e.query = a.query;
                else if ("/" == o || "\\" == o && isSpecial(e))
                    s = RELATIVE_SLASH;
                else if ("?" == o)
                    e.username = a.username,
                    e.password = a.password,
                    e.host = a.host,
                    e.port = a.port,
                    e.path = a.path.slice(),
                    e.query = "",
                    s = QUERY;
                else {
                    if ("#" != o) {
                        e.username = a.username,
                        e.password = a.password,
                        e.host = a.host,
                        e.port = a.port,
                        e.path = a.path.slice(),
                        e.path.pop(),
                        s = PATH;
                        continue
                    }
                    e.username = a.username,
                    e.password = a.password,
                    e.host = a.host,
                    e.port = a.port,
                    e.path = a.path.slice(),
                    e.query = a.query,
                    e.fragment = "",
                    s = FRAGMENT
                }
                break;
            case RELATIVE_SLASH:
                if (!isSpecial(e) || "/" != o && "\\" != o) {
                    if ("/" != o) {
                        e.username = a.username,
                        e.password = a.password,
                        e.host = a.host,
                        e.port = a.port,
                        s = PATH;
                        continue
                    }
                    s = AUTHORITY
                } else
                    s = SPECIAL_AUTHORITY_IGNORE_SLASHES;
                break;
            case SPECIAL_AUTHORITY_SLASHES:
                if (s = SPECIAL_AUTHORITY_IGNORE_SLASHES,
                "/" != o || "/" != u.charAt(c + 1))
                    continue;
                c++;
                break;
            case SPECIAL_AUTHORITY_IGNORE_SLASHES:
                if ("/" != o && "\\" != o) {
                    s = AUTHORITY;
                    continue
                }
                break;
            case AUTHORITY:
                if ("@" == o) {
                    h && (u = "%40" + u),
                    h = !0,
                    l = arrayFrom(u);
                    for (var m = 0; m < l.length; m++) {
                        var p = l[m];
                        if (":" != p || f) {
                            var g = percentEncode(p, userinfoPercentEncodeSet);
                            f ? e.password += g : e.username += g
                        } else
                            f = !0
                    }
                    u = ""
                } else if (o == EOF || "/" == o || "?" == o || "#" == o || "\\" == o && isSpecial(e)) {
                    if (h && "" == u)
                        return INVALID_AUTHORITY;
                    c -= arrayFrom(u).length + 1,
                    u = "",
                    s = HOST
                } else
                    u += o;
                break;
            case HOST:
            case HOSTNAME:
                if (r && "file" == e.scheme) {
                    s = FILE_HOST;
                    continue
                }
                if (":" != o || d) {
                    if (o == EOF || "/" == o || "?" == o || "#" == o || "\\" == o && isSpecial(e)) {
                        if (isSpecial(e) && "" == u)
                            return INVALID_HOST;
                        if (r && "" == u && (includesCredentials(e) || null !== e.port))
                            return;
                        if (i = parseHost(e, u))
                            return i;
                        if (u = "",
                        s = PATH_START,
                        r)
                            return;
                        continue
                    }
                    "[" == o ? d = !0 : "]" == o && (d = !1),
                    u += o
                } else {
                    if ("" == u)
                        return INVALID_HOST;
                    if (i = parseHost(e, u))
                        return i;
                    if (u = "",
                    s = PORT,
                    r == HOSTNAME)
                        return
                }
                break;
            case PORT:
                if (!DIGIT.test(o)) {
                    if (o == EOF || "/" == o || "?" == o || "#" == o || "\\" == o && isSpecial(e) || r) {
                        if ("" != u) {
                            var y = parseInt(u, 10);
                            if (y > 65535)
                                return INVALID_PORT;
                            e.port = isSpecial(e) && y === specialSchemes[e.scheme] ? null : y,
                            u = ""
                        }
                        if (r)
                            return;
                        s = PATH_START;
                        continue
                    }
                    return INVALID_PORT
                }
                u += o;
                break;
            case FILE:
                if (e.scheme = "file",
                "/" == o || "\\" == o)
                    s = FILE_SLASH;
                else {
                    if (!a || "file" != a.scheme) {
                        s = PATH;
                        continue
                    }
                    if (o == EOF)
                        e.host = a.host,
                        e.path = a.path.slice(),
                        e.query = a.query;
                    else if ("?" == o)
                        e.host = a.host,
                        e.path = a.path.slice(),
                        e.query = "",
                        s = QUERY;
                    else {
                        if ("#" != o) {
                            startsWithWindowsDriveLetter(n.slice(c).join("")) || (e.host = a.host,
                            e.path = a.path.slice(),
                            shortenURLsPath(e)),
                            s = PATH;
                            continue
                        }
                        e.host = a.host,
                        e.path = a.path.slice(),
                        e.query = a.query,
                        e.fragment = "",
                        s = FRAGMENT
                    }
                }
                break;
            case FILE_SLASH:
                if ("/" == o || "\\" == o) {
                    s = FILE_HOST;
                    break
                }
                a && "file" == a.scheme && !startsWithWindowsDriveLetter(n.slice(c).join("")) && (isWindowsDriveLetter(a.path[0], !0) ? e.path.push(a.path[0]) : e.host = a.host),
                s = PATH;
                continue;
            case FILE_HOST:
                if (o == EOF || "/" == o || "\\" == o || "?" == o || "#" == o) {
                    if (!r && isWindowsDriveLetter(u))
                        s = PATH;
                    else if ("" == u) {
                        if (e.host = "",
                        r)
                            return;
                        s = PATH_START
                    } else {
                        if (i = parseHost(e, u))
                            return i;
                        if ("localhost" == e.host && (e.host = ""),
                        r)
                            return;
                        u = "",
                        s = PATH_START
                    }
                    continue
                }
                u += o;
                break;
            case PATH_START:
                if (isSpecial(e)) {
                    if (s = PATH,
                    "/" != o && "\\" != o)
                        continue
                } else if (r || "?" != o)
                    if (r || "#" != o) {
                        if (o != EOF && (s = PATH,
                        "/" != o))
                            continue
                    } else
                        e.fragment = "",
                        s = FRAGMENT;
                else
                    e.query = "",
                    s = QUERY;
                break;
            case PATH:
                if (o == EOF || "/" == o || "\\" == o && isSpecial(e) || !r && ("?" == o || "#" == o)) {
                    if (isDoubleDot(u) ? (shortenURLsPath(e),
                    "/" == o || "\\" == o && isSpecial(e) || e.path.push("")) : isSingleDot(u) ? "/" == o || "\\" == o && isSpecial(e) || e.path.push("") : ("file" == e.scheme && !e.path.length && isWindowsDriveLetter(u) && (e.host && (e.host = ""),
                    u = u.charAt(0) + ":"),
                    e.path.push(u)),
                    u = "",
                    "file" == e.scheme && (o == EOF || "?" == o || "#" == o))
                        for (; e.path.length > 1 && "" === e.path[0]; )
                            e.path.shift();
                    "?" == o ? (e.query = "",
                    s = QUERY) : "#" == o && (e.fragment = "",
                    s = FRAGMENT)
                } else
                    u += percentEncode(o, pathPercentEncodeSet);
                break;
            case CANNOT_BE_A_BASE_URL_PATH:
                "?" == o ? (e.query = "",
                s = QUERY) : "#" == o ? (e.fragment = "",
                s = FRAGMENT) : o != EOF && (e.path[0] += percentEncode(o, C0ControlPercentEncodeSet));
                break;
            case QUERY:
                r || "#" != o ? o != EOF && ("'" == o && isSpecial(e) ? e.query += "%27" : e.query += "#" == o ? "%23" : percentEncode(o, C0ControlPercentEncodeSet)) : (e.fragment = "",
                s = FRAGMENT);
                break;
            case FRAGMENT:
                o != EOF && (e.fragment += percentEncode(o, fragmentPercentEncodeSet))
            }
            c++
        }
    }, URLConstructor = function(e) {
        var t, r, a = anInstance(this, URLConstructor, "URL"), n = arguments.length > 1 ? arguments[1] : void 0, o = String(e), l = setInternalState$6(a, {
            type: "URL"
        });
        if (void 0 !== n)
            if (n instanceof URLConstructor)
                t = getInternalURLState(n);
            else if (r = parseURL(t = {}, String(n)))
                throw TypeError(r);
        if (r = parseURL(l, o, null, t))
            throw TypeError(r);
        var i = l.searchParams = new URLSearchParams$1
          , s = getInternalSearchParamsState(i);
        s.updateSearchParams(l.query),
        s.updateURL = function() {
            l.query = String(i) || null
        }
        ,
        descriptors || (a.href = serializeURL.call(a),
        a.origin = getOrigin.call(a),
        a.protocol = getProtocol.call(a),
        a.username = getUsername.call(a),
        a.password = getPassword.call(a),
        a.host = getHost.call(a),
        a.hostname = getHostname.call(a),
        a.port = getPort.call(a),
        a.pathname = getPathname.call(a),
        a.search = getSearch.call(a),
        a.searchParams = getSearchParams.call(a),
        a.hash = getHash.call(a))
    }, URLPrototype = URLConstructor.prototype, serializeURL = function() {
        var e = getInternalURLState(this)
          , t = e.scheme
          , r = e.username
          , a = e.password
          , n = e.host
          , o = e.port
          , l = e.path
          , i = e.query
          , s = e.fragment
          , c = t + ":";
        return null !== n ? (c += "//",
        includesCredentials(e) && (c += r + (a ? ":" + a : "") + "@"),
        c += serializeHost(n),
        null !== o && (c += ":" + o)) : "file" == t && (c += "//"),
        c += e.cannotBeABaseURL ? l[0] : l.length ? "/" + l.join("/") : "",
        null !== i && (c += "?" + i),
        null !== s && (c += "#" + s),
        c
    }, getOrigin = function() {
        var e = getInternalURLState(this)
          , t = e.scheme
          , r = e.port;
        if ("blob" == t)
            try {
                return new URL(t.path[0]).origin
            } catch (e) {
                return "null"
            }
        return "file" != t && isSpecial(e) ? t + "://" + serializeHost(e.host) + (null !== r ? ":" + r : "") : "null"
    }, getProtocol = function() {
        return getInternalURLState(this).scheme + ":"
    }, getUsername = function() {
        return getInternalURLState(this).username
    }, getPassword = function() {
        return getInternalURLState(this).password
    }, getHost = function() {
        var e = getInternalURLState(this)
          , t = e.host
          , r = e.port;
        return null === t ? "" : null === r ? serializeHost(t) : serializeHost(t) + ":" + r
    }, getHostname = function() {
        var e = getInternalURLState(this).host;
        return null === e ? "" : serializeHost(e)
    }, getPort = function() {
        var e = getInternalURLState(this).port;
        return null === e ? "" : String(e)
    }, getPathname = function() {
        var e = getInternalURLState(this)
          , t = e.path;
        return e.cannotBeABaseURL ? t[0] : t.length ? "/" + t.join("/") : ""
    }, getSearch = function() {
        var e = getInternalURLState(this).query;
        return e ? "?" + e : ""
    }, getSearchParams = function() {
        return getInternalURLState(this).searchParams
    }, getHash = function() {
        var e = getInternalURLState(this).fragment;
        return e ? "#" + e : ""
    }, accessorDescriptor = function(e, t) {
        return {
            get: e,
            set: t,
            configurable: !0,
            enumerable: !0
        }
    };
    if (descriptors && objectDefineProperties(URLPrototype, {
        href: accessorDescriptor(serializeURL, (function(e) {
            var t = getInternalURLState(this)
              , r = String(e)
              , a = parseURL(t, r);
            if (a)
                throw TypeError(a);
            getInternalSearchParamsState(t.searchParams).updateSearchParams(t.query)
        }
        )),
        origin: accessorDescriptor(getOrigin),
        protocol: accessorDescriptor(getProtocol, (function(e) {
            var t = getInternalURLState(this);
            parseURL(t, String(e) + ":", SCHEME_START)
        }
        )),
        username: accessorDescriptor(getUsername, (function(e) {
            var t = getInternalURLState(this)
              , r = arrayFrom(String(e));
            if (!cannotHaveUsernamePasswordPort(t)) {
                t.username = "";
                for (var a = 0; a < r.length; a++)
                    t.username += percentEncode(r[a], userinfoPercentEncodeSet)
            }
        }
        )),
        password: accessorDescriptor(getPassword, (function(e) {
            var t = getInternalURLState(this)
              , r = arrayFrom(String(e));
            if (!cannotHaveUsernamePasswordPort(t)) {
                t.password = "";
                for (var a = 0; a < r.length; a++)
                    t.password += percentEncode(r[a], userinfoPercentEncodeSet)
            }
        }
        )),
        host: accessorDescriptor(getHost, (function(e) {
            var t = getInternalURLState(this);
            t.cannotBeABaseURL || parseURL(t, String(e), HOST)
        }
        )),
        hostname: accessorDescriptor(getHostname, (function(e) {
            var t = getInternalURLState(this);
            t.cannotBeABaseURL || parseURL(t, String(e), HOSTNAME)
        }
        )),
        port: accessorDescriptor(getPort, (function(e) {
            var t = getInternalURLState(this);
            cannotHaveUsernamePasswordPort(t) || ("" == (e = String(e)) ? t.port = null : parseURL(t, e, PORT))
        }
        )),
        pathname: accessorDescriptor(getPathname, (function(e) {
            var t = getInternalURLState(this);
            t.cannotBeABaseURL || (t.path = [],
            parseURL(t, e + "", PATH_START))
        }
        )),
        search: accessorDescriptor(getSearch, (function(e) {
            var t = getInternalURLState(this);
            "" == (e = String(e)) ? t.query = null : ("?" == e.charAt(0) && (e = e.slice(1)),
            t.query = "",
            parseURL(t, e, QUERY)),
            getInternalSearchParamsState(t.searchParams).updateSearchParams(t.query)
        }
        )),
        searchParams: accessorDescriptor(getSearchParams),
        hash: accessorDescriptor(getHash, (function(e) {
            var t = getInternalURLState(this);
            "" != (e = String(e)) ? ("#" == e.charAt(0) && (e = e.slice(1)),
            t.fragment = "",
            parseURL(t, e, FRAGMENT)) : t.fragment = null
        }
        ))
    }),
    redefine(URLPrototype, "toJSON", (function() {
        return serializeURL.call(this)
    }
    ), {
        enumerable: !0
    }),
    redefine(URLPrototype, "toString", (function() {
        return serializeURL.call(this)
    }
    ), {
        enumerable: !0
    }),
    NativeURL) {
        var nativeCreateObjectURL = NativeURL.createObjectURL
          , nativeRevokeObjectURL = NativeURL.revokeObjectURL;
        nativeCreateObjectURL && redefine(URLConstructor, "createObjectURL", (function(e) {
            return nativeCreateObjectURL.apply(NativeURL, arguments)
        }
        )),
        nativeRevokeObjectURL && redefine(URLConstructor, "revokeObjectURL", (function(e) {
            return nativeRevokeObjectURL.apply(NativeURL, arguments)
        }
        ))
    }
    function mobileinit() {
        Store.cellMainSrollBarSize = 0;
        var e = !1
          , t = {}
          , r = !1
          , a = null;
        $(document).on("touchstart", "#luckysheet-grid-window-1", (function(r) {
            clearInterval(a),
            e = !0;
            var n = r.originalEvent.targetTouches[0];
            t = {
                x: n.pageX,
                y: n.pageY,
                vy: 0,
                moveType: "y"
            }
        }
        )),
        $(document).on("touchmove", "#luckysheet-grid-window-1", (function(a) {
            if (!(a.originalEvent.targetTouches.length > 1 || a.scale && 1 !== a.scale)) {
                var n = a.originalEvent.targetTouches[0];
                if (e) {
                    var o = n.pageX - t.x
                      , l = n.pageY - t.y;
                    t.x = n.pageX,
                    t.y = n.pageY;
                    var i = $("#luckysheet-scrollbar-x").scrollLeft()
                      , s = $("#luckysheet-scrollbar-y").scrollTop();
                    (i -= o) < 0 && (i = 0),
                    (s -= l) < 0 && (s = 0),
                    $("#luckysheet-scrollbar-y").scrollTop(s),
                    t.vy_y = l,
                    t.scrollTop = s,
                    $("#luckysheet-scrollbar-x").scrollLeft(i),
                    t.vy_x = o,
                    t.scrollLeft = i
                } else if (r) {
                    var c = mouseposition(n.pageX, n.pageY)
                      , u = c[0] + $("#luckysheet-cell-main").scrollLeft()
                      , h = rowLocation(c[1] + $("#luckysheet-cell-main").scrollTop())
                      , d = h[1]
                      , f = h[0]
                      , m = h[2]
                      , p = colLocation(u)
                      , g = p[1]
                      , y = p[0]
                      , v = p[2]
                      , A = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                      , b = 0
                      , k = 0
                      , w = [];
                    A.top > f ? (b = f,
                    k = A.top + A.height - f,
                    A.row[1] > A.row_focus && (A.row[1] = A.row_focus),
                    w = [m, A.row[1]]) : A.top == f ? (b = f,
                    k = A.top + A.height - f,
                    w = [m, A.row[0]]) : (b = A.top,
                    k = d - A.top - 1,
                    A.row[0] < A.row_focus && (A.row[0] = A.row_focus),
                    w = [A.row[0], m]);
                    var x = 0
                      , S = 0
                      , _ = [];
                    A.left > y ? (x = y,
                    S = A.left + A.width - y,
                    A.column[1] > A.column_focus && (A.column[1] = A.column_focus),
                    _ = [v, A.column[1]]) : A.left == y ? (x = y,
                    S = A.left + A.width - y,
                    _ = [v, A.column[0]]) : (x = A.left,
                    S = g - A.left - 1,
                    A.column[0] < A.column_focus && (A.column[0] = A.column_focus),
                    _ = [A.column[0], v]);
                    var C = menuButton.mergeMoveMain(_, w, A, b, k, x, S);
                    null != C && (_ = C[0],
                    w = C[1],
                    b = C[2],
                    k = C[3],
                    x = C[4],
                    S = C[5]),
                    A.row = w,
                    A.column = _,
                    A.left_move = x,
                    A.width_move = S,
                    A.top_move = b,
                    A.height_move = k,
                    Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = A,
                    selectHightlightShow(),
                    luckysheetFreezen.scrollFreezen()
                }
                a.stopPropagation()
            }
        }
        )),
        $(document).on("touchend", (function(n) {
            if (e) {
                var o = Math.abs(t.vy_x)
                  , l = .25 * (2 * (o >> 31) + 1)
                  , i = Math.abs(t.vy_y)
                  , s = .25 * (2 * (i >> 31) + 1);
                (o > 0 || i > 0) && (a = setInterval((function() {
                    (o -= l) <= 0 && (o = 0),
                    (i -= s) <= 0 && (i = 0),
                    t.vy_y > 0 ? t.scrollTop -= i : t.scrollTop += i,
                    $("#luckysheet-scrollbar-y").scrollTop(t.scrollTop),
                    t.vy_x > 0 ? t.scrollLeft -= o : t.scrollLeft += o,
                    $("#luckysheet-scrollbar-x").scrollLeft(t.scrollLeft),
                    o <= 0 && i <= 0 && clearInterval(a)
                }
                ), 20))
            }
            e = !1,
            r = !1
        }
        )),
        $(document).on("touchstart", ".luckysheet-cs-touchhandle", (function(t) {
            r = !0,
            e = !1,
            t.stopPropagation()
        }
        )),
        document.addEventListener("touchmove", (function(e) {
            e.preventDefault()
        }
        ), {
            passive: !1
        })
    }
    function formulaHistoryHanddler(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "redo";
        if (null != e) {
            var r = e.data;
            "undo" == t && (r = e.curdata);
            for (var a = 0; a < e.range.length; a++)
                for (var n = e.range[a].row[0], o = e.range[a].row[1], l = e.range[a].column[0], i = e.range[a].column[1], s = n; s < o + 1; s++)
                    for (var c = l; c < i + 1 && !(s > r.length - 1); c++)
                        null == r[s][c] || null == r[s][c].f || "" == r[s][c].f ? luckysheetformula.delFunctionGroup(s, c, e.sheetIndex) : null != r[s][c] && null != r[s][c].f && r[s][c].f.length > 0 && luckysheetformula.insertUpdateFunctionGroup(s, c, e.sheetIndex)
        }
    }
    setToStringTag(URLConstructor, "URL"),
    _export({
        global: !0,
        forced: !nativeUrl,
        sham: !descriptors
    }, {
        URL: URLConstructor
    });
    var controlHistory = {
        redo: function(e) {
            if (0 != Store.jfredo.length) {
                var t = Store.jfredo.pop();
                if (Store.jfundo.push(t),
                Store.clearjfundo = !1,
                sheetmanage.hasSheet(t.sheetIndex) && Store.currentSheetIndex != t.sheetIndex && sheetmanage.changeSheetExec(t.sheetIndex),
                "datachange" == t.type) {
                    formulaHistoryHanddler(t);
                    var r = {
                        cfg: t.config,
                        RowlChange: t.RowlChange,
                        cdformat: t.cdformat,
                        dataVerification: t.dataVerification,
                        dynamicArray: t.dynamicArray
                    };
                    jfrefreshgrid(t.data, t.range, r)
                } else if ("pasteCut" == t.type) {
                    jfrefreshgrid_pastcut({
                        sheetIndex: t.source.sheetIndex,
                        data: t.source.curData,
                        curData: t.source.data,
                        config: t.source.curConfig,
                        curConfig: t.source.config,
                        cdformat: t.source.curCdformat,
                        curCdformat: t.source.cdformat,
                        dataVerification: t.source.curDataVerification,
                        curDataVerification: t.source.dataVerification,
                        range: t.source.range
                    }, {
                        sheetIndex: t.target.sheetIndex,
                        data: t.target.curData,
                        curData: t.target.data,
                        config: t.target.curConfig,
                        curConfig: t.target.config,
                        cdformat: t.target.curCdformat,
                        curCdformat: t.target.cdformat,
                        dataVerification: t.target.curDataVerification,
                        curDataVerification: t.target.dataVerification,
                        range: t.target.range
                    }, t.RowlChange)
                } else if ("rangechange" == t.type)
                    formulaHistoryHanddler(t),
                    jfrefreshrange(t.data, t.range, t.cdformat);
                else if ("resize" == t.type) {
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].config = Store.config,
                    "resizeR" == t.ctrlType ? server.saveParam("cg", t.sheetIndex, t.config.rowlen, {
                        k: "rowlen"
                    }) : "resizeC" == t.ctrlType && server.saveParam("cg", t.sheetIndex, t.config.columnlen, {
                        k: "columnlen"
                    });
                    var a = $.extend(!0, {}, t.images);
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].images = a,
                    server.saveParam("all", t.sheetIndex, a, {
                        k: "images"
                    }),
                    imageCtrl.images = a,
                    imageCtrl.allImagesShow(),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
                } else if ("cellRowChange" == t.type)
                    jfrefreshgridall(t.data[0].length, t.data.length, t.data, t.config, t.range, t.ctrlType, t.ctrlValue, t.cdformat);
                else if ("extend" == t.type)
                    jfrefreshgridall(t.data[0].length, t.data.length, t.data, t.config, t.range, "dele", t.ctrlValue);
                else if ("dele" == t.type) {
                    var n = $.extend(!0, {}, t.ctrlValue);
                    n.restore = !0,
                    jfrefreshgridall(t.data[0].length, t.data.length, t.data, t.config, t.range, "extend", n)
                } else if ("addRC" == t.type) {
                    var o = $.extend(!0, {}, t.ctrlValue);
                    "rightbottom" == o.direction && (o.index = o.index + 1),
                    jfrefreshgrid_adRC(t.data, t.config, "delRC", o, t.calc, t.filterObj, t.cf, t.af, t.freezen, t.dataVerification, t.hyperlink)
                } else if ("delRC" == t.type) {
                    var l = $.extend(!0, {}, t.ctrlValue);
                    l.restore = !0,
                    l.direction = "lefttop",
                    jfrefreshgrid_adRC(t.data, t.config, "addRC", l, t.calc, t.filterObj, t.cf, t.af, t.freezen, t.dataVerification, t.hyperlink)
                } else if ("deleteCell" == t.type)
                    jfrefreshgrid_deleteCell(t.data, t.config, t.ctrl, t.calc, t.filterObj, t.cf, t.dataVerification, t.hyperlink);
                else if ("showHidRows" == t.type)
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].config = t.config,
                    server.saveParam("cg", t.sheetIndex, t.config.rowhidden, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
                else if ("showHidCols" == t.type)
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].config = t.config,
                    server.saveParam("cg", t.sheetIndex, t.config.colhidden, {
                        k: "colhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
                else if ("datachangeAll" == t.type)
                    luckysheetformula.execFunctionGroup(),
                    jfrefreshgridall(t.data[0].length, t.data.length, t.data, null, t.range, "datachangeAll", t.ctrlValue);
                else if ("datachangeAll_filter_clear" == t.type)
                    createFilterOptions(t.filter_save),
                    $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").each((function(e) {
                        var r = $(this)
                          , a = t.optiongroups[e];
                        labelFilterOptionState(r, a.optionstate, a.rowhidden, a.caljs, !1, a.st_r, a.ed_r, a.cindex, a.st_c, a.ed_c)
                    }
                    )),
                    server.saveParam("fsr", Store.currentSheetIndex, {
                        filter: t.optiongroups,
                        filter_select: t.filter_save
                    }),
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                    null == Store.config.rowhidden && (Store.config.rowhidden = {}),
                    server.saveParam("cg", Store.currentSheetIndex, Store.config.rowhidden, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
                    $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide();
                else if ("datachangeAll_filter" == t.type) {
                    var i = $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(t.optionsindex)
                      , s = i.data("str")
                      , c = i.data("edr")
                      , u = i.data("cindex")
                      , h = i.data("stc")
                      , d = i.data("edc");
                    labelFilterOptionState(i, json.hasKey(t.rowhidenPre), t.rowhidenPre, t.caljs, !0, s, c, u, h, d),
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                    null == Store.config.rowhidden && (Store.config.rowhidden = {}),
                    server.saveParam("cg", Store.currentSheetIndex, Store.config.rowhidden, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
                    $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide()
                } else if ("filtershow" == t.type)
                    $("#luckysheet-filter-selected-sheet" + t.sheetIndex + ", #luckysheet-filter-options-sheet" + t.sheetIndex).remove(),
                    server.allowUpdate && server.saveParam("all", t.sheetIndex, null, {
                        k: "filter_select"
                    });
                else if ("pivotTable_change" == t.type)
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].pivotTable = t.pivotTable,
                    pivotTable.getCellData(t.sheetIndex),
                    pivotTable.initialPivotManage(!0),
                    pivotTable.refreshPivotTable();
                else if ("addSheet" == t.type)
                    sheetmanage.deleteSheet(t.index),
                    sheetmanage.changeSheetExec(t.currentSheetIndex),
                    $("#luckysheet-input-box").removeAttr("style"),
                    $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide();
                else if ("copySheet" == t.type)
                    sheetmanage.deleteSheet(t.index),
                    sheetmanage.changeSheetExec(t.copyindex);
                else if ("deleteSheet" == t.type) {
                    for (var f = !1, m = 0; m < Store.luckysheetfile.length; m++)
                        Store.luckysheetfile[m].name == t.name && (f = !0);
                    f || (sheetmanage.createSheetbydata(t, "isrenew"),
                    $("#luckysheet-input-box").removeAttr("style"),
                    $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide())
                } else if ("sheetName" == t.type)
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].name = t.oldtxt,
                    $("#luckysheet-sheets-item" + t.sheetIndex).find(".luckysheet-sheets-item-name").html(t.oldtxt),
                    server.saveParam("all", t.sheetIndex, t.oldtxt, {
                        k: "name"
                    });
                else if ("sheetColor" == t.type) {
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].color = t.oldcolor;
                    var p = $("#luckysheet-sheets-item" + t.sheetIndex);
                    p.find(".luckysheet-sheets-item-color").remove(),
                    null != t.oldcolor && p.append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + t.oldcolor + ';"></div>'),
                    server.saveParam("all", t.sheetIndex, t.oldcolor, {
                        k: "color"
                    })
                } else if ("mergeChange" == t.type) {
                    var g = {
                        cfg: t.config
                    };
                    jfrefreshgrid(t.data, t.range, g)
                } else if ("updateDataVerification" == t.type)
                    dataVerificationCtrl.ref(t.currentDataVerification, t.historyDataVerification, t.sheetIndex);
                else if ("updateDataVerificationOfCheckbox" == t.type)
                    dataVerificationCtrl.refOfCheckbox(t.currentDataVerification, t.historyDataVerification, t.sheetIndex, t.data, t.range);
                else if ("updateHyperlink" == t.type)
                    hyperlinkCtrl.ref(t.currentHyperlink, t.historyHyperlink, t.sheetIndex, t.data, t.range);
                else if ("updateCF" == t.type) {
                    for (var y = t.data.historyRules, v = 0; v < y.length; v++) {
                        var A = y[v].sheetIndex;
                        Store.luckysheetfile[getSheetIndex(A)].luckysheet_conditionformat_save = y[v].luckysheet_conditionformat_save,
                        server.allowUpdate && server.saveParam("all", A, y[v].luckysheet_conditionformat_save, {
                            k: "luckysheet_conditionformat_save"
                        })
                    }
                    conditionformat.ref()
                } else if ("updateAF" == t.type) {
                    var b = t.data.historyRules
                      , k = getSheetIndex(t.sheetIndex);
                    Store.luckysheetfile[k].luckysheet_alternateformat_save = $.extend(!0, [], b),
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1)
                } else if ("borderChange" == t.type)
                    null == t.config.borderInfo ? server.saveParam("cg", t.sheetIndex, [], {
                        k: "borderInfo"
                    }) : server.saveParam("cg", t.sheetIndex, t.config.borderInfo, {
                        k: "borderInfo"
                    }),
                    Store.config = t.config,
                    Store.luckysheetfile[getSheetIndex(t.sheetIndex)].config = Store.config,
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1);
                else if ("postil" == t.type) {
                    luckysheetPostil.ref(t.data, t.rc);
                    for (var w = 0; w < t.rc.length; w++) {
                        var x = t.rc[w].split("_")[0]
                          , S = t.rc[w].split("_")[1];
                        null != t.data[x][S] && null != t.data[x][S].ps ? luckysheetPostil.buildPs(x, S, t.data[x][S].ps) : luckysheetPostil.buildPs(x, S, null)
                    }
                } else
                    "imageCtrl" == t.type ? (imageCtrl.images = $.extend(!0, {}, t.images),
                    imageCtrl.allImagesShow(),
                    imageCtrl.ref()) : "zoomChange" == t.type && (Store.zoomRatio = t.zoomRatio,
                    server.saveParam("all", t.currentSheetIndex, t.zoomRatio, {
                        k: "zoomRatio"
                    }),
                    zoomNumberDomBind(),
                    zoomRefreshView());
                cleargridelement(e),
                Store.clearjfundo = !0
            }
        },
        undo: function() {
            if (0 != Store.jfundo.length) {
                var e = Store.jfundo.pop();
                if (Store.jfredo.push(e),
                Store.clearjfundo = !1,
                sheetmanage.hasSheet(e.sheetIndex) && Store.currentSheetIndex != e.sheetIndex && sheetmanage.changeSheetExec(e.sheetIndex),
                "datachange" == e.type) {
                    luckysheetformula.execFunctionGroup();
                    var t = {
                        cfg: e.curConfig,
                        RowlChange: e.RowlChange,
                        cdformat: e.curCdformat,
                        dataVerification: e.curDataVerification,
                        dynamicArray: e.curDynamicArray
                    };
                    formulaHistoryHanddler(e, "undo"),
                    jfrefreshgrid(e.curdata, e.range, t)
                } else if ("pasteCut" == e.type)
                    jfrefreshgrid_pastcut(e.source, e.target, e.RowlChange);
                else if ("rangechange" == e.type)
                    formulaHistoryHanddler(e, "undo"),
                    jfrefreshrange(e.curdata, e.range, e.curCdformat);
                else if ("resize" == e.type) {
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].config = Store.config,
                    "resizeR" == e.ctrlType ? server.saveParam("cg", e.sheetIndex, e.curconfig.rowlen, {
                        k: "rowlen"
                    }) : "resizeC" == e.ctrlType && server.saveParam("cg", e.sheetIndex, e.curconfig.columnlen, {
                        k: "columnlen"
                    });
                    var r = $.extend(!0, {}, e.curImages);
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].images = r,
                    server.saveParam("all", e.sheetIndex, r, {
                        k: "images"
                    }),
                    imageCtrl.images = r,
                    imageCtrl.allImagesShow(),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
                } else if ("cellRowChange" == e.type)
                    jfrefreshgridall(e.curdata[0].length, e.curdata.length, e.curdata, e.curconfig, e.currange, e.ctrlType, e.ctrlValue, e.curCdformat);
                else if ("extend" == e.type)
                    jfrefreshgridall(e.curdata[0].length, e.curdata.length, e.curdata, e.curconfig, e.currange, e.ctrlType, e.ctrlValue);
                else if ("dele" == e.type) {
                    $.extend(!0, {}, e.ctrlValue).restore = !0,
                    jfrefreshgridall(e.curdata[0].length, e.curdata.length, e.curdata, e.curconfig, e.currange, e.ctrlType, e.ctrlValue)
                } else if ("addRC" == e.type)
                    jfrefreshgrid_adRC(e.curData, e.curConfig, "addRC", e.ctrlValue, e.curCalc, e.curFilterObj, e.curCf, e.curAf, e.curFreezen, e.curDataVerification, e.curHyperlink);
                else if ("delRC" == e.type)
                    jfrefreshgrid_adRC(e.curData, e.curConfig, "delRC", e.ctrlValue, e.curCalc, e.curFilterObj, e.curCf, e.curAf, e.curFreezen, e.curDataVerification, e.curHyperlink);
                else if ("deleteCell" == e.type)
                    jfrefreshgrid_deleteCell(e.curData, e.curConfig, e.ctrl, e.curCalc, e.curFilterObj, e.curCf, e.curDataVerification, e.curHyperlink);
                else if ("showHidRows" == e.type)
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].config = e.curconfig,
                    server.saveParam("cg", e.sheetIndex, e.curconfig.rowhidden, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
                else if ("showHidCols" == e.type)
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].config = e.curconfig,
                    server.saveParam("cg", e.sheetIndex, e.curconfig.colhidden, {
                        k: "colhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
                else if ("datachangeAll" == e.type)
                    luckysheetformula.execFunctionGroup(),
                    jfrefreshgridall(e.curdata[0].length, e.curdata.length, e.curdata, null, e.currange, "datachangeAll", e.ctrlValue);
                else if ("datachangeAll_filter_clear" == e.type)
                    server.saveParam("fsc", Store.currentSheetIndex, null),
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                    server.saveParam("cg", Store.currentSheetIndex, {}, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
                    $("#luckysheet-filter-menu .luckysheet-filter-selected-input").hide().find("input").val(),
                    $("#luckysheet-filter-selected span").data("type", "0").data("type", null).text("无"),
                    $("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex + ", #luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove(),
                    $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide();
                else if ("datachangeAll_filter" == e.type) {
                    var a = $("#luckysheet-filter-options-sheet" + Store.currentSheetIndex + " .luckysheet-filter-options").eq(e.optionsindex)
                      , n = a.data("str")
                      , o = a.data("edr")
                      , l = a.data("cindex")
                      , i = a.data("stc")
                      , s = a.data("edc");
                    labelFilterOptionState(a, json.hasKey(e.rowhidden), e.rowhidden, e.caljs, !0, n, o, l, i, s),
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                    server.saveParam("cg", Store.currentSheetIndex, Store.config.rowhidden, {
                        k: "rowhidden"
                    }),
                    jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
                    $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide()
                } else if ("filtershow" == e.type)
                    Store.luckysheet_select_save = [e.filter_save],
                    Store.filterchage = !1,
                    createFilter(),
                    Store.filterchage = !0,
                    server.saveParam("all", e.sheetIndex, e.filter_save, {
                        k: "filter_select"
                    });
                else if ("pivotTable_change" == e.type)
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].pivotTable = e.pivotTablecur,
                    pivotTable.getCellData(e.sheetIndex),
                    pivotTable.initialPivotManage(!0),
                    pivotTable.refreshPivotTable();
                else if ("addSheet" == e.type)
                    sheetmanage.createSheetbydata(e.sheetconfig),
                    $("#luckysheet-input-box").removeAttr("style"),
                    $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide();
                else if ("copySheet" == e.type)
                    sheetmanage.copySheet(e.copyindex);
                else if ("deleteSheet" == e.type)
                    sheetmanage.deleteSheet(e.index),
                    0 == e.order ? sheetmanage.changeSheetExec(Store.luckysheetfile[0].index) : sheetmanage.changeSheetExec(Store.luckysheetfile[e.order - 1].index),
                    $("#luckysheet-input-box").removeAttr("style"),
                    $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide();
                else if ("sheetName" == e.type)
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].name = e.txt,
                    $("#luckysheet-sheets-item" + e.sheetIndex).find(".luckysheet-sheets-item-name").html(e.txt),
                    server.saveParam("all", e.sheetIndex, e.txt, {
                        k: "name"
                    });
                else if ("sheetColor" == e.type) {
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].color = e.color;
                    var c = $("#luckysheet-sheets-item" + e.sheetIndex);
                    c.find(".luckysheet-sheets-item-color").remove(),
                    null != e.color && c.append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + e.color + ';"></div>'),
                    server.saveParam("all", e.sheetIndex, e.color, {
                        k: "color"
                    })
                } else if ("mergeChange" == e.type) {
                    var u = {
                        cfg: e.curConfig
                    };
                    jfrefreshgrid(e.curData, e.range, u)
                } else if ("updateDataVerification" == e.type)
                    dataVerificationCtrl.ref(e.historyDataVerification, e.currentDataVerification, e.sheetIndex);
                else if ("updateDataVerificationOfCheckbox" == e.type)
                    dataVerificationCtrl.refOfCheckbox(e.historyDataVerification, e.currentDataVerification, e.sheetIndex, e.curData, e.range);
                else if ("updateHyperlink" == e.type)
                    hyperlinkCtrl.ref(e.historyHyperlink, e.currentHyperlink, e.sheetIndex, e.curData, e.range);
                else if ("updateCF" == e.type) {
                    for (var h = e.data.currentRules, d = 0; d < h.length; d++) {
                        var f = h[d].sheetIndex;
                        Store.luckysheetfile[getSheetIndex(f)].luckysheet_conditionformat_save = h[d].luckysheet_conditionformat_save,
                        server.allowUpdate && server.saveParam("all", f, h[d].luckysheet_conditionformat_save, {
                            k: "luckysheet_conditionformat_save"
                        })
                    }
                    conditionformat.ref()
                } else if ("updateAF" == e.type) {
                    var m = e.data.currentRules
                      , p = getSheetIndex(e.sheetIndex);
                    Store.luckysheetfile[p].luckysheet_alternateformat_save = $.extend(!0, [], m),
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1)
                } else if ("borderChange" == e.type)
                    server.saveParam("cg", e.sheetIndex, e.curconfig.borderInfo, {
                        k: "borderInfo"
                    }),
                    Store.config = e.curconfig,
                    Store.luckysheetfile[getSheetIndex(e.sheetIndex)].config = Store.config,
                    setTimeout((function() {
                        luckysheetrefreshgrid()
                    }
                    ), 1);
                else if ("postil" == e.type) {
                    luckysheetPostil.ref(e.curdata, e.rc);
                    for (var g = 0; g < e.rc.length; g++) {
                        var y = e.rc[g].split("_")[0]
                          , v = e.rc[g].split("_")[1];
                        null != e.curdata[y][v] && null != e.curdata[y][v].ps ? luckysheetPostil.buildPs(y, v, e.curdata[y][v].ps) : luckysheetPostil.buildPs(y, v, null)
                    }
                } else
                    "imageCtrl" == e.type ? (imageCtrl.images = $.extend(!0, {}, e.curImages),
                    imageCtrl.allImagesShow(),
                    imageCtrl.ref()) : "zoomChange" == e.type && (Store.zoomRatio = e.curZoomRatio,
                    server.saveParam("all", e.currentSheetIndex, e.curZoomRatio, {
                        k: "zoomRatio"
                    }),
                    zoomNumberDomBind(),
                    zoomRefreshView());
                Store.clearjfundo = !0
            }
        }
    }
      , luckysheetSplitColumn = {
        createDialog: function() {
            var e = locale()
              , t = e.splitText
              , r = e.punctuation
              , a = e.button;
            $("#luckysheet-modal-dialog-mask").show(),
            $("#luckysheet-splitColumn-dialog").remove();
            var n = '<div class="box"><div class="boxTitle">' + t.splitDelimiters + '</div><div class="boxMain"><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_01" type="checkbox"/><label for="splitColumn_type_01">' + r.tab + '</label></div><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_02" type="checkbox"/><label for="splitColumn_type_02">' + r.semicolon + '</label></div><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_03" type="checkbox"/><label for="splitColumn_type_03">' + r.comma + '</label></div><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_04" type="checkbox"/><label for="splitColumn_type_04">' + r.space + '</label></div><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_05" type="checkbox"/><label for="splitColumn_type_05">' + t.splitOther + '</label><input type="text" class="formulaInputFocus" maxlength="1"/></div></div><div style="height: 22px;line-height: 22px;"><input id="splitColumn_type_06" type="checkbox"/><label for="splitColumn_type_06">' + t.splitContinueSymbol + '</label></div><div class="boxTitle" style="margin-top: 10px;">' + t.splitDataPreview + '</div><div class="boxMain" id="splitColumnData"></div></div>';
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-splitColumn-dialog",
                addclass: "luckysheet-splitColumn-dialog",
                title: t.splitTextTitle,
                content: n,
                botton: '<button id="luckysheet-splitColumn-dialog-confirm" class="btn btn-primary">' + a.confirm + '</button><button class="btn btn-default luckysheet-model-close-btn">' + a.cancel + "</button>",
                style: "z-index:100003"
            }));
            var o = $("#luckysheet-splitColumn-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end()
              , l = o.outerHeight()
              , i = o.outerWidth()
              , s = $(window).width()
              , c = $(window).height()
              , u = $(document).scrollLeft()
              , h = $(document).scrollTop();
            $("#luckysheet-splitColumn-dialog").css({
                left: (s + u - i) / 2,
                top: (c + h - l) / 3
            }).show();
            var d = this.getDataArr();
            this.dataPreview(d)
        },
        init: function() {
            var e = this
              , t = locale().splitText;
            $(document).off("change.SPCinpcheckbox").on("change.SPCcheckbox", "#luckysheet-splitColumn-dialog .box input[type='checkbox']", (function() {
                var t = e.getRegStr()
                  , r = e.getDataArr(t);
                e.dataPreview(r)
            }
            )),
            $(document).off("keyup.SPCinptext").on("keyup.SPCinptext", "#luckysheet-splitColumn-dialog .box input[type='text']", (function() {
                if ($(this).siblings("input[type='checkbox']").is(":checked")) {
                    var t = e.getRegStr()
                      , r = e.getDataArr(t);
                    e.dataPreview(r)
                }
            }
            )),
            $(document).off("click.SPCconfirm").on("click.SPCconfirm", "#luckysheet-splitColumn-dialog #luckysheet-splitColumn-dialog-confirm", (function() {
                $("#luckysheet-modal-dialog-mask").hide(),
                $("#luckysheet-splitColumn-dialog").hide();
                var r = e.getRegStr()
                  , a = e.getDataArr(r)
                  , n = Store.luckysheet_select_save[0].row[0]
                  , o = Store.luckysheet_select_save[0].column[0];
                if (1 != a[0].length) {
                    for (var l = !1, i = 0; i < a.length; i++)
                        for (var s = 1; s < a[0].length; s++) {
                            var c = Store.flowdata[n + i][o + s];
                            if (null != c && null != c.v) {
                                l = !0;
                                break
                            }
                        }
                    if (l) {
                        tooltip.confirm("", t.splitConfirmToExe, (function() {
                            e.update(n, o, a)
                        }
                        ))
                    } else
                        e.update(n, o, a)
                }
            }
            ))
        },
        update: function(e, t, r) {
            for (var a = editor.deepCopyFlowData(Store.flowdata), n = 0; n < r.length; n++)
                for (var o = 0; o < r[0].length; o++) {
                    setcellvalue(e + n, t + o, a, r[n][o])
                }
            var l = Store.luckysheet_select_save[0].row[0]
              , i = Store.luckysheet_select_save[0].column[0];
            jfrefreshgrid(a, [{
                row: [l, l + r.length - 1],
                column: [i, i + r[0].length - 1]
            }]),
            selectHightlightShow()
        },
        dataPreview: function(e) {
            $("#luckysheet-splitColumn-dialog #splitColumnData").empty();
            for (var t = "", r = 0; r < e.length; r++) {
                for (var a = "", n = 0; n < e[0].length; n++)
                    a += "<td>" + e[r][n] + "</td>";
                t += "<tr>" + a + "</tr>"
            }
            var o = "<table>" + t + "</table>";
            $("#luckysheet-splitColumn-dialog #splitColumnData").append(o)
        },
        getRegStr: function() {
            var e = ""
              , t = 0;
            return $("#luckysheet-splitColumn-dialog .box input[type='checkbox']:checked").each((function(r, a) {
                var n = $(a).attr("id");
                if ("splitColumn_type_01" == n)
                    e += "\\t",
                    t++;
                else if ("splitColumn_type_02" == n)
                    t > 0 && (e += "|"),
                    e += ";",
                    t++;
                else if ("splitColumn_type_03" == n)
                    t > 0 && (e += "|"),
                    e += ",",
                    t++;
                else if ("splitColumn_type_04" == n)
                    t > 0 && (e += "|"),
                    e += "\\s",
                    t++;
                else if ("splitColumn_type_05" == n) {
                    var o = $(a).siblings("input[type='text']").val().trim();
                    "" != o && (t > 0 && (e += "|"),
                    e += o)
                } else
                    "splitColumn_type_06" == n && (e = "[" + e + "]+")
            }
            )),
            e
        },
        getDataArr: function(e) {
            var t = []
              , r = Store.luckysheet_select_save[0].row[0]
              , a = Store.luckysheet_select_save[0].row[1]
              , n = Store.luckysheet_select_save[0].column[0];
            if (null != e && "" != e) {
                for (var o = new RegExp(e,"g"), l = [], i = r; i <= a; i++) {
                    var s, c = Store.flowdata[i][n], u = void 0;
                    null == (u = null != c && null != c.m ? c.m : getcellvalue(i, n, Store.flowdata)) && (u = ""),
                    s = u.toString().split(o),
                    l.push(s)
                }
                for (var h = l.length, d = 0, f = 0; f < h; f++)
                    l[f].length > d && (d = l[f].length);
                t = this.getNullData(h, d);
                for (var m = 0; m < t.length; m++)
                    for (var p = 0; p < t[0].length; p++)
                        null != l[m][p] && (t[m][p] = l[m][p])
            } else
                for (var g = r; g <= a; g++) {
                    var y = []
                      , v = Store.flowdata[g][n]
                      , A = void 0;
                    null == (A = null != v && null != v.m ? v.m : getcellvalue(g, n, Store.flowdata)) && (A = ""),
                    y.push(A),
                    t.push(y)
                }
            return t
        },
        getNullData: function(e, t) {
            for (var r = [], a = 0; a < e; a++) {
                for (var n = [], o = 0; o < t; o++)
                    n.push("");
                r.push(n)
            }
            return r
        }
    }
      , isInitialCellFormatModel = !1;
    function initialCellFormatModelEvent() {
        var e = locale().cellFormat;
        $("#luckysheet-cellFormat-confirm").click((function() {
            var t = $("#luckysheet-protection-check-locked").is(":checked")
              , r = $("#luckysheet-protection-check-hidden").is(":checked");
            t = 1 == t ? 1 : 0,
            r = 1 == r ? 1 : 0,
            jfrefreshgrid(recycleSeletion((function(e, a, n, o) {
                null == e ? setcellvalue(a, n, o, {
                    lo: t,
                    hi: r
                }) : (e.lo = t,
                e.hi = r)
            }
            ), (function() {
                alert(e.sheetDataIsNullAlert)
            }
            )), void 0, void 0, !1),
            $("#luckysheet-cellFormat-config").hide(),
            $("#luckysheet-modal-dialog-mask").hide()
        }
        ))
    }
    function recycleSeletion(e, t) {
        if (null != Store.luckysheet_select_save && Store.luckysheet_select_save.length > 0) {
            var r = sheetmanage.getSheetByIndex().data;
            if (null != r)
                for (var a = 0; a < Store.luckysheet_select_save.length; a++)
                    for (var n = Store.luckysheet_select_save[a], o = n.row, l = n.column, i = o[0]; i <= o[1]; i++)
                        for (var s = l[0]; s <= l[1]; s++) {
                            var c = void 0
                              , u = menuButton.mergeborer(r, i, s);
                            if (u) {
                                var h = u.row[2]
                                  , d = u.column[2];
                                c = r[h][d]
                            } else
                                c = r[i][s];
                            e(c, i, s, r)
                        }
            else
                t();
            return r
        }
    }
    function initialCellFormatModel() {
        if (!isInitialCellFormatModel) {
            isInitialCellFormatModel = !0;
            var e = locale()
              , t = e.cellFormat
              , r = e.button;
            $("body").append(replaceHtml$1(modelHTML, {
                id: "luckysheet-cellFormat-config",
                addclass: "luckysheet-cellFormat-config",
                title: t.cellFormatTitle,
                content: '\n            <div class="luckysheet-cellFormat-menu-c">\n                <div class="luckysheet-cellFormat-menu luckysheet-cellFormat-menu-active" id="luckysheet-cellFormat-protection">\n                    '.concat(t.protection, '\n                </div>\n            </div>\n            <div id="luckysheet-cellFormat-protection-content" class="luckysheet-cellFormat-content">\n                <div class="luckysheet-cellFormat-protection">\n                    <p>\n                        ').concat(t.protectionTips, '\n                    </p>\n                    <label for="luckysheet-protection-check-locked"><input id="luckysheet-protection-check-locked" name="luckysheet-protection-check-locked" type="checkbox">').concat(t.locked, '</label><span>部分选中</span>\n                    <br/>\n                    <label for="luckysheet-protection-check-hidden"><input id="luckysheet-protection-check-hidden" name="luckysheet-protection-check-hidden" type="checkbox">').concat(t.hidden, "</label><span>全部选中</span>\n                </div>\n            </div>\n        "),
                botton: '<button id="luckysheet-cellFormat-confirm" class="btn btn-primary">'.concat(r.confirm, '</button>\n                    <button class="btn btn-default luckysheet-model-close-btn">').concat(r.cancel, "</button>"),
                style: "z-index:100003"
            })),
            initialCellFormatModelEvent()
        }
    }
    function openCellFormatModel() {
        initialCellFormatModel();
        var e = locale()
          , t = e.cellFormat;
        e.button;
        if ($("#luckysheet-rightclick-menu").hide(),
        checkProtectionNotEnable(Store.currentSheetIndex)) {
            var r = !1
              , a = !1
              , n = 0
              , o = 0
              , l = 0;
            if (null != Store.luckysheet_select_save && Store.luckysheet_select_save.length > 0) {
                recycleSeletion((function(e) {
                    null != e && null != e.lo && 1 != e.lo || (r = !0,
                    n++),
                    null != e && 1 == e.hi && (a = !0,
                    o++),
                    l++
                }
                ), (function() {
                    r = !0
                }
                ));
                var i = ""
                  , s = "";
                r && (i = n == l ? t.tipsAll : t.tipsPart),
                a && (s = o == l ? t.tipsAll : t.tipsPart),
                $("#luckysheet-protection-check-locked").prop("checked", r).parent().next().html(i),
                $("#luckysheet-protection-check-hidden").prop("checked", a).parent().next().html(s),
                openSelfModel("luckysheet-cellFormat-config")
            } else
                alert(t.selectionIsNullAlert)
        }
    }
    function luckysheetscrollevent(e) {
        var t = $("#luckysheet-cell-main")
          , r = $("#luckysheet-scrollbar-x").scrollLeft()
          , a = $("#luckysheet-scrollbar-y").scrollTop();
        return null != luckysheetFreezen.freezenhorizontaldata && a < luckysheetFreezen.freezenhorizontaldata[2] ? (a = luckysheetFreezen.freezenhorizontaldata[2],
        void $("#luckysheet-scrollbar-y").scrollTop(a)) : null != luckysheetFreezen.freezenverticaldata && r < luckysheetFreezen.freezenverticaldata[2] ? (r = luckysheetFreezen.freezenverticaldata[2],
        void $("#luckysheet-scrollbar-x").scrollLeft(r)) : ($("#luckysheet-cols-h-c").scrollLeft(r),
        $("#luckysheet-rows-h").scrollTop(a),
        t.scrollLeft(r).scrollTop(a),
        $("#luckysheet-input-box-index").css({
            left: $("#luckysheet-input-box").css("left"),
            top: parseInt($("#luckysheet-input-box").css("top")) - 20 + "px",
            "z-index": $("#luckysheet-input-box").css("z-index")
        }).show(),
        luckysheetrefreshgrid(r, a),
        $("#luckysheet-bottom-controll-row").css("left", r),
        void (null == luckysheetFreezen.freezenhorizontaldata && null == luckysheetFreezen.freezenverticaldata || luckysheetFreezen.scrollAdapt()))
    }
    function luckysheetHandler() {
        browser.detectOS();
        browser.mobilecheck() && mobileinit(),
        Date.now || (Date.now = function() {
            return (new Date).getTime()
        }
        ),
        function() {
            for (var e = ["webkit", "moz"], t = 0; t < e.length && !window.requestAnimationFrame; ++t) {
                var r = e[t];
                window.requestAnimationFrame = window[r + "RequestAnimationFrame"],
                window.cancelAnimationFrame = window[r + "CancelAnimationFrame"] || window[r + "CancelRequestAnimationFrame"]
            }
            if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
                var a = 0;
                window.requestAnimationFrame = function(e) {
                    var t = Date.now()
                      , r = Math.max(a + 16, t);
                    return setTimeout((function() {
                        e(a = r)
                    }
                    ), r - t)
                }
                ,
                window.cancelAnimationFrame = clearTimeout
            }
        }(),
        $("#luckysheet-sheet-container-c").mousewheel((function(e, t) {
            var r = e.deltaFactor < 40 ? 1 : e.deltaFactor < 80 ? 2 : 3
              , a = $(this).scrollLeft();
            0 != e.deltaY ? e.deltaY < 0 ? a += 10 * r : a -= 10 * r : 0 != e.deltaX && (e.deltaX > 0 ? a += 10 * r : a -= 10 * r),
            $(this).scrollLeft(a),
            e.preventDefault()
        }
        )),
        $("#luckysheet-cell-main").scroll((function() {}
        )).mousewheel((function(e, t) {
            e.preventDefault()
        }
        ));
        var e, t = locale(), r = t.drag, a = t.info;
        $("#luckysheet-grid-window-1").mousewheel((function(t, r) {
            var a = $("#luckysheet-scrollbar-x").scrollLeft()
              , n = $("#luckysheet-scrollbar-y").scrollTop()
              , o = Store.visibledatacolumn
              , l = Store.visibledatarow;
            null != luckysheetFreezen.freezenhorizontaldata && (l = luckysheetFreezen.freezenhorizontaldata[3]),
            null != luckysheetFreezen.freezenverticaldata && (o = luckysheetFreezen.freezenverticaldata[3]),
            clearTimeout(e),
            null != Store.visibledatacolumn_unique ? o = Store.visibledatacolumn_unique : (o = ArrayUnique(o),
            Store.visibledatacolumn_unique = o),
            null != Store.visibledatarow_unique ? l = Store.visibledatarow_unique : (l = ArrayUnique(l),
            Store.visibledatarow_unique = l);
            luckysheet_searcharray(o, a);
            var i = luckysheet_searcharray(l, n);
            null != luckysheetFreezen.freezenhorizontaldata && (i = luckysheet_searcharray(l, n + luckysheetFreezen.freezenhorizontaldata[0]));
            var s = 0
              , c = t.deltaFactor < 40 ? 1 : t.deltaFactor < 80 ? 2 : 3;
            if (0 != t.deltaY) {
                var u, h = Math.round(c / Store.zoomRatio);
                h = h < 1 ? 1 : h,
                t.deltaY < 0 ? (u = i + h) >= l.length && (u = l.length - 1) : (u = i - h) < 0 && (u = 0),
                s = 0 == u ? 0 : l[u - 1],
                null != luckysheetFreezen.freezenhorizontaldata && (s -= luckysheetFreezen.freezenhorizontaldata[0]),
                $("#luckysheet-scrollbar-y").scrollTop(s)
            } else
                0 != t.deltaX && (t.deltaX > 0 ? a += 20 * Store.zoomRatio : a -= 20 * Store.zoomRatio,
                $("#luckysheet-scrollbar-x").scrollLeft(a));
            e = setTimeout((function() {
                Store.visibledatacolumn_unique = null,
                Store.visibledatarow_unique = null
            }
            ), 500)
        }
        )),
        $("#luckysheet-scrollbar-x").scroll((function() {
            luckysheetscrollevent()
        }
        )).mousewheel((function(e, t) {
            e.preventDefault()
        }
        )),
        $("#luckysheet-scrollbar-y").scroll((function() {
            luckysheetscrollevent()
        }
        )).mousewheel((function(e, t) {
            e.preventDefault()
        }
        )),
        $(window).resize((function() {
            document.getElementById(Store.container) && luckysheetsizeauto()
        }
        )),
        $("#luckysheet-rich-text-editor").mouseup((function(e) {
            menuButton.inputMenuButtonFocus(e.target)
        }
        )),
        $("#luckysheet-cell-main, #luckysheetTableContent").mousedown((function(e) {
            if (!$(e.target).hasClass("luckysheet-mousedown-cancel")) {
                $("#luckysheet-cell-selected").find(".luckysheet-cs-fillhandle").css("cursor", "default").end().find(".luckysheet-cs-draghandle").css("cursor", "default"),
                $("#luckysheet-cell-main, #luckysheetTableContent, #luckysheet-sheettable_0").css("cursor", "default"),
                luckysheetPostil.removeActivePs(),
                ($("#luckysheet-modal-dialog-activeImage").is(":visible") || $("#luckysheet-modal-dialog-cropping").is(":visible")) && imageCtrl.cancelActiveImgItem();
                var t = mouseposition(e.pageX, e.pageY);
                if (!(t[0] >= Store.cellmainWidth - Store.cellMainSrollBarSize || t[1] >= Store.cellmainHeight - Store.cellMainSrollBarSize)) {
                    var r = t[0] + $("#luckysheet-cell-main").scrollLeft()
                      , a = t[1] + $("#luckysheet-cell-main").scrollTop();
                    null != luckysheetFreezen.freezenverticaldata && t[0] < luckysheetFreezen.freezenverticaldata[0] - luckysheetFreezen.freezenverticaldata[2] && (r = t[0] + luckysheetFreezen.freezenverticaldata[2]),
                    null != luckysheetFreezen.freezenhorizontaldata && t[1] < luckysheetFreezen.freezenhorizontaldata[0] - luckysheetFreezen.freezenhorizontaldata[2] && (a = t[1] + luckysheetFreezen.freezenhorizontaldata[2]);
                    var n = sheetmanage.getSheetByIndex()
                      , o = $("#luckysheetTableContent").get(0).getContext("2d")
                      , l = rowLocation(a)
                      , i = l[1]
                      , s = l[0]
                      , c = l[2]
                      , u = colLocation(r)
                      , h = u[1]
                      , d = u[0]
                      , f = u[2]
                      , m = c
                      , p = f
                      , g = menuButton.mergeborer(Store.flowdata, c, f);
                    if (g && (i = g.row[1],
                    s = g.row[0],
                    c = g.row[2],
                    m = g.row[3],
                    h = g.column[1],
                    d = g.column[0],
                    f = g.column[2],
                    p = g.column[3]),
                    method.createHookFunction("cellMousedownBefore", Store.flowdata[c][f], {
                        r: c,
                        c: f,
                        start_r: s,
                        start_c: d,
                        end_r: i,
                        end_c: h
                    }, n, o)) {
                        if (dataVerificationCtrl.cellFocus(c, f, !0),
                        d < $("#luckysheet-cell-main").scrollLeft() && $("#luckysheet-scrollbar-x").scrollLeft(d),
                        s < $("#luckysheet-cell-main").scrollTop() && $("#luckysheet-scrollbar-y").scrollTop(s),
                        "3" == e.which) {
                            $("#luckysheet-dataVerification-showHintBox").hide();
                            for (var y = !1, v = 0; v < Store.luckysheet_select_save.length; v++)
                                if (null != Store.luckysheet_select_save[v].row && c >= Store.luckysheet_select_save[v].row[0] && c <= Store.luckysheet_select_save[v].row[1] && f >= Store.luckysheet_select_save[v].column[0] && f <= Store.luckysheet_select_save[v].column[1]) {
                                    y = !0;
                                    break
                                }
                            if (y)
                                return
                        }
                        if (null == Store.flowdata[c] || null == Store.flowdata[c][f] || null == Store.flowdata[c][f].dd || null == luckysheetConfigsetting.fireMousedown || "function" != getObjType(luckysheetConfigsetting.fireMousedown))
                            if (hyperlinkCtrl.hyperlink && hyperlinkCtrl.hyperlink[c + "_" + f] && "3" != e.which)
                                hyperlinkCtrl.cellFocus(c, f);
                            else {
                                Store.luckysheet_scroll_status = !0;
                                var A = $("#luckysheet-input-box");
                                if (parseInt(A.css("top")) > 0) {
                                    if (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton()) {
                                        var b = [c, m]
                                          , k = [f, p]
                                          , w = d
                                          , x = h - d - 1
                                          , S = s
                                          , _ = i - s - 1;
                                        if (e.shiftKey) {
                                            var C = luckysheetformula.func_selectedrange
                                              , T = 0
                                              , E = 0
                                              , I = [];
                                            C.top > s ? (T = s,
                                            E = C.top + C.height - s,
                                            C.row[1] > C.row_focus && (C.row[1] = C.row_focus),
                                            I = [c, C.row[1]]) : C.top == s ? (T = s,
                                            E = C.top + C.height - s,
                                            I = [c, C.row[0]]) : (T = C.top,
                                            E = i - C.top - 1,
                                            C.row[0] < C.row_focus && (C.row[0] = C.row_focus),
                                            I = [C.row[0], c]);
                                            var R = 0
                                              , B = 0
                                              , N = [];
                                            C.left > d ? (R = d,
                                            B = C.left + C.width - d,
                                            C.column[1] > C.column_focus && (C.column[1] = C.column_focus),
                                            N = [f, C.column[1]]) : C.left == d ? (R = d,
                                            B = C.left + C.width - d,
                                            N = [f, C.column[0]]) : (R = C.left,
                                            B = h - C.left - 1,
                                            C.column[0] < C.column_focus && (C.column[0] = C.column_focus),
                                            N = [C.column[0], f]);
                                            var F = menuButton.mergeMoveMain(N, I, C, T, E, R, B);
                                            null != F && (N = F[0],
                                            I = F[1],
                                            T = F[2],
                                            E = F[3],
                                            R = F[4],
                                            B = F[5]),
                                            luckysheet_count_show(R, T, B, E, I, N),
                                            C.row = I,
                                            C.column = N,
                                            C.left_move = R,
                                            C.width_move = B,
                                            C.top_move = T,
                                            C.height_move = E,
                                            luckysheetformula.func_selectedrange = C
                                        } else if (e.ctrlKey && "," != $("#luckysheet-rich-text-editor").find("span").last().text()) {
                                            var P = $("#luckysheet-rich-text-editor").text();
                                            if (P.length > 0) {
                                                var L = P.substr(P.length - 1, 1);
                                                "," != L && "=" != L && "(" != L && (P += ",")
                                            }
                                            if (P.length > 0 && "=" == P.substr(0, 1)) {
                                                if (P = luckysheetformula.functionHTMLGenerate(P),
                                                window.getSelection) {
                                                    var O = window.getSelection();
                                                    luckysheetformula.functionRangeIndex = [$(O.anchorNode).parent().index(), O.anchorOffset]
                                                } else {
                                                    var D = document.selection.createRange();
                                                    luckysheetformula.functionRangeIndex = D
                                                }
                                                $("#luckysheet-rich-text-editor").html(P),
                                                luckysheetformula.canceFunctionrangeSelected(),
                                                luckysheetformula.createRangeHightlight()
                                            }
                                            luckysheetformula.rangestart = !1,
                                            luckysheetformula.rangedrag_column_start = !1,
                                            luckysheetformula.rangedrag_row_start = !1,
                                            $("#luckysheet-functionbox-cell").html(P),
                                            luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor")),
                                            luckysheetformula.israngeseleciton(),
                                            luckysheetformula.func_selectedrange = {
                                                left: w,
                                                width: x,
                                                top: S,
                                                height: _,
                                                left_move: w,
                                                width_move: x,
                                                top_move: S,
                                                height_move: _,
                                                row: b,
                                                column: k,
                                                row_focus: c,
                                                column_focus: f
                                            }
                                        } else
                                            luckysheetformula.func_selectedrange = {
                                                left: w,
                                                width: x,
                                                top: S,
                                                height: _,
                                                left_move: w,
                                                width_move: x,
                                                top_move: S,
                                                height_move: _,
                                                row: b,
                                                column: k,
                                                row_focus: c,
                                                column_focus: f
                                            };
                                        return luckysheetformula.rangeSetValue({
                                            row: b,
                                            column: k
                                        }),
                                        luckysheetformula.rangestart = !0,
                                        luckysheetformula.rangedrag_column_start = !1,
                                        luckysheetformula.rangedrag_row_start = !1,
                                        $("#luckysheet-formula-functionrange-select").css({
                                            left: w,
                                            width: x,
                                            top: S,
                                            height: _
                                        }).show(),
                                        $("#luckysheet-formula-help-c").hide(),
                                        luckysheet_count_show(w, S, x, _, b, k),
                                        void setTimeout((function() {
                                            var e, t = window.getSelection().anchorNode;
                                            $("#luckysheet-search-formula-parm").is(":visible") || $("#luckysheet-search-formula-parm-select").is(":visible") ? (e = $("#luckysheet-rich-text-editor"),
                                            luckysheetformula.rangechangeindex = luckysheetformula.data_parm_index) : e = $(t).closest("div");
                                            var r = e.find("span[rangeindex='" + luckysheetformula.rangechangeindex + "']");
                                            luckysheetformula.setCaretPosition(r.get(0), 0, r.html().length)
                                        }
                                        ), 1)
                                    }
                                    luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                                    Store.luckysheet_select_status = !0,
                                    $("#luckysheet-info").is(":visible") && (Store.luckysheet_select_status = !1)
                                } else
                                    checkProtectionSelectLockedOrUnLockedCells(c, f, Store.currentSheetIndex) && (Store.luckysheet_select_status = !0);
                                if ($("#luckysheet-multiRange-dialog").is(":visible")) {
                                    if (conditionformat.selectStatus = !0,
                                    Store.luckysheet_select_status = !1,
                                    e.shiftKey) {
                                        var M = conditionformat.selectRange[conditionformat.selectRange.length - 1]
                                          , U = 0
                                          , H = 0
                                          , q = [];
                                        M.top > s ? (U = s,
                                        H = M.top + M.height - s,
                                        M.row[1] > M.row_focus && (M.row[1] = M.row_focus),
                                        q = [c, M.row[1]]) : M.top == s ? (U = s,
                                        H = M.top + M.height - s,
                                        q = [c, M.row[0]]) : (U = M.top,
                                        H = i - M.top - 1,
                                        M.row[0] < M.row_focus && (M.row[0] = M.row_focus),
                                        q = [M.row[0], c]);
                                        var z = 0
                                          , j = 0
                                          , V = [];
                                        M.left > d ? (z = d,
                                        j = M.left + M.width - d,
                                        M.column[1] > M.column_focus && (M.column[1] = M.column_focus),
                                        V = [f, M.column[1]]) : M.left == d ? (z = d,
                                        j = M.left + M.width - d,
                                        V = [f, M.column[0]]) : (z = M.left,
                                        j = h - M.left - 1,
                                        M.column[0] < M.column_focus && (M.column[0] = M.column_focus),
                                        V = [M.column[0], f]);
                                        var Q = menuButton.mergeMoveMain(V, q, M, U, H, z, j);
                                        null != Q && (V = Q[0],
                                        q = Q[1],
                                        U = Q[2],
                                        H = Q[3],
                                        z = Q[4],
                                        j = Q[5]),
                                        M.row = q,
                                        M.column = V,
                                        M.left_move = z,
                                        M.width_move = j,
                                        M.top_move = U,
                                        M.height_move = H,
                                        conditionformat.selectRange[conditionformat.selectRange.length - 1] = M
                                    } else
                                        e.ctrlKey || (conditionformat.selectRange = []),
                                        conditionformat.selectRange.push({
                                            left: d,
                                            width: h - d - 1,
                                            top: s,
                                            height: i - s - 1,
                                            left_move: d,
                                            width_move: h - d - 1,
                                            top_move: s,
                                            height_move: i - s - 1,
                                            row: [c, m],
                                            column: [f, p],
                                            row_focus: c,
                                            column_focus: f
                                        });
                                    selectionCopyShow(conditionformat.selectRange);
                                    var G = conditionformat.getTxtByRange(conditionformat.selectRange);
                                    $("#luckysheet-multiRange-dialog input").val(G)
                                } else if (conditionformat.selectStatus = !1,
                                conditionformat.selectRange = [],
                                $("#luckysheet-singleRange-dialog").is(":visible")) {
                                    Store.luckysheet_select_status = !1,
                                    selectionCopyShow([{
                                        row: [c, c],
                                        column: [f, f]
                                    }]);
                                    var K = getRangetxt(Store.currentSheetIndex, {
                                        row: [c, c],
                                        column: [f, f]
                                    }, Store.currentSheetIndex);
                                    $("#luckysheet-singleRange-dialog input").val(K)
                                } else if ($("#luckysheet-dataVerificationRange-dialog").is(":visible")) {
                                    if (dataVerificationCtrl.selectStatus = !0,
                                    Store.luckysheet_select_status = !1,
                                    e.shiftKey) {
                                        var W = dataVerificationCtrl.selectRange[dataVerificationCtrl.selectRange.length - 1]
                                          , Y = 0
                                          , X = 0
                                          , J = [];
                                        W.top > s ? (Y = s,
                                        X = W.top + W.height - s,
                                        W.row[1] > W.row_focus && (W.row[1] = W.row_focus),
                                        J = [c, W.row[1]]) : W.top == s ? (Y = s,
                                        X = W.top + W.height - s,
                                        J = [c, W.row[0]]) : (Y = W.top,
                                        X = i - W.top - 1,
                                        W.row[0] < W.row_focus && (W.row[0] = W.row_focus),
                                        J = [W.row[0], c]);
                                        var Z = 0
                                          , ee = 0
                                          , te = [];
                                        W.left > d ? (Z = d,
                                        ee = W.left + W.width - d,
                                        W.column[1] > W.column_focus && (W.column[1] = W.column_focus),
                                        te = [f, W.column[1]]) : W.left == d ? (Z = d,
                                        ee = W.left + W.width - d,
                                        te = [f, W.column[0]]) : (Z = W.left,
                                        ee = h - W.left - 1,
                                        W.column[0] < W.column_focus && (W.column[0] = W.column_focus),
                                        te = [W.column[0], f]);
                                        var re = menuButton.mergeMoveMain(te, J, W, Y, X, Z, ee);
                                        null != re && (te = re[0],
                                        J = re[1],
                                        Y = re[2],
                                        X = re[3],
                                        Z = re[4],
                                        ee = re[5]),
                                        W.row = J,
                                        W.column = te,
                                        W.left_move = Z,
                                        W.width_move = ee,
                                        W.top_move = Y,
                                        W.height_move = X,
                                        dataVerificationCtrl.selectRange[dataVerificationCtrl.selectRange.length - 1] = W
                                    } else
                                        e.ctrlKey || (dataVerificationCtrl.selectRange = []),
                                        dataVerificationCtrl.selectRange.push({
                                            left: d,
                                            width: h - d - 1,
                                            top: s,
                                            height: i - s - 1,
                                            left_move: d,
                                            width_move: h - d - 1,
                                            top_move: s,
                                            height_move: i - s - 1,
                                            row: [c, m],
                                            column: [f, p],
                                            row_focus: c,
                                            column_focus: f
                                        });
                                    selectionCopyShow(dataVerificationCtrl.selectRange);
                                    var ae = dataVerificationCtrl.getTxtByRange(dataVerificationCtrl.selectRange);
                                    $("#luckysheet-dataVerificationRange-dialog input").val(ae)
                                } else if (dataVerificationCtrl.selectStatus = !1,
                                dataVerificationCtrl.selectRange = [],
                                ifFormulaGenerator.singleRangeFocus && $("#luckysheet-ifFormulaGenerator-dialog .singRange").click(),
                                $("#luckysheet-ifFormulaGenerator-singleRange-dialog").is(":visible")) {
                                    Store.luckysheet_select_status = !1,
                                    luckysheetformula.rangestart = !1,
                                    $("#luckysheet-formula-functionrange-select").css({
                                        left: d,
                                        width: h - d - 1,
                                        top: s,
                                        height: i - s - 1
                                    }).show(),
                                    $("#luckysheet-formula-help-c").hide();
                                    var ne = getRangetxt(Store.currentSheetIndex, {
                                        row: [c, c],
                                        column: [f, f]
                                    }, Store.currentSheetIndex);
                                    $("#luckysheet-ifFormulaGenerator-singleRange-dialog input").val(ne)
                                } else {
                                    if ($("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                                        Store.luckysheet_select_status = !1,
                                        luckysheetformula.func_selectedrange = {
                                            left: d,
                                            width: h - d - 1,
                                            top: s,
                                            height: i - s - 1,
                                            left_move: d,
                                            width_move: h - d - 1,
                                            top_move: s,
                                            height_move: i - s - 1,
                                            row: [c, c],
                                            column: [f, f],
                                            row_focus: c,
                                            column_focus: f
                                        },
                                        luckysheetformula.rangestart = !0,
                                        $("#luckysheet-formula-functionrange-select").css({
                                            left: d,
                                            width: h - d - 1,
                                            top: s,
                                            height: i - s - 1
                                        }).show(),
                                        $("#luckysheet-formula-help-c").hide();
                                        var oe = getRangetxt(Store.currentSheetIndex, {
                                            row: [c, c],
                                            column: [f, f]
                                        }, Store.currentSheetIndex);
                                        return $("#luckysheet-ifFormulaGenerator-multiRange-dialog input").val(oe),
                                        $("#luckysheet-row-count-show").hide(),
                                        void $("#luckysheet-column-count-show").hide()
                                    }
                                    if (Store.luckysheet_select_status) {
                                        if (e.shiftKey) {
                                            var le = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                                              , ie = 0
                                              , se = 0
                                              , ce = [];
                                            le.top > s ? (ie = s,
                                            se = le.top + le.height - s,
                                            le.row[1] > le.row_focus && (le.row[1] = le.row_focus),
                                            ce = [c, le.row[1]]) : le.top == s ? (ie = s,
                                            se = le.top + le.height - s,
                                            ce = [c, le.row[0]]) : (ie = le.top,
                                            se = i - le.top - 1,
                                            le.row[0] < le.row_focus && (le.row[0] = le.row_focus),
                                            ce = [le.row[0], c]);
                                            var ue = 0
                                              , he = 0
                                              , de = [];
                                            le.left > d ? (ue = d,
                                            he = le.left + le.width - d,
                                            le.column[1] > le.column_focus && (le.column[1] = le.column_focus),
                                            de = [f, le.column[1]]) : le.left == d ? (ue = d,
                                            he = le.left + le.width - d,
                                            de = [f, le.column[0]]) : (ue = le.left,
                                            he = h - le.left - 1,
                                            le.column[0] < le.column_focus && (le.column[0] = le.column_focus),
                                            de = [le.column[0], f]);
                                            var fe = menuButton.mergeMoveMain(de, ce, le, ie, se, ue, he);
                                            null != fe && (de = fe[0],
                                            ce = fe[1],
                                            ie = fe[2],
                                            se = fe[3],
                                            ue = fe[4],
                                            he = fe[5]),
                                            le.row = ce,
                                            le.column = de,
                                            le.left_move = ue,
                                            le.width_move = he,
                                            le.top_move = ie,
                                            le.height_move = se,
                                            Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = le,
                                            $("#luckysheet-alternateformat-rangeDialog").is(":visible") && $("#luckysheet-alternateformat-rangeDialog input").val(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save)),
                                            pivotTable.luckysheet_pivotTable_select_state && $("#luckysheet-pivotTable-range-selection-input").val(Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].name + "!" + chatatABC(Store.luckysheet_select_save[0].column[0]) + (Store.luckysheet_select_save[0].row[0] + 1) + ":" + chatatABC(Store.luckysheet_select_save[0].column[1]) + (Store.luckysheet_select_save[0].row[1] + 1))
                                        } else
                                            e.ctrlKey ? Store.luckysheet_select_save.push({
                                                left: d,
                                                width: h - d - 1,
                                                top: s,
                                                height: i - s - 1,
                                                left_move: d,
                                                width_move: h - d - 1,
                                                top_move: s,
                                                height_move: i - s - 1,
                                                row: [c, m],
                                                column: [f, p],
                                                row_focus: c,
                                                column_focus: f
                                            }) : (Store.luckysheet_select_save = [],
                                            Store.luckysheet_select_save.push({
                                                left: d,
                                                width: h - d - 1,
                                                top: s,
                                                height: i - s - 1,
                                                left_move: d,
                                                width_move: h - d - 1,
                                                top_move: s,
                                                height_move: i - s - 1,
                                                row: [c, m],
                                                column: [f, p],
                                                row_focus: c,
                                                column_focus: f
                                            }),
                                            menuButton.menuButtonFocus(Store.flowdata, c, f),
                                            luckysheetformula.fucntionboxshow(c, f));
                                        selectHightlightShow(),
                                        null == luckysheetFreezen.freezenhorizontaldata && null == luckysheetFreezen.freezenverticaldata || luckysheetFreezen.scrollAdaptOfselect(),
                                        browser.mobilecheck() || luckysheetactiveCell(),
                                        server.allowUpdate && server.saveParam("mv", Store.currentSheetIndex, Store.luckysheet_select_save)
                                    }
                                    alternateformat.rangefocus && (alternateformat.rangefocus = !1,
                                    $("#luckysheet-alternateformat-range .fa-table").click()),
                                    $("#luckysheet-row-count-show, #luckysheet-column-count-show").hide(),
                                    isEditMode() || hideAllNeedRangeShow(),
                                    pivotTable.pivotclick(c, f, Store.currentSheetIndex),
                                    luckysheetContainerFocus(),
                                    method.createHookFunction("cellMousedown", Store.flowdata[c][f], {
                                        r: c,
                                        c: f,
                                        start_r: s,
                                        start_c: d,
                                        end_r: i,
                                        end_c: h
                                    }, n, o)
                                }
                            }
                        else
                            luckysheetConfigsetting.fireMousedown(Store.flowdata[c][f].dd)
                    }
                }
            }
        }
        )).mouseup((function(e) {
            if ("3" == e.which) {
                if (!Store.allowEdit)
                    return;
                if (isEditMode())
                    return;
                var t = e.pageX
                  , r = e.pageY
                  , a = Store.luckysheet_select_save[0]
                  , n = luckysheetConfigsetting.cellRightClickConfig;
                if ($("#luckysheet-cols-rows-data").show(),
                $("#luckysheet-cols-rows-handleincell").show(),
                $("#luckysheet-cols-rows-add, #luckysheet-cols-rows-shift").hide(),
                $$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "block",
                $$("#luckysheet-cols-rows-handleincell .luckysheet-menuseparator").style.display = "block",
                null != a.row && 0 == a.row[0] && a.row[1] == Store.flowdata.length - 1) {
                    if (!(n.copy || n.copyAs || n.paste || n.insertColumn || n.deleteColumn || n.hideColumn || n.columnWidth || n.clear || n.matrix || n.sort || n.filter || n.chart || n.image || n.link || n.data || n.cellFormat))
                        return;
                    Store.luckysheetRightHeadClickIs = "column",
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right),
                    $("#luckysheet-cols-rows-add").show(),
                    $("#luckysheet-cols-rows-shift").hide(),
                    $("#luckysheet-cols-rows-handleincell").hide(),
                    Store.luckysheet_cols_menu_status = !0,
                    $$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "block",
                    $$("#luckysheet-top-left-add-selected").style.display = n.insertColumn ? "block" : "none",
                    $$("#luckysheet-bottom-right-add-selected").style.display = n.insertColumn ? "block" : "none",
                    $$("#luckysheet-del-selected").style.display = n.deleteColumn ? "block" : "none",
                    $$("#luckysheet-hide-selected").style.display = n.hideColumn ? "block" : "none",
                    $$("#luckysheet-show-selected").style.display = n.hideColumn ? "block" : "none",
                    $$("#luckysheet-column-row-width-selected").style.display = n.columnWidth ? "block" : "none",
                    n.copy || n.copyAs || n.paste || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none",
                    n.insertColumn || n.deleteColumn || n.hideColumn || n.columnWidth || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none")),
                    n.insertColumn || n.deleteColumn || n.hideColumn || n.columnWidth || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none");
                    var o = $.extend(!0, {}, Store.config);
                    null == o.columnlen && (o.columnlen = {});
                    for (var l = null == o.columnlen[Store.luckysheet_select_save[0].column[0]] ? Store.defaultcollen : o.columnlen[Store.luckysheet_select_save[0].column[0]], i = !0, s = 0; s < Store.luckysheet_select_save.length; s++)
                        for (var c = Store.luckysheet_select_save[s], u = c.column[0], h = c.column[1], d = u; d <= h; d++) {
                            if ((null == o.columnlen[d] ? Store.defaultcollen : o.columnlen[d]) != l) {
                                i = !1;
                                break
                            }
                        }
                    i ? $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val(l) : $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val("")
                } else if (null != a.column && 0 == a.column[0] && a.column[1] == Store.flowdata[0].length - 1) {
                    if (!(n.copy || n.copyAs || n.paste || n.insertRow || n.deleteRow || n.hideRow || n.rowHeight || n.clear || n.matrix || n.sort || n.filter || n.chart || n.image || n.link || n.data || n.cellFormat))
                        return;
                    Store.luckysheetRightHeadClickIs = "row",
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top),
                    $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom),
                    $("#luckysheet-cols-rows-add").show(),
                    $("#luckysheet-cols-rows-shift").hide(),
                    $("#luckysheet-cols-rows-handleincell").hide(),
                    Store.luckysheet_cols_menu_status = !0,
                    $$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "block",
                    $$("#luckysheet-top-left-add-selected").style.display = n.insertRow ? "block" : "none",
                    $$("#luckysheet-bottom-right-add-selected").style.display = n.insertRow ? "block" : "none",
                    $$("#luckysheet-del-selected").style.display = n.deleteRow ? "block" : "none",
                    $$("#luckysheet-hide-selected").style.display = n.hideRow ? "block" : "none",
                    $$("#luckysheet-show-selected").style.display = n.hideRow ? "block" : "none",
                    $$("#luckysheet-column-row-width-selected").style.display = n.rowHeight ? "block" : "none",
                    n.copy || n.copyAs || n.paste || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none",
                    n.insertRow || n.deleteRow || n.hideRow || n.rowHeight || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none")),
                    n.insertRow || n.deleteRow || n.hideRow || n.rowHeight || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none");
                    var f = $.extend(!0, {}, Store.config);
                    null == f.rowlen && (f.rowlen = {});
                    for (var m = null == f.rowlen[Store.luckysheet_select_save[0].row[0]] ? Store.defaultrowlen : f.rowlen[Store.luckysheet_select_save[0].row[0]], p = !0, g = 0; g < Store.luckysheet_select_save.length; g++)
                        for (var y = Store.luckysheet_select_save[g], v = y.row[0], A = y.row[1], b = v; b <= A; b++) {
                            if ((null == f.rowlen[b] ? Store.defaultrowlen : f.rowlen[b]) != m) {
                                p = !1;
                                break
                            }
                        }
                    p ? $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val(m) : $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val("")
                } else {
                    if (!(n.copy || n.copyAs || n.paste || n.insertRow || n.insertColumn || n.deleteRow || n.deleteColumn || n.deleteCell || n.clear || n.matrix || n.sort || n.filter || n.chart || n.image || n.link || n.data || n.cellFormat))
                        return;
                    n.copy || n.copyAs || n.paste || ($$("#luckysheet-cols-rows-handleincell .luckysheet-menuseparator").style.display = "none",
                    n.insertRow || n.insertColumn || n.deleteRow || n.deleteColumn || n.deleteCell || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none")),
                    n.insertRow || n.insertColumn || n.deleteRow || n.deleteColumn || n.deleteCell || ($$("#luckysheet-cols-rows-handleincell .luckysheet-menuseparator").style.display = "none")
                }
                n.clear || n.matrix || n.sort || n.filter || n.chart || n.image || n.link || n.data || n.cellFormat || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none"),
                showrightclickmenu($("#luckysheet-rightclick-menu"), t, r)
            }
        }
        )).dblclick((function(e) {
            if (!$(e.target).hasClass("luckysheet-mousedown-cancel") && Store.allowEdit && !(parseInt($("#luckysheet-input-box").css("top")) > 0)) {
                var t = mouseposition(e.pageX, e.pageY);
                if (!(t[0] >= Store.cellmainWidth - Store.cellMainSrollBarSize || t[1] >= Store.cellmainHeight - Store.cellMainSrollBarSize)) {
                    var r = $("#luckysheet-cell-main").scrollLeft()
                      , a = $("#luckysheet-cell-main").scrollTop()
                      , n = t[0] + r
                      , o = t[1] + a;
                    null != luckysheetFreezen.freezenverticaldata && t[0] < luckysheetFreezen.freezenverticaldata[0] - luckysheetFreezen.freezenverticaldata[2] && (n = t[0] + luckysheetFreezen.freezenverticaldata[2]),
                    null != luckysheetFreezen.freezenhorizontaldata && t[1] < luckysheetFreezen.freezenhorizontaldata[0] - luckysheetFreezen.freezenhorizontaldata[2] && (o = t[1] + luckysheetFreezen.freezenhorizontaldata[2]);
                    var l = rowLocation(o)[2]
                      , i = colLocation(n)[2];
                    if (pivotTable.isPivotRange(l, i)) {
                        if (!(null != pivotTable.filter && 0 != pivotTable.filter.length || null != pivotTable.row && 0 != pivotTable.row.length || null != pivotTable.column && 0 != pivotTable.column.length || null != pivotTable.values && 0 != pivotTable.values.length))
                            return;
                        if (null == pivotTable.values || 0 == pivotTable.values.length)
                            return;
                        if (0 == l || 0 == i)
                            return;
                        if (null != pivotTable.column && pivotTable.column.length > 0)
                            if (pivotTable.values.length >= 2 && "column" == pivotTable.showType) {
                                if (l <= pivotTable.column.length || i >= pivotTable.pivotDatas[0].length - pivotTable.values.length)
                                    return
                            } else if (l <= pivotTable.column.length - 1 || i >= pivotTable.pivotDatas[0].length - 1)
                                return;
                        if (null != pivotTable.row && pivotTable.row.length > 0)
                            if (pivotTable.values.length >= 2 && "row" == pivotTable.showType) {
                                if (i <= pivotTable.row.length || l >= pivotTable.pivotDatas.length - pivotTable.values.length)
                                    return
                            } else if (i <= pivotTable.row.length - 1 || l >= pivotTable.pivotDatas.length - 1)
                                return;
                        return sheetmanage.addNewSheet(e),
                        void pivotTable.drillDown(l, i)
                    }
                    if ($("#luckysheet-search-formula-parm").is(":visible") || $("#luckysheet-search-formula-parm-select").is(":visible"))
                        $("#luckysheet-cell-selected").hide();
                    else {
                        if ($("#luckysheet-conditionformat-dialog").is(":visible") || $("#luckysheet-administerRule-dialog").is(":visible") || $("#luckysheet-newConditionRule-dialog").is(":visible") || $("#luckysheet-editorConditionRule-dialog").is(":visible") || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                            return;
                        if ($("#luckysheet-modal-dialog-slider-alternateformat").is(":visible") || $("#luckysheet-alternateformat-rangeDialog").is(":visible"))
                            return;
                        menuButton.luckysheetPaintModelOn && menuButton.cancelPaintModel(),
                        luckysheetupdateCell(l, i, Store.flowdata)
                    }
                }
            }
        }
        )),
        document.getElementById("luckysheet-cell-main").addEventListener("drop", (function(e) {
            e.preventDefault(),
            e.stopPropagation();
            var t = e.dataTransfer.files;
            if (1 == t.length && t[0].type.indexOf("image") > -1) {
                if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects"))
                    return;
                var r = new FileReader;
                r.readAsDataURL(t[0]),
                r.onload = function(e) {
                    var t = e.target.result;
                    imageCtrl.inserImg(t)
                }
            }
        }
        ), !1),
        document.getElementById("luckysheet-cell-main").addEventListener("dragover", (function(e) {
            e.preventDefault(),
            e.stopPropagation()
        }
        ), !1),
        $(document).on("mousemove.luckysheetEvent", (function(e) {
            if (luckysheetPostil.overshow(e),
            hyperlinkCtrl.overshow(e),
            window.cancelAnimationFrame(Store.jfautoscrollTimeout),
            luckysheetConfigsetting && luckysheetConfigsetting.hook && luckysheetConfigsetting.hook.sheetMousemove) {
                var t = mouseposition(e.pageX, e.pageY)
                  , r = t[0] + $("#luckysheet-cell-main").scrollLeft()
                  , a = rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop())
                  , n = a[1]
                  , o = a[0]
                  , l = a[2]
                  , i = colLocation(r)
                  , s = i[1]
                  , c = i[0]
                  , u = i[2]
                  , h = menuButton.mergeborer(Store.flowdata, l, u);
                h && (n = h.row[1],
                o = h.row[0],
                l = h.row[2],
                s = h.column[1],
                c = h.column[0],
                u = h.column[2]);
                var d = sheetmanage.getSheetByIndex()
                  , f = {
                    functionResizeStatus: luckysheetformula.functionResizeStatus,
                    horizontalmoveState: !!luckysheetFreezen.horizontalmovestate,
                    verticalmoveState: !!luckysheetFreezen.verticalmovestate,
                    pivotTableMoveState: !!pivotTable && pivotTable.movestate,
                    sheetMoveStatus: Store.luckysheet_sheet_move_status,
                    scrollStatus: !!Store.luckysheet_scroll_status,
                    selectStatus: !!Store.luckysheet_select_status,
                    rowsSelectedStatus: !!Store.luckysheet_rows_selected_status,
                    colsSelectedStatus: !!Store.luckysheet_cols_selected_status,
                    cellSelectedMove: !!Store.luckysheet_cell_selected_move,
                    cellSelectedExtend: !!Store.luckysheet_cell_selected_extend,
                    colsChangeSize: !!Store.luckysheet_cols_change_size,
                    rowsChangeSize: !!Store.luckysheet_rows_change_size,
                    chartMove: !!Store.chartparam.luckysheetCurrentChartMove,
                    chartResize: !!Store.chartparam.luckysheetCurrentChartResize,
                    rangeResize: !!luckysheetformula.rangeResize,
                    rangeMove: !!luckysheetformula.rangeMove
                }
                  , m = $("#luckysheetTableContent").get(0).getContext("2d");
                method.createHookFunction("sheetMousemove", Store.flowdata[l][u], {
                    r: l,
                    c: u,
                    start_r: o,
                    start_c: c,
                    end_r: n,
                    end_c: s
                }, d, f, m)
            }
            if (luckysheetformula.functionResizeStatus) {
                var p = e.pageY - luckysheetformula.functionResizeData.y
                  , g = luckysheetformula.functionResizeData.calculatebarHeight + p
                  , y = Math.round($(window).height() / 2);
                if (g <= 28) {
                    if (g <= 20)
                        return;
                    g = 28
                } else if (g >= y) {
                    if (g >= y + 8)
                        return;
                    g = y
                }
                Store.calculatebarHeight = g,
                $("#luckysheet-wa-calculate").css("height", Store.calculatebarHeight - 2),
                $("#luckysheet-wa-calculate-size").css({
                    background: "#5e5e5e",
                    cursor: "ns-resize"
                }),
                clearTimeout(luckysheetformula.functionResizeTimeout),
                luckysheetformula.functionResizeTimeout = setTimeout((function() {
                    luckysheetsizeauto()
                }
                ), 15)
            } else if (luckysheetFreezen.horizontalmovestate) {
                var v = mouseposition(e.pageX, e.pageY)
                  , A = $("#luckysheet-cell-main").scrollLeft()
                  , b = $("#luckysheet-cell-main").scrollTop()
                  , k = (v[0],
                rowLocation(v[1] + b))
                  , w = k[1]
                  , x = k[0]
                  , S = k[2]
                  , _ = v[1] + Store.columnHeaderHeight;
                _ < Store.columnHeaderHeight && (_ = Store.columnHeaderHeight),
                _ > luckysheetFreezen.windowHeight - 4 && (_ = luckysheetFreezen.windowHeight - 4),
                $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({
                    top: _
                }),
                _ + b - Store.columnHeaderHeight >= x + (w - x) / 2 ? (_ = w - 2 - b + Store.columnHeaderHeight,
                luckysheetFreezen.freezenhorizontaldata = [w, S + 1, b, luckysheetFreezen.cutVolumn(Store.visibledatarow, S + 1), _]) : (_ = x - 2 - b + Store.columnHeaderHeight,
                luckysheetFreezen.freezenhorizontaldata = [x, S, b, luckysheetFreezen.cutVolumn(Store.visibledatarow, S), _]),
                $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-drop").css({
                    top: _
                }),
                luckysheetFreezen.saveFreezen(luckysheetFreezen.freezenhorizontaldata, _, null, null)
            } else if (luckysheetFreezen.verticalmovestate) {
                var C = mouseposition(e.pageX, e.pageY)
                  , T = $("#luckysheet-cell-main").scrollLeft()
                  , E = $("#luckysheet-cell-main").scrollTop()
                  , I = C[0] + T
                  , R = (C[1],
                colLocation(I))
                  , B = R[1]
                  , N = R[0]
                  , F = R[2]
                  , P = C[0] + Store.rowHeaderWidth;
                P < Store.rowHeaderWidth && (P = Store.rowHeaderWidth),
                P > luckysheetFreezen.windowWidth - 4 && (P = luckysheetFreezen.windowWidth - 4),
                $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css({
                    left: P
                }),
                P + T - Store.rowHeaderWidth >= N + (B - N) / 2 ? (P = B - 2 - T + Store.rowHeaderWidth,
                luckysheetFreezen.freezenverticaldata = [B, F + 1, T, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, F + 1), P]) : (P = N - 2 - T + Store.rowHeaderWidth,
                luckysheetFreezen.freezenverticaldata = [N, F, T, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, F), P]),
                $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-drop").css({
                    left: P
                }),
                luckysheetFreezen.saveFreezen(null, null, luckysheetFreezen.freezenverticaldata, P),
                luckysheetsizeauto()
            } else if (pivotTable && pivotTable.movestate) {
                var L = e.pageX
                  , O = e.pageY;
                $("#luckysheet-modal-dialog-slider-pivot-move").css({
                    left: L - pivotTable.movesave.width / 2,
                    top: O - pivotTable.movesave.height
                })
            } else if (Store.luckysheet_sheet_move_status) {
                var D = $("#luckysheet-sheet-container-c").scrollLeft()
                  , M = e.pageX + D;
                if (Math.abs(e.pageX - Store.luckysheet_sheet_move_data.pageX) < 3)
                    return;
                var U = $("#luckysheet-sheet-container").width()
                  , H = M - Store.luckysheet_sheet_move_data.curleft - $("#luckysheet-sheet-container").offset().left;
                Store.luckysheet_sheet_move_data.activeobject.css({
                    left: H
                });
                var q = luckysheet_searcharray(Store.luckysheet_sheet_move_data.widthlist, H + Store.luckysheet_sheet_move_data.curleft);
                Store.luckysheet_sheet_move_data.cursorobject.css({
                    cursor: "move"
                }),
                H - D <= 6 && $("#luckysheet-sheets-leftscroll").click(),
                H - D >= U - 40 && $("#luckysheet-sheets-rightscroll").click(),
                q != Store.luckysheet_sheet_move_data.curindex && (-1 == q && H > 0 ? (q = Store.luckysheet_sheet_move_data.widthlist.length - 1,
                $("#luckysheet-sheets-item-clone").insertAfter($("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").eq(q))) : -1 == q && H <= 0 ? $("#luckysheet-sheets-item-clone").insertBefore($("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").eq(0)) : $("#luckysheet-sheets-item-clone").insertAfter($("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").eq(q)),
                Store.luckysheet_sheet_move_data.widthlist = [],
                $("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").each((function(e) {
                    0 == e ? Store.luckysheet_sheet_move_data.widthlist.push(parseInt($(this).outerWidth())) : Store.luckysheet_sheet_move_data.widthlist.push(parseInt($(this).outerWidth()) + Store.luckysheet_sheet_move_data.widthlist[e - 1])
                }
                )),
                Store.luckysheet_sheet_move_data.curindex = $("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").index($("#luckysheet-sheets-item-clone")))
            } else if (Store.luckysheet_model_move_state) {
                var z = $(document).scrollTop()
                  , j = $(document).scrollLeft()
                  , V = e.pageY + z
                  , Q = e.pageX + j
                  , G = $(window).height()
                  , K = $(window).width()
                  , W = Store.luckysheet_model_move_obj.height()
                  , Y = Store.luckysheet_model_move_obj.width()
                  , X = V - Store.luckysheet_model_xy[1]
                  , J = Q - Store.luckysheet_model_xy[0];
                X < 0 && (X = 0),
                X + W + 62 > G && (X = G - W - 62),
                J < 0 && (J = 0),
                J + Y + 86 > K && (J = K - Y - 86),
                Store.luckysheet_model_move_obj.css({
                    top: X,
                    left: J
                }),
                e.preventDefault()
            } else if (Store.luckysheet_scroll_status || Store.luckysheet_select_status || Store.luckysheet_rows_selected_status || Store.luckysheet_cols_selected_status || Store.luckysheet_cell_selected_move || Store.luckysheet_cell_selected_extend || Store.luckysheet_cols_change_size || Store.luckysheet_rows_change_size || Store.chartparam.luckysheetCurrentChartMove || Store.chartparam.luckysheetCurrentChartResize || luckysheetformula.rangeResize || luckysheetformula.rangeMove) {
                Store.luckysheet_select_status && (clearTimeout(Store.countfuncTimeout),
                Store.countfuncTimeout = setTimeout((function() {
                    countfunc()
                }
                ), 500)),
                Store.jfautoscrollTimeout = window.requestAnimationFrame((function t() {
                    if (Store.luckysheet_scroll_status && !Store.luckysheet_cols_change_size && !Store.luckysheet_rows_change_size) {
                        var r, a, n = mouseposition(e.pageX, e.pageY), o = $("#luckysheet-scrollbar-x").scrollLeft(), l = $("#luckysheet-scrollbar-y").scrollTop(), i = n[0], s = n[1], c = $("#luckysheet-cell-main").height() - 20 * Store.zoomRatio, u = $("#luckysheet-cell-main").width() - 60 * Store.zoomRatio;
                        if (s < 0 || s > c)
                            r = s < 0 ? l + s / 2 : l + (s - c) / 2,
                            $("#luckysheet-scrollbar-y").scrollTop(r);
                        if (i < 0 || i > u)
                            a = i < 0 ? o + i / 2 : o + (i - u) / 2,
                            $("#luckysheet-scrollbar-x").scrollLeft(a)
                    }
                    if (Store.luckysheet_select_status) {
                        var h = mouseposition(e.pageX, e.pageY)
                          , d = h[0] + $("#luckysheet-cell-main").scrollLeft()
                          , f = rowLocation(h[1] + $("#luckysheet-cell-main").scrollTop())
                          , m = f[1]
                          , p = f[0]
                          , g = f[2]
                          , y = colLocation(d)
                          , v = y[1]
                          , A = y[0]
                          , b = y[2];
                        if (!checkProtectionSelectLockedOrUnLockedCells(g, b, Store.currentSheetIndex))
                            return;
                        var k = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                          , w = 0
                          , x = 0
                          , S = [];
                        k.top > p ? (w = p,
                        x = k.top + k.height - p,
                        k.row[1] > k.row_focus && (k.row[1] = k.row_focus),
                        S = [g, k.row[1]]) : k.top == p ? (w = p,
                        x = k.top + k.height - p,
                        S = [g, k.row[0]]) : (w = k.top,
                        x = m - k.top - 1,
                        k.row[0] < k.row_focus && (k.row[0] = k.row_focus),
                        S = [k.row[0], g]);
                        var _ = 0
                          , C = 0
                          , T = [];
                        k.left > A ? (_ = A,
                        C = k.left + k.width - A,
                        k.column[1] > k.column_focus && (k.column[1] = k.column_focus),
                        T = [b, k.column[1]]) : k.left == A ? (_ = A,
                        C = k.left + k.width - A,
                        T = [b, k.column[0]]) : (_ = k.left,
                        C = v - k.left - 1,
                        k.column[0] < k.column_focus && (k.column[0] = k.column_focus),
                        T = [k.column[0], b]);
                        var E = menuButton.mergeMoveMain(T, S, k, w, x, _, C);
                        null != E && (T = E[0],
                        S = E[1],
                        w = E[2],
                        x = E[3],
                        _ = E[4],
                        C = E[5]),
                        k.row = S,
                        k.column = T,
                        k.left_move = _,
                        k.width_move = C,
                        k.top_move = w,
                        k.height_move = x,
                        Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = k,
                        selectHightlightShow(),
                        luckysheetFreezen.scrollFreezen(),
                        $("#luckysheet-alternateformat-rangeDialog").is(":visible") && $("#luckysheet-alternateformat-rangeDialog input").val(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])),
                        pivotTable.luckysheet_pivotTable_select_state && $("#luckysheet-pivotTable-range-selection-input").val(Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].name + "!" + chatatABC(Store.luckysheet_select_save[0].column[0]) + (Store.luckysheet_select_save[0].row[0] + 1) + ":" + chatatABC(Store.luckysheet_select_save[0].column[1]) + (Store.luckysheet_select_save[0].row[1] + 1))
                    } else if (conditionformat.selectStatus) {
                        var I = mouseposition(e.pageX, e.pageY)
                          , R = I[0] + $("#luckysheet-cell-main").scrollLeft()
                          , B = rowLocation(I[1] + $("#luckysheet-cell-main").scrollTop())
                          , N = B[1]
                          , F = B[0]
                          , P = B[2]
                          , L = colLocation(R)
                          , O = L[1]
                          , D = L[0]
                          , M = L[2]
                          , U = conditionformat.selectRange[conditionformat.selectRange.length - 1]
                          , H = 0
                          , q = 0
                          , z = [];
                        U.top > F ? (H = F,
                        q = U.top + U.height - F,
                        U.row[1] > U.row_focus && (U.row[1] = U.row_focus),
                        z = [P, U.row[1]]) : U.top == F ? (H = F,
                        q = U.top + U.height - F,
                        z = [P, U.row[0]]) : (H = U.top,
                        q = N - U.top - 1,
                        U.row[0] < U.row_focus && (U.row[0] = U.row_focus),
                        z = [U.row[0], P]);
                        var j = 0
                          , V = 0
                          , Q = [];
                        U.left > D ? (j = D,
                        V = U.left + U.width - D,
                        U.column[1] > U.column_focus && (U.column[1] = U.column_focus),
                        Q = [M, U.column[1]]) : U.left == D ? (j = D,
                        V = U.left + U.width - D,
                        Q = [M, U.column[0]]) : (j = U.left,
                        V = O - U.left - 1,
                        U.column[0] < U.column_focus && (U.column[0] = U.column_focus),
                        Q = [U.column[0], M]);
                        var G = menuButton.mergeMoveMain(Q, z, U, H, q, j, V);
                        null != G && (Q = G[0],
                        z = G[1],
                        H = G[2],
                        q = G[3],
                        j = G[4],
                        V = G[5]),
                        U.row = z,
                        U.column = Q,
                        U.left_move = j,
                        U.width_move = V,
                        U.top_move = H,
                        U.height_move = q,
                        conditionformat.selectRange[conditionformat.selectRange.length - 1] = U,
                        selectionCopyShow(conditionformat.selectRange);
                        var K = conditionformat.getTxtByRange(conditionformat.selectRange);
                        $("#luckysheet-multiRange-dialog input").val(K)
                    } else if (dataVerificationCtrl.selectStatus) {
                        var W = mouseposition(e.pageX, e.pageY)
                          , Y = W[0] + $("#luckysheet-cell-main").scrollLeft()
                          , X = rowLocation(W[1] + $("#luckysheet-cell-main").scrollTop())
                          , J = X[1]
                          , Z = X[0]
                          , ee = X[2]
                          , te = colLocation(Y)
                          , re = te[1]
                          , ae = te[0]
                          , ne = te[2]
                          , oe = dataVerificationCtrl.selectRange[dataVerificationCtrl.selectRange.length - 1]
                          , le = 0
                          , ie = 0
                          , se = [];
                        oe.top > Z ? (le = Z,
                        ie = oe.top + oe.height - Z,
                        oe.row[1] > oe.row_focus && (oe.row[1] = oe.row_focus),
                        se = [ee, oe.row[1]]) : oe.top == Z ? (le = Z,
                        ie = oe.top + oe.height - Z,
                        se = [ee, oe.row[0]]) : (le = oe.top,
                        ie = J - oe.top - 1,
                        oe.row[0] < oe.row_focus && (oe.row[0] = oe.row_focus),
                        se = [oe.row[0], ee]);
                        var ce = 0
                          , ue = 0
                          , he = [];
                        oe.left > ae ? (ce = ae,
                        ue = oe.left + oe.width - ae,
                        oe.column[1] > oe.column_focus && (oe.column[1] = oe.column_focus),
                        he = [ne, oe.column[1]]) : oe.left == ae ? (ce = ae,
                        ue = oe.left + oe.width - ae,
                        he = [ne, oe.column[0]]) : (ce = oe.left,
                        ue = re - oe.left - 1,
                        oe.column[0] < oe.column_focus && (oe.column[0] = oe.column_focus),
                        he = [oe.column[0], ne]);
                        var de = menuButton.mergeMoveMain(he, se, oe, le, ie, ce, ue);
                        null != de && (he = de[0],
                        se = de[1],
                        le = de[2],
                        ie = de[3],
                        ce = de[4],
                        ue = de[5]),
                        oe.row = se,
                        oe.column = he,
                        oe.left_move = ce,
                        oe.width_move = ue,
                        oe.top_move = le,
                        oe.height_move = ie,
                        dataVerificationCtrl.selectRange[dataVerificationCtrl.selectRange.length - 1] = oe,
                        selectionCopyShow(dataVerificationCtrl.selectRange);
                        var fe = dataVerificationCtrl.getTxtByRange(dataVerificationCtrl.selectRange);
                        $("#luckysheet-dataVerificationRange-dialog input").val(fe)
                    } else if (luckysheetformula.rangestart)
                        luckysheetformula.rangedrag(e);
                    else if (luckysheetformula.rangedrag_row_start)
                        luckysheetformula.rangedrag_row(e);
                    else if (luckysheetformula.rangedrag_column_start)
                        luckysheetformula.rangedrag_column(e);
                    else if (Store.luckysheet_rows_selected_status) {
                        var me = mouseposition(e.pageX, e.pageY)[1] + $("#luckysheet-rows-h").scrollTop();
                        if (me < 0)
                            return !1;
                        var pe = rowLocation(me)
                          , ge = pe[1]
                          , ye = pe[0]
                          , ve = pe[2]
                          , Ae = Store.visibledatacolumn.length - 1
                          , be = (Store.visibledatacolumn[Ae],
                        $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]))
                          , ke = 0
                          , we = 0
                          , xe = [];
                        be.top > ye ? (ke = ye,
                        we = be.top + be.height - ye,
                        be.row[1] > be.row_focus && (be.row[1] = be.row_focus),
                        xe = [ve, be.row[1]]) : be.top == ye ? (ke = ye,
                        we = be.top + be.height - ye,
                        xe = [ve, be.row[0]]) : (ke = be.top,
                        we = ge - be.top - 1,
                        be.row[0] < be.row_focus && (be.row[0] = be.row_focus),
                        xe = [be.row[0], ve]),
                        be.row = xe,
                        be.top_move = ke,
                        be.height_move = we,
                        Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = be,
                        selectHightlightShow(),
                        clearTimeout(Store.countfuncTimeout),
                        Store.countfuncTimeout = setTimeout((function() {
                            countfunc()
                        }
                        ), 500)
                    } else if (Store.luckysheet_cols_selected_status) {
                        var Se = mouseposition(e.pageX, e.pageY)[0] + $("#luckysheet-cols-h-c").scrollLeft();
                        if (Se < 0)
                            return !1;
                        var _e = Store.visibledatarow.length - 1
                          , Ce = (Store.visibledatarow[_e],
                        colLocation(Se))
                          , Te = Ce[1]
                          , Ee = Ce[0]
                          , Ie = Ce[2]
                          , Re = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                          , Be = 0
                          , Ne = 0
                          , Fe = [];
                        Re.left > Ee ? (Be = Ee,
                        Ne = Re.left + Re.width - Ee,
                        Re.column[1] > Re.column_focus && (Re.column[1] = Re.column_focus),
                        Fe = [Ie, Re.column[1]]) : Re.left == Ee ? (Be = Ee,
                        Ne = Re.left + Re.width - Ee,
                        Fe = [Ie, Re.column[0]]) : (Be = Re.left,
                        Ne = Te - Re.left - 1,
                        Re.column[0] < Re.column_focus && (Re.column[0] = Re.column_focus),
                        Fe = [Re.column[0], Ie]),
                        Re.column = Fe,
                        Re.left_move = Be,
                        Re.width_move = Ne,
                        Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = Re,
                        selectHightlightShow(),
                        clearTimeout(Store.countfuncTimeout),
                        Store.countfuncTimeout = setTimeout((function() {
                            countfunc()
                        }
                        ), 500)
                    } else if (Store.luckysheet_cell_selected_move) {
                        var Pe = mouseposition(e.pageX, e.pageY)
                          , $e = $("#luckysheet-cell-main").scrollLeft()
                          , Le = $("#luckysheet-cell-main").scrollTop()
                          , Oe = Pe[0] + $e
                          , De = Pe[1] + Le
                          , Me = $(window).height() + Le - Store.sheetBarHeight - Store.statisticBarHeight
                          , Ue = $(window).width() + $e
                          , He = rowLocation(De)
                          , qe = He[1]
                          , ze = He[0]
                          , je = He[2]
                          , Ve = colLocation(Oe)
                          , Qe = Ve[1]
                          , Ge = Ve[0]
                          , Ke = Ve[2]
                          , We = Store.luckysheet_cell_selected_move_index[0]
                          , Ye = Store.luckysheet_cell_selected_move_index[1]
                          , Xe = Store.luckysheet_select_save[0].row[0] - We + je
                          , Je = Store.luckysheet_select_save[0].row[1] - We + je
                          , Ze = Store.luckysheet_select_save[0].column[0] - Ye + Ke
                          , et = Store.luckysheet_select_save[0].column[1] - Ye + Ke;
                        (Xe < 0 || De < 0) && (Xe = 0,
                        Je = Store.luckysheet_select_save[0].row[1] - Store.luckysheet_select_save[0].row[0]),
                        (Ze < 0 || Oe < 0) && (Ze = 0,
                        et = Store.luckysheet_select_save[0].column[1] - Store.luckysheet_select_save[0].column[0]),
                        (Je >= Store.visibledatarow[Store.visibledatarow.length - 1] || De > Me) && (Xe = Store.visibledatarow.length - 1 - Store.luckysheet_select_save[0].row[1] + Store.luckysheet_select_save[0].row[0],
                        Je = Store.visibledatarow.length - 1),
                        (et >= Store.visibledatacolumn[Store.visibledatacolumn.length - 1] || Oe > Ue) && (Ze = Store.visibledatacolumn.length - 1 - Store.luckysheet_select_save[0].column[1] + Store.luckysheet_select_save[0].column[0],
                        et = Store.visibledatacolumn.length - 1),
                        Ge = Ze - 1 == -1 ? 0 : Store.visibledatacolumn[Ze - 1],
                        Qe = Store.visibledatacolumn[et],
                        ze = Xe - 1 == -1 ? 0 : Store.visibledatarow[Xe - 1],
                        qe = Store.visibledatarow[Je],
                        $("#luckysheet-cell-selected-move").css({
                            left: Ge,
                            width: Qe - Ge - 2,
                            top: ze,
                            height: qe - ze - 2,
                            display: "block"
                        })
                    } else if (Store.luckysheet_cell_selected_extend) {
                        var tt = mouseposition(e.pageX, e.pageY)
                          , rt = $("#luckysheet-cell-main").scrollLeft() - 5
                          , at = $("#luckysheet-cell-main").scrollTop() - 5
                          , nt = tt[0] + rt
                          , ot = tt[1] + at
                          , lt = $(window).height() + at - Store.sheetBarHeight - Store.statisticBarHeight
                          , it = $(window).width() + rt
                          , st = rowLocation(ot)
                          , ct = st[1]
                          , ut = st[0]
                          , ht = st[2]
                          , dt = colLocation(nt)
                          , ft = dt[1]
                          , mt = dt[0]
                          , pt = dt[2]
                          , gt = Store.luckysheet_cell_selected_extend_index[0]
                          , yt = Store.luckysheet_cell_selected_extend_index[1]
                          , vt = Store.luckysheet_select_save[0].row[0]
                          , At = Store.luckysheet_select_save[0].row[1]
                          , bt = Store.luckysheet_select_save[0].column[0]
                          , kt = Store.luckysheet_select_save[0].column[1];
                        (vt < 0 || ot < 0) && (vt = 0,
                        At = Store.luckysheet_select_save[0].row[1] - Store.luckysheet_select_save[0].row[0]),
                        (bt < 0 || nt < 0) && (bt = 0,
                        kt = Store.luckysheet_select_save[0].column[1] - Store.luckysheet_select_save[0].column[0]),
                        (At >= Store.visibledatarow[Store.visibledatarow.length - 1] || ot > lt) && (vt = Store.visibledatarow.length - 1 - Store.luckysheet_select_save[0].row[1] + Store.luckysheet_select_save[0].row[0],
                        At = Store.visibledatarow.length - 1),
                        (kt >= Store.visibledatacolumn[Store.visibledatacolumn.length - 1] || nt > it) && (bt = Store.visibledatacolumn.length - 1 - Store.luckysheet_select_save[0].column[1] + Store.luckysheet_select_save[0].column[0],
                        kt = Store.visibledatacolumn.length - 1);
                        var wt = Store.luckysheet_select_save[0].top_move
                          , xt = Store.luckysheet_select_save[0].height_move
                          , St = Store.luckysheet_select_save[0].left_move
                          , _t = Store.luckysheet_select_save[0].width_move;
                        Math.abs(gt - ht) > Math.abs(yt - pt) ? ht >= vt && ht <= At || (Store.luckysheet_select_save[0].top_move >= ut ? (wt = ut,
                        xt = Store.luckysheet_select_save[0].top_move + Store.luckysheet_select_save[0].height_move - ut) : (wt = Store.luckysheet_select_save[0].top_move,
                        xt = ct - Store.luckysheet_select_save[0].top_move - 1)) : pt >= bt && pt <= kt || (Store.luckysheet_select_save[0].left_move >= mt ? (St = mt,
                        _t = Store.luckysheet_select_save[0].left_move + Store.luckysheet_select_save[0].width_move - mt) : (St = Store.luckysheet_select_save[0].left_move,
                        _t = ft - Store.luckysheet_select_save[0].left_move - 1)),
                        $("#luckysheet-cell-selected-extend").css({
                            left: St,
                            width: _t,
                            top: wt,
                            height: xt,
                            display: "block"
                        })
                    } else if (Store.luckysheet_cols_change_size) {
                        var Ct = mouseposition(e.pageX, e.pageY)
                          , Tt = $("#luckysheet-cols-h-c").scrollLeft()
                          , Et = Ct[0] + Tt
                          , It = $(window).width()
                          , Rt = Store.visibledatarow.length - 1
                          , Bt = (Store.visibledatarow[Rt],
                        colLocation(Et));
                        Bt[1],
                        Bt[0],
                        Bt[2];
                        Et + 3 - Store.luckysheet_cols_change_size_start[0] > 30 && Et < It + Tt - 100 && ($("#luckysheet-change-size-line").css({
                            left: Et
                        }),
                        $("#luckysheet-cols-change-size").css({
                            left: Et - 2
                        }))
                    } else if (Store.luckysheet_rows_change_size) {
                        var Nt = mouseposition(e.pageX, e.pageY)
                          , Ft = $("#luckysheet-rows-h").scrollTop()
                          , Pt = Nt[1] + Ft
                          , $t = $(window).height()
                          , Lt = rowLocation(Pt);
                        Lt[1],
                        Lt[0],
                        Lt[2];
                        Pt + 3 - Store.luckysheet_rows_change_size_start[0] > 19 && Pt < $t + Ft - 200 && ($("#luckysheet-change-size-line").css({
                            top: Pt
                        }),
                        $("#luckysheet-rows-change-size").css({
                            top: Pt 
                        }))
                    } else if (Store.chartparam.luckysheetCurrentChartMove) {
                        var Ot = mouseposition(e.pageX, e.pageY)
                          , Dt = Ot[0] + $("#luckysheet-cell-main").scrollLeft()
                          , Mt = Ot[1] + $("#luckysheet-cell-main").scrollTop()
                          , Ut = Store.chartparam.luckysheetCurrentChartMoveObj.height()
                          , Ht = Store.chartparam.luckysheetCurrentChartMoveObj.width()
                          , qt = Mt - Store.chartparam.luckysheetCurrentChartMoveXy[1]
                          , zt = Dt - Store.chartparam.luckysheetCurrentChartMoveXy[0];
                        if (qt < 0 && (qt = 0),
                        qt + Ut + 42 + 6 > Store.chartparam.luckysheetCurrentChartMoveWinH && (qt = Store.chartparam.luckysheetCurrentChartMoveWinH - Ut - 42 - 6),
                        zt < 0 && (zt = 0),
                        zt + Ht + 22 + 36 > Store.chartparam.luckysheetCurrentChartMoveWinW && (zt = Store.chartparam.luckysheetCurrentChartMoveWinW - Ht - 22 - 36),
                        Store.chartparam.luckysheetCurrentChartMoveObj.css({
                            top: qt,
                            left: zt
                        }),
                        null != luckysheetFreezen.freezenhorizontaldata || null != luckysheetFreezen.freezenverticaldata) {
                            luckysheetFreezen.scrollAdapt();
                            var jt = Store.chartparam.luckysheetCurrentChartMoveObj.offset()
                              , Vt = Store.chartparam.luckysheetCurrentChartMoveObj.position();
                            Store.chartparam.luckysheetCurrentChartMoveXy = [e.pageX - jt.left, e.pageY - jt.top, Vt.left, Vt.top, $("#luckysheet-scrollbar-x").scrollLeft(), $("#luckysheet-scrollbar-y").scrollTop()]
                        }
                    } else if (Store.chartparam.luckysheetCurrentChartResize) {
                        var Qt = $("#luckysheet-cell-main").scrollTop()
                          , Gt = $("#luckysheet-cell-main").scrollLeft()
                          , Kt = mouseposition(e.pageX, e.pageY)
                          , Wt = Kt[0] + Gt
                          , Yt = Kt[1] + Qt;
                        if (Wt < 0 || Yt < 0)
                            return !1;
                        Store.chartparam.luckysheetCurrentChartResizeObj.height(),
                        Store.chartparam.luckysheetCurrentChartResizeObj.width();
                        var Xt = Yt - Store.chartparam.luckysheetCurrentChartResizeXy[1]
                          , Jt = Wt - Store.chartparam.luckysheetCurrentChartResizeXy[0]
                          , Zt = Store.chartparam.luckysheetCurrentChartResizeXy[5]
                          , er = Store.chartparam.luckysheetCurrentChartResizeXy[3]
                          , tr = Store.chartparam.luckysheetCurrentChartResizeXy[4]
                          , rr = Store.chartparam.luckysheetCurrentChartResizeXy[2];
                        "lm" != Store.chartparam.luckysheetCurrentChartResize && "lt" != Store.chartparam.luckysheetCurrentChartResize && "lb" != Store.chartparam.luckysheetCurrentChartResize || (tr = Wt,
                        rr = Store.chartparam.luckysheetCurrentChartResizeXy[2] - Jt,
                        tr > Store.chartparam.luckysheetCurrentChartResizeXy[2] + Store.chartparam.luckysheetCurrentChartResizeXy[4] - 60 ? (tr = Store.chartparam.luckysheetCurrentChartResizeXy[2] + Store.chartparam.luckysheetCurrentChartResizeXy[4] - 60,
                        rr = Store.chartparam.luckysheetCurrentChartResizeXy[2] - (Store.chartparam.luckysheetCurrentChartResizeXy[2] + Store.chartparam.luckysheetCurrentChartResizeXy[4] - 60 - Store.chartparam.luckysheetCurrentChartResizeXy[0])) : tr <= 0 && (tr = 0,
                        rr = Store.chartparam.luckysheetCurrentChartResizeXy[2] + Store.chartparam.luckysheetCurrentChartResizeXy[0])),
                        "rm" != Store.chartparam.luckysheetCurrentChartResize && "rt" != Store.chartparam.luckysheetCurrentChartResize && "rb" != Store.chartparam.luckysheetCurrentChartResize || ((rr = Store.chartparam.luckysheetCurrentChartResizeXy[2] + Jt) < 60 ? rr = 60 : rr >= Store.chartparam.luckysheetCurrentChartResizeWinW - Store.chartparam.luckysheetCurrentChartResizeXy[4] - 22 - 36 && (rr = Store.chartparam.luckysheetCurrentChartResizeWinW - Store.chartparam.luckysheetCurrentChartResizeXy[4] - 22 - 36)),
                        "mt" != Store.chartparam.luckysheetCurrentChartResize && "lt" != Store.chartparam.luckysheetCurrentChartResize && "rt" != Store.chartparam.luckysheetCurrentChartResize || (Zt = Yt,
                        er = Store.chartparam.luckysheetCurrentChartResizeXy[3] - Xt,
                        Zt > Store.chartparam.luckysheetCurrentChartResizeXy[3] + Store.chartparam.luckysheetCurrentChartResizeXy[5] - 60 ? (Zt = Store.chartparam.luckysheetCurrentChartResizeXy[3] + Store.chartparam.luckysheetCurrentChartResizeXy[5] - 60,
                        er = Store.chartparam.luckysheetCurrentChartResizeXy[3] - (Store.chartparam.luckysheetCurrentChartResizeXy[3] + Store.chartparam.luckysheetCurrentChartResizeXy[5] - 60 - Store.chartparam.luckysheetCurrentChartResizeXy[1])) : Zt <= 0 && (Zt = 0,
                        er = Store.chartparam.luckysheetCurrentChartResizeXy[3] + Store.chartparam.luckysheetCurrentChartResizeXy[1])),
                        "mb" != Store.chartparam.luckysheetCurrentChartResize && "lb" != Store.chartparam.luckysheetCurrentChartResize && "rb" != Store.chartparam.luckysheetCurrentChartResize || ((er = Store.chartparam.luckysheetCurrentChartResizeXy[3] + Xt) < 60 ? er = 60 : er >= Store.chartparam.luckysheetCurrentChartResizeWinH - Store.chartparam.luckysheetCurrentChartResizeXy[5] - 42 - 6 && (er = Store.chartparam.luckysheetCurrentChartResizeWinH - Store.chartparam.luckysheetCurrentChartResizeXy[5] - 42 - 6));
                        var ar = {
                            top: Zt,
                            left: tr,
                            height: er,
                            width: rr
                        };
                        Store.chartparam.luckysheetCurrentChartResizeObj.css(ar),
                        Store.resizeChart(Store.chartparam.luckysheetCurrentChart)
                    } else if (imageCtrl.move) {
                        var nr = mouseposition(e.pageX, e.pageY)
                          , or = nr[0] + $("#luckysheet-cell-main").scrollLeft()
                          , lr = nr[1] + $("#luckysheet-cell-main").scrollTop()
                          , ir = imageCtrl.images[imageCtrl.currentImgId];
                        ir.isFixedPos && (or = e.pageX,
                        lr = e.pageY);
                        var sr = $("#luckysheet-modal-dialog-activeImage").height()
                          , cr = $("#luckysheet-modal-dialog-activeImage").width()
                          , ur = lr - imageCtrl.moveXY[1]
                          , hr = or - imageCtrl.moveXY[0]
                          , dr = 0
                          , fr = imageCtrl.currentWinH - sr - 42 - 6
                          , mr = 0
                          , pr = imageCtrl.currentWinW - cr - 22 - 36;
                        ir.isFixedPos && (fr = (dr = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight) + Store.cellmainHeight - Store.cellMainSrollBarSize - sr,
                        pr = (mr = Store.rowHeaderWidth) + Store.cellmainWidth - Store.cellMainSrollBarSize - cr),
                        ur < dr && (ur = dr),
                        ur > fr && (ur = fr),
                        hr < mr && (hr = mr),
                        hr > pr && (hr = pr),
                        $("#luckysheet-modal-dialog-activeImage").css({
                            left: hr,
                            top: ur
                        })
                    } else if (imageCtrl.resize) {
                        var gr = mouseposition(e.pageX, e.pageY)
                          , yr = $("#luckysheet-cell-main").scrollLeft()
                          , vr = $("#luckysheet-cell-main").scrollTop()
                          , Ar = gr[0] + yr
                          , br = gr[1] + vr;
                        if (Ar < 0 || br < 0)
                            return !1;
                        var kr = imageCtrl.resizeXY
                          , wr = br - kr[1]
                          , xr = Ar - kr[0]
                          , Sr = kr[5]
                          , _r = kr[3]
                          , Cr = kr[4]
                          , Tr = kr[2]
                          , Er = imageCtrl.resize
                          , Ir = imageCtrl.images[imageCtrl.currentImgId];
                        if (Ir.isFixedPos) {
                            var Rr = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight
                              , Br = Store.rowHeaderWidth;
                            "lt" == Er ? ((Cr = kr[4] - kr[6] + xr) < Br && (Cr = Br),
                            Cr > kr[4] - kr[6] + kr[2] - 1 && (Cr = kr[4] - kr[6] + kr[2] - 1),
                            Tr = kr[4] - kr[6] + kr[2] - Cr,
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            (Sr = kr[5] - kr[7] + kr[3] - _r) < Rr && (Sr = Rr,
                            _r = kr[5] - kr[7] + kr[3] - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[4] - kr[6] + kr[2] - Tr),
                            Sr > kr[5] - kr[7] + kr[3] - 1 && (Sr = kr[5] - kr[7] + kr[3] - 1,
                            _r = kr[5] - kr[7] + kr[3] - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[4] - kr[6] + kr[2] - Tr)) : "lm" == Er ? ((Cr = kr[4] - kr[6] + xr) < Br && (Cr = Br),
                            Cr > kr[4] - kr[6] + kr[2] - 1 && (Cr = kr[4] - kr[6] + kr[2] - 1),
                            Tr = kr[4] - kr[6] + kr[2] - Cr,
                            Sr = kr[5] - kr[7],
                            _r = kr[3]) : "lb" == Er ? ((Cr = kr[4] - kr[6] + xr) < Br && (Cr = Br),
                            Cr > kr[4] - kr[6] + kr[2] - 1 && (Cr = kr[4] - kr[6] + kr[2] - 1),
                            Tr = kr[4] - kr[6] + kr[2] - Cr,
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            Sr = kr[5] - kr[7],
                            _r < 1 && (_r = 1,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[4] - kr[6] + kr[2] - Tr),
                            _r > Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr && (_r = Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[4] - kr[6] + kr[2] - Tr)) : "rt" == Er ? (Cr = kr[4] - kr[6],
                            (Tr = kr[2] + xr) < 1 && (Tr = 1),
                            Tr > Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr && (Tr = Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr),
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            (Sr = kr[5] - kr[7] + kr[3] - _r) < Rr && (Sr = Rr,
                            _r = kr[5] - kr[7] + kr[3] - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3]))),
                            Sr > kr[5] - kr[7] + kr[3] - 1 && (Sr = kr[5] - kr[7] + kr[3] - 1,
                            _r = kr[5] - kr[7] + kr[3] - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3])))) : "rm" == Er ? (Cr = kr[4] - kr[6],
                            (Tr = kr[2] + xr) < 1 && (Tr = 1),
                            Tr > Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr && (Tr = Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr),
                            Sr = kr[5] - kr[7],
                            _r = kr[3]) : "rb" == Er ? (Cr = kr[4] - kr[6],
                            (Tr = kr[2] + xr) < 1 && (Tr = 1),
                            Tr > Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr && (Tr = Br + Store.cellmainWidth - Store.cellMainSrollBarSize - Cr),
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            Sr = kr[5] - kr[7],
                            _r < 1 && (_r = 1,
                            Tr = Math.round(_r * (kr[2] / kr[3]))),
                            _r > Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr && (_r = Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr,
                            Tr = Math.round(_r * (kr[2] / kr[3])))) : "mt" == Er ? (Cr = kr[4] - kr[6],
                            Tr = kr[2],
                            (Sr = kr[5] - kr[7] + wr) < Rr && (Sr = Rr),
                            Sr > kr[5] - kr[7] + kr[3] - 1 && (Sr = kr[5] - kr[7] + kr[3] - 1),
                            _r = kr[5] - kr[7] + kr[3] - Sr) : "mb" == Er && (Cr = kr[4] - kr[6],
                            Tr = kr[2],
                            Sr = kr[5] - kr[7],
                            (_r = kr[3] + wr) < 1 && (_r = 1),
                            _r > Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr && (_r = Rr + Store.cellmainHeight - Store.cellMainSrollBarSize - Sr))
                        } else
                            "lt" == Er ? (Cr = Ar,
                            Tr = kr[2] - xr,
                            Cr > kr[2] + kr[4] - 1 ? (Cr = kr[2] + kr[4] - 1,
                            Tr = kr[2] + kr[0] - (kr[2] + kr[4] - 1)) : Cr <= 0 && (Cr = 0,
                            Tr = kr[2] + kr[0]),
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            (Sr = kr[3] + kr[1] - _r) > kr[3] + kr[5] - 1 ? (Sr = kr[3] + kr[5] - 1,
                            _r = kr[3] + kr[1] - (kr[3] + kr[5] - 1),
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[2] + kr[0] - Tr) : Sr <= 0 && (Sr = 0,
                            _r = kr[3] + kr[1],
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[2] + kr[0] - Tr)) : "lm" == Er ? (Cr = Ar,
                            Tr = kr[2] - xr,
                            Cr > kr[2] + kr[4] - 1 ? (Cr = kr[2] + kr[4] - 1,
                            Tr = kr[2] + kr[0] - (kr[2] + kr[4] - 1)) : Cr <= 0 && (Cr = 0,
                            Tr = kr[2] + kr[0])) : "lb" == Er ? (Cr = Ar,
                            Tr = kr[2] - xr,
                            Cr > kr[2] + kr[4] - 1 ? (Cr = kr[2] + kr[4] - 1,
                            Tr = kr[2] + kr[0] - (kr[2] + kr[4] - 1)) : Cr <= 0 && (Cr = 0,
                            Tr = kr[2] + kr[0]),
                            (_r = Math.round(Tr * (kr[3] / kr[2]))) < 1 ? (_r = 1,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[2] + kr[0] - Tr) : _r >= imageCtrl.currentWinH - kr[5] - 42 - 6 && (_r = imageCtrl.currentWinH - kr[5] - 42 - 6,
                            Tr = Math.round(_r * (kr[2] / kr[3])),
                            Cr = kr[2] + kr[0] - Tr)) : "rt" == Er ? ((Tr = kr[2] + xr) < 1 ? Tr = 1 : Tr >= imageCtrl.currentWinW - kr[4] - 22 - 36 && (Tr = imageCtrl.currentWinW - kr[4] - 22 - 36),
                            _r = Math.round(Tr * (kr[3] / kr[2])),
                            (Sr = kr[3] + kr[1] - _r) > kr[3] + kr[5] - 1 ? (Sr = kr[3] + kr[5] - 1,
                            _r = kr[3] + kr[1] - (kr[3] + kr[5] - 1),
                            Tr = Math.round(_r * (kr[2] / kr[3]))) : Sr <= 0 && (Sr = 0,
                            _r = kr[3] + kr[1],
                            Tr = Math.round(_r * (kr[2] / kr[3])))) : "rm" == Er ? (Tr = kr[2] + xr) < 1 ? Tr = 1 : Tr >= imageCtrl.currentWinW - kr[4] - 22 - 36 && (Tr = imageCtrl.currentWinW - kr[4] - 22 - 36) : "rb" == Er ? ((Tr = kr[2] + xr) < 1 ? Tr = 1 : Tr >= imageCtrl.currentWinW - kr[4] - 22 - 36 && (Tr = imageCtrl.currentWinW - kr[4] - 22 - 36),
                            (_r = Math.round(Tr * (kr[3] / kr[2]))) < 1 ? (_r = 1,
                            Tr = Math.round(_r * (kr[2] / kr[3]))) : _r >= imageCtrl.currentWinH - kr[5] - 42 - 6 && (_r = imageCtrl.currentWinH - kr[5] - 42 - 6,
                            Tr = Math.round(_r * (kr[2] / kr[3])))) : "mt" == Er ? (Sr = br,
                            _r = kr[3] - wr,
                            Sr > kr[3] + kr[5] - 1 ? (Sr = kr[3] + kr[5] - 1,
                            _r = kr[3] + kr[1] - (kr[3] + kr[5] - 1)) : Sr <= 0 && (Sr = 0,
                            _r = kr[3] + kr[1])) : "mb" == Er && ((_r = kr[3] + wr) < 1 ? _r = 1 : _r >= imageCtrl.currentWinH - kr[5] - 42 - 6 && (_r = imageCtrl.currentWinH - kr[5] - 42 - 6));
                        $("#luckysheet-modal-dialog-activeImage").css({
                            width: Tr,
                            height: _r,
                            left: Cr,
                            top: Sr
                        });
                        var Nr = Tr / Ir.crop.width
                          , Fr = _r / Ir.crop.height
                          , Pr = Math.round(Ir.default.width * Nr)
                          , $r = Math.round(Ir.default.height * Fr)
                          , Lr = Math.round(Ir.crop.offsetLeft * Nr)
                          , Or = Math.round(Ir.crop.offsetTop * Fr);
                        $("#luckysheet-modal-dialog-activeImage .luckysheet-modal-dialog-content").css({
                            "background-size": Pr + "px " + $r + "px",
                            "background-position": -Lr + "px " + -Or + "px"
                        })
                    } else if (imageCtrl.cropChange) {
                        var Dr = mouseposition(e.pageX, e.pageY)
                          , Mr = Dr[0] + $("#luckysheet-cell-main").scrollLeft()
                          , Ur = Dr[1] + $("#luckysheet-cell-main").scrollTop();
                        if (Mr < 0 || Ur < 0)
                            return !1;
                        var Hr, qr, zr, jr, Vr = imageCtrl.cropChangeXY, Qr = Ur - Vr[1], Gr = Mr - Vr[0], Kr = imageCtrl.images[imageCtrl.currentImgId], Wr = imageCtrl.cropChange;
                        "lt" == Wr ? ((zr = Kr.crop.offsetLeft + Gr) < 0 && (zr = 0),
                        zr > Kr.crop.width + Kr.crop.offsetLeft - 1 && (zr = Kr.crop.width + Kr.crop.offsetLeft - 1),
                        Hr = Kr.crop.width + Kr.crop.offsetLeft - zr,
                        (jr = Kr.crop.offsetTop + Qr) < 0 && (jr = 0),
                        jr > Kr.crop.height + Kr.crop.offsetTop - 1 && (jr = Kr.crop.height + Kr.crop.offsetTop - 1),
                        qr = Kr.crop.height + Kr.crop.offsetTop - jr) : "lm" == Wr ? ((zr = Kr.crop.offsetLeft + Gr) < 0 && (zr = 0),
                        zr > Kr.crop.width + Kr.crop.offsetLeft - 1 && (zr = Kr.crop.width + Kr.crop.offsetLeft - 1),
                        Hr = Kr.crop.width + Kr.crop.offsetLeft - zr,
                        jr = Kr.crop.offsetTop,
                        qr = Kr.crop.height) : "lb" == Wr ? ((zr = Kr.crop.offsetLeft + Gr) < 0 && (zr = 0),
                        zr > Kr.crop.width + Kr.crop.offsetLeft - 1 && (zr = Kr.crop.width + Kr.crop.offsetLeft - 1),
                        Hr = Kr.crop.width + Kr.crop.offsetLeft - zr,
                        jr = Kr.crop.offsetTop,
                        (qr = Kr.crop.height + Qr) < 1 && (qr = 1),
                        qr > Kr.default.height - jr && (qr = Kr.default.height - jr)) : "rt" == Wr ? (zr = Kr.crop.offsetLeft,
                        (Hr = Kr.crop.width + Gr) < 1 && (Hr = 1),
                        Hr > Kr.default.width - zr && (Hr = Kr.default.width - zr),
                        (jr = Kr.crop.offsetTop + Qr) < 0 && (jr = 0),
                        jr > Kr.crop.height + Kr.crop.offsetTop - 1 && (jr = Kr.crop.height + Kr.crop.offsetTop - 1),
                        qr = Kr.crop.height + Kr.crop.offsetTop - jr) : "rm" == Wr ? (zr = Kr.crop.offsetLeft,
                        (Hr = Kr.crop.width + Gr) < 1 && (Hr = 1),
                        Hr > Kr.default.width - zr && (Hr = Kr.default.width - zr),
                        jr = Kr.crop.offsetTop,
                        qr = Kr.crop.height) : "rb" == Wr ? (zr = Kr.crop.offsetLeft,
                        (Hr = Kr.crop.width + Gr) < 1 && (Hr = 1),
                        Hr > Kr.default.width - zr && (Hr = Kr.default.width - zr),
                        jr = Kr.crop.offsetTop,
                        (qr = Kr.crop.height + Qr) < 1 && (qr = 1),
                        qr > Kr.default.height - jr && (qr = Kr.default.height - jr)) : "mt" == Wr ? (zr = Kr.crop.offsetLeft,
                        Hr = Kr.crop.width,
                        (jr = Kr.crop.offsetTop + Qr) < 0 && (jr = 0),
                        jr > Kr.crop.height + Kr.crop.offsetTop - 1 && (jr = Kr.crop.height + Kr.crop.offsetTop - 1),
                        qr = Kr.crop.height + Kr.crop.offsetTop - jr) : "mb" == Wr && (zr = Kr.crop.offsetLeft,
                        Hr = Kr.crop.width,
                        jr = Kr.crop.offsetTop,
                        (qr = Kr.crop.height + Qr) < 1 && (qr = 1),
                        qr > Kr.default.height - jr && (qr = Kr.default.height - jr));
                        var Yr = Kr.default.left + zr
                          , Xr = Kr.default.top + jr;
                        Kr.isFixedPos && (Yr = Kr.fixedLeft + zr,
                        Xr = Kr.fixedTop + jr),
                        $("#luckysheet-modal-dialog-cropping").show().css({
                            width: Hr,
                            height: qr,
                            left: Yr,
                            top: Xr
                        }),
                        $("#luckysheet-modal-dialog-cropping .cropping-mask").css({
                            width: Kr.default.width,
                            height: Kr.default.height,
                            "background-image": "url(" + Kr.src + ")",
                            left: -zr,
                            top: -jr
                        }),
                        $("#luckysheet-modal-dialog-cropping .cropping-content").css({
                            "background-image": "url(" + Kr.src + ")",
                            "background-size": Kr.default.width + "px " + Kr.default.height + "px",
                            "background-position": -zr + "px " + -jr + "px"
                        }),
                        imageCtrl.cropChangeObj = {
                            width: Hr,
                            height: qr,
                            offsetLeft: zr,
                            offsetTop: jr
                        }
                    } else if (luckysheetPostil.move) {
                        var Jr = mouseposition(e.pageX, e.pageY)
                          , Zr = Jr[0] + $("#luckysheet-cell-main").scrollLeft()
                          , ea = Jr[1] + $("#luckysheet-cell-main").scrollTop()
                          , ta = luckysheetPostil.currentObj.outerHeight()
                          , ra = luckysheetPostil.currentObj.outerWidth()
                          , aa = ea - luckysheetPostil.moveXY[1]
                          , na = Zr - luckysheetPostil.moveXY[0];
                        aa < 0 && (aa = 0),
                        aa + ta + 42 + 6 > luckysheetPostil.currentWinH && (aa = luckysheetPostil.currentWinH - ta - 42 - 6),
                        na < 0 && (na = 0),
                        na + ra + 22 + 36 > luckysheetPostil.currentWinW && (na = luckysheetPostil.currentWinW - ra - 22 - 36),
                        luckysheetPostil.currentObj.css({
                            left: na,
                            top: aa
                        })
                    } else if (luckysheetPostil.resize) {
                        var oa = mouseposition(e.pageX, e.pageY)
                          , la = oa[0] + $("#luckysheet-cell-main").scrollLeft()
                          , ia = oa[1] + $("#luckysheet-cell-main").scrollTop();
                        if (la < 0 || ia < 0)
                            return !1;
                        var sa = luckysheetPostil.resizeXY
                          , ca = ia - sa[1]
                          , ua = la - sa[0]
                          , ha = sa[5]
                          , da = sa[3]
                          , fa = sa[4]
                          , ma = sa[2]
                          , pa = luckysheetPostil.resize;
                        "lm" != pa && "lt" != pa && "lb" != pa || (fa = la,
                        ma = sa[2] - ua,
                        fa > sa[2] + sa[4] - 60 ? (fa = sa[2] + sa[4] - 60,
                        ma = sa[2] - (sa[2] + sa[4] - 60 - sa[0])) : fa <= 0 && (fa = 0,
                        ma = sa[2] + sa[0])),
                        "rm" != pa && "rt" != pa && "rb" != pa || ((ma = sa[2] + ua) < 60 ? ma = 60 : ma >= luckysheetPostil.currentWinW - sa[4] - 22 - 36 && (ma = luckysheetPostil.currentWinW - sa[4] - 22 - 36)),
                        "mt" != pa && "lt" != pa && "rt" != pa || (ha = ia,
                        da = sa[3] - ca,
                        ha > sa[3] + sa[5] - 60 ? (ha = sa[3] + sa[5] - 60,
                        da = sa[3] - (sa[3] + sa[5] - 60 - sa[1])) : ha <= 0 && (ha = 0,
                        da = sa[3] + sa[1])),
                        "mb" != pa && "lb" != pa && "rb" != pa || ((da = sa[3] + ca) < 60 ? da = 60 : da >= luckysheetPostil.currentWinH - sa[5] - 42 - 6 && (da = luckysheetPostil.currentWinH - sa[5] - 42 - 6)),
                        luckysheetPostil.currentObj.css({
                            width: ma,
                            height: da,
                            left: fa,
                            top: ha
                        })
                    } else
                        luckysheetformula.rangeResize ? luckysheetformula.rangeResizeDraging(e, luckysheetformula.rangeResizeObj, luckysheetformula.rangeResizexy, luckysheetformula.rangeResize, luckysheetformula.rangeResizeWinW, luckysheetformula.rangeResizeWinH, Store.ch_width, Store.rh_height) : luckysheetformula.rangeMove ? luckysheetformula.rangeMoveDraging(e, luckysheetformula.rangeMovexy, luckysheetformula.rangeMoveObj.data("range"), luckysheetformula.rangeMoveObj, Store.sheetBarHeight, Store.statisticBarHeight) : Store.chart_selection.rangeResize ? Store.chart_selection.rangeResizeDraging(e, Store.sheetBarHeight, Store.statisticBarHeight) : Store.chart_selection.rangeMove && Store.chart_selection.rangeMoveDraging(e, Store.sheetBarHeight, Store.statisticBarHeight);
                    Store.jfautoscrollTimeout = window.requestAnimationFrame(t)
                }
                ))
            }
        }
        )),
        $(document).on("mouseup.luckysheetEvent", (function(e) {
            if (luckysheetConfigsetting && luckysheetConfigsetting.hook && luckysheetConfigsetting.hook.sheetMouseup) {
                var t = mouseposition(e.pageX, e.pageY)
                  , a = t[0] + $("#luckysheet-cell-main").scrollLeft()
                  , n = rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop())
                  , o = n[1]
                  , l = n[0]
                  , i = n[2]
                  , s = colLocation(a)
                  , c = s[1]
                  , u = s[0]
                  , h = s[2]
                  , d = menuButton.mergeborer(Store.flowdata, i, h);
                d && (o = d.row[1],
                l = d.row[0],
                i = d.row[2],
                c = d.column[1],
                u = d.column[0],
                h = d.column[2]);
                var f = sheetmanage.getSheetByIndex()
                  , m = {
                    functionResizeStatus: luckysheetformula.functionResizeStatus,
                    horizontalmoveState: !!luckysheetFreezen.horizontalmovestate,
                    verticalmoveState: !!luckysheetFreezen.verticalmovestate,
                    pivotTableMoveState: !!pivotTable && pivotTable.movestate,
                    sheetMoveStatus: Store.luckysheet_sheet_move_status,
                    scrollStatus: !!Store.luckysheet_scroll_status,
                    selectStatus: !!Store.luckysheet_select_status,
                    rowsSelectedStatus: !!Store.luckysheet_rows_selected_status,
                    colsSelectedStatus: !!Store.luckysheet_cols_selected_status,
                    cellSelectedMove: !!Store.luckysheet_cell_selected_move,
                    cellSelectedExtend: !!Store.luckysheet_cell_selected_extend,
                    colsChangeSize: !!Store.luckysheet_cols_change_size,
                    rowsChangeSize: !!Store.luckysheet_rows_change_size,
                    chartMove: !!Store.chartparam.luckysheetCurrentChartMove,
                    chartResize: !!Store.chartparam.luckysheetCurrentChartResize,
                    rangeResize: !!luckysheetformula.rangeResize,
                    rangeMove: !!luckysheetformula.rangeMove
                }
                  , p = $("#luckysheetTableContent").get(0).getContext("2d");
                method.createHookFunction("sheetMouseup", Store.flowdata[i][h], {
                    r: i,
                    c: h,
                    start_r: l,
                    start_c: u,
                    end_r: o,
                    end_c: c
                }, f, m, p)
            }
            (Store.luckysheet_select_status && (clearTimeout(Store.countfuncTimeout),
            Store.countfuncTimeout = setTimeout((function() {
                countfunc()
            }
            ), 0),
            menuButton.luckysheetPaintModelOn && (selection.pasteHandlerOfPaintModel(Store.luckysheet_copy_save),
            menuButton.luckysheetPaintSingle && menuButton.cancelPaintModel())),
            Store.luckysheet_select_status = !1,
            window.cancelAnimationFrame(Store.jfautoscrollTimeout),
            Store.luckysheet_scroll_status = !1,
            $("#luckysheet-cell-selected").find(".luckysheet-cs-fillhandle").css("cursor", "crosshair").end().find(".luckysheet-cs-draghandle").css("cursor", "move"),
            $("#luckysheet-cell-main, #luckysheetTableContent, #luckysheet-sheettable_0").css("cursor", "default"),
            Store.luckysheet_rows_selected_status = !1,
            Store.luckysheet_cols_selected_status = !1,
            Store.luckysheet_model_move_state = !1,
            luckysheetformula.functionResizeStatus && (luckysheetformula.functionResizeStatus = !1,
            $("#luckysheet-wa-calculate-size").removeAttr("style")),
            luckysheetFreezen.horizontalmovestate && (luckysheetFreezen.horizontalmovestate = !1,
            $("#luckysheet-freezebar-horizontal").removeClass("luckysheet-freezebar-active"),
            $("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css("cursor", "-webkit-grab"),
            luckysheetFreezen.freezenhorizontaldata[4] <= Store.columnHeaderHeight && luckysheetFreezen.cancelFreezenHorizontal(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            luckysheetFreezen.verticalmovestate && (luckysheetFreezen.verticalmovestate = !1,
            $("#luckysheet-freezebar-vertical").removeClass("luckysheet-freezebar-active"),
            $("#luckysheet-freezebar-vertical").find(".luckysheet-freezebar-vertical-handle").css("cursor", "-webkit-grab"),
            luckysheetFreezen.freezenverticaldata[4] <= Store.rowHeaderWidth && luckysheetFreezen.cancelFreezenVertical(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            pivotTable && pivotTable.movestate) && ($("#luckysheet-modal-dialog-slider-pivot-move").remove(),
            pivotTable.movestate = !1,
            $("#luckysheet-modal-dialog-pivotTable-list, #luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").css("cursor", "default"),
            "luckysheet-modal-dialog-pivotTable-list" != pivotTable.movesave.containerid && 0 == $(e.target).closest(".luckysheet-modal-dialog-slider-config-list").length && ("luckysheet-modal-dialog-config-value" == pivotTable.movesave.containerid && pivotTable.resetOrderby(pivotTable.movesave.obj),
            pivotTable.movesave.obj.remove(),
            pivotTable.showvaluecolrow(),
            $("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each((function() {
                $(this).find(".luckysheet-slider-list-item-selected").find("i").remove()
            }
            )),
            $("#luckysheet-modal-dialog-config-filter, #luckysheet-modal-dialog-config-row, #luckysheet-modal-dialog-config-column, #luckysheet-modal-dialog-config-value").find(".luckysheet-modal-dialog-slider-config-item").each((function() {
                var e = $(this).data("index");
                $("#luckysheet-modal-dialog-pivotTable-list").find(".luckysheet-modal-dialog-slider-list-item").each((function() {
                    var t = $(this).find(".luckysheet-slider-list-item-selected");
                    $(this).data("index") == e && 0 == t.find("i").length && t.append('<i class="fa fa-check luckysheet-mousedown-cancel"></i>')
                }
                ))
            }
            )),
            pivotTable.refreshPivotTable()));
            if (Store.luckysheet_sheet_move_status && (Store.luckysheet_sheet_move_status = !1,
            Store.luckysheet_sheet_move_data.activeobject.insertBefore($("#luckysheet-sheets-item-clone")),
            Store.luckysheet_sheet_move_data.activeobject.removeAttr("style"),
            $("#luckysheet-sheets-item-clone").remove(),
            Store.luckysheet_sheet_move_data.cursorobject.css({
                cursor: "pointer"
            }),
            Store.luckysheet_sheet_move_data = {},
            sheetmanage.reOrderAllSheet()),
            clearTimeout(Store.chartparam.luckysheetCurrentChartMoveTimeout),
            Store.chartparam.luckysheetCurrentChartMove && (Store.chartparam.luckysheetCurrentChartMove = !1,
            Store.chartparam.luckysheetInsertChartTosheetChange)) {
                var g = Store.chartparam.luckysheetCurrentChartMoveObj.css("top")
                  , y = Store.chartparam.luckysheetCurrentChartMoveObj.css("left")
                  , v = $("#luckysheet-cell-main").scrollLeft()
                  , A = $("#luckysheet-cell-main").scrollTop()
                  , b = Store.chartparam.luckysheetCurrentChartMoveXy[2]
                  , k = Store.chartparam.luckysheetCurrentChartMoveXy[3]
                  , w = Store.chartparam.luckysheetCurrentChartMoveXy[4]
                  , x = Store.chartparam.luckysheetCurrentChartMoveXy[5]
                  , S = Store.chartparam.luckysheetCurrentChartMoveObj.find(".luckysheet-modal-dialog-content").attr("id");
                Store.jfredo.push({
                    type: "moveChart",
                    chart_id: S,
                    sheetIndex: Store.currentSheetIndex,
                    myTop: g,
                    myLeft: y,
                    scrollTop: A,
                    scrollLeft: v,
                    x: b,
                    y: k,
                    scrollTop1: x,
                    scrollLeft1: w
                })
            }
            if (Store.chartparam.luckysheetCurrentChartResize && (Store.chartparam.luckysheetCurrentChartResize = null,
            Store.chartparam.luckysheetInsertChartTosheetChange)) {
                var _ = Store.chartparam.luckysheetCurrentChartResizeObj.height()
                  , C = Store.chartparam.luckysheetCurrentChartResizeObj.width()
                  , T = (v = $("#luckysheet-cell-main").scrollLeft(),
                A = $("#luckysheet-cell-main").scrollTop(),
                g = Store.chartparam.luckysheetCurrentChartMoveObj.css("top"),
                y = Store.chartparam.luckysheetCurrentChartMoveObj.css("left"),
                S = Store.chartparam.luckysheetCurrentChartResizeObj.find(".luckysheet-modal-dialog-content").attr("id"),
                Store.chartparam.luckysheetCurrentChartResizeXy[2])
                  , E = Store.chartparam.luckysheetCurrentChartResizeXy[3];
                b = Store.chartparam.luckysheetCurrentChartResizeXy[4],
                k = Store.chartparam.luckysheetCurrentChartResizeXy[5],
                w = Store.chartparam.luckysheetCurrentChartResizeXy[6],
                x = Store.chartparam.luckysheetCurrentChartResizeXy[7];
                Store.jfredo.push({
                    type: "resizeChart",
                    chart_id: S,
                    sheetIndex: Store.currentSheetIndex,
                    myTop: g,
                    myLeft: y,
                    myHeight: _,
                    myWidth: C,
                    scrollTop: A,
                    scrollLeft: v,
                    x: b,
                    y: k,
                    myWidth1: T,
                    myHeight1: E,
                    scrollTop1: x,
                    scrollLeft1: w
                })
            }
            if (luckysheetformula.rangeResize && luckysheetformula.rangeResizeDragged(e, luckysheetformula.rangeResizeObj, luckysheetformula.rangeResize, luckysheetformula.rangeResizexy, luckysheetformula.rangeResizeWinW, luckysheetformula.rangeResizeWinH),
            imageCtrl.move && imageCtrl.moveImgItem(),
            imageCtrl.resize && imageCtrl.resizeImgItem(),
            imageCtrl.cropChange && imageCtrl.cropChangeImgItem(),
            luckysheetPostil.move) {
                luckysheetPostil.move = !1;
                var I = luckysheetPostil.currentObj.closest(".luckysheet-postil-show").attr("id")
                  , R = I.split("luckysheet-postil-show_")[1].split("_")[0]
                  , B = I.split("luckysheet-postil-show_")[1].split("_")[1]
                  , N = editor.deepCopyFlowData(Store.flowdata)
                  , F = [];
                N[R][B].ps.left = luckysheetPostil.currentObj.position().left,
                N[R][B].ps.top = luckysheetPostil.currentObj.position().top,
                N[R][B].ps.value = luckysheetPostil.currentObj.find(".formulaInputFocus").text(),
                F.push(R + "_" + B),
                luckysheetPostil.ref(N, F),
                $("#" + I).remove(),
                N[R][B].ps.isshow ? (luckysheetPostil.buildPs(R, B, N[R][B].ps),
                $("#" + I).addClass("luckysheet-postil-show-active"),
                $("#" + I).find(".luckysheet-postil-dialog-resize").show()) : luckysheetPostil.editPs(R, B)
            }
            if (luckysheetPostil.resize) {
                luckysheetPostil.resize = null;
                var P = luckysheetPostil.currentObj.closest(".luckysheet-postil-show").attr("id")
                  , L = P.split("luckysheet-postil-show_")[1].split("_")[0]
                  , O = P.split("luckysheet-postil-show_")[1].split("_")[1]
                  , D = editor.deepCopyFlowData(Store.flowdata)
                  , M = [];
                D[L][O].ps.left = luckysheetPostil.currentObj.position().left,
                D[L][O].ps.top = luckysheetPostil.currentObj.position().top,
                D[L][O].ps.width = luckysheetPostil.currentObj.outerWidth(),
                D[L][O].ps.height = luckysheetPostil.currentObj.outerHeight(),
                D[L][O].ps.value = luckysheetPostil.currentObj.find(".formulaInputFocus").text(),
                M.push(L + "_" + O),
                luckysheetPostil.ref(D, M),
                $("#" + P).remove(),
                D[L][O].ps.isshow ? (luckysheetPostil.buildPs(L, O, D[L][O].ps),
                $("#" + P).addClass("luckysheet-postil-show-active"),
                $("#" + P).find(".luckysheet-postil-dialog-resize").show()) : luckysheetPostil.editPs(L, O)
            }
            if (Store.luckysheet_rows_change_size) {
                Store.luckysheet_rows_change_size = !1,
                $("#luckysheet-change-size-line").hide(),
                $("#luckysheet-rows-change-size").css("opacity", 0),
                $("#luckysheet-sheettable, #luckysheet-rows-h, #luckysheet-rows-h canvas").css("cursor", "default");
                var U = mouseposition(e.pageX, e.pageY)
                  , H = $("#luckysheet-rows-h").scrollTop()
                  , q = U[1] + H
                  , z = $(window).height()
                  , j = rowLocation(q)
                  , V = (j[1],
                j[0],
                j[2],
                q + 3 - Store.luckysheet_rows_change_size_start[0]);
                q + 3 - Store.luckysheet_rows_change_size_start[0] < 19 && (V = 19),
                q >= z - 200 + H && (V = winW - 200 - Store.luckysheet_rows_change_size_start[0] + H);
                var Q = $.extend(!0, {}, Store.config);
                null == Q.rowlen && (Q.rowlen = {}),
                null == Q.customHeight && (Q.customHeight = {}),
                Q.customHeight[Store.luckysheet_rows_change_size_start[1]] = 1,
                Q.rowlen[Store.luckysheet_rows_change_size_start[1]] = Math.ceil(V / Store.zoomRatio);
                var G = imageCtrl.moveChangeSize("row", Store.luckysheet_rows_change_size_start[1], V);
                Store.clearjfundo && (Store.jfundo = [],
                Store.jfredo.push({
                    type: "resize",
                    ctrlType: "resizeR",
                    sheetIndex: Store.currentSheetIndex,
                    config: $.extend(!0, {}, Store.config),
                    curconfig: $.extend(!0, {}, Q),
                    images: $.extend(!0, {}, imageCtrl.images),
                    curImages: $.extend(!0, {}, G)
                })),
                Store.config = Q,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, Q.rowlen, {
                    k: "rowlen"
                }),
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].images = G,
                server.saveParam("all", Store.currentSheetIndex, G, {
                    k: "images"
                }),
                imageCtrl.images = G,
                imageCtrl.allImagesShow(),
                jfrefreshgrid_rhcw(Store.flowdata.length, null)
            }
            if (Store.luckysheet_cols_change_size) {
                Store.luckysheet_cols_change_size = !1,
                $("#luckysheet-change-size-line").hide(),
                $("#luckysheet-cols-change-size").css("opacity", 0),
                $("#luckysheet-sheettable, #luckysheet-cols-h-c, .luckysheet-cols-h-cells, .luckysheet-cols-h-cells canvas").css("cursor", "default");
                var K = mouseposition(e.pageX, e.pageY)
                  , W = $("#luckysheet-cols-h-c").scrollLeft()
                  , Y = K[0] + W
                  , X = $(window).width()
                  , J = Store.visibledatarow.length - 1
                  , Z = (Store.visibledatarow[J],
                colLocation(Y))
                  , ee = (Z[1],
                Z[0],
                Z[2],
                Y + 3 - Store.luckysheet_cols_change_size_start[0])
                  , te = Store.defaultcollen;
                if (null != Store.config.columnlen && null != Store.config.columnlen[Store.luckysheet_cols_change_size_start[1]] && (te = Store.config.columnlen[Store.luckysheet_cols_change_size_start[1]]),
                Math.abs(ee - te) < 3)
                    return;
                Y + 3 - Store.luckysheet_cols_change_size_start[0] < 30 && (ee = 30),
                Y >= X - 100 + W && (ee = X - 100 - Store.luckysheet_cols_change_size_start[0] + W);
                var re = $.extend(!0, {}, Store.config);
                null == re.columnlen && (re.columnlen = {}),
                null == re.customWidth && (re.customWidth = {}),
                re.customWidth[Store.luckysheet_cols_change_size_start[1]] = 1,
                re.columnlen[Store.luckysheet_cols_change_size_start[1]] = Math.ceil(ee / Store.zoomRatio);
                var ae = imageCtrl.moveChangeSize("column", Store.luckysheet_cols_change_size_start[1], ee);
                Store.clearjfundo && (Store.jfundo = [],
                Store.jfredo.push({
                    type: "resize",
                    ctrlType: "resizeC",
                    sheetIndex: Store.currentSheetIndex,
                    config: $.extend(!0, {}, Store.config),
                    curconfig: $.extend(!0, {}, re),
                    images: $.extend(!0, {}, imageCtrl.images),
                    curImages: $.extend(!0, {}, ae)
                })),
                Store.config = re,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, re.columnlen, {
                    k: "columnlen"
                }),
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].images = ae,
                server.saveParam("all", Store.currentSheetIndex, ae, {
                    k: "images"
                }),
                imageCtrl.images = ae,
                imageCtrl.allImagesShow(),
                jfrefreshgrid_rhcw(null, Store.flowdata[0].length),
                setTimeout((function() {
                    luckysheetrefreshgrid()
                }
                ), 1)
            }
            if (luckysheetformula.rangeMove && luckysheetformula.rangeMoveDragged(luckysheetformula.rangeMoveObj),
            Store.luckysheet_cell_selected_move) {
                $("#luckysheet-cell-selected-move").hide(),
                Store.luckysheet_cell_selected_move = !1;
                var ne = mouseposition(e.pageX, e.pageY);
                if (!checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex))
                    return;
                var oe = $("#luckysheet-cell-main").scrollLeft()
                  , le = $("#luckysheet-cell-main").scrollTop()
                  , ie = ne[0] + oe
                  , se = ne[1] + le
                  , ce = $(window).height() + le - Store.sheetBarHeight - Store.statisticBarHeight
                  , ue = $(window).width() + oe
                  , he = rowLocation(se)[2]
                  , de = colLocation(ie)[2]
                  , fe = Store.luckysheet_cell_selected_move_index[0]
                  , me = Store.luckysheet_cell_selected_move_index[1];
                if (he == fe && de == me)
                    return;
                var pe = editor.deepCopyFlowData(Store.flowdata)
                  , ge = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , ye = getdatabyselection(ge)
                  , ve = $.extend(!0, {}, Store.config);
                if (null == ve.merge && (ve.merge = {}),
                null == ve.rowlen && (ve.rowlen = {}),
                hasPartMC(ve, ge.row[0], ge.row[1], ge.column[0], ge.column[1]))
                    return void (isEditMode() ? alert(r.noMerge) : tooltip.info('<i class="fa fa-exclamation-triangle"></i>', r.noMerge));
                var Ae = ge.row[0] - fe + he
                  , be = ge.row[1] - fe + he
                  , ke = ge.column[0] - me + de
                  , we = ge.column[1] - me + de;
                if (!checkProtectionLockedRangeList([{
                    row: [Ae, be],
                    column: [ke, we]
                }], Store.currentSheetIndex))
                    return;
                if ((Ae < 0 || se < 0) && (Ae = 0,
                be = ge.row[1] - ge.row[0]),
                (ke < 0 || ie < 0) && (ke = 0,
                we = ge.column[1] - ge.column[0]),
                (be >= Store.visibledatarow[Store.visibledatarow.length - 1] || se > ce) && (Ae = Store.visibledatarow.length - 1 - ge.row[1] + ge.row[0],
                be = Store.visibledatarow.length - 1),
                (we >= Store.visibledatacolumn[Store.visibledatacolumn.length - 1] || ie > ue) && (ke = Store.visibledatacolumn.length - 1 - ge.column[1] + ge.column[0],
                we = Store.visibledatacolumn.length - 1),
                hasPartMC(ve, Ae, be, ke, we))
                    return void (isEditMode() ? alert(r.noMerge) : tooltip.info('<i class="fa fa-exclamation-triangle"></i>', r.noMerge));
                for (var xe = getBorderInfoCompute(Store.currentSheetIndex), Se = null, _e = ge.row[0]; _e <= ge.row[1]; _e++) {
                    _e in ve.rowlen && (Se = !0);
                    for (var Ce = ge.column[0]; Ce <= ge.column[1]; Ce++) {
                        var Te = pe[_e][Ce];
                        "object" == getObjType(Te) && "mc"in Te && Te.mc.r + "_" + Te.mc.c in ve.merge && delete ve.merge[Te.mc.r + "_" + Te.mc.c],
                        pe[_e][Ce] = null
                    }
                }
                if (ve.borderInfo && ve.borderInfo.length > 0) {
                    for (var Ee = [], Ie = 0; Ie < ve.borderInfo.length; Ie++) {
                        var Re = ve.borderInfo[Ie].rangeType;
                        if ("range" == Re) {
                            for (var Be = ve.borderInfo[Ie].range, Ne = [], Fe = 0; Fe < Be.length; Fe++)
                                Ne = Ne.concat(conditionformat.CFSplitRange(Be[Fe], {
                                    row: ge.row,
                                    column: ge.column
                                }, {
                                    row: [Ae, be],
                                    column: [ke, we]
                                }, "restPart"));
                            ve.borderInfo[Ie].range = Ne,
                            Ee.push(ve.borderInfo[Ie])
                        } else if ("cell" == Re) {
                            var Pe = ve.borderInfo[Ie].value.row_index
                              , $e = ve.borderInfo[Ie].value.col_index;
                            Pe >= ge.row[0] && Pe <= ge.row[1] && $e >= ge.column[0] && $e <= ge.column[1] || Ee.push(ve.borderInfo[Ie])
                        }
                    }
                    ve.borderInfo = Ee
                }
                for (var Le = {}, Oe = 0; Oe < ye.length; Oe++)
                    for (var De = 0; De < ye[0].length; De++) {
                        if (xe[Oe + ge.row[0] + "_" + (De + ge.column[0])]) {
                            var Me = {
                                rangeType: "cell",
                                value: {
                                    row_index: Oe + Ae,
                                    col_index: De + ke,
                                    l: xe[Oe + ge.row[0] + "_" + (De + ge.column[0])].l,
                                    r: xe[Oe + ge.row[0] + "_" + (De + ge.column[0])].r,
                                    t: xe[Oe + ge.row[0] + "_" + (De + ge.column[0])].t,
                                    b: xe[Oe + ge.row[0] + "_" + (De + ge.column[0])].b
                                }
                            };
                            null == ve.borderInfo && (ve.borderInfo = []),
                            ve.borderInfo.push(Me)
                        }
                        var Ue = "";
                        if (null != ye[Oe] && null != ye[Oe][De] && (Ue = ye[Oe][De]),
                        "object" == getObjType(Ue) && "mc"in Ue) {
                            var He = $.extend(!0, {}, Ue.mc);
                            "rs"in Ue.mc ? (Le[He.r + "_" + He.c] = [Oe + Ae, De + ke],
                            Ue.mc.r = Oe + Ae,
                            Ue.mc.c = De + ke,
                            ve.merge[Oe + Ae + "_" + (De + ke)] = Ue.mc) : (Ue.mc.r = Le[He.r + "_" + He.c][0],
                            Ue.mc.c = Le[He.r + "_" + He.c][1])
                        }
                        pe[Oe + Ae][De + ke] = Ue
                    }
                Se && (ve = rowlenByRange(pe, ge.row[0], ge.row[1], ve),
                ve = rowlenByRange(pe, Ae, be, ve));
                var qe, ze, je = $.extend(!0, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save);
                if (null != je && je.length > 0)
                    for (var Ve = 0; Ve < je.length; Ve++) {
                        for (var Qe = je[Ve].cellrange, Ge = [], Ke = 0; Ke < Qe.length; Ke++) {
                            var We = conditionformat.CFSplitRange(Qe[Ke], {
                                row: ge.row,
                                column: ge.column
                            }, {
                                row: [Ae, be],
                                column: [ke, we]
                            }, "allPart");
                            Ge = Ge.concat(We)
                        }
                        je[Ve].cellrange = Ge
                    }
                qe = Store.luckysheet_select_save[0].row_focus == Store.luckysheet_select_save[0].row[0] ? Ae : be,
                ze = Store.luckysheet_select_save[0].column_focus == Store.luckysheet_select_save[0].column[0] ? ke : we;
                var Ye = [];
                Ye.push({
                    row: ge.row,
                    column: ge.column
                }),
                Ye.push({
                    row: [Ae, be],
                    column: [ke, we]
                }),
                ge.row = [Ae, be],
                ge.column = [ke, we],
                ge.row_focus = qe,
                ge.column_focus = ze,
                jfrefreshgrid(pe, Ye, {
                    cfg: ve,
                    RowlChange: Se,
                    cdformat: je
                }),
                selectHightlightShow(),
                $("#luckysheet-sheettable").css("cursor", "default"),
                clearTimeout(Store.countfuncTimeout),
                Store.countfuncTimeout = setTimeout((function() {
                    countfunc()
                }
                ), 500)
            }
            if (Store.chart_selection.rangeMove && Store.chart_selection.rangeMoveDragged(),
            Store.chart_selection.rangeResize && Store.chart_selection.rangeResizeDragged(),
            Store.luckysheet_cell_selected_extend) {
                if (Store.luckysheet_cell_selected_extend = !1,
                $("#luckysheet-cell-selected-extend").hide(),
                !checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex))
                    return;
                var Xe = mouseposition(e.pageX, e.pageY)
                  , Je = $("#luckysheet-cell-main").scrollLeft()
                  , Ze = $("#luckysheet-cell-main").scrollTop()
                  , et = Xe[0] + Je - 5
                  , tt = Xe[1] + Ze - 5
                  , rt = $(window).height() + Ze - Store.sheetBarHeight - Store.statisticBarHeight
                  , at = $(window).width() + Je
                  , nt = rowLocation(tt)
                  , ot = (nt[1],
                nt[0])
                  , lt = nt[2]
                  , it = colLocation(et)
                  , st = (it[1],
                it[0])
                  , ct = it[2]
                  , ut = Store.luckysheet_cell_selected_extend_index[0]
                  , ht = Store.luckysheet_cell_selected_extend_index[1]
                  , dt = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , ft = dt.row[0]
                  , mt = dt.row[1]
                  , pt = dt.column[0]
                  , gt = dt.column[1];
                (ft < 0 || tt < 0) && (ft = 0,
                mt = dt.row[1] - dt.row[0]),
                (pt < 0 || et < 0) && (pt = 0,
                gt = dt.column[1] - dt.column[0]),
                (mt >= Store.visibledatarow[Store.visibledatarow.length - 1] || tt > rt) && (ft = Store.visibledatarow.length - 1 - dt.row[1] + dt.row[0],
                mt = Store.visibledatarow.length - 1),
                (gt >= Store.visibledatacolumn[Store.visibledatacolumn.length - 1] || et > at) && (pt = Store.visibledatacolumn.length - 1 - dt.column[1] + dt.column[0],
                gt = Store.visibledatacolumn.length - 1),
                luckysheetDropCell.copyRange = {
                    row: $.extend(!0, [], dt.row),
                    column: $.extend(!0, [], dt.column)
                };
                var yt = luckysheetDropCell.typeItemHide();
                if (yt[0] || yt[1] || yt[2] || yt[3] || yt[4] || yt[5] || yt[6] ? luckysheetDropCell.applyType = "1" : luckysheetDropCell.applyType = "0",
                Math.abs(ut - lt) > Math.abs(ht - ct)) {
                    if (lt >= ft && lt <= mt)
                        return;
                    if (Store.luckysheet_select_save[0].top_move >= ot) {
                        if (luckysheetDropCell.applyRange = {
                            row: [lt, dt.row[0] - 1],
                            column: dt.column
                        },
                        luckysheetDropCell.direction = "up",
                        ft -= dt.row[0] - lt,
                        pivotTable.isPivotRange(ft, gt))
                            return void tooltip.info(r.affectPivot, "")
                    } else if (luckysheetDropCell.applyRange = {
                        row: [dt.row[1] + 1, lt],
                        column: dt.column
                    },
                    luckysheetDropCell.direction = "down",
                    mt += lt - dt.row[1],
                    pivotTable.isPivotRange(mt, gt))
                        return void tooltip.info(r.affectPivot, "")
                } else {
                    if (ct >= pt && ct <= gt)
                        return;
                    if (Store.luckysheet_select_save[0].left_move >= st) {
                        if (luckysheetDropCell.applyRange = {
                            row: dt.row,
                            column: [ct, dt.column[0] - 1]
                        },
                        luckysheetDropCell.direction = "left",
                        pt -= dt.column[0] - ct,
                        pivotTable.isPivotRange(mt, pt))
                            return void tooltip.info(r.affectPivot, "")
                    } else if (luckysheetDropCell.applyRange = {
                        row: dt.row,
                        column: [dt.column[1] + 1, ct]
                    },
                    luckysheetDropCell.direction = "right",
                    gt += ct - dt.column[1],
                    pivotTable.isPivotRange(mt, gt))
                        return void tooltip.info(r.affectPivot, "")
                }
                if (null != Store.config.merge) {
                    for (var vt = !1, At = dt.row[0]; At <= dt.row[1]; At++)
                        for (var bt = dt.column[0]; bt <= dt.column[1]; bt++) {
                            var kt = Store.flowdata[At][bt];
                            if (null != kt && null != kt.mc) {
                                vt = !0;
                                break
                            }
                        }
                    if (vt)
                        return void (isEditMode() ? alert(r.noMerge) : tooltip.info(r.noMerge, ""));
                    for (var wt = ft; wt <= mt; wt++)
                        for (var xt = pt; xt <= gt; xt++) {
                            var St = Store.flowdata[wt][xt];
                            if (null != St && null != St.mc) {
                                vt = !0;
                                break
                            }
                        }
                    if (vt)
                        return void (isEditMode() ? alert(r.noMerge) : tooltip.info(r.noMerge, ""))
                }
                dt.row = [ft, mt],
                dt.column = [pt, gt],
                luckysheetDropCell.update(),
                luckysheetDropCell.createIcon(),
                $("#luckysheet-cell-selected-move").hide(),
                $("#luckysheet-sheettable").css("cursor", "default"),
                clearTimeout(Store.countfuncTimeout),
                Store.countfuncTimeout = setTimeout((function() {
                    countfunc()
                }
                ), 500)
            }
        }
        )),
        $(".luckysheet-grid-container, #luckysheet-rightclick-menu").on("contextmenu", (function(e) {
            e.preventDefault()
        }
        )),
        $("#luckysheet-cell-main div.luckysheet-cs-draghandle").mousedown((function(e) {
            if (!isEditMode() && !1 !== Store.allowEdit) {
                $("#luckysheet-cell-selected").find(".luckysheet-cs-fillhandle").css("cursor", "move").end().find(".luckysheet-cs-draghandle").css("cursor", "move"),
                $("#luckysheet-cell-main, #luckysheetTableContent, #luckysheet-sheettable_0").css("cursor", "move"),
                Store.luckysheet_cell_selected_move = !0,
                Store.luckysheet_scroll_status = !0;
                var t = mouseposition(e.pageX, e.pageY)
                  , r = t[0] + $("#luckysheet-cell-main").scrollLeft()
                  , a = rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop())
                  , n = a[0]
                  , o = a[1]
                  , l = a[2]
                  , i = colLocation(r)
                  , s = i[0]
                  , c = i[1]
                  , u = i[2];
                Store.luckysheet_cell_selected_move_index = [l, u],
                $("#luckysheet-cell-selected-move").css({
                    left: s,
                    width: c - s - 1,
                    top: n,
                    height: o - n - 1,
                    display: "block"
                }),
                e.stopPropagation()
            }
        }
        )),
        $("#luckysheet-cell-main div.luckysheet-cs-fillhandle").mousedown((function(e) {
            isEditMode() || !1 === Store.allowEdit || ($("#luckysheet-cell-selected").find(".luckysheet-cs-fillhandle").css("cursor", "crosshair").end().find(".luckysheet-cs-draghandle").css("cursor", "crosshair"),
            $("#luckysheet-cell-main, #luckysheetTableContent, #luckysheet-sheettable_0").css("cursor", "crosshair"),
            Store.luckysheet_cell_selected_extend_time = setTimeout((function() {
                Store.luckysheet_cell_selected_extend = !0,
                Store.luckysheet_scroll_status = !0;
                var t = mouseposition(e.pageX, e.pageY)
                  , r = t[0] + $("#luckysheet-cell-main").scrollLeft() - 5
                  , a = rowLocation(t[1] + $("#luckysheet-cell-main").scrollTop() - 5)
                  , n = a[0]
                  , o = a[1]
                  , l = a[2]
                  , i = colLocation(r)
                  , s = i[0]
                  , c = i[1]
                  , u = i[2];
                Store.luckysheet_cell_selected_extend_index = [l, u],
                $("#luckysheet-cell-selected-extend").css({
                    left: s,
                    width: c - s - 1,
                    top: n,
                    height: o - n - 1,
                    display: "block"
                })
            }
            ), 100),
            e.stopPropagation())
        }
        )).click((function() {
            clearTimeout(Store.luckysheet_cell_selected_extend_time),
            event.stopPropagation()
        }
        )).dblclick((function() {
            var e = Store.luckysheet_select_save[0]
              , t = e.row[0]
              , r = e.row[1]
              , a = e.column[0]
              , n = e.column[1];
            if (!pivotTable.isPivotRange(t, a)) {
                for (var o = !1, l = 0, i = r + 1; i < Store.flowdata.length; i++)
                    if (a - 1 >= 0 && n + 1 < Store.flowdata[0].length) {
                        var s = Store.flowdata[i][a - 1]
                          , c = Store.flowdata[i][n + 1];
                        if (i == r + 1) {
                            if ((null == s || isRealNull(s.v)) && (null == c || isRealNull(c.v))) {
                                o = !1;
                                break
                            }
                            o = !0,
                            l++
                        } else {
                            if ((null == s || isRealNull(s.v)) && (null == c || isRealNull(c.v)))
                                break;
                            l++
                        }
                    } else if (a - 1 >= 0) {
                        var u = Store.flowdata[i][a - 1];
                        if (i == r + 1) {
                            if (null == u || isRealNull(u.v)) {
                                o = !1;
                                break
                            }
                            o = !0,
                            l++
                        } else {
                            if (null == u || isRealNull(u.v))
                                break;
                            l++
                        }
                    } else if (n + 1 < Store.flowdata[0].length) {
                        var h = Store.flowdata[i][n + 1];
                        if (i == r + 1) {
                            if (null == h || isRealNull(h.v)) {
                                o = !1;
                                break
                            }
                            o = !0,
                            l++
                        } else {
                            if (null == h || isRealNull(h.v))
                                break;
                            l++
                        }
                    }
                if (o && 0 != l) {
                    luckysheetDropCell.copyRange = {
                        row: [t, r],
                        column: [a, n]
                    };
                    var d = luckysheetDropCell.typeItemHide();
                    d[0] || d[1] || d[2] || d[3] || d[4] || d[5] || d[6] ? luckysheetDropCell.applyType = "1" : luckysheetDropCell.applyType = "0",
                    luckysheetDropCell.applyRange = {
                        row: [r + 1, r + l],
                        column: [a, n]
                    },
                    luckysheetDropCell.direction = "down",
                    Store.luckysheet_select_save = [{
                        row: [t, r + l],
                        column: [a, n]
                    }],
                    luckysheetDropCell.update(),
                    luckysheetDropCell.createIcon(),
                    $("#luckysheet-cell-selected-move").hide(),
                    $("#luckysheet-sheettable").css("cursor", "default"),
                    clearTimeout(Store.countfuncTimeout),
                    Store.countfuncTimeout = setTimeout((function() {
                        countfunc()
                    }
                    ), 500),
                    event.stopPropagation()
                } else
                    event.stopPropagation()
            }
        }
        )),
        $("#luckysheet-bottom-add-row, #luckysheet-bottom-add-row-input, #luckysheet-bottom-return-top").on("mousedown dblclick mouseup", (function(e) {
            e.stopPropagation()
        }
        )),
        $("#luckysheet-bottom-add-row").on("click", (function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            $(this);
            var t = $("#luckysheet-bottom-add-row-input").val();
            "" == t && (t = 100),
            isNaN(parseInt(t)) ? isEditMode() ? alert(a.tipInputNumber) : tooltip.info("error", a.tipInputNumber) : (t = parseInt(t)) < 1 || t > 100 ? isEditMode() ? alert(a.tipInputNumberLimit) : tooltip.info("error", a.tipInputNumberLimit) : luckysheetextendtable("row", Store.flowdata.length - 1, t)
        }
        )),
        $("#luckysheet-bottom-return-top").on("click", (function(e) {
            $("#luckysheet-scrollbar-y").scrollTop(0)
        }
        )),
        $("#luckysheet-copy-btn, #luckysheet-cols-copy-btn, #luckysheet-paste-btn-title").click((function(e) {
            if ($(this).parent().hide(),
            null != Store.config.merge) {
                for (var t = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                    var n = Store.luckysheet_select_save[a].row[0]
                      , o = Store.luckysheet_select_save[a].row[1]
                      , l = Store.luckysheet_select_save[a].column[0]
                      , i = Store.luckysheet_select_save[a].column[1];
                    if (t = hasPartMC(Store.config, n, o, l, i))
                        break
                }
                if (t)
                    return void (isEditMode() ? alert(r.noPartMerge) : tooltip.info(r.noPartMerge, ""))
            }
            var s = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save;
            if (Store.luckysheet_select_save.length > 1 && null != s && s.length > 0) {
                var c = !1
                  , u = conditionformat.getComputeMap();
                e: for (var h = 0; h < Store.luckysheet_select_save.length && !c; h++)
                    for (var d = Store.luckysheet_select_save[h].row[0], f = Store.luckysheet_select_save[h].row[1], m = Store.luckysheet_select_save[h].column[0], p = Store.luckysheet_select_save[h].column[1], g = d; g <= f; g++)
                        for (var y = m; y <= p; y++)
                            if (null != conditionformat.checksCF(g, y, u)) {
                                c = !0;
                                continue e
                            }
                if (c)
                    return void (isEditMode() ? alert(r.noMulti) : tooltip.info(r.noMulti, ""))
            }
            if (Store.luckysheet_select_save.length > 1) {
                for (var v = !0, A = Store.luckysheet_select_save[0].row[0], b = Store.luckysheet_select_save[0].row[1], k = !0, w = Store.luckysheet_select_save[0].column[0], x = Store.luckysheet_select_save[0].column[1], S = 1; S < Store.luckysheet_select_save.length; S++)
                    Store.luckysheet_select_save[S].row[0] == A && Store.luckysheet_select_save[S].row[1] == b || (v = !1),
                    Store.luckysheet_select_save[S].column[0] == w && Store.luckysheet_select_save[S].column[1] == x || (k = !1);
                if (!v && !k || selectIsOverlap())
                    return void (isEditMode() ? alert(r.noMulti) : tooltip.info(r.noMulti, ""))
            }
            selection.copy(e)
        }
        )),
        $("#luckysheet-copy-paste, #luckysheet-cols-paste-btn, #luckysheet-paste-btn-title").click((function(e) {
            selection.paste(e, "btn"),
            $(this).parent().hide()
        }
        )),
        $("#luckysheet-chart-btn-title").click((function() {
            createLuckyChart()
        }
        )),
        $("#luckysheetdatavisual").click((function() {
            createLuckyChart(),
            $("#luckysheet-rightclick-menu").hide()
        }
        )),
        $("#luckysheet-pivot-btn-title").click((function(e) {
            checkProtectionAuthorityNormal(Store.currentSheetIndex, "usePivotTablereports") && pivotTable.createPivotTable(e)
        }
        )),
        $("#luckysheet-chart-btn-screenshot").click((function() {
            var e = t.screenshot;
            if (0 != Store.luckysheet_select_save.length)
                if (Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(e.screenshotTipHasMulti) : tooltip.info(e.screenshotTipTitle, e.screenshotTipHasMulti);
                else {
                    if (null != Store.config.merge) {
                        for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                            var n = Store.luckysheet_select_save[a].row[0]
                              , o = Store.luckysheet_select_save[a].row[1]
                              , l = Store.luckysheet_select_save[a].column[0]
                              , i = Store.luckysheet_select_save[a].column[1];
                            if (r = hasPartMC(Store.config, n, o, l, i))
                                break
                        }
                        if (r)
                            return void (isEditMode() ? alert(e.screenshotTipHasMerge) : tooltip.info(e.screenshotTipTitle, e.screenshotTipHasMerge))
                    }
                    var s, c, u, h, d = Store.luckysheet_select_save[0].row[0], f = Store.luckysheet_select_save[0].row[1], m = Store.luckysheet_select_save[0].column[0], p = Store.luckysheet_select_save[0].column[1];
                    d - 1 < 0 ? (s = 0,
                    c = Store.visibledatarow[f]) : (s = Store.visibledatarow[d - 1],
                    c = Store.visibledatarow[f] - Store.visibledatarow[d - 1]),
                    m - 1 < 0 ? (u = 0,
                    h = Store.visibledatacolumn[p]) : (u = Store.visibledatacolumn[m - 1],
                    h = Store.visibledatacolumn[p] - Store.visibledatacolumn[m - 1]);
                    var g = $("<canvas>").attr({
                        width: Math.ceil(h * devicePixelRatio),
                        height: Math.ceil(c * devicePixelRatio)
                    }).css({
                        width: h,
                        height: c
                    });
                    luckysheetDrawMain(u, s, h, c, 1, 1, null, null, g);
                    var y = g.get(0).getContext("2d");
                    y.beginPath(),
                    y.moveTo(0, 0),
                    y.lineTo(0, Store.devicePixelRatio * c),
                    y.lineWidth = 2 * Store.devicePixelRatio,
                    y.strokeStyle = luckysheetdefaultstyle.strokeStyle,
                    y.stroke(),
                    y.closePath(),
                    y.beginPath(),
                    y.moveTo(0, 0),
                    y.lineTo(Store.devicePixelRatio * h, 0),
                    y.lineWidth = 2 * Store.devicePixelRatio,
                    y.strokeStyle = luckysheetdefaultstyle.strokeStyle,
                    y.stroke(),
                    y.closePath();
                    var v = new Image
                      , A = g.get(0).toDataURL("image/png");
                    v.src = A,
                    h > c ? v.style.width = "100%" : v.style.height = "100%";
                    var b = $(window).height() - 200;
                    tooltip.screenshot(e.screenshotTipSuccess, '<div id="luckysheet-confirm-screenshot-save" style="height:' + b + 'px;overflow:auto;"></div>', A),
                    $("#luckysheet-confirm-screenshot-save").append(v),
                    g.remove()
                }
            else
                isEditMode() ? alert(e.screenshotTipNoSelection) : tooltip.info(e.screenshotTipTitle, e.screenshotTipNoSelection)
        }
        )),
        $(document).on("click.luckysheetEvent", "a.download", (function() {
            for (var e = $("#luckysheet-confirm-screenshot-save img").attr("src"), r = t.screenshot, a = atob(e.split(",")[1]), n = a.length, o = new Uint8Array(n), l = 0; l < n; l++)
                o[l] = a.charCodeAt(l);
            var i, s = new Blob([o]), c = document.createElement("a");
            c.setAttribute("href", URL.createObjectURL(s)),
            c.setAttribute("download", r.screenshotImageName + ".png"),
            c.style.display = "none",
            document.body.appendChild(c),
            c.click(),
            c.addEventListener("click", i = function() {
                requestAnimationFrame((function() {
                    URL.revokeObjectURL(c.href)
                }
                )),
                c.removeAttribute("href"),
                c.removeEventListener("click", i)
            }
            ),
            document.body.removeChild(c)
        }
        )),
        $("#luckysheet-splitColumn-btn-title").click((function() {
            if (checkProtectionNotEnable(Store.currentSheetIndex) && null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length) {
                var e = t.splitText;
                Store.luckysheet_select_save.length > 1 ? tooltip.info(e.tipNoMulti, "") : Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1] ? (luckysheetSplitColumn.createDialog(),
                luckysheetSplitColumn.init()) : tooltip.info(e.tipNoMultiColumn, "")
            }
        }
        )),
        $("#luckysheet-insertImg-btn-title").click((function() {
            checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects") && $("#luckysheet-imgUpload").click()
        }
        )),
        $("#luckysheetInsertImage").click((function() {
            checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects") && ($("#luckysheet-imgUpload").click(),
            $("#luckysheet-rightclick-menu").hide())
        }
        )),
        $("#luckysheet-imgUpload").click((function(e) {
            e.stopPropagation()
        }
        )),
        $("#luckysheet-imgUpload").on("change", (function(e) {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects", !1)) {
                var t = e.currentTarget.files[0]
                  , r = new FileReader;
                r.readAsDataURL(t),
                r.onload = function(e) {
                    var t = e.target.result;
                    imageCtrl.inserImg(t),
                    $("#luckysheet-imgUpload").val("")
                }
            }
        }
        )),
        $("#luckysheet-insertLink-btn-title").click((function() {
            checkProtectionNotEnable(Store.currentSheetIndex) && null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length && (hyperlinkCtrl.createDialog(),
            hyperlinkCtrl.init())
        }
        )),
        $("#luckysheetInsertLink").click((function() {
            $("#luckysheet-insertLink-btn-title").click(),
            $("#luckysheet-rightclick-menu").hide()
        }
        )),
        $("#luckysheet-dataVerification-btn-title").click((function() {
            checkProtectionNotEnable(Store.currentSheetIndex) && null != Store.luckysheet_select_save && 0 != Store.luckysheet_select_save.length && (dataVerificationCtrl.createDialog(),
            dataVerificationCtrl.init())
        }
        )),
        $("#luckysheetDataVerification").click((function() {
            $("#luckysheet-dataVerification-btn-title").click(),
            $("#luckysheet-rightclick-menu").hide()
        }
        )),
        $("#luckysheetCellFormatRightClickMenu").click((function() {
            openCellFormatModel()
        }
        )),
        $("#luckysheet-freezen-btn-horizontal").click((function() {
            $.trim($(this).text()) == locale().freezen.freezenCancel ? (luckysheetFreezen.saveFrozen("freezenCancel"),
            null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            luckysheetFreezen.scrollAdapt()) : (luckysheetFreezen.saveFrozen("freezenRow"),
            null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            null == luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.createFreezenHorizontal(),
            luckysheetFreezen.createAssistCanvas()))
        }
        )),
        $("#luckysheet-freezen-btn-vertical").click((function() {
            null != luckysheetFreezen.freezenverticaldata ? (luckysheetFreezen.saveFrozen("freezenCancel"),
            luckysheetFreezen.cancelFreezenVertical(),
            luckysheetrefreshgrid()) : (luckysheetFreezen.saveFrozen("freezenColumn"),
            luckysheetFreezen.createFreezenVertical()),
            luckysheetFreezen.createAssistCanvas()
        }
        )),
        $("#luckysheet-rightclick-menu input").on("keydown", (function(e) {
            e.stopPropagation()
        }
        )),
        $("#luckysheet-modal-dialog-mask").on("click dbclick mousedown mousemove mouseup", (function(e) {
            e.stopPropagation(),
            e.preventDefault()
        }
        ));
        $(document).on("visibilitychange.luckysheetEvent webkitvisibilitychange.luckysheetEvent msvisibilitychange.luckysheetEvent", (function() {
            (document.hidden || document.webkitHidden || document.msHidden) && (Store.iscopyself = !1)
        }
        )).on("mouseleave.luckysheetEvent", (function() {
            Store.iscopyself = !1
        }
        )).on("mousedown.luckysheetEvent", (function(e) {
            luckysheetPostil.removeActivePs(),
            hideMenuByCancel(e),
            $(e.target).closest("#luckysheet-wa-editor").length > 0 && parseInt($("#luckysheet-input-box").css("top")) > 0 && (console.log(e),
            luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"))
        }
        )),
        $("#luckysheet-left-top").mousedown((function(e) {
            checkProtectionAllSelected(Store.currentSheetIndex) && ($("#luckysheet-wa-functionbox-confirm").click(),
            Store.luckysheet_select_status = !1,
            Store.luckysheet_select_save = [{
                row: [0, Store.flowdata.length - 1],
                column: [0, Store.flowdata[0].length - 1],
                row_focus: 0,
                column_focus: 0
            }],
            selectHightlightShow(),
            clearTimeout(Store.countfuncTimeout),
            Store.countfuncTimeout = setTimeout((function() {
                countfunc()
            }
            ), 500),
            e.stopPropagation())
        }
        )),
        $("#luckysheet-icon-undo").click((function(e) {
            controlHistory.redo(e)
        }
        )),
        $("#luckysheet-icon-redo").click((function(e) {
            controlHistory.undo(e)
        }
        )),
        $(document).on("mousedown.luckysheetEvent", "div.luckysheet-modal-dialog", (function(e) {
            if ($(e.target).is(".luckysheet-modal-dialog")) {
                Store.luckysheet_model_move_state = !0,
                Store.luckysheet_model_move_obj = $(e.currentTarget);
                var t = Store.luckysheet_model_move_obj.offset();
                Store.luckysheet_model_xy = [e.pageX - t.left, e.pageY - t.top]
            }
        }
        )),
        $(document).on("click.luckysheetEvent", ".luckysheet-modal-dialog-title-close, .luckysheet-model-close-btn", (function(e) {
            ($("#textcolorselect").is(":visible") || $("#cellcolorselect").is(":visible")) && $("#luckysheet-conditionformat-dialog").show(),
            $(e.currentTarget).parents(".luckysheet-modal-dialog").hide(),
            $("#luckysheet-modal-dialog-mask").hide(),
            $(this).parents(".luckysheet-modal-dialog").hasClass("luckysheet-search-formula") && (luckysheetformula.dontupdate(),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect")),
            $(this).parents(".luckysheet-modal-dialog").hasClass("luckysheet-search-formula-parm") && (luckysheetformula.dontupdate(),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect")),
            $(this).parents(".luckysheet-modal-dialog").hasClass("luckysheet-search-formula-parm-select") && (luckysheetformula.dontupdate(),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect")),
            luckysheetContainerFocus()
        }
        )),
        $("#luckysheet_info_detail_title").click((function() {
          console.log(luckysheetConfigsetting.myFolderUrl);
            window.open(luckysheetConfigsetting.myFolderUrl, "_self")
        }
        )),
        $("#luckysheet-chart-rangeShow").on("mousedown.chartRangeShowMove", ".luckysheet-chart-rangeShow-move", (function(e) {
            Store.chart_selection.rangeMove = !0,
            Store.luckysheet_scroll_status = !0,
            Store.chart_selection.rangeMoveObj = $(this).parent();
            var t = Store.currentChart
              , r = $(this).parent().attr("id");
            if ("luckysheet-chart-rangeShow-content" == r) {
                var a = t.rangeArray[0].row[0] + t.rangeSplitArray.content.row[0]
                  , n = t.rangeArray[0].column[0] + t.rangeSplitArray.content.column[0];
                Store.chart_selection.rangeMoveIndex = [a, n]
            } else if ("luckysheet-chart-rangeShow-rowtitle" == r) {
                var o = t.rangeArray[0].row[0] + t.rangeSplitArray.rowtitle.row[0]
                  , l = t.rangeArray[0].column[0] + t.rangeSplitArray.rowtitle.column[0];
                Store.chart_selection.rangeMoveIndex = [o, l]
            } else if ("luckysheet-chart-rangeShow-coltitle" == r) {
                var i = t.rangeArray[0].row[0] + t.rangeSplitArray.coltitle.row[0]
                  , s = t.rangeArray[0].column[0] + t.rangeSplitArray.coltitle.column[0];
                Store.chart_selection.rangeMoveIndex = [i, s]
            }
            var c = mouseposition(e.pageX, e.pageY)
              , u = c[0] + $("#luckysheet-cell-main").scrollLeft()
              , h = c[1] + $("#luckysheet-cell-main").scrollTop()
              , d = $(this).data("type");
            "top" == d ? h += 3 : "right" == d ? u -= 3 : "bottom" == d ? h -= 3 : "left" == d && (u += 3);
            var f = rowLocation(h)[2]
              , m = colLocation(u)[2];
            Store.chart_selection.rangeMovexy = [f, m],
            e.stopPropagation()
        }
        )),
        $("#luckysheet-chart-rangeShow").on("mousedown.chartRangeShowResize", ".luckysheet-chart-rangeShow-resize", (function(e) {
            Store.chart_selection.rangeResize = $(this).data("type"),
            Store.luckysheet_scroll_status = !0,
            Store.chart_selection.rangeResizeObj = $(this).parent();
            var t, r, a, n, o = Store.currentChart, l = $(this).parent().attr("id");
            if ("luckysheet-chart-rangeShow-content" == l)
                o.rangeRowCheck.exits ? (t = o.rangeArray[0].row[0] + o.rangeSplitArray.content.row[0],
                r = o.rangeArray[0].row[0] + o.rangeSplitArray.content.row[1]) : (t = o.rangeSplitArray.content.row[0],
                r = o.rangeSplitArray.content.row[0]),
                o.rangeColCheck.exits ? (a = o.rangeArray[0].column[0] + o.rangeSplitArray.content.column[0],
                n = o.rangeArray[0].column[0] + o.rangeSplitArray.content.column[1]) : (a = o.rangeSplitArray.content.column[0],
                n = o.rangeSplitArray.content.column[1]),
                Store.chart_selection.rangeResizeIndex = {
                    row: [t, r],
                    column: [a, n]
                };
            else if ("luckysheet-chart-rangeShow-rowtitle" == l) {
                var i = o.rangeArray[0].row[0] + o.rangeSplitArray.rowtitle.row[0]
                  , s = o.rangeArray[0].row[0] + o.rangeSplitArray.rowtitle.row[1]
                  , c = o.rangeArray[0].column[0] + o.rangeSplitArray.rowtitle.column[0]
                  , u = o.rangeArray[0].column[0] + o.rangeSplitArray.rowtitle.column[1];
                Store.chart_selection.rangeResizeIndex = {
                    row: [i, s],
                    column: [c, u]
                }
            } else if ("luckysheet-chart-rangeShow-coltitle" == l) {
                var h = o.rangeArray[0].row[0] + o.rangeSplitArray.coltitle.row[0]
                  , d = o.rangeArray[0].row[0] + o.rangeSplitArray.coltitle.row[1]
                  , f = o.rangeArray[0].column[0] + o.rangeSplitArray.coltitle.column[0]
                  , m = o.rangeArray[0].column[0] + o.rangeSplitArray.coltitle.column[1];
                Store.chart_selection.rangeResizeIndex = {
                    row: [h, d],
                    column: [f, m]
                }
            }
            var p = mouseposition(e.pageX, e.pageY)
              , g = p[0] + $("#luckysheet-cell-main").scrollLeft()
              , y = p[1] + $("#luckysheet-cell-main").scrollTop();
            "lt" == Store.chart_selection.rangeResize ? (g += 3,
            y += 3) : "lb" == Store.chart_selection.rangeResize ? (g += 3,
            y -= 3) : "rt" == Store.chart_selection.rangeResize ? (g -= 3,
            y += 3) : "rb" == Store.chart_selection.rangeResize && (g -= 3,
            y -= 3);
            var v = rowLocation(y)[2]
              , A = colLocation(g)[2];
            Store.chart_selection.rangeResizexy = [v, A],
            e.stopPropagation()
        }
        )),
        $("#luckysheet-wa-calculate-size").mousedown((function(e) {
            var t = e.pageY;
            luckysheetformula.functionResizeData.y = t,
            luckysheetformula.functionResizeStatus = !0,
            luckysheetformula.functionResizeData.calculatebarHeight = Store.calculatebarHeight,
            null != luckysheetformula.rangetosheet && luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1])
        }
        )),
        menuButton.initialMenuButton();
        document.getElementById("testdpidiv").offsetWidth,
        Store.devicePixelRatio,
        document.getElementById("testdpidiv").offsetHeight,
        Store.devicePixelRatio;
        $(document).on("paste.luckysheetEvent", (function(e) {
            if (!isEditMode() && selection.isPasteAction) {
                $("#luckysheet-rich-text-editor").blur(),
                selection.isPasteAction = !1;
                var t = window.clipboardData;
                t || (t = e.originalEvent.clipboardData);
                var r = t.getData("text/html")
                  , a = !0;
                if (r.indexOf("luckysheet_copy_action_table") > -1 && null != Store.luckysheet_copy_save.copyRange && Store.luckysheet_copy_save.copyRange.length > 0) {
                    for (var n = [], o = new RegExp("<tr.*?>(.*?)</tr>","g"), l = new RegExp("<td.*?>(.*?)</td>","g"), i = r.match(o), s = 0; s < i.length; s++) {
                        var c = []
                          , u = i[s].match(l);
                        if (null != u)
                            for (var h = 0; h < u.length; h++) {
                                var d = u[h].replace(/<td.*?>/g, "").replace(/<\/td>/g, "");
                                c.push(d)
                            }
                        n.push(c)
                    }
                    var f, m = Store.luckysheet_copy_save.copyRange[0].row[0], p = Store.luckysheet_copy_save.copyRange[0].row[1], g = Store.luckysheet_copy_save.copyRange[0].column[0], y = Store.luckysheet_copy_save.copyRange[0].column[1], v = Store.luckysheet_copy_save.dataSheetIndex;
                    f = v == Store.currentSheetIndex ? editor.deepCopyFlowData(Store.flowdata) : Store.luckysheetfile[getSheetIndex(v)].data;
                    for (var A = m; A <= p && !(A - m > n.length - 1); A++)
                        for (var b = g; b <= y; b++) {
                            var k = f[A][b];
                            if (null == k || null == k.mc || null != k.mc.rs) {
                                var w = void 0;
                                if (null == (w = null != k ? null != k.ct && k.ct.fa.indexOf("w") > -1 ? f[A][b].v : f[A][b].m : "") && (w = ""),
                                n[A - m][b - g] != w) {
                                    a = !1;
                                    break
                                }
                            }
                        }
                }
                var x = locale().fontjson;
                if (r.indexOf("luckysheet_copy_action_table") > -1 && null != Store.luckysheet_copy_save.copyRange && Store.luckysheet_copy_save.copyRange.length > 0 && a)
                    Store.luckysheet_paste_iscut ? (Store.luckysheet_paste_iscut = !1,
                    selection.pasteHandlerOfCutPaste(Store.luckysheet_copy_save),
                    selection.clearcopy(e)) : selection.pasteHandlerOfCopyPaste(Store.luckysheet_copy_save);
                else if (r.indexOf("luckysheet_copy_action_image") > -1)
                    imageCtrl.pasteImgItem();
                else if (r.indexOf("table") > -1) {
                    $("#luckysheet-copy-content").html(r);
                    var S = new Array($("#luckysheet-copy-content").find("table tr").length)
                      , _ = 0;
                    $("#luckysheet-copy-content").find("table tr").eq(0).find("td").each((function() {
                        var e = parseInt($(this).attr("colspan"));
                        isNaN(e) && (e = 1),
                        _ += e
                    }
                    ));
                    for (var C = 0; C < S.length; C++)
                        S[C] = new Array(_);
                    var T = 0
                      , E = {};
                    $("#luckysheet-copy-content").find("table tr").each((function() {
                        var e = $(this)
                          , t = 0;
                        e.find("td").each((function() {
                            var e = $(this)
                              , r = {}
                              , a = e.text();
                            if (0 == $.trim(a).length)
                                r.v = null,
                                r.m = "";
                            else {
                                var n = genarate(e.text());
                                r.v = n[2],
                                r.ct = n[1],
                                r.m = n[0]
                            }
                            var o = e.css("background-color");
                            "rgba(0, 0, 0, 0)" == o && (o = null),
                            r.bg = o;
                            var l = e.css("font-weight");
                            r.bl = 400 == l || "normal" == l ? 0 : 1;
                            var i = e.css("font-style");
                            r.it = "normal" == i ? 0 : 1;
                            for (var s = e.css("font-family").split(","), c = 0; c < s.length; c++) {
                                var u = $.trim(s[c].toLowerCase());
                                if (null != (u = x[u])) {
                                    r.ff = u;
                                    break
                                }
                                r.ff = 0
                            }
                            var h = Math.floor(72 * parseInt(e.css("font-size")) / 96) + 1;
                            r.fs = h;
                            var d = e.css("color");
                            r.fc = d;
                            var f = e.css("text-align");
                            r.ht = "center" == f ? 0 : "right" == f ? 2 : 1;
                            var m = e.css("vertical-align");
                            for (r.vt = "middle" == m ? 0 : "top" == m || "text-top" == m ? 1 : 2; t < _ && null != S[T][t]; )
                                t++;
                            if (t == _)
                                return !0;
                            if (null == S[T][t]) {
                                S[T][t] = r;
                                var p = parseInt(e.attr("rowspan"))
                                  , g = parseInt(e.attr("colspan"));
                                isNaN(p) && (p = 1),
                                isNaN(g) && (g = 1);
                                for (var y = Store.luckysheet_select_save[0].row[0] + T, v = Store.luckysheet_select_save[0].column[0] + t, A = 0; A < p; A++)
                                    for (var b = 0; b < g; b++) {
                                        if (0 == A) {
                                            var k = e.css("border-top");
                                            if (null != k && k.length > 0 && "0px" != k.substr(0, 3).toLowerCase()) {
                                                var w = e.css("border-top-width")
                                                  , C = e.css("border-top-style")
                                                  , I = e.css("border-top-color")
                                                  , R = menuButton.getQKBorder(w, C, I);
                                                null == E[T + A + "_" + (t + b)] && (E[T + A + "_" + (t + b)] = {}),
                                                E[T + A + "_" + (t + b)].t = {
                                                    style: R[0],
                                                    color: R[1]
                                                }
                                            }
                                        }
                                        if (A == p - 1) {
                                            var B = e.css("border-bottom");
                                            if (null != B && B.length > 0 && "0px" != B.substr(0, 3).toLowerCase()) {
                                                var N = e.css("border-bottom-width")
                                                  , F = e.css("border-bottom-style")
                                                  , P = e.css("border-bottom-color")
                                                  , L = menuButton.getQKBorder(N, F, P);
                                                null == E[T + A + "_" + (t + b)] && (E[T + A + "_" + (t + b)] = {}),
                                                E[T + A + "_" + (t + b)].b = {
                                                    style: L[0],
                                                    color: L[1]
                                                }
                                            }
                                        }
                                        if (0 == b) {
                                            var O = e.css("border-left");
                                            if (null != O && O.length > 0 && "0px" != O.substr(0, 3).toLowerCase()) {
                                                var D = e.css("border-left-width")
                                                  , M = e.css("border-left-style")
                                                  , U = e.css("border-left-color")
                                                  , H = menuButton.getQKBorder(D, M, U);
                                                null == E[T + A + "_" + (t + b)] && (E[T + A + "_" + (t + b)] = {}),
                                                E[T + A + "_" + (t + b)].l = {
                                                    style: H[0],
                                                    color: H[1]
                                                }
                                            }
                                        }
                                        if (b == g - 1) {
                                            var q = e.css("border-right");
                                            if (null != q && q.length > 0 && "0px" != q.substr(0, 3).toLowerCase()) {
                                                var z = e.css("border-right-width")
                                                  , j = e.css("border-right-style")
                                                  , V = e.css("border-right-color")
                                                  , Q = menuButton.getQKBorder(z, j, V);
                                                null == E[T + A + "_" + (t + b)] && (E[T + A + "_" + (t + b)] = {}),
                                                E[T + A + "_" + (t + b)].r = {
                                                    style: Q[0],
                                                    color: Q[1]
                                                }
                                            }
                                        }
                                        0 == A && 0 == b || (S[T + A][t + b] = {
                                            mc: {
                                                r: y,
                                                c: v
                                            }
                                        })
                                    }
                                if (p > 1 || g > 1) {
                                    var G = {
                                        rs: p,
                                        cs: g,
                                        r: y,
                                        c: v
                                    };
                                    S[T][t].mc = G
                                }
                            }
                            return ++t == _ || void 0
                        }
                        )),
                        T++
                    }
                    )),
                    Store.luckysheet_selection_range = [],
                    selection.pasteHandler(S, E),
                    $("#luckysheet-copy-content").empty()
                } else {
                    if (1 == t.files.length && t.files[0].type.indexOf("image") > -1) {
                        var I = new FileReader;
                        return I.readAsDataURL(t.files[0]),
                        void (I.onload = function(e) {
                            var t = e.target.result;
                            imageCtrl.inserImg(t)
                        }
                        )
                    }
                    r = t.getData("text/plain"),
                    selection.pasteHandler(r)
                }
            }
        }
        )),
        luckysheetConfigsetting.enablePage && $("#luckysheet-bottom-page-next").click((function() {
            var e = luckysheetConfigsetting.pageInfo.queryExps
              , t = luckysheetConfigsetting.pageInfo.reportId
              , r = luckysheetConfigsetting.pageInfo.fields
              , n = luckysheetConfigsetting.pageInfo.mobile
              , o = luckysheetConfigsetting.pageInfo.frezon
              , l = luckysheetConfigsetting.pageInfo.currentPage
              , i = (luckysheetConfigsetting.pageInfo.totalPage,
            luckysheetConfigsetting.pageInfo.pageUrl);
            method.addDataAjax({
                queryExps: e,
                reportId: t,
                fields: r,
                mobile: n,
                frezon: o,
                pageIndex: l,
                currentPage: l
            }, Store.currentSheetIndex, i, (function() {
                if (luckysheetConfigsetting.pageInfo.currentPage++,
                luckysheetConfigsetting.pageInfo.totalPage == luckysheetConfigsetting.pageInfo.currentPage) {
                    $("#luckysheet-bottom-page-next").hide();
                    var e = replaceHtml$1(a.pageInfoFull, {
                        total: luckysheetConfigsetting.total,
                        totalPage: luckysheetConfigsetting.pageInfo.totalPage
                    });
                    $("#luckysheet-bottom-page-info").html(e)
                } else {
                    var t = replaceHtml$1(a.pageInfo, {
                        total: luckysheetConfigsetting.total,
                        totalPage: luckysheetConfigsetting.pageInfo.totalPage,
                        currentPage: luckysheetConfigsetting.pageInfo.currentPage
                    });
                    $("#luckysheet-bottom-page-info").html(t)
                }
            }
            ))
        }
        )).mousedown((function(e) {
            e.stopPropagation()
        }
        )),
        $("#luckysheet-bottom-bottom-top").click((function() {
            $("#luckysheet-scrollbar-y").scrollTop(0)
        }
        )).mousedown((function(e) {
            e.stopPropagation()
        }
        ))
    }
    var mathSign = Math.sign || function(e) {
        return 0 == (e = +e) || e != e ? e : e < 0 ? -1 : 1
    }
      , abs$1 = Math.abs
      , pow$3 = Math.pow;
    function initialMatrixOperation() {
        var e = locale().drag;
        $("#luckysheet-copy-json-head").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    if (1 == s.length) {
                        for (var u = {}, h = 0; h < s[0].length; h++)
                            u[getcellvalue(0, h, s)] = "";
                        c.push(u)
                    } else
                        for (var d = 1; d < s.length; d++) {
                            for (var f = {}, m = 0; m < s[0].length; m++)
                                null == getcellvalue(0, m, s) ? f[""] = getcellvalue(d, m, s) : f[getcellvalue(0, m, s)] = getcellvalue(d, m, s);
                            c.push(f)
                        }
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-json-nohead").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = Store.luckysheet_select_save[0].column[0], h = 0; h < s.length; h++) {
                        for (var d = {}, f = 0; f < s[0].length; f++)
                            d[chatatABC(f + u)] = getcellvalue(h, f, s);
                        c.push(d)
                    }
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-array1").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = 0; u < s.length; u++)
                        for (var h = 0; h < s[0].length; h++)
                            c.push(getcellvalue(u, h, s));
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-array2").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = 0; u < s.length; u++) {
                        for (var h = [], d = 0; d < s[0].length; d++)
                            h.push(getcellvalue(u, d, s));
                        c.push(h)
                    }
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-arraymore-confirm").click((function(t) {
            if ("INPUT" !== t.target.nodeName)
                if ($("body .luckysheet-cols-menu").hide(),
                Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
                else {
                    if (null != Store.config.merge) {
                        for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                            var n = Store.luckysheet_select_save[a].row[0]
                              , o = Store.luckysheet_select_save[a].row[1]
                              , l = Store.luckysheet_select_save[a].column[0]
                              , i = Store.luckysheet_select_save[a].column[1];
                            if (r = hasPartMC(Store.config, n, o, l, i))
                                break
                        }
                        if (r)
                            return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                    }
                    var s = getdatabyselection(Store.luckysheet_select_save[0])
                      , c = [];
                    if (0 != s.length) {
                        for (var u = 0; u < s.length; u++)
                            for (var h = 0; h < s[0].length; h++)
                                c.push(s[u][h]);
                        var d = $("#luckysheet-copy-arraymore-row").val()
                          , f = $("#luckysheet-copy-arraymore-col").val();
                        if ("" == d && "" == f)
                            return selection.copybyformat(t, JSON.stringify(c)),
                            void $("body .luckysheet-cols-menu").hide();
                        if (("" == d || null == (d = parseInt(d))) && (d = 1),
                        ("" == f || null == (f = parseInt(f))) && (f = 1),
                        "NaN" != d.toString() && "NaN" != f.toString())
                            if (d < 1 || f < 1)
                                isEditMode() ? alert(e.notLessOne) : tooltip.info(e.notLessOne, "");
                            else {
                                for (var m = c.length, p = 0, g = [], y = 0; y < d; y++) {
                                    for (var v = [], A = 0; A < f; A++)
                                        if (v.push(c[p++]),
                                        p >= m)
                                            return selection.copybyformat(t, JSON.stringify(g)),
                                            void $("body .luckysheet-cols-menu").hide();
                                    g.push(v)
                                }
                                selection.copybyformat(t, JSON.stringify(g))
                            }
                        else
                            isEditMode() ? alert(e.inputCorrect) : tooltip.info(e.inputCorrect, "")
                    }
                }
        }
        )),
        $("#luckysheet-copy-diagonal").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = s[0].length, h = 0; h < s.length && !(h >= u); h++)
                        c.push(s[h][h]);
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-antidiagonal").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = s[0].length, h = 0; h < s.length && !(h >= u); h++)
                        c.push(s[h][u - h - 1]);
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-copy-diagonaloffset").click((function(t) {
            if ("INPUT" !== t.target.nodeName)
                if ($("body .luckysheet-cols-menu").hide(),
                luckysheetContainerFocus(),
                Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
                else {
                    if (null != Store.config.merge) {
                        for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                            var n = Store.luckysheet_select_save[a].row[0]
                              , o = Store.luckysheet_select_save[a].row[1]
                              , l = Store.luckysheet_select_save[a].column[0]
                              , i = Store.luckysheet_select_save[a].column[1];
                            if (r = hasPartMC(Store.config, n, o, l, i))
                                break
                        }
                        if (r)
                            return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                    }
                    var s = getdatabyselection(Store.luckysheet_select_save[0])
                      , c = [];
                    if (0 != s.length) {
                        var u = s[0].length
                          , h = parseInt($("#luckysheet-copy-diagonaloffset-value").val());
                        if ("NaN" != h.toString())
                            if (h < 0)
                                isEditMode() ? alert(e.offsetColumnLessZero) : tooltip.info(e.offsetColumnLessZero, "");
                            else {
                                null == h && (h = 1);
                                for (var d = 0; d < s.length && !(d + h >= u); d++)
                                    c.push(s[d][d + h]);
                                selection.copybyformat(t, JSON.stringify(c))
                            }
                        else
                            isEditMode() ? alert(e.inputCorrect) : tooltip.info(e.inputCorrect, "")
                    }
                }
        }
        )),
        $("#luckysheet-copy-boolvalue").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                if (null != Store.config.merge) {
                    for (var r = !1, a = 0; a < Store.luckysheet_select_save.length; a++) {
                        var n = Store.luckysheet_select_save[a].row[0]
                          , o = Store.luckysheet_select_save[a].row[1]
                          , l = Store.luckysheet_select_save[a].column[0]
                          , i = Store.luckysheet_select_save[a].column[1];
                        if (r = hasPartMC(Store.config, n, o, l, i))
                            break
                    }
                    if (r)
                        return void (isEditMode() ? alert(e.noPartMerge) : tooltip.info(e.noPartMerge, ""))
                }
                var s = getdatabyselection(Store.luckysheet_select_save[0])
                  , c = [];
                if (0 != s.length) {
                    for (var u = 0; u < s.length; u++) {
                        for (var h = [], d = 0; d < s[0].length; d++) {
                            var f = !1
                              , m = void 0;
                            f = null != (m = "object" == getObjType(s[u][d]) ? s[u][d].v : s[u][d]) && "" != m && (null == (m = parseInt(m)) || m > 0),
                            h.push(f)
                        }
                        c.push(h)
                    }
                    selection.copybyformat(t, JSON.stringify(c))
                }
            }
        }
        )),
        $("#luckysheet-matrix-turn-up").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r.length - 1; n >= 0; n--) {
                        for (var o = [], l = 0; l < r[0].length; l++) {
                            var i = "";
                            null != r[n] && null != r[n][l] && (i = r[n][l]),
                            o.push(i)
                        }
                        a.push(o)
                    }
                    editor.controlHandler(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-turn-left").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = 0; n < r.length; n++) {
                        for (var o = [], l = r[0].length - 1; l >= 0; l--) {
                            var i = "";
                            null != r[n] && null != r[n][l] && (i = r[n][l]),
                            o.push(i)
                        }
                        a.push(o)
                    }
                    editor.controlHandler(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-turn-cw").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = 0; n < r[0].length; n++) {
                        for (var o = [], l = r.length - 1; l >= 0; l--) {
                            var i = "";
                            null != r[l] && null != r[l][n] && (i = r[l][n]),
                            o.push(i)
                        }
                        a.push(o)
                    }
                    editor.controlHandlerD(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-turn-anticw").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r[0].length - 1; n >= 0; n--) {
                        for (var o = [], l = 0; l < r.length; l++) {
                            var i = "";
                            null != r[l] && null != r[l][n] && (i = r[l][n]),
                            o.push(i)
                        }
                        a.push(o)
                    }
                    editor.controlHandlerD(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-turn-trans").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = 0; n < r[0].length; n++) {
                        for (var o = [], l = 0; l < r.length; l++) {
                            var i = "";
                            null != r[l] && null != r[l][n] && (i = r[l][n]),
                            o.push(i)
                        }
                        a.push(o)
                    }
                    editor.controlHandlerD(a)
                }
            }
        }
        ));
        var t = function(e, t) {
            if (0 == e)
                return 0;
            var r, a;
            for (a = (t - 1) * (r = e) / t + e / (Math.pow(r, t - 1) * t); Math.abs(a - r) > 1e-6; )
                a = (t - 1) * (r = a) / t + e / (Math.pow(r, t - 1) * t);
            return a
        };
        $("#luckysheet-matrix-cal-confirm").click((function(r) {
            if ("INPUT" !== r.target.nodeName && "SELECT" !== r.target.nodeName)
                if ($("body .luckysheet-cols-menu").hide(),
                luckysheetContainerFocus(),
                Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
                else {
                    var a = getdatabyselection(Store.luckysheet_select_save[0]);
                    if (0 != a.length) {
                        var n = $("#luckysheet-matrix-cal-type").val()
                          , o = parseInt($("#luckysheet-matrix-cal-value").val());
                        if ("NaN" != o.toString()) {
                            null == o && (o = 2);
                            for (var l = [], i = 0; i < a.length; i++) {
                                for (var s = [], c = 0; c < a[0].length; c++) {
                                    var u = "";
                                    null != a[i] && null != a[i][c] && (u = a[i][c],
                                    null != parseInt(u) && null != a[i][c].ct && "n" == a[i][c].ct.t && ("minus" == n ? u.v = u.v - o : "multiply" == n ? u.v = u.v * o : "divided" == n ? u.v = numFormat$1(u.v / o, 4) : "power" == n ? u.v = Math.pow(u.v, o) : "root" == n ? 2 == o ? u.v = numFormat$1(Math.sqrt(u.v), 4) : 3 == o && Math.cbrt ? u.v = numFormat$1(Math.cbrt(u.v), 4) : u.v = numFormat$1(t(u.v, o), 4) : u.v = "log" == n ? numFormat$1(1e4 * Math.log(u.v) / Math.log(Math.abs(o)), 4) : u.v + o,
                                    null == u.v ? u.m = "" : u.m = u.v.toString())),
                                    s.push(u)
                                }
                                l.push(s)
                            }
                            editor.controlHandler(l)
                        } else
                            isEditMode() ? alert(e.inputCorrect) : tooltip.info(e.inputCorrect, "")
                    }
                }
        }
        )),
        $("#luckysheet-matrix-delezero-row").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r[0].length, o = 0; o < r.length; o++) {
                        for (var l = [], i = !0, s = !0, c = 0; c < n; c++) {
                            var u = "";
                            if (null != r[o] && null != r[o][c]) {
                                if (("0" == (u = r[o][c]).v || 0 == u.v) && i)
                                    continue;
                                i = !1
                            }
                            l.push(u)
                        }
                        var h = [];
                        if (l.length == n)
                            h = l;
                        else {
                            for (var d = l.length - 1; d >= 0; d--) {
                                var f = "";
                                if (null != l[d]) {
                                    if (("0" == (f = l[d]).v || 0 == f.v) && s)
                                        continue;
                                    s = !1
                                }
                                h.unshift(f)
                            }
                            for (var m = n - h.length, p = 0; p < m; p++)
                                h.push("")
                        }
                        a.push(h)
                    }
                    editor.controlHandler(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-delezero-column").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r.length, o = r[0].length, l = 0; l < o; l++) {
                        for (var i = [], s = !0, c = !0, u = 0; u < n; u++) {
                            var h = "";
                            if (null != r[u] && null != r[u][l]) {
                                if (("0" == (h = r[u][l]).v || 0 == h.v) && s)
                                    continue;
                                s = !1
                            }
                            i.push(h)
                        }
                        var d = [];
                        if (i.length == n)
                            d = i;
                        else {
                            for (var f = i.length - 1; f >= 0; f--) {
                                var m = "";
                                if (null != i[f]) {
                                    if (("0" == (m = i[f]).v || 0 == m.v) && c)
                                        continue;
                                    c = !1
                                }
                                d.unshift(m)
                            }
                            for (var p = n - d.length, g = 0; g < p; g++)
                                d.push("")
                        }
                        a.push(d)
                    }
                    for (var y = [], v = 0; v < a[0].length; v++) {
                        for (var A = [], b = 0; b < a.length; b++) {
                            var k = "";
                            null != a[b] && null != a[b][v] && (k = a[b][v]),
                            A.push(k)
                        }
                        y.push(A)
                    }
                    editor.controlHandler(y)
                }
            }
        }
        )),
        $("#luckysheet-matrix-delerpt-row").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r[0].length, o = 0; o < r.length; o++) {
                        for (var l = [], i = {}, s = 0; s < n; s++) {
                            var c = null;
                            null != r[o] && null != r[o][s] && ((c = r[o][s]).v in i || (i[c.v] = []),
                            i[c.v].push(c))
                        }
                        for (var u = 0; u < n; u++) {
                            var h = null;
                            null != r[o] && null != r[o][u] && 1 == i[(h = r[o][u]).v].length && l.push(h)
                        }
                        for (var d = n - l.length, f = 0; f < d; f++)
                            l.push(null);
                        a.push(l)
                    }
                    editor.controlHandler(a)
                }
            }
        }
        )),
        $("#luckysheet-matrix-delerpt-column").click((function(t) {
            if ($("body .luckysheet-cols-menu").hide(),
            luckysheetContainerFocus(),
            Store.luckysheet_select_save.length > 1)
                isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "");
            else {
                var r = getdatabyselection(Store.luckysheet_select_save[0]);
                if (0 != r.length) {
                    for (var a = [], n = r.length, o = r[0].length, l = 0; l < o; l++) {
                        for (var i = [], s = {}, c = 0; c < n; c++) {
                            var u = null;
                            null != r[c] && null != r[c][l] && ((u = r[c][l]).v in s || (s[u.v] = []),
                            s[u.v].push(u))
                        }
                        for (var h = 0; h < n; h++) {
                            var d = null;
                            null != r[h] && null != r[h][l] && 1 == s[(d = r[h][l]).v].length && i.push(d)
                        }
                        a1 = i;
                        for (var f = n - a1.length, m = 0; m < f; m++)
                            a1.push(null);
                        a.push(a1)
                    }
                    for (var p = [], g = 0; g < a[0].length; g++) {
                        for (var y = [], v = 0; v < a.length; v++) {
                            var A = null;
                            null != a[v] && null != a[v][g] && (A = a[v][g]),
                            y.push(A)
                        }
                        p.push(y)
                    }
                    editor.controlHandler(p)
                }
            }
        }
        ))
    }
    _export({
        target: "Math",
        stat: !0
    }, {
        cbrt: function(e) {
            return mathSign(e = +e) * pow$3(abs$1(e), 1 / 3)
        }
    });
    var isInitialSheetConfig = !1
      , luckysheetcurrentSheetitem = null
      , jfdbclicklagTimeout = null;
    function showsheetconfigmenu() {
        if (!isInitialSheetConfig) {
            isInitialSheetConfig = !0;
            var e = locale()
              , t = e.toolbar;
            $("#luckysheetsheetconfigcolorur").spectrum({
                showPalette: !0,
                preferredFormat: "hex",
                clickoutFiresChange: !1,
                showInitial: !0,
                showInput: !0,
                flat: !0,
                hideAfterPaletteSelect: !1,
                showSelectionPalette: !0,
                maxPaletteSize: 10,
                cancelText: e.sheetconfig.cancelText,
                chooseText: e.sheetconfig.chooseText,
                togglePaletteMoreText: t.toolMore,
                togglePaletteLessText: t.toolLess,
                clearText: t.clearText,
                noColorSelectedText: t.noColorSelectedText,
                palette: [["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", "rgb(204, 204, 204)", "rgb(217, 217, 217)", "rgb(255, 255, 255)"], ["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"], ["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)", "rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)"], ["rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)", "rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)"], ["rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)", "rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)"], ["rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)", "rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)"], ["rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)", "rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"], ["#c1232b", "#27727b", "#fcce10", "#e87c25", "#b5c334", "#fe8463", "#9bca63", "#fad860", "#f3a43b", "#60c0dd", "#d7504b", "#c6e579", "#f4e001", "#f0805a", "#26c0c0", "#c12e34", "#e6b600", "#0098d9", "#2b821d", "#005eaa", "#339ca8", "#cda819", "#32a487", "#3fb1e3", "#6be6c1", "#626c91", "#a0a7e6", "#c4ebad", "#96dee8"]],
                change: function(e) {
                    $(this);
                    e = null != e ? e.toHexString() : "rgb(0, 0, 0)";
                    var t = null;
                    luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").length > 0 && (t = luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").css("background-color")),
                    luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").remove(),
                    luckysheetcurrentSheetitem.append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + e + ';"></div>');
                    var r = getSheetIndex(Store.currentSheetIndex);
                    if (Store.luckysheetfile[r].color = e,
                    server.saveParam("all", Store.currentSheetIndex, e, {
                        k: "color"
                    }),
                    Store.clearjfundo) {
                        var a = {
                            type: "sheetColor"
                        };
                        a.sheetIndex = Store.currentSheetIndex,
                        a.oldcolor = t,
                        a.color = e,
                        Store.jfundo = [],
                        Store.jfredo.push(a)
                    }
                }
            }),
            $("#luckysheetsheetconfigcolorreset").click((function() {
                var e = null;
                luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").length > 0 && (e = luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").css("background-color")),
                luckysheetcurrentSheetitem.find(".luckysheet-sheets-item-color").remove();
                var t = getSheetIndex(Store.currentSheetIndex);
                if (Store.luckysheetfile[t].color = null,
                server.saveParam("all", Store.currentSheetIndex, null, {
                    k: "color"
                }),
                Store.clearjfundo) {
                    var r = {
                        type: "sheetColor"
                    };
                    r.sheetIndex = Store.currentSheetIndex,
                    r.oldcolor = e,
                    r.color = null,
                    Store.jfundo = [],
                    Store.jfredo.push(r)
                }
            }
            ))
        }
        var r = getSheetIndex(Store.currentSheetIndex);
        null != Store.luckysheetfile[r].color && Store.luckysheetfile[r].color.length > 0 && $("#luckysheetsheetconfigcolorur").spectrum("set", Store.luckysheetfile[r].color),
        $("#luckysheetsheetconfigcolorur").parent().find("span, div, button, input, a").addClass("luckysheet-mousedown-cancel");
        var a = luckysheetConfigsetting.sheetRightClickConfig;
        (a.delete || a.copy || a.rename || a.color || a.hide || a.move) && setTimeout((function() {
            mouseclickposition($("#luckysheet-rightclick-sheet-menu"), luckysheetcurrentSheetitem.offset().left + luckysheetcurrentSheetitem.width(), luckysheetcurrentSheetitem.offset().top - 18, "leftbottom")
        }
        ), 1)
    }
    var luckysheetsheetrightclick = function(e, t, r) {
        clearTimeout(jfdbclicklagTimeout),
        t.hasClass("luckysheet-sheets-item-name") && "true" == t.attr("contenteditable") || (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton() ? setTimeout((function() {
            luckysheetformula.setCaretPosition(luckysheetformula.rangeSetValueTo.get(0), 0, luckysheetformula.rangeSetValueTo.text().length),
            luckysheetformula.createRangeHightlight(),
            $("#luckysheet-input-box-index").find(".luckysheet-input-box-index-sheettxt").remove().end().prepend("<span class='luckysheet-input-box-index-sheettxt'>" + sheetmanage.getSheetName(luckysheetformula.rangetosheet) + "!</span>").show(),
            $("#luckysheet-input-box-index").css({
                left: $("#luckysheet-input-box").css("left"),
                top: parseInt($("#luckysheet-input-box").css("top")) - 20 + "px",
                "z-index": $("#luckysheet-input-box").css("z-index")
            })
        }
        ), 1) : ($("#luckysheet-input-box").removeAttr("style"),
        $("#luckysheet-formula-functionrange .luckysheet-formula-functionrange-highlight").remove()),
        $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
        e.addClass("luckysheet-sheets-item-active"),
        cleargridelement(r),
        sheetmanage.changeSheet(e.data("index")),
        $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(),
        (t.hasClass("luckysheet-sheets-item-menu") || t.hasClass("fa-sort-desc") || "3" == r.which) && (luckysheetcurrentSheetitem = t.closest(".luckysheet-sheets-item"),
        showsheetconfigmenu()))
    };
    function initialSheetBar() {
        var e = locale().sheetconfig;
        $("#luckysheet-sheet-area").on("mousedown", "div.luckysheet-sheets-item", (function(e) {
            if (!isEditMode()) {
                var t = $(this)
                  , r = $(e.target)
                  , a = r.closest(".luckysheet-sheets-item");
                if ("3" == e.which)
                    return luckysheetsheetrightclick(t, r, e),
                    luckysheetcurrentSheetitem = a,
                    void showsheetconfigmenu();
                a.hasClass("luckysheet-sheets-item-active") && "false" == a.find(".luckysheet-sheets-item-name").attr("contenteditable") && (jfdbclicklagTimeout = setTimeout((function() {
                    Store.luckysheet_sheet_move_status = !0,
                    Store.luckysheet_sheet_move_data = {},
                    Store.luckysheet_sheet_move_data.widthlist = [],
                    $("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").each((function(e) {
                        0 == e ? Store.luckysheet_sheet_move_data.widthlist.push(parseInt($(this).outerWidth())) : Store.luckysheet_sheet_move_data.widthlist.push(parseInt($(this).outerWidth()) + Store.luckysheet_sheet_move_data.widthlist[e - 1])
                    }
                    )),
                    Store.luckysheet_sheet_move_data.curindex = $("#luckysheet-sheet-area div.luckysheet-sheets-item").index(a);
                    var t = e.pageX;
                    Store.luckysheet_sheet_move_data.curleft = t - a.offset().left,
                    Store.luckysheet_sheet_move_data.pageX = t,
                    Store.luckysheet_sheet_move_data.activeobject = a,
                    Store.luckysheet_sheet_move_data.cursorobject = r;
                    var n = a.clone().css("visibility", "hidden").attr("id", "luckysheet-sheets-item-clone");
                    a.after(n),
                    a.css({
                        position: "absolute",
                        opacity: .8,
                        cursor: "move",
                        transition: "initial",
                        "z-index": 10
                    })
                }
                ), 200))
            }
        }
        )).on("click", "div.luckysheet-sheets-item", (function(e) {
            if (!isEditMode()) {
                var t = $(this)
                  , r = $(e.target);
                luckysheetsheetrightclick(t, r, e)
            }
        }
        ));
        var t = function(e) {
            !1 !== Store.allowEdit && (e.attr("contenteditable", "true").addClass("luckysheet-mousedown-cancel").data("oldtxt", e.text()),
            setTimeout((function() {
                selectTextDom(e.get(0))
            }
            ), 1))
        };
        $("#luckysheet-sheet-area").on("dblclick", "span.luckysheet-sheets-item-name", (function(e) {
            t($(this))
        }
        )),
        $("#luckysheet-sheet-area").on("blur", "span.luckysheet-sheets-item-name", (function(t) {
            if (!1 !== Store.allowEdit) {
                var r = $(this)
                  , a = r.text()
                  , n = r.data("oldtxt");
                if (new RegExp("[\\[\\]:\\?*/'\"]").test(a))
                    alert(e.sheetNameSpecCharError);
                else {
                    for (var o = getSheetIndex(Store.currentSheetIndex), l = 0; l < Store.luckysheetfile.length; l++)
                        if (o != l && Store.luckysheetfile[l].name == a)
                            return isEditMode() ? alert(e.tipNameRepeat) : tooltip.info("", e.tipNameRepeat),
                            void r.text(n).attr("contenteditable", "false");
                    if (sheetmanage.sheetArrowShowAndHide(),
                    Store.luckysheetfile[o].name = a,
                    server.saveParam("all", Store.currentSheetIndex, a, {
                        k: "name"
                    }),
                    r.attr("contenteditable", "false").removeClass("luckysheet-mousedown-cancel"),
                    Store.clearjfundo) {
                        var i = {
                            type: "sheetName"
                        };
                        i.sheetIndex = Store.currentSheetIndex,
                        i.oldtxt = n,
                        i.txt = a,
                        Store.jfundo = [],
                        Store.jfredo.push(i)
                    }
                }
            }
        }
        )),
        $("#luckysheet-sheet-area").on("keydown", "span.luckysheet-sheets-item-name", (function(e) {
            if (!1 !== Store.allowEdit) {
                var t = e.keyCode
                  , r = $(this);
                if (t == keycode.ENTER) {
                    var a = getSheetIndex(Store.currentSheetIndex);
                    Store.luckysheetfile[a].name = r.text(),
                    r.attr("contenteditable", "false")
                }
            }
        }
        )),
        $("#luckysheetsheetconfigrename").click((function() {
            t(luckysheetcurrentSheetitem.find("span.luckysheet-sheets-item-name")),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide()
        }
        )),
        $("#luckysheetsheetconfigshow").click((function() {
            $("#luckysheet-sheets-m").click(),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-rightclick-sheet-menu").hide()
        }
        )),
        $("#luckysheetsheetconfigmoveleft").click((function() {
            luckysheetcurrentSheetitem.prevAll(":visible").length > 0 && (luckysheetcurrentSheetitem.insertBefore(luckysheetcurrentSheetitem.prevAll(":visible").eq(0)),
            sheetmanage.reOrderAllSheet()),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide()
        }
        )),
        $("#luckysheetsheetconfigmoveright").click((function() {
            luckysheetcurrentSheetitem.nextAll(":visible").length > 0 && (luckysheetcurrentSheetitem.insertAfter(luckysheetcurrentSheetitem.nextAll(":visible").eq(0)),
            sheetmanage.reOrderAllSheet()),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide()
        }
        )),
        $("#luckysheetsheetconfigdelete").click((function(t) {
            if ($("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(),
            $("#luckysheet-sheet-container-c .luckysheet-sheets-item:visible").length <= 1)
                isEditMode() ? alert(e.noMoreSheet) : tooltip.info(e.noMoreSheet, "");
            else {
                var r = getSheetIndex(Store.currentSheetIndex);
                tooltip.confirm(e.confirmDelete + "【" + Store.luckysheetfile[r].name + "】？", "<span style='color:#9e9e9e;font-size:12px;'>" + e.redoDelete + "</span>", (function() {
                    sheetmanage.deleteSheet(luckysheetcurrentSheetitem.data("index"))
                }
                ), null),
                $("#luckysheet-input-box").removeAttr("style")
            }
        }
        )),
        $("#luckysheetsheetconfigcopy").click((function(e) {
            sheetmanage.copySheet(luckysheetcurrentSheetitem.data("index"), e),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide()
        }
        )),
        $("#luckysheetsheetconfighide").click((function() {
            1 != $("#luckysheet-sheet-area div.luckysheet-sheets-item:visible").length ? (sheetmanage.setSheetHide(luckysheetcurrentSheetitem.data("index")),
            $("#luckysheet-input-box").removeAttr("style"),
            $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide()) : isEditMode() ? alert(e.noHide) : tooltip.info("", e.noHide)
        }
        )),
        $("#luckysheet-sheets-add").click((function(e) {
            sheetmanage.addNewSheet(e),
            sheetmanage.locationSheet(),
            $("#luckysheet-input-box").removeAttr("style")
        }
        ));
        var r = null
          , a = 0
          , n = 0;
        $("#luckysheet-sheets-leftscroll").click((function() {
            var e = $("#luckysheet-sheet-container-c");
            a = e.scrollLeft(),
            (n = e.scrollLeft() - 150) <= 0 && $("#luckysheet-sheet-container .docs-sheet-fade-left").hide(),
            $("#luckysheet-sheet-container .docs-sheet-fade-right").show(),
            clearInterval(r),
            r = setInterval((function() {
                a -= 4,
                e.scrollLeft(a),
                a <= n && clearInterval(r)
            }
            ), 1)
        }
        )),
        $("#luckysheet-sheets-rightscroll").click((function() {
            var e = $("#luckysheet-sheet-container-c");
            a = e.scrollLeft(),
            n = e.scrollLeft() + 150,
            a > 0 && $("#luckysheet-sheet-container .docs-sheet-fade-right").hide(),
            $("#luckysheet-sheet-container .docs-sheet-fade-left").show(),
            clearInterval(r),
            r = setInterval((function() {
                a += 4,
                e.scrollLeft(a),
                a >= n && clearInterval(r)
            }
            ), 1)
        }
        ));
        var o = !0;
        $("#luckysheet-sheets-m").click((function(t) {
            $("#luckysheet-sheet-list").html("");
            for (var r = "", a = 0; a < Store.luckysheetfile.length; a++) {
                var n = Store.luckysheetfile[a]
                  , l = ""
                  , i = "";
                1 == n.status && (l = '<i class="fa fa-check" aria-hidden="true"></i>'),
                1 == n.hide && (l = '<i class="fa fa-low-vision" aria-hidden="true"></i>',
                i += "color:#BBBBBB;"),
                null != n.color && n.color.length > 0 && (i += "border-right:4px solid " + n.color + ";"),
                r += replaceHtml$1(sheetselectlistitemHTML, {
                    index: n.index,
                    name: n.name,
                    icon: l,
                    style: i
                })
            }
            o ? ($("#" + Store.container).append(replaceHtml$1(sheetselectlistHTML, {
                item: r
            })),
            $("#luckysheet-sheet-list").on("click", ".luckysheet-cols-menuitem", (function(t) {
                if (isEditMode())
                    alert(e.chartEditNoOpt);
                else {
                    var r = $(this)
                      , a = r.data("index");
                    r.data("index") != Store.currentSheetIndex && (sheetmanage.setSheetShow(a),
                    sheetmanage.locationSheet())
                }
            }
            )),
            o = !1) : $("#luckysheet-sheet-list").html(r),
            mouseclickposition($("#luckysheet-sheet-list"), $(this).offset().left, $(this).offset().top - 12, "leftbottom"),
            $("#luckysheet-input-box").removeAttr("style")
        }
        ))
    }
    function formulaBarInitial() {
        var e = locale().formula;
        $("#luckysheet-functionbox-cell").focus((function() {
            if (!isEditMode() && Store.luckysheet_select_save.length > 0) {
                var e = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
                luckysheetupdateCell(e.row_focus, e.column_focus, Store.flowdata, null, !0),
                luckysheetformula.rangeResizeTo = $("#luckysheet-functionbox-cell")
            }
        }
        )).keydown((function(e) {
            if (!isEditMode()) {
                e.ctrlKey,
                e.altKey,
                e.shiftKey;
                var t = e.keyCode
                  , r = $("#luckysheet-input-box");
                if (t == keycode.ENTER && parseInt(r.css("top")) > 0)
                    $("#luckysheet-formula-search-c").is(":visible") && null != luckysheetformula.searchFunctionCell ? luckysheetformula.searchFunctionEnter($("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active")) : (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                    Store.luckysheet_select_save = [{
                        row: [Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[0]],
                        column: [Store.luckysheetCellUpdate[1], Store.luckysheetCellUpdate[1]],
                        row_focus: Store.luckysheetCellUpdate[0],
                        column_focus: Store.luckysheetCellUpdate[1]
                    }],
                    luckysheetMoveHighlightCell("down", 1, "rangeOfSelect"),
                    $("#luckysheet-rich-text-editor").focus()),
                    e.preventDefault();
                else if (t == keycode.ESC && parseInt(r.css("top")) > 0)
                    luckysheetformula.dontupdate(),
                    luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"),
                    $("#luckysheet-rich-text-editor").focus(),
                    e.preventDefault();
                else if (t == keycode.F4 && parseInt(r.css("top")) > 0)
                    luckysheetformula.setfreezonFuc(e),
                    e.preventDefault();
                else if (t == keycode.UP && parseInt(r.css("top")) > 0) {
                    if ($("#luckysheet-formula-search-c").is(":visible")) {
                        var a = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active").prev();
                        0 == a.length && (a = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").last()),
                        $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").removeClass("luckysheet-formula-search-item-active"),
                        a.addClass("luckysheet-formula-search-item-active"),
                        e.preventDefault()
                    }
                } else if (t == keycode.DOWN && parseInt(r.css("top")) > 0) {
                    if ($("#luckysheet-formula-search-c").is(":visible")) {
                        var n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active").next();
                        0 == n.length && (n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").first()),
                        $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").removeClass("luckysheet-formula-search-item-active"),
                        n.addClass("luckysheet-formula-search-item-active"),
                        e.preventDefault()
                    }
                } else
                    t == keycode.LEFT && parseInt(r.css("top")) > 0 || t == keycode.RIGHT && parseInt(r.css("top")) > 0 ? luckysheetformula.rangeHightlightselected($("#luckysheet-functionbox-cell")) : (!(t >= 112 && t <= 123 || t <= 46 || 144 == t || 108 == t || e.ctrlKey || e.altKey || e.shiftKey && (37 == t || 38 == t || 39 == t || 40 == t)) || 8 == t || 32 == t || 46 == t || e.ctrlKey && 86 == t) && luckysheetformula.functionInputHanddler($("#luckysheet-rich-text-editor"), $("#luckysheet-functionbox-cell"), t)
            }
        }
        )).click((function() {
            isEditMode() || luckysheetformula.rangeHightlightselected($("#luckysheet-functionbox-cell"))
        }
        )),
        $("#luckysheet-wa-functionbox-cancel").click((function() {
            $(this).hasClass("luckysheet-wa-calculate-active") && ($("#luckysheet-search-formula-parm").is(":visible") && $("#luckysheet-search-formula-parm").hide(),
            $("#luckysheet-search-formula-parm-select").is(":visible") && $("#luckysheet-search-formula-parm-select").hide(),
            luckysheetformula.dontupdate(),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"))
        }
        )),
        $("#luckysheet-wa-functionbox-confirm").click((function() {
            $(this).hasClass("luckysheet-wa-calculate-active") && ($("#luckysheet-search-formula-parm").is(":visible") && $("#luckysheet-search-formula-parm").hide(),
            $("#luckysheet-search-formula-parm-select").is(":visible") && $("#luckysheet-search-formula-parm-select").hide(),
            luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
            luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"))
        }
        )),
        $("#luckysheet-wa-functionbox-fx").click((function() {
            if (0 != Store.luckysheet_select_save.length) {
                var t = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                  , r = t.row_focus
                  , a = t.column_focus;
                luckysheetupdateCell(r, a, Store.flowdata);
                var n = Store.flowdata[r][a];
                if (null != n && null != n.f) {
                    var o = luckysheetformula.getfunctionParam(n.f);
                    null != o.fn ? insertFormula.formulaParmDialog(o.fn, o.param) : insertFormula.formulaListDialog()
                } else
                    $("#luckysheet-rich-text-editor").html('<span dir="auto" class="luckysheet-formula-text-color">=</span>'),
                    $("#luckysheet-functionbox-cell").html($("#luckysheet-rich-text-editor").html()),
                    insertFormula.formulaListDialog();
                insertFormula.init()
            } else
                isEditMode() ? alert(e.tipSelectCell) : tooltip.info(e.tipSelectCell, "")
        }
        )),
        $("#luckysheet-formula-functionrange").on("mousedown", ".luckysheet-copy", (function(e) {
            luckysheetformula.rangeMove = !0,
            Store.luckysheet_scroll_status = !0,
            luckysheetformula.rangeMoveObj = $(this).parent(),
            luckysheetformula.rangeMoveIndex = $(this).parent().attr("rangeindex");
            var t = mouseposition(e.pageX, e.pageY)
              , r = t[0] + $("#luckysheet-cell-main").scrollLeft()
              , a = t[1] + $("#luckysheet-cell-main").scrollTop();
            $("#luckysheet-formula-functionrange-highlight-" + luckysheetformula.rangeMoveIndex).find(".luckysheet-selection-copy-hc").css("opacity", .13);
            var n = $(this).data("type");
            "top" == n ? a += 3 : "right" == n ? r -= 3 : "bottom" == n ? a -= 3 : "left" == n && (r += 3);
            var o = rowLocation(a)[2]
              , l = colLocation(r)[2];
            luckysheetformula.rangeMovexy = [o, l],
            $("#luckysheet-sheettable").css("cursor", "move"),
            e.stopPropagation()
        }
        )),
        $("#luckysheet-formula-functionrange").on("mousedown", ".luckysheet-highlight", (function(e) {
            luckysheetformula.rangeResize = $(this).data("type"),
            luckysheetformula.rangeResizeIndex = $(this).parent().attr("rangeindex");
            var t = mouseposition(e.pageX, e.pageY)
              , r = $("#luckysheet-cell-main").scrollLeft()
              , a = $("#luckysheet-cell-main").scrollTop()
              , n = t[0] + r
              , o = t[1] + a;
            luckysheetformula.rangeResizeObj = $(this).parent(),
            $("#luckysheet-formula-functionrange-highlight-" + luckysheetformula.rangeResizeIndex).find(".luckysheet-selection-copy-hc").css("opacity", .13),
            "lt" == luckysheetformula.rangeResize ? (n += 3,
            o += 3) : "lb" == luckysheetformula.rangeResize ? (n += 3,
            o -= 3) : "rt" == luckysheetformula.rangeResize ? (n -= 3,
            o += 3) : "rb" == luckysheetformula.rangeResize && (n -= 3,
            o -= 3);
            var l = rowLocation(o)
              , i = l[1]
              , s = l[0]
              , c = colLocation(n)
              , u = c[1]
              , h = c[0]
              , d = luckysheetformula.rangeResizeObj.position();
            luckysheetformula.rangeResizexy = [h, s, luckysheetformula.rangeResizeObj.width(), luckysheetformula.rangeResizeObj.height(), d.left + r, d.top + a, u, i],
            luckysheetformula.rangeResizeWinH = $("#luckysheet-cell-main")[0].scrollHeight,
            luckysheetformula.rangeResizeWinW = $("#luckysheet-cell-main")[0].scrollWidth,
            Store.luckysheet_scroll_status = !0,
            e.stopPropagation()
        }
        ))
    }
    function rowColumnOperationInitial() {
        $("#luckysheet-rows-h").mousedown((function(e) {
            if (checkProtectionAllSelected(Store.currentSheetIndex)) {
                luckysheetPostil.removeActivePs(),
                ($("#luckysheet-modal-dialog-activeImage").is(":visible") || $("#luckysheet-modal-dialog-cropping").is(":visible")) && imageCtrl.cancelActiveImgItem();
                var t = rowLocation(mouseposition(e.pageX, e.pageY)[1] + $("#luckysheet-rows-h").scrollTop())
                  , r = t[1]
                  , a = t[0]
                  , n = t[2]
                  , o = Store.visibledatacolumn.length - 1
                  , l = Store.visibledatacolumn[o];
                if ($("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(),
                "3" == e.which) {
                    for (var i = !1, s = 0; s < Store.luckysheet_select_save.length; s++) {
                        var c = Store.luckysheet_select_save[s];
                        if (null != c.row && n >= c.row[0] && n <= c.row[1] && 0 == c.column[0] && c.column[1] == Store.flowdata[0].length - 1) {
                            i = !0;
                            break
                        }
                    }
                    if (i)
                        return
                }
                var u = a
                  , h = r - a - 1
                  , d = [n, n];
                Store.luckysheet_scroll_status = !0;
                var f = $("#luckysheet-input-box");
                if (parseInt(f.css("top")) > 0) {
                    if (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton() || $("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                        var m = menuButton.mergeMoveMain([0, o], d, {
                            row_focus: n,
                            column_focus: 0
                        }, u, h, 0, l);
                        if (null != m && (d = m[1],
                        u = m[2],
                        h = m[3]),
                        e.shiftKey) {
                            var p = luckysheetformula.func_selectedrange
                              , g = 0
                              , y = 0
                              , v = [];
                            p.top > a ? (g = a,
                            y = p.top + p.height - a,
                            p.row[1] > p.row_focus && (p.row[1] = p.row_focus),
                            v = [n, p.row[1]]) : p.top == a ? (g = a,
                            y = p.top + p.height - a,
                            v = [n, p.row[0]]) : (g = p.top,
                            y = r - p.top - 1,
                            p.row[0] < p.row_focus && (p.row[0] = p.row_focus),
                            v = [p.row[0], n]);
                            var A = menuButton.mergeMoveMain([0, o], v, {
                                row_focus: n,
                                column_focus: 0
                            }, g, y, 0, l);
                            null != A && (v = A[1],
                            g = A[2],
                            y = A[3]),
                            p.row = v,
                            p.top_move = g,
                            p.height_move = y,
                            luckysheetformula.func_selectedrange = p
                        } else if (e.ctrlKey && "," != $("#luckysheet-rich-text-editor").find("span").last().text()) {
                            var b = $("#luckysheet-rich-text-editor").text() + ",";
                            if (b.length > 0 && "=" == b.substr(0, 1)) {
                                if (b = luckysheetformula.functionHTMLGenerate(b),
                                window.getSelection) {
                                    var k = window.getSelection();
                                    luckysheetformula.functionRangeIndex = [$(k.anchorNode).parent().index(), k.anchorOffset]
                                } else {
                                    var w = document.selection.createRange();
                                    luckysheetformula.functionRangeIndex = w
                                }
                                $("#luckysheet-rich-text-editor").html(b),
                                luckysheetformula.canceFunctionrangeSelected(),
                                luckysheetformula.createRangeHightlight()
                            }
                            luckysheetformula.rangestart = !1,
                            luckysheetformula.rangedrag_column_start = !1,
                            luckysheetformula.rangedrag_row_start = !1,
                            $("#luckysheet-functionbox-cell").html(b),
                            luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor")),
                            luckysheetformula.israngeseleciton(),
                            luckysheetformula.func_selectedrange = {
                                left: colLocationByIndex(0)[0],
                                width: colLocationByIndex(0)[1] - colLocationByIndex(0)[0] - 1,
                                top: u,
                                height: h,
                                left_move: 0,
                                width_move: l - 0 - 1,
                                top_move: u,
                                height_move: h,
                                row: d,
                                column: [0, o],
                                row_focus: n,
                                column_focus: 0
                            }
                        } else
                            luckysheetformula.func_selectedrange = {
                                left: colLocationByIndex(0)[0],
                                width: colLocationByIndex(0)[1] - colLocationByIndex(0)[0] - 1,
                                top: u,
                                height: h,
                                left_move: 0,
                                width_move: l - 0 - 1,
                                top_move: u,
                                height_move: h,
                                row: d,
                                column: [0, o],
                                row_focus: n,
                                column_focus: 0
                            };
                        if (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton())
                            luckysheetformula.rangeSetValue({
                                row: d,
                                column: [null, null]
                            });
                        else if ($("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                            var x = getRangetxt(Store.currentSheetIndex, {
                                row: d,
                                column: [0, o]
                            }, Store.currentSheetIndex);
                            $("#luckysheet-ifFormulaGenerator-multiRange-dialog input").val(x)
                        }
                        return luckysheetformula.rangedrag_row_start = !0,
                        luckysheetformula.rangestart = !1,
                        luckysheetformula.rangedrag_column_start = !1,
                        $("#luckysheet-formula-functionrange-select").css({
                            left: 0,
                            width: l - 0 - 1,
                            top: u,
                            height: h
                        }).show(),
                        $("#luckysheet-formula-help-c").hide(),
                        luckysheet_count_show(0, u, l - 0 - 1, h, d, [0, o]),
                        void setTimeout((function() {
                            var e, t = window.getSelection().anchorNode;
                            $("#luckysheet-search-formula-parm").is(":visible") || $("#luckysheet-search-formula-parm-select").is(":visible") ? (e = $("#luckysheet-rich-text-editor"),
                            luckysheetformula.rangechangeindex = luckysheetformula.data_parm_index) : e = $(t).closest("div");
                            var r = e.find("span[rangeindex='" + luckysheetformula.rangechangeindex + "']");
                            luckysheetformula.setCaretPosition(r.get(0), 0, r.html().length)
                        }
                        ), 1)
                    }
                    luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                    Store.luckysheet_rows_selected_status = !0
                } else
                    Store.luckysheet_rows_selected_status = !0;
                if (Store.luckysheet_rows_selected_status) {
                    if (e.shiftKey) {
                        var S = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                          , _ = 0
                          , C = 0
                          , T = [];
                        S.top > a ? (_ = a,
                        C = S.top + S.height - a,
                        S.row[1] > S.row_focus && (S.row[1] = S.row_focus),
                        T = [n, S.row[1]]) : S.top == a ? (_ = a,
                        C = S.top + S.height - a,
                        T = [n, S.row[0]]) : (_ = S.top,
                        C = r - S.top - 1,
                        S.row[0] < S.row_focus && (S.row[0] = S.row_focus),
                        T = [S.row[0], n]),
                        S.row = T,
                        S.top_move = _,
                        S.height_move = C,
                        Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = S
                    } else
                        e.ctrlKey || (Store.luckysheet_select_save = []),
                        Store.luckysheet_select_save.push({
                            left: colLocationByIndex(0)[0],
                            width: colLocationByIndex(0)[1] - colLocationByIndex(0)[0] - 1,
                            top: u,
                            height: h,
                            left_move: 0,
                            width_move: l - 0 - 1,
                            top_move: u,
                            height_move: h,
                            row: d,
                            column: [0, o],
                            row_focus: n,
                            column_focus: 0
                        });
                    selectHightlightShow(),
                    server.allowUpdate && server.saveParam("mv", Store.currentSheetIndex, Store.luckysheet_select_save)
                }
                selectHelpboxFill(),
                setTimeout((function() {
                    clearTimeout(Store.countfuncTimeout),
                    countfunc()
                }
                ), 101)
            }
        }
        )).mousemove((function(e) {
            if (Store.luckysheet_rows_selected_status || Store.luckysheet_rows_change_size || Store.luckysheet_select_status)
                $("#luckysheet-rows-h-hover").hide();
            else {
                var t = mouseposition(e.pageX, e.pageY)[1] + $("#luckysheet-rows-h").scrollTop()
                  , r = rowLocation(t)
                  , a = r[1]
                  , n = r[0] - 12;
                $("#luckysheet-rows-h-hover").css({
                    top: n,
                    height: a - n - 1 - 12,
                    display: "block"
                }),
                t < a - 1 && t >= a - 5 ? $("#luckysheet-rows-change-size").css({
                    top: a - 22,
                    opacity: 0
                }) : $("#luckysheet-rows-change-size").css("opacity", 0)
            }
        }
        )).mouseleave((function(e) {
            $("#luckysheet-rows-h-hover").hide(),
            $("#luckysheet-rows-change-size").css("opacity", 0)
        }
        )).mouseup((function(e) {
            if (3 == e.which) {
                if (isEditMode())
                    return;
                $("#luckysheet-cols-rows-shift").hide(),
                Store.luckysheetRightHeadClickIs = "row",
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom),
                $("#luckysheet-cols-rows-add").show(),
                $("#luckysheet-cols-rows-data").show(),
                $("#luckysheet-cols-rows-shift").hide(),
                $("#luckysheet-cols-rows-handleincell").hide(),
                $$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "block",
                $$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "block";
                var t = luckysheetConfigsetting.cellRightClickConfig;
                if (!(t.copy || t.copyAs || t.paste || t.insertRow || t.deleteRow || t.hideRow || t.rowHeight || t.clear || t.matrix || t.sort || t.filter || t.chart || t.image || t.link || t.data || t.cellFormat))
                    return;
                $$("#luckysheet-top-left-add-selected").style.display = t.insertRow ? "block" : "none",
                $$("#luckysheet-bottom-right-add-selected").style.display = t.insertRow ? "block" : "none",
                $$("#luckysheet-del-selected").style.display = t.deleteRow ? "block" : "none",
                $$("#luckysheet-hide-selected").style.display = t.hideRow ? "block" : "none",
                $$("#luckysheet-show-selected").style.display = t.hideRow ? "block" : "none",
                $$("#luckysheet-column-row-width-selected").style.display = t.rowHeight ? "block" : "none",
                t.copy || t.copyAs || t.paste || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none",
                t.insertRow || t.deleteRow || t.hideRow || t.rowHeight || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none")),
                t.insertRow || t.deleteRow || t.hideRow || t.rowHeight || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none"),
                t.clear || t.matrix || t.sort || t.filter || t.chart || t.image || t.link || t.data || t.cellFormat || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none"),
                showrightclickmenu($("#luckysheet-rightclick-menu"), $(this).offset().left + 46, e.pageY),
                Store.luckysheet_cols_menu_status = !0;
                var r = $.extend(!0, {}, Store.config);
                null == r.rowlen && (r.rowlen = {});
                for (var a = null == r.rowlen[Store.luckysheet_select_save[0].row[0]] ? Store.defaultrowlen : r.rowlen[Store.luckysheet_select_save[0].row[0]], n = !0, o = 0; o < Store.luckysheet_select_save.length; o++)
                    for (var l = Store.luckysheet_select_save[o], i = l.row[0], s = l.row[1], c = i; c <= s; c++) {
                        if ((null == r.rowlen[c] ? Store.defaultrowlen : r.rowlen[c]) != a) {
                            n = !1;
                            break
                        }
                    }
                n ? $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val(a) : $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val("")
            }
        }
        )),
        $("#luckysheet-cols-h-c").mousedown((function(e) {
            if (checkProtectionAllSelected(Store.currentSheetIndex)) {
                luckysheetPostil.removeActivePs(),
                ($("#luckysheet-modal-dialog-activeImage").is(":visible") || $("#luckysheet-modal-dialog-cropping").is(":visible")) && imageCtrl.cancelActiveImgItem();
                var t = mouseposition(e.pageX, e.pageY)[0] + $(this).scrollLeft()
                  , r = Store.visibledatarow.length - 1
                  , a = Store.visibledatarow[r]
                  , n = colLocation(t)
                  , o = n[1]
                  , l = n[0]
                  , i = n[2];
                if (Store.orderbyindex = i,
                $("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(),
                $("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide(),
                "3" == e.which) {
                    for (var s = !1, c = 0; c < Store.luckysheet_select_save.length; c++) {
                        var u = Store.luckysheet_select_save[c];
                        if (null != u.column && i >= u.column[0] && i <= u.column[1] && 0 == u.row[0] && u.row[1] == Store.flowdata.length - 1) {
                            s = !0;
                            break
                        }
                    }
                    if (s)
                        return
                }
                var h = l
                  , d = o - l - 1
                  , f = [i, i];
                Store.luckysheet_scroll_status = !0;
                var m = $("#luckysheet-input-box");
                if (parseInt(m.css("top")) > 0) {
                    if (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton() || $("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                        var p = menuButton.mergeMoveMain(f, [0, r], {
                            row_focus: 0,
                            column_focus: i
                        }, 0, a, h, d);
                        if (null != p && (f = p[0],
                        h = p[4],
                        d = p[5]),
                        e.shiftKey) {
                            var g = luckysheetformula.func_selectedrange
                              , y = 0
                              , v = 0
                              , A = [];
                            g.left > l ? (y = l,
                            v = g.left + g.width - l,
                            g.column[1] > g.column_focus && (g.column[1] = g.column_focus),
                            A = [i, g.column[1]]) : g.left == l ? (y = l,
                            v = g.left + g.width - l,
                            A = [i, g.column[0]]) : (y = g.left,
                            v = o - g.left - 1,
                            g.column[0] < g.column_focus && (g.column[0] = g.column_focus),
                            A = [g.column[0], i]);
                            var b = menuButton.mergeMoveMain(A, [0, r], {
                                row_focus: 0,
                                column_focus: i
                            }, 0, a, y, v);
                            null != b && (A = b[0],
                            y = b[4],
                            v = b[5]),
                            g.column = A,
                            g.left_move = y,
                            g.width_move = v,
                            luckysheetformula.func_selectedrange = g
                        } else if (e.ctrlKey && "," != $("#luckysheet-rich-text-editor").find("span").last().text()) {
                            var k = $("#luckysheet-rich-text-editor").text() + ",";
                            if (k.length > 0 && "=" == k.substr(0, 1)) {
                                if (k = luckysheetformula.functionHTMLGenerate(k),
                                window.getSelection) {
                                    var w = window.getSelection();
                                    luckysheetformula.functionRangeIndex = [$(w.anchorNode).parent().index(), w.anchorOffset]
                                } else {
                                    var x = document.selection.createRange();
                                    luckysheetformula.functionRangeIndex = x
                                }
                                $("#luckysheet-rich-text-editor").html(k),
                                luckysheetformula.canceFunctionrangeSelected(),
                                luckysheetformula.createRangeHightlight()
                            }
                            luckysheetformula.rangestart = !1,
                            luckysheetformula.rangedrag_column_start = !1,
                            luckysheetformula.rangedrag_row_start = !1,
                            $("#luckysheet-functionbox-cell").html(k),
                            luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor")),
                            luckysheetformula.israngeseleciton(),
                            luckysheetformula.func_selectedrange = {
                                left: h,
                                width: d,
                                top: rowLocationByIndex(0)[0],
                                height: rowLocationByIndex(0)[1] - rowLocationByIndex(0)[0] - 1,
                                left_move: h,
                                width_move: d,
                                top_move: 0,
                                height_move: a - 0 - 1,
                                row: [0, r],
                                column: f,
                                row_focus: 0,
                                column_focus: i
                            }
                        } else
                            luckysheetformula.func_selectedrange = {
                                left: h,
                                width: d,
                                top: rowLocationByIndex(0)[0],
                                height: rowLocationByIndex(0)[1] - rowLocationByIndex(0)[0] - 1,
                                left_move: h,
                                width_move: d,
                                top_move: 0,
                                height_move: a - 0 - 1,
                                row: [0, r],
                                column: f,
                                row_focus: 0,
                                column_focus: i
                            };
                        if (luckysheetformula.rangestart || luckysheetformula.rangedrag_column_start || luckysheetformula.rangedrag_row_start || luckysheetformula.israngeseleciton())
                            luckysheetformula.rangeSetValue({
                                row: [null, null],
                                column: f
                            });
                        else if ($("#luckysheet-ifFormulaGenerator-multiRange-dialog").is(":visible")) {
                            var S = getRangetxt(Store.currentSheetIndex, {
                                row: [0, r],
                                column: f
                            }, Store.currentSheetIndex);
                            $("#luckysheet-ifFormulaGenerator-multiRange-dialog input").val(S)
                        }
                        return luckysheetformula.rangedrag_column_start = !0,
                        luckysheetformula.rangestart = !1,
                        luckysheetformula.rangedrag_row_start = !1,
                        $("#luckysheet-formula-functionrange-select").css({
                            left: h,
                            width: d,
                            top: 0,
                            height: a - 0 - 1
                        }).show(),
                        $("#luckysheet-formula-help-c").hide(),
                        void luckysheet_count_show(h, 0, d, a - 0 - 1, [0, r], f)
                    }
                    luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                    Store.luckysheet_cols_selected_status = !0
                } else
                    Store.luckysheet_cols_selected_status = !0;
                if (Store.luckysheet_cols_selected_status) {
                    if (e.shiftKey) {
                        var _ = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1])
                          , C = 0
                          , T = 0
                          , E = [];
                        _.left > l ? (C = l,
                        T = _.left + _.width - l,
                        _.column[1] > _.column_focus && (_.column[1] = _.column_focus),
                        E = [i, _.column[1]]) : _.left == l ? (C = l,
                        T = _.left + _.width - l,
                        E = [i, _.column[0]]) : (C = _.left,
                        T = o - _.left - 1,
                        _.column[0] < _.column_focus && (_.column[0] = _.column_focus),
                        E = [_.column[0], i]),
                        _.column = E,
                        _.left_move = C,
                        _.width_move = T,
                        Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = _
                    } else
                        e.ctrlKey || (Store.luckysheet_select_save = []),
                        Store.luckysheet_select_save.push({
                            left: h,
                            width: d,
                            top: rowLocationByIndex(0)[0],
                            height: rowLocationByIndex(0)[1] - rowLocationByIndex(0)[0] - 1,
                            left_move: h,
                            width_move: d,
                            top_move: 0,
                            height_move: a - 0 - 1,
                            row: [0, r],
                            column: f,
                            row_focus: 0,
                            column_focus: i
                        });
                    selectHightlightShow(),
                    server.allowUpdate && server.saveParam("mv", Store.currentSheetIndex, Store.luckysheet_select_save)
                }
                selectHelpboxFill(),
                setTimeout((function() {
                    clearTimeout(Store.countfuncTimeout),
                    countfunc()
                }
                ), 101),
                Store.luckysheet_cols_menu_status && ($("#luckysheet-rightclick-menu").hide(),
                $("#luckysheet-cols-h-hover").hide(),
                $("#luckysheet-cols-menu-btn").hide(),
                Store.luckysheet_cols_menu_status = !1),
                e.stopPropagation()
            }
        }
        )).mousemove((function(e) {
            if (Store.luckysheet_cols_selected_status || Store.luckysheet_select_status)
                return $("#luckysheet-cols-h-hover").hide(),
                void $("#luckysheet-cols-menu-btn").hide();
            if (!Store.luckysheet_cols_menu_status && !Store.luckysheet_cols_change_size) {
                var t = mouseposition(e.pageX, e.pageY)[0] + $("#luckysheet-cols-h-c").scrollLeft()
                  , r = colLocation(t)
                  , a = r[1]
                  , n = r[0];
                $("#luckysheet-cols-h-hover").css({
                    left: n,
                    width: a - n - 1,
                    display: "block"
                }),
                $("#luckysheet-cols-menu-btn").css({
                    left: a - 19,
                    display: "block"
                }),
                $("#luckysheet-cols-change-size").css({
                    left: a - 5
                }),
                t < a && t >= a - 5 ? ($("#luckysheet-cols-change-size").css({
                    opacity: 0
                }),
                $("#luckysheet-cols-menu-btn").hide()) : ($("#luckysheet-change-size-line").hide(),
                $("#luckysheet-cols-change-size").css("opacity", 0))
            }
        }
        )).mouseleave((function(e) {
            Store.luckysheet_cols_menu_status || Store.luckysheet_cols_change_size || ($("#luckysheet-cols-h-hover").hide(),
            $("#luckysheet-cols-menu-btn").hide(),
            $("#luckysheet-cols-change-size").css("opacity", 0))
        }
        )).mouseup((function(e) {
            if (3 == e.which) {
                if (isEditMode())
                    return;
                Store.luckysheetRightHeadClickIs = "column",
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left),
                $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right),
                $("#luckysheet-cols-rows-add").show(),
                $("#luckysheet-cols-rows-data").show(),
                $("#luckysheet-cols-rows-shift").hide(),
                $("#luckysheet-cols-rows-handleincell").hide(),
                $$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "block",
                $$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "block";
                var t = luckysheetConfigsetting.cellRightClickConfig;
                if (!(t.copy || t.copyAs || t.paste || t.insertColumn || t.deleteColumn || t.hideColumn || t.columnWidth || t.clear || t.matrix || t.sort || t.filter || t.chart || t.image || t.link || t.data || t.cellFormat))
                    return;
                $$("#luckysheet-top-left-add-selected").style.display = t.insertColumn ? "block" : "none",
                $$("#luckysheet-bottom-right-add-selected").style.display = t.insertColumn ? "block" : "none",
                $$("#luckysheet-del-selected").style.display = t.deleteColumn ? "block" : "none",
                $$("#luckysheet-hide-selected").style.display = t.hideColumn ? "block" : "none",
                $$("#luckysheet-show-selected").style.display = t.hideColumn ? "block" : "none",
                $$("#luckysheet-column-row-width-selected").style.display = t.columnWidth ? "block" : "none",
                t.copy || t.copyAs || t.paste || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none",
                t.insertColumn || t.deleteColumn || t.hideColumn || t.columnWidth || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none")),
                t.insertColumn || t.deleteColumn || t.hideColumn || t.columnWidth || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none"),
                t.clear || t.matrix || t.sort || t.filter || t.chart || t.image || t.link || t.data || t.cellFormat || ($$("#luckysheet-cols-rows-data .luckysheet-menuseparator").style.display = "none"),
                showrightclickmenu($("#luckysheet-rightclick-menu"), e.pageX, $(this).offset().top + 18),
                Store.luckysheet_cols_menu_status = !0;
                var r = $.extend(!0, {}, Store.config);
                null == r.columnlen && (r.columnlen = {});
                for (var a = null == r.columnlen[Store.luckysheet_select_save[0].column[0]] ? Store.defaultcollen : r.columnlen[Store.luckysheet_select_save[0].column[0]], n = !0, o = 0; o < Store.luckysheet_select_save.length; o++)
                    for (var l = Store.luckysheet_select_save[o], i = l.column[0], s = l.column[1], c = i; c <= s; c++) {
                        if ((null == r.columnlen[c] ? Store.defaultcollen : r.columnlen[c]) != a) {
                            n = !1;
                            break
                        }
                    }
                n ? $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val(a) : $("#luckysheet-cols-rows-add").find("input[type='number'].rcsize").val("")
            }
        }
        )),
        $("#luckysheet-rows-change-size").mousedown((function(e) {
            luckysheetPostil.removeActivePs(),
            ($("#luckysheet-modal-dialog-activeImage").is(":visible") || $("#luckysheet-modal-dialog-cropping").is(":visible")) && imageCtrl.cancelActiveImgItem(),
            $("#luckysheet-input-box").hide(),
            $("#luckysheet-rows-change-size").css({
                opacity: 1
            });
            var t = mouseposition(e.pageX, e.pageY)[1] + $("#luckysheet-rows-h").scrollTop()
              , r = $("#luckysheet-cell-main").scrollLeft()
              , a = $("#luckysheet-cell-main").width()
              , n = rowLocation(t)
              , o = n[1]
              , l = n[0]
              , i = n[2];
            Store.luckysheet_rows_change_size = !0,
            Store.luckysheet_scroll_status = !0,
            $("#luckysheet-change-size-line").css({
                height: "1px",
                "border-width": "0 0px 1px 0",
                top: o - 3,
                left: 0,
                width: r + a,
                display: "block",
                cursor: "ns-resize"
            }),
            $("#luckysheet-sheettable, #luckysheet-rows-h, #luckysheet-rows-h canvas").css("cursor", "ns-resize"),
            Store.luckysheet_rows_change_size_start = [l, i],
            $("#luckysheet-rightclick-menu").hide(),
            $("#luckysheet-rows-h-hover").hide(),
            $("#luckysheet-cols-menu-btn").hide(),
            e.stopPropagation()
        }
        )),
        $("#luckysheet-cols-change-size").mousedown((function(e) {
            luckysheetPostil.removeActivePs(),
            ($("#luckysheet-modal-dialog-activeImage").is(":visible") || $("#luckysheet-modal-dialog-cropping").is(":visible")) && imageCtrl.cancelActiveImgItem(),
            $("#luckysheet-input-box").hide(),
            $("#luckysheet-cols-change-size").css({
                opacity: 1
            });
            var t = mouseposition(e.pageX, e.pageY)
              , r = $("#luckysheet-cols-h-c").scrollLeft()
              , a = $("#luckysheet-cell-main").scrollTop()
              , n = $("#luckysheet-cell-main").height()
              , o = t[0] + r
              , l = Store.visibledatarow.length - 1
              , i = (Store.visibledatarow[l],
            colLocation(o))
              , s = i[1]
              , c = i[0]
              , u = i[2];
            Store.luckysheet_cols_change_size = !0,
            Store.luckysheet_scroll_status = !0,
            $("#luckysheet-change-size-line").css({
                height: n + a,
                "border-width": "0 1px 0 0",
                top: 0,
                left: s - 3,
                width: "1px",
                display: "block",
                cursor: "ew-resize"
            }),
            $("#luckysheet-sheettable, #luckysheet-cols-h-c, .luckysheet-cols-h-cells, .luckysheet-cols-h-cells canvas").css("cursor", "ew-resize"),
            Store.luckysheet_cols_change_size_start = [c, u],
            $("#luckysheet-rightclick-menu").hide(),
            $("#luckysheet-cols-h-hover").hide(),
            $("#luckysheet-cols-menu-btn").hide(),
            Store.luckysheet_cols_dbclick_times = 0,
            e.stopPropagation()
        }
        )).dblclick((function() {
            luckysheetcolsdbclick()
        }
        )),
        $("#luckysheet-cols-menu-btn").click((function(e) {
            var t = $("#luckysheet-rightclick-menu")
              , r = $(this).offset();
            $("#luckysheet-cols-rows-shift").show(),
            Store.luckysheetRightHeadClickIs = "column",
            $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column),
            $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left),
            $("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right),
            $("#luckysheet-cols-rows-add").show(),
            $("#luckysheet-cols-rows-data").hide(),
            $("#luckysheet-cols-rows-shift").show(),
            $("#luckysheet-cols-rows-handleincell").hide(),
            $$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "block",
            $$("#luckysheet-cols-rows-shift .luckysheet-menuseparator").style.display = "block";
            var a = luckysheetConfigsetting.cellRightClickConfig;
            (a.copy || a.copyAs || a.paste || a.insertColumn || a.deleteColumn || a.hideColumn || a.columnWidth || a.sort) && ($$("#luckysheet-top-left-add-selected").style.display = a.insertColumn ? "block" : "none",
            $$("#luckysheet-bottom-right-add-selected").style.display = a.insertColumn ? "block" : "none",
            $$("#luckysheet-del-selected").style.display = a.deleteColumn ? "block" : "none",
            $$("#luckysheet-hide-selected").style.display = a.hideColumn ? "block" : "none",
            $$("#luckysheet-show-selected").style.display = a.hideColumn ? "block" : "none",
            $$("#luckysheet-column-row-width-selected").style.display = a.columnWidth ? "block" : "none",
            a.copy || a.copyAs || a.paste || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none",
            a.insertColumn || a.deleteColumn || a.hideColumn || a.columnWidth || ($$("#luckysheet-cols-rows-shift .luckysheet-menuseparator").style.display = "none")),
            a.insertColumn || a.deleteColumn || a.hideColumn || a.columnWidth || ($$("#luckysheet-cols-rows-add .luckysheet-menuseparator").style.display = "none"),
            a.sort || ($$("#luckysheet-cols-rows-shift .luckysheet-menuseparator").style.display = "none"),
            showrightclickmenu(t, r.left, r.top + 18),
            Store.luckysheet_cols_menu_status = !0)
        }
        )),
        $("#luckysheet-top-left-add-selected").click((function(e) {
            if ("INPUT" !== e.target.nodeName) {
                $("#luckysheet-rightclick-menu").hide(),
                luckysheetContainerFocus();
                var t = locale()
                  , r = t.drag
                  , a = t.info;
                if (Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(r.noMulti) : tooltip.info(r.noMulti, "");
                else {
                    var n = $(this).find("input").val();
                    if (isRealNum(n))
                        if ((n = parseInt(n)) < 1 || n > 100)
                            isEditMode() ? alert(a.tipInputNumberLimit) : tooltip.info(a.tipInputNumberLimit, "");
                        else {
                            var o = Store.luckysheet_select_save[0][Store.luckysheetRightHeadClickIs][0];
                            luckysheetextendtable(Store.luckysheetRightHeadClickIs, o, n, "lefttop")
                        }
                    else
                        isEditMode() ? alert(a.tipInputNumber) : tooltip.info(a.tipInputNumber, "")
                }
            }
        }
        )),
        $("#luckysheetColsRowsHandleAdd_row").click((function(e) {
            ($("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus(),
            !1 !== Store.allowEdit) && luckysheetextendtable("row", Store.luckysheet_select_save[0].row[0], 1, "lefttop")
        }
        )),
        $("#luckysheetColsRowsHandleAdd_column").click((function(e) {
            ($("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus(),
            !1 !== Store.allowEdit) && luckysheetextendtable("column", Store.luckysheet_select_save[0].column[0], 1, "lefttop")
        }
        )),
        $("#luckysheet-bottom-right-add-selected").click((function(e) {
            if ("INPUT" !== e.target.nodeName) {
                $("#luckysheet-rightclick-menu").hide(),
                luckysheetContainerFocus();
                var t = locale()
                  , r = t.drag
                  , a = t.info;
                if (Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(r.noMulti) : tooltip.info(r.noMulti, "");
                else {
                    var n = $(this).find("input").val();
                    if (isRealNum(n))
                        if ((n = parseInt(n)) < 1 || n > 100)
                            isEditMode() ? alert(a.tipInputNumberLimit) : tooltip.info(a.tipInputNumberLimit, "");
                        else {
                            var o = Store.luckysheet_select_save[0][Store.luckysheetRightHeadClickIs][1];
                            luckysheetextendtable(Store.luckysheetRightHeadClickIs, o, n, "rightbottom")
                        }
                    else
                        isEditMode() ? alert(a.tipInputNumber) : tooltip.info(a.tipInputNumber, "")
                }
            }
        }
        )),
        $("#luckysheet-del-selected, #luckysheet-del-selected_t").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            if (Store.luckysheet_select_save.length > 1)
                ("row" == Store.luckysheetRightHeadClickIs || "column" == Store.luckysheetRightHeadClickIs) && (isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, ""));
            else {
                var r = Store.luckysheet_select_save[0][Store.luckysheetRightHeadClickIs][0]
                  , a = Store.luckysheet_select_save[0][Store.luckysheetRightHeadClickIs][1];
                luckysheetdeletetable(Store.luckysheetRightHeadClickIs, r, a)
            }
        }
        )),
        $("#luckysheet-delRows").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            Store.luckysheet_select_save.length > 1 ? ("row" == Store.luckysheetRightHeadClickIs || "column" == Store.luckysheetRightHeadClickIs) && (isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, "")) : luckysheetdeletetable("row", Store.luckysheet_select_save[0].row[0], Store.luckysheet_select_save[0].row[1])
        }
        )),
        $("#luckysheet-delCols").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            Store.luckysheet_select_save.length > 1 ? ("row" == Store.luckysheetRightHeadClickIs || "column" == Store.luckysheetRightHeadClickIs) && (isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, "")) : luckysheetdeletetable("column", Store.luckysheet_select_save[0].column[0], Store.luckysheet_select_save[0].column[1])
        }
        )),
        $("#luckysheet-hide-selected").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            if (Store.luckysheet_select_save.length > 1)
                ("row" == Store.luckysheetRightHeadClickIs || "column" == Store.luckysheetRightHeadClickIs) && (isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, ""));
            else if ("row" == Store.luckysheetRightHeadClickIs) {
                if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows"))
                    return;
                var r = $.extend(!0, {}, Store.config);
                null == r.rowhidden && (r.rowhidden = {});
                for (var a = 0; a < Store.luckysheet_select_save.length; a++)
                    for (var n = Store.luckysheet_select_save[a].row[0], o = Store.luckysheet_select_save[a].row[1], l = n; l <= o; l++)
                        r.rowhidden[l] = 0;
                if (Store.clearjfundo) {
                    var i = {
                        type: "showHidRows"
                    };
                    i.sheetIndex = Store.currentSheetIndex,
                    i.config = $.extend(!0, {}, Store.config),
                    i.curconfig = r,
                    Store.jfundo = [],
                    Store.jfredo.push(i)
                }
                Store.config = r,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, r.rowhidden, {
                    k: "rowhidden"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
            } else if ("column" == Store.luckysheetRightHeadClickIs) {
                if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns"))
                    return;
                var s = $.extend(!0, {}, Store.config);
                null == s.colhidden && (s.colhidden = {});
                for (var c = 0; c < Store.luckysheet_select_save.length; c++)
                    for (var u = Store.luckysheet_select_save[c].column[0], h = Store.luckysheet_select_save[c].column[1], d = u; d <= h; d++)
                        s.colhidden[d] = 0;
                if (Store.clearjfundo) {
                    var f = {
                        type: "showHidCols"
                    };
                    f.sheetIndex = Store.currentSheetIndex,
                    f.config = $.extend(!0, {}, Store.config),
                    f.curconfig = s,
                    Store.jfundo = [],
                    Store.jfredo.push(f)
                }
                Store.config = s,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, s.colhidden, {
                    k: "colhidden"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
            }
        }
        )),
        $("#luckysheet-show-selected").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            if (Store.luckysheet_select_save.length > 1)
                ("row" == Store.luckysheetRightHeadClickIs || "column" == Store.luckysheetRightHeadClickIs) && (isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, ""));
            else if ("row" == Store.luckysheetRightHeadClickIs) {
                if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows"))
                    return;
                var r = $.extend(!0, {}, Store.config);
                if (null == r.rowhidden)
                    return;
                for (var a = 0; a < Store.luckysheet_select_save.length; a++)
                    for (var n = Store.luckysheet_select_save[a].row[0], o = Store.luckysheet_select_save[a].row[1], l = n; l <= o; l++)
                        delete r.rowhidden[l];
                if (Store.clearjfundo) {
                    var i = {
                        type: "showHidRows"
                    };
                    i.sheetIndex = Store.currentSheetIndex,
                    i.config = $.extend(!0, {}, Store.config),
                    i.curconfig = r,
                    Store.jfundo = [],
                    Store.jfredo.push(i)
                }
                Store.config = r,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, r.rowhidden, {
                    k: "rowhidden"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
            } else if ("column" == Store.luckysheetRightHeadClickIs) {
                if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns"))
                    return;
                var s = $.extend(!0, {}, Store.config);
                if (null == s.colhidden)
                    return;
                for (var c = 0; c < Store.luckysheet_select_save.length; c++)
                    for (var u = Store.luckysheet_select_save[c].column[0], h = Store.luckysheet_select_save[c].column[1], d = u; d <= h; d++)
                        delete s.colhidden[d];
                if (Store.clearjfundo) {
                    var f = {
                        type: "showHidCols"
                    };
                    f.sheetIndex = Store.currentSheetIndex,
                    f.config = $.extend(!0, {}, Store.config),
                    f.curconfig = s,
                    Store.jfundo = [],
                    Store.jfredo.push(f)
                }
                Store.config = s,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                server.saveParam("cg", Store.currentSheetIndex, s.colhidden, {
                    k: "colhidden"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)
            }
        }
        )),
        $("#luckysheet-delCellsMoveLeft").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            Store.luckysheet_select_save.length > 1 ? isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, "") : luckysheetDeleteCell("moveLeft", Store.luckysheet_select_save[0].row[0], Store.luckysheet_select_save[0].row[1], Store.luckysheet_select_save[0].column[0], Store.luckysheet_select_save[0].column[1])
        }
        )),
        $("#luckysheet-delCellsMoveUp").click((function(e) {
            $("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus();
            var t = locale().drag;
            Store.luckysheet_select_save.length > 1 ? isEditMode() ? alert(t.noMulti) : tooltip.info(t.noMulti, "") : luckysheetDeleteCell("moveUp", Store.luckysheet_select_save[0].row[0], Store.luckysheet_select_save[0].row[1], Store.luckysheet_select_save[0].column[0], Store.luckysheet_select_save[0].column[1])
        }
        )),
        $("#luckysheet-delete-text").click((function() {
            if (checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex) && ($("#luckysheet-rightclick-menu").hide(),
            luckysheetContainerFocus(),
            !1 !== Store.allowEdit && Store.luckysheet_select_save.length > 0)) {
                for (var e = editor.deepCopyFlowData(Store.flowdata), t = !1, r = 0; r < Store.luckysheet_select_save.length; r++) {
                    var a = Store.luckysheet_select_save[r].row[0]
                      , n = Store.luckysheet_select_save[r].row[1]
                      , o = Store.luckysheet_select_save[r].column[0]
                      , l = Store.luckysheet_select_save[r].column[1];
                    if (hasPartMC(Store.config, a, n, o, l)) {
                        t = !0;
                        break
                    }
                }
                if (t) {
                    var i = locale().drag;
                    return void (isEditMode() ? alert(i.noPartMerge) : tooltip.info(i.noPartMerge, ""))
                }
                for (var s = 0; s < Store.luckysheet_select_save.length; s++)
                    for (var c = Store.luckysheet_select_save[s].row[0], u = Store.luckysheet_select_save[s].row[1], h = Store.luckysheet_select_save[s].column[0], d = Store.luckysheet_select_save[s].column[1], f = c; f <= u; f++)
                        for (var m = h; m <= d; m++)
                            pivotTable.isPivotRange(f, m) || ("object" == getObjType(e[f][m]) ? (delete e[f][m].m,
                            delete e[f][m].v,
                            null != e[f][m].f && (delete e[f][m].f,
                            luckysheetformula.delFunctionGroup(f, m, Store.currentSheetIndex),
                            delete e[f][m].spl),
                            null != e[f][m].ct && "inlineStr" == e[f][m].ct.t && delete e[f][m].ct) : e[f][m] = null);
                jfrefreshgrid(e, Store.luckysheet_select_save)
            }
        }
        )),
        $("#luckysheet-column-row-width-selected").click((function(e) {
            if ("INPUT" !== e.target.nodeName) {
                $("#luckysheet-rightclick-menu").hide(),
                luckysheetContainerFocus();
                var t, r = parseInt($(this).closest(".luckysheet-cols-menuitem").find("input[type='number']").val().trim()), a = locale().info, n = $.extend(!0, {}, Store.config), o = null;
                if ("row" == Store.luckysheetRightHeadClickIs) {
                    if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows"))
                        return;
                    if (r < 0 || r > 545)
                        return void (isEditMode() ? alert(a.tipRowHeightLimit) : tooltip.info(a.tipRowHeightLimit, ""));
                    t = "resizeR",
                    null == n.rowlen && (n.rowlen = {});
                    for (var l = 0; l < Store.luckysheet_select_save.length; l++)
                        for (var i = Store.luckysheet_select_save[l].row[0], s = Store.luckysheet_select_save[l].row[1], c = i; c <= s; c++)
                            n.rowlen[c] = r,
                            o = imageCtrl.moveChangeSize("row", c, r)
                } else if ("column" == Store.luckysheetRightHeadClickIs) {
                    if (!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns"))
                        return;
                    if (r < 0 || r > 2038)
                        return void (isEditMode() ? alert(a.tipColumnWidthLimit) : tooltip.info(a.tipColumnWidthLimit, ""));
                    t = "resizeC",
                    null == n.columnlen && (n.columnlen = {});
                    for (var u = 0; u < Store.luckysheet_select_save.length; u++)
                        for (var h = Store.luckysheet_select_save[u].column[0], d = Store.luckysheet_select_save[u].column[1], f = h; f <= d; f++)
                            n.columnlen[f] = r,
                            o = imageCtrl.moveChangeSize("column", f, r)
                }
                Store.clearjfundo && (Store.jfundo = [],
                Store.jfredo.push({
                    type: "resize",
                    ctrlType: t,
                    sheetIndex: Store.currentSheetIndex,
                    config: $.extend(!0, {}, Store.config),
                    curconfig: $.extend(!0, {}, n),
                    images: $.extend(!0, {}, imageCtrl.images),
                    curImages: $.extend(!0, {}, o)
                })),
                Store.config = n,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config,
                Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].images = o,
                server.saveParam("all", Store.currentSheetIndex, o, {
                    k: "images"
                }),
                imageCtrl.images = o,
                imageCtrl.allImagesShow(),
                "row" == Store.luckysheetRightHeadClickIs ? (server.saveParam("cg", Store.currentSheetIndex, n.rowlen, {
                    k: "rowlen"
                }),
                jfrefreshgrid_rhcw(Store.flowdata.length, null)) : "column" == Store.luckysheetRightHeadClickIs && (server.saveParam("cg", Store.currentSheetIndex, n.columnlen, {
                    k: "columnlen"
                }),
                jfrefreshgrid_rhcw(null, Store.flowdata[0].length))
            }
        }
        ))
    }
    function luckysheetcolsdbclick() {
        Store.luckysheet_cols_change_size = !1,
        $("#luckysheet-change-size-line").hide(),
        $("#luckysheet-cols-change-size").css("opacity", 0),
        $("#luckysheet-sheettable, #luckysheet-cols-h-c, .luckysheet-cols-h-cells, .luckysheet-cols-h-cells canvas").css("cursor", "default");
        var e = mouseposition(event.pageX, event.pageY)
          , t = $("#luckysheet-cols-h-c").scrollLeft()
          , r = colLocation(e[0] + t)[2]
          , a = editor.deepCopyFlowData(Store.flowdata)
          , n = $("#luckysheetTableContent").get(0).getContext("2d")
          , o = $.extend(!0, {}, Store.config);
        null == o.columnlen && (o.columnlen = {});
        var l = {}
          , i = $("#luckysheet-cell-main").scrollTop()
          , s = Store.luckysheetTableContentHW[1]
          , c = luckysheet_searcharray(Store.visibledatarow, i)
          , u = luckysheet_searcharray(Store.visibledatarow, i + s);
        (u += u - c) >= a.length && (u = a.length - 1);
        for (var h = 0; h < Store.luckysheet_select_save.length; h++) {
            var d = Store.luckysheet_select_save[h].column[0]
              , f = Store.luckysheet_select_save[h].column[1];
            if (r < d || r > f) {
                if (r in l)
                    continue;
                for (var m = Store.defaultcollen, p = c; p <= u; p++) {
                    var g = a[p][r];
                    if (null != g && (!isRealNull(g.v) || isInlineStringCell(g))) {
                        var y = getCellTextInfo(g, n, {
                            r: p,
                            c: r,
                            cellWidth: colLocationByIndex(r)[1] - colLocationByIndex(r)[0] - 2
                        })
                          , v = 0;
                        null != y && (v = y.textWidthAll),
                        v + 6 > m && (m = v + 6)
                    }
                }
                m != Store.defaultcollen && (o.columnlen[r] = m,
                o.customWidth && delete o.customWidth[r]),
                l[r] = 1
            } else
                for (var A = d; A <= f; A++)
                    if (!(A in l)) {
                        for (var b = Store.defaultcollen, k = c; k <= u; k++) {
                            var w = a[k][A];
                            if (null != w && (!isRealNull(w.v) || isInlineStringCell(w))) {
                                var x = getCellTextInfo(w, n, {
                                    r: k,
                                    c: A,
                                    cellWidth: colLocationByIndex(A)[1] - colLocationByIndex(A)[0] - 2
                                })
                                  , S = 0;
                                null != x && (S = x.textWidthAll),
                                S + 6 > b && (b = S + 6)
                            }
                        }
                        b != Store.defaultcollen && (o.columnlen[A] = b,
                        o.customWidth && delete o.customWidth[A]),
                        l[A] = 1
                    }
        }
        jfrefreshgridall(Store.flowdata[0].length, Store.flowdata.length, Store.flowdata, o, Store.luckysheet_select_save, "resizeC", "columnlen")
    }
    function formulaMoveEvent(e, t, r, a) {
        var n;
        if (!$("#luckysheet-formula-search-c").is(":visible") || "up" != e && "down" != e) {
            if ($("#luckysheet-formula-functionrange-select").is(":visible")) {
                if (t && r)
                    luckysheetMoveHighlightRange2(e, "rangeOfFormula");
                else if (t)
                    luckysheetMoveHighlightCell2(e, "rangeOfFormula");
                else if (r) {
                    var o = e
                      , l = 1;
                    "up" == e && (o = "down",
                    l = -1),
                    "left" == e && (o = "right",
                    l = -1),
                    luckysheetMoveHighlightRange(o, l, "rangeOfFormula")
                } else {
                    var i = e
                      , s = 1;
                    "up" == e && (i = "down",
                    s = -1),
                    "left" == e && (i = "right",
                    s = -1),
                    luckysheetMoveHighlightCell(i, s, "rangeOfFormula")
                }
                a.preventDefault()
            } else if (luckysheetformula.israngeseleciton()) {
                var c = $(window.getSelection().anchorNode);
                if (null == c.parent().next().text() || "" == c.parent().next().text()) {
                    var u = $("#luckysheet-input-box #luckysheet-input-box-index").text()
                      , h = luckysheetformula.getcellrange(u);
                    null == h && (h = luckysheetformula.getcellrange($("#luckysheet-input-box-index").text()));
                    var d = h.row[0]
                      , f = h.row[1]
                      , m = h.column[0]
                      , p = h.column[1]
                      , g = Store.visibledatarow[f]
                      , y = d - 1 == -1 ? 0 : Store.visibledatarow[d - 1]
                      , v = Store.visibledatacolumn[p]
                      , A = m - 1 == -1 ? 0 : Store.visibledatacolumn[m - 1];
                    if (luckysheetformula.func_selectedrange = {
                        left: A,
                        width: v - A - 1,
                        top: y,
                        height: g - y - 1,
                        left_move: A,
                        width_move: v - A - 1,
                        top_move: y,
                        height_move: g - y - 1,
                        row: [d, f],
                        column: [m, p],
                        row_focus: d,
                        column_focus: m
                    },
                    luckysheetformula.rangeSetValue({
                        row: [d, f],
                        column: [m, p]
                    }),
                    luckysheetformula.rangestart = !0,
                    luckysheetformula.rangedrag_column_start = !1,
                    luckysheetformula.rangedrag_row_start = !1,
                    t && r)
                        luckysheetMoveHighlightRange2(e, "rangeOfFormula");
                    else if (t)
                        luckysheetMoveHighlightCell2(e, "rangeOfFormula");
                    else if (r) {
                        var b = e
                          , k = 1;
                        "up" == e && (b = "down",
                        k = -1),
                        "left" == e && (b = "right",
                        k = -1),
                        luckysheetMoveHighlightRange(b, k, "rangeOfFormula")
                    } else {
                        var w = e
                          , x = 1;
                        "up" == e && (w = "down",
                        x = -1),
                        "left" == e && (w = "right",
                        x = -1),
                        luckysheetMoveHighlightCell(w, x, "rangeOfFormula")
                    }
                    a.preventDefault()
                }
            } else if (!t && !r) {
                var S = $(window.getSelection().anchorNode)
                  , _ = window.getSelection().anchorOffset;
                "up" == e ? (S.parent().is("span") && 0 == S.parent().next().length && _ > 0 || S.is("#luckysheet-rich-text-editor") && S.context.childElementCount == _ || S.parent().is("#luckysheet-rich-text-editor") && S.context.length == _) && (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                luckysheetMoveHighlightCell("down", -1, "rangeOfSelect"),
                a.preventDefault()) : "down" == e ? (S.parent().is("span") && 0 == S.parent().next().length && _ > 0 || S.is("#luckysheet-rich-text-editor") && S.context.childElementCount == _ || S.parent().is("#luckysheet-rich-text-editor") && S.context.length == _) && (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                luckysheetMoveHighlightCell("down", 1, "rangeOfSelect"),
                a.preventDefault()) : "left" == e ? S.parent().is("span") && 0 == S.parent().prev().length && 0 == _ || S.is("#luckysheet-rich-text-editor") && 1 == _ || S.parent().is("#luckysheet-rich-text-editor") && 0 == _ ? (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                luckysheetMoveHighlightCell("right", -1, "rangeOfSelect"),
                a.preventDefault()) : luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor")) : "right" == e && (S.parent().is("span") && 0 == S.parent().next().length && _ > 0 || S.is("#luckysheet-rich-text-editor") && S.context.childElementCount == _ || S.parent().is("#luckysheet-rich-text-editor") && S.context.length == _ ? (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                luckysheetMoveHighlightCell("right", 1, "rangeOfSelect"),
                a.preventDefault()) : luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor")))
            }
        } else
            "down" == e ? 0 == (n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active").next()).length && (n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").first()) : "up" == e && 0 == (n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active").prev()).length && (n = $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").last()),
            $("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item").removeClass("luckysheet-formula-search-item-active"),
            n.addClass("luckysheet-formula-search-item-active"),
            a.preventDefault()
    }
    function keyboardInitial() {
        var e = locale().drag;
        $("#luckysheet-input-box").click((function() {
            luckysheetformula.rangeHightlightselected($("#luckysheet-rich-text-editor"))
        }
        )).add("#" + Store.container).on("keydown", (function(t) {
            var r = t.ctrlKey
              , a = t.altKey
              , n = t.shiftKey
              , o = t.keyCode;
            if ($("#luckysheet-modal-dialog-mask").is(":visible") || $(t.target).hasClass("luckysheet-mousedown-cancel") || $(t.target).hasClass("sp-input") || parseInt($("#luckysheet-input-box").css("top")) > 0 && $(t.target).closest(".luckysheet-input-box").length > 0 && o != keycode.ENTER && o != keycode.TAB && o != keycode.UP && o != keycode.DOWN && o != keycode.LEFT && o != keycode.RIGHT) {
                var l = $(window.getSelection().anchorNode);
                if ((l.parent().is("#luckysheet-helpbox-cell") || l.is("#luckysheet-helpbox-cell")) && o == keycode.ENTER) {
                    var i = $("#luckysheet-helpbox-cell").text();
                    if (luckysheetformula.iscelldata(i)) {
                        var s = luckysheetformula.getcellrange(i);
                        Store.luckysheet_select_save = [{
                            row: s.row,
                            column: s.column,
                            row_focus: s.row[0],
                            column_focus: s.column[0]
                        }],
                        selectHightlightShow(),
                        $("#luckysheet-helpbox-cell").blur();
                        var c = $("#luckysheet-cell-main").scrollLeft()
                          , u = $("#luckysheet-cell-main").scrollTop()
                          , h = $("#luckysheet-cell-main").height()
                          , d = $("#luckysheet-cell-main").width()
                          , f = Store.visibledatarow[s.row[1]]
                          , m = s.row[0] - 1 == -1 ? 0 : Store.visibledatarow[s.row[0] - 1]
                          , p = Store.visibledatacolumn[s.column[1]]
                          , g = s.column[0] - 1 == -1 ? 0 : Store.visibledatacolumn[s.column[0] - 1];
                        p - c - d + 20 > 0 ? $("#luckysheet-scrollbar-x").scrollLeft(p - d + 20) : g - c - 20 < 0 && $("#luckysheet-scrollbar-x").scrollLeft(g - 20),
                        f - u - h + 20 > 0 ? $("#luckysheet-scrollbar-y").scrollTop(f - h + 20) : m - u - 20 < 0 && $("#luckysheet-scrollbar-y").scrollTop(m - 20)
                    }
                }
            } else if (!($("#luckysheet-modal-dialog-mask").is(":visible") || $(t.target).hasClass("luckysheet-mousedown-cancel") || $(t.target).hasClass("formulaInputFocus"))) {
                var y = $("#luckysheet-input-box");
                if ((a || t.metaKey) && o == keycode.ENTER && parseInt(y.css("top")) > 0) {
                    var v = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
                      , A = v.row_focus
                      , b = v.column_focus;
                    enterKeyControll(Store.flowdata[A][b]),
                    t.preventDefault()
                } else if (o == keycode.ENTER && parseInt(y.css("top")) > 0)
                    $("#luckysheet-formula-search-c").is(":visible") && null != luckysheetformula.searchFunctionCell ? luckysheetformula.searchFunctionEnter($("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active")) : (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                    Store.luckysheet_select_save = [{
                        row: [Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[0]],
                        column: [Store.luckysheetCellUpdate[1], Store.luckysheetCellUpdate[1]],
                        row_focus: Store.luckysheetCellUpdate[0],
                        column_focus: Store.luckysheetCellUpdate[1]
                    }],
                    luckysheetMoveHighlightCell("down", 1, "rangeOfSelect")),
                    $("#luckysheet-search-formula-parm").is(":visible") && $("#luckysheet-search-formula-parm").hide(),
                    $("#luckysheet-search-formula-parm-select").is(":visible") && $("#luckysheet-search-formula-parm-select").hide(),
                    t.preventDefault();
                else if (o == keycode.TAB) {
                    if (parseInt(y.css("top")) > 0)
                        return;
                    luckysheetMoveHighlightCell("right", 1, "rangeOfSelect"),
                    t.preventDefault()
                } else if (o == keycode.F2) {
                    if (parseInt(y.css("top")) > 0)
                        return;
                    var k = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
                    luckysheetupdateCell(k.row_focus, k.column_focus, Store.flowdata),
                    t.preventDefault()
                } else if (o == keycode.F4 && parseInt(y.css("top")) > 0)
                    luckysheetformula.setfreezonFuc(t),
                    t.preventDefault();
                else if (o == keycode.ESC && parseInt(y.css("top")) > 0)
                    luckysheetformula.dontupdate(),
                    luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"),
                    t.preventDefault();
                else if (o == keycode.ENTER) {
                    if ($(t.target).hasClass("formulaInputFocus") || $("#luckysheet-conditionformat-dialog").is(":visible"))
                        return;
                    if (null != String.fromCharCode(o) && $("#luckysheet-cell-selected").is(":visible")) {
                        var w = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
                        luckysheetupdateCell(w.row_focus, w.column_focus, Store.flowdata),
                        t.preventDefault()
                    }
                } else {
                    if (r || t.metaKey) {
                        if (n) {
                            if (Store.luckysheet_shiftpositon = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]),
                            Store.luckysheet_shiftkeydown = !0,
                            o == keycode.UP) {
                                if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                    return;
                                luckysheetMoveHighlightRange2("up", "rangeOfSelect")
                            } else if (o == keycode.DOWN) {
                                if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                    return;
                                luckysheetMoveHighlightRange2("down", "rangeOfSelect")
                            } else if (o == keycode.LEFT) {
                                if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                    return;
                                luckysheetMoveHighlightRange2("left", "rangeOfSelect")
                            } else if (o == keycode.RIGHT) {
                                if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                    return;
                                luckysheetMoveHighlightRange2("right", "rangeOfSelect")
                            }
                        } else if (66 == o)
                            $("#luckysheet-icon-bold").click();
                        else {
                            if (67 == o) {
                                if (null != imageCtrl.currentImgId)
                                    return void imageCtrl.copyImgItem(t);
                                if (menuButton.luckysheetPaintModelOn && menuButton.cancelPaintModel(),
                                0 == Store.luckysheet_select_save.length)
                                    return;
                                if (null != Store.config.merge) {
                                    for (var x = !1, S = 0; S < Store.luckysheet_select_save.length; S++) {
                                        var _ = Store.luckysheet_select_save[S].row[0]
                                          , C = Store.luckysheet_select_save[S].row[1]
                                          , T = Store.luckysheet_select_save[S].column[0]
                                          , E = Store.luckysheet_select_save[S].column[1];
                                        if (x = hasPartMC(Store.config, _, C, T, E))
                                            break
                                    }
                                    if (x)
                                        return void (isEditMode() ? alert(e.noMerge) : tooltip.info(e.noMerge, ""))
                                }
                                var I = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].luckysheet_conditionformat_save;
                                if (Store.luckysheet_select_save.length > 1 && null != I && I.length > 0) {
                                    var R = !1
                                      , B = conditionformat.getComputeMap();
                                    e: for (var N = 0; N < Store.luckysheet_select_save.length && !R; N++)
                                        for (var F = Store.luckysheet_select_save[N].row[0], P = Store.luckysheet_select_save[N].row[1], L = Store.luckysheet_select_save[N].column[0], O = Store.luckysheet_select_save[N].column[1], D = F; D <= P; D++)
                                            for (var M = L; M <= O; M++)
                                                if (null != conditionformat.checksCF(D, M, B)) {
                                                    R = !0;
                                                    continue e
                                                }
                                    if (R)
                                        return void (isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, ""))
                                }
                                if (Store.luckysheet_select_save.length > 1) {
                                    for (var U = !0, H = Store.luckysheet_select_save[0].row[0], q = Store.luckysheet_select_save[0].row[1], z = !0, j = Store.luckysheet_select_save[0].column[0], V = Store.luckysheet_select_save[0].column[1], Q = 1; Q < Store.luckysheet_select_save.length; Q++)
                                        Store.luckysheet_select_save[Q].row[0] == H && Store.luckysheet_select_save[Q].row[1] == q || (U = !1),
                                        Store.luckysheet_select_save[Q].column[0] == j && Store.luckysheet_select_save[Q].column[1] == V || (z = !1);
                                    if (!U && !z || selectIsOverlap())
                                        return void (isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, ""))
                                }
                                return selection.copy(t),
                                Store.luckysheet_paste_iscut = !1,
                                luckysheetactiveCell(),
                                void t.stopPropagation()
                            }
                            if (70 == o)
                                luckysheetSearchReplace.createDialog(0),
                                luckysheetSearchReplace.init(),
                                $("#luckysheet-search-replace #searchInput input").focus();
                            else if (72 == o)
                                luckysheetSearchReplace.createDialog(1),
                                luckysheetSearchReplace.init(),
                                $("#luckysheet-search-replace #searchInput input").focus();
                            else if (73 == o)
                                $("#luckysheet-icon-italic").click();
                            else {
                                if (86 == o) {
                                    if (isEditMode())
                                        return;
                                    if ($(t.target).hasClass("formulaInputFocus"))
                                        return;
                                    return Store.luckysheet_select_save.length > 1 ? void (isEditMode() ? alert(e.noPaste) : tooltip.info(e.noPaste, "")) : (selection.isPasteAction = !0,
                                    luckysheetactiveCell(),
                                    void t.stopPropagation())
                                }
                                if (88 == o) {
                                    if (menuButton.luckysheetPaintModelOn && menuButton.cancelPaintModel(),
                                    0 == Store.luckysheet_select_save.length)
                                        return;
                                    if (null != Store.config.merge) {
                                        for (var G = !1, K = 0; K < Store.luckysheet_select_save.length; K++) {
                                            var W = Store.luckysheet_select_save[K].row[0]
                                              , Y = Store.luckysheet_select_save[K].row[1]
                                              , X = Store.luckysheet_select_save[K].column[0]
                                              , J = Store.luckysheet_select_save[K].column[1];
                                            if (G = hasPartMC(Store.config, W, Y, X, J))
                                                break
                                        }
                                        if (G)
                                            return void (luckysheetConfigsetting.editMode ? alert(_locale_drag.noMerge) : tooltip.info(_locale_drag.noMerge, ""))
                                    }
                                    return Store.luckysheet_select_save.length > 1 ? void (isEditMode() ? alert(e.noMulti) : tooltip.info(e.noMulti, "")) : (selection.copy(t),
                                    Store.luckysheet_paste_iscut = !0,
                                    luckysheetactiveCell(),
                                    void t.stopPropagation())
                                }
                                if (90 == o)
                                    return controlHistory.redo(t),
                                    luckysheetactiveCell(),
                                    void t.stopPropagation();
                                if (89 == o)
                                    return controlHistory.undo(t),
                                    luckysheetactiveCell(),
                                    void t.stopPropagation();
                                if (o == keycode.UP) {
                                    if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                        return;
                                    luckysheetMoveHighlightCell2("up", "rangeOfSelect")
                                } else if (o == keycode.DOWN) {
                                    if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                        return;
                                    luckysheetMoveHighlightCell2("down", "rangeOfSelect")
                                } else if (o == keycode.LEFT) {
                                    if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                        return;
                                    luckysheetMoveHighlightCell2("left", "rangeOfSelect")
                                } else if (o == keycode.RIGHT) {
                                    if (parseInt(y.css("top")) > 0 || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                        return;
                                    luckysheetMoveHighlightCell2("right", "rangeOfSelect")
                                } else
                                    "A" == String.fromCharCode(o).toLocaleUpperCase() && ($("#luckysheet-left-top").trigger("mousedown"),
                                    $(document).trigger("mouseup"))
                            }
                        }
                        return void t.preventDefault()
                    }
                    if (n && (o == keycode.UP || o == keycode.DOWN || o == keycode.LEFT || o == keycode.RIGHT || a && (53 == o || 101 == o))) {
                        if (parseInt(y.css("top")) > 0 || $(t.target).hasClass("formulaInputFocus"))
                            return;
                        if (Store.luckysheet_shiftpositon = $.extend(!0, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]),
                        Store.luckysheet_shiftkeydown = !0,
                        o == keycode.UP) {
                            if ($("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                return;
                            luckysheetMoveHighlightRange("down", -1, "rangeOfSelect")
                        } else if (o == keycode.DOWN) {
                            if ($("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                return;
                            luckysheetMoveHighlightRange("down", 1, "rangeOfSelect")
                        } else if (o == keycode.LEFT) {
                            if ($("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                return;
                            luckysheetMoveHighlightRange("right", -1, "rangeOfSelect")
                        } else if (o == keycode.RIGHT) {
                            if ($("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                                return;
                            luckysheetMoveHighlightRange("right", 1, "rangeOfSelect")
                        } else
                            !a || 53 != o && 101 != o || $("#luckysheet-icon-strikethrough").click();
                        t.preventDefault()
                    } else if (o == keycode.ESC)
                        menuButton.luckysheetPaintModelOn ? menuButton.cancelPaintModel() : (cleargridelement(t),
                        t.preventDefault()),
                        selectHightlightShow();
                    else if (o == keycode.DELETE || o == keycode.BACKSPACE)
                        null != imageCtrl.currentImgId ? imageCtrl.removeImgItem() : $("#luckysheet-delete-text").click(),
                        t.preventDefault();
                    else if (8 == o && null != imageCtrl.currentImgId)
                        imageCtrl.removeImgItem(),
                        t.preventDefault();
                    else if (o == keycode.UP) {
                        if (parseInt(y.css("top")) > 0 || $(t.target).hasClass("formulaInputFocus") || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                            return;
                        luckysheetMoveHighlightCell("down", -1, "rangeOfSelect"),
                        t.preventDefault()
                    } else if (o == keycode.DOWN) {
                        if (parseInt(y.css("top")) > 0 || $(t.target).hasClass("formulaInputFocus") || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                            return;
                        luckysheetMoveHighlightCell("down", 1, "rangeOfSelect"),
                        t.preventDefault()
                    } else if (o == keycode.LEFT) {
                        if (parseInt(y.css("top")) > 0 || $(t.target).hasClass("formulaInputFocus") || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                            return;
                        luckysheetMoveHighlightCell("right", -1, "rangeOfSelect"),
                        t.preventDefault()
                    } else if (o == keycode.RIGHT) {
                        if (parseInt(y.css("top")) > 0 || $(t.target).hasClass("formulaInputFocus") || $("#luckysheet-singleRange-dialog").is(":visible") || $("#luckysheet-multiRange-dialog").is(":visible"))
                            return;
                        luckysheetMoveHighlightCell("right", 1, "rangeOfSelect"),
                        t.preventDefault()
                    } else if ((!(o >= 112 && o <= 123 || o <= 46 || 144 == o || 108 == o || t.ctrlKey || t.altKey || t.shiftKey && (37 == o || 38 == o || 39 == o || 40 == o)) || 8 == o || 32 == o || 46 == o || 0 == o || t.ctrlKey && 86 == o) && null != String.fromCharCode(o) && $("#luckysheet-cell-selected").is(":visible") && o != keycode.CAPSLOCK && o != keycode.WIN && 18 != o) {
                        var Z = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
                        luckysheetupdateCell(Z.row_focus, Z.column_focus, Store.flowdata, !0),
                        8 == o && $("#luckysheet-rich-text-editor").html("<br/>"),
                        luckysheetformula.functionInputHanddler($("#luckysheet-functionbox-cell"), $("#luckysheet-rich-text-editor"), o)
                    }
                }
                luckysheetactiveCell(),
                t.stopPropagation()
            }
        }
        )),
        $("#" + Store.container).add("#luckysheet-input-box").keydown((function(e) {
            if (!($("#luckysheet-modal-dialog-mask").is(":visible") || $(e.target).hasClass("luckysheet-mousedown-cancel") || $(e.target).hasClass("formulaInputFocus"))) {
                var t = e.ctrlKey
                  , r = (e.altKey,
                e.shiftKey)
                  , a = e.keyCode
                  , n = $("#luckysheet-input-box");
                a == keycode.ESC && parseInt($("#luckysheet-input-box").css("top")) > 0 ? (luckysheetformula.dontupdate(),
                luckysheetMoveHighlightCell("down", 0, "rangeOfSelect"),
                e.preventDefault()) : a == keycode.ENTER && parseInt(n.css("top")) > 0 ? $("#luckysheet-formula-search-c").is(":visible") && null != luckysheetformula.searchFunctionCell && (luckysheetformula.searchFunctionEnter($("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active")),
                e.preventDefault()) : a == keycode.TAB && parseInt(n.css("top")) > 0 ? ($("#luckysheet-formula-search-c").is(":visible") && null != luckysheetformula.searchFunctionCell ? luckysheetformula.searchFunctionEnter($("#luckysheet-formula-search-c").find(".luckysheet-formula-search-item-active")) : (luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
                luckysheetMoveHighlightCell("right", 1, "rangeOfSelect")),
                e.preventDefault()) : a == keycode.F4 && parseInt(n.css("top")) > 0 ? (luckysheetformula.setfreezonFuc(e),
                e.preventDefault()) : a == keycode.UP && parseInt(n.css("top")) > 0 ? formulaMoveEvent("up", t, r, e) : a == keycode.DOWN && parseInt(n.css("top")) > 0 ? formulaMoveEvent("down", t, r, e) : a == keycode.LEFT && parseInt(n.css("top")) > 0 ? formulaMoveEvent("left", t, r, e) : a == keycode.RIGHT && parseInt(n.css("top")) > 0 ? formulaMoveEvent("right", t, r, e) : (!(a >= 112 && a <= 123 || a <= 46 || 144 == a || 108 == a || e.ctrlKey || e.altKey || e.shiftKey && (37 == a || 38 == a || 39 == a || 40 == a || a == keycode.WIN || a == keycode.WIN_R || a == keycode.MENU)) || 8 == a || 32 == a || 46 == a || e.ctrlKey && 86 == a) && (luckysheetformula.functionInputHanddler($("#luckysheet-functionbox-cell"), $("#luckysheet-rich-text-editor"), a),
                setCenterInputPosition(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1], Store.flowdata))
            }
        }
        )).keyup((function(e) {
            var t = e.keyCode;
            e.shiftKey || 16 != t || (Store.luckysheet_shiftkeydown = !1,
            Store.luckysheet_shiftpositon = null),
            parseInt($("#luckysheet-input-box").css("top")),
            e.preventDefault()
        }
        )),
        $("#luckysheet_info_detail_input").val(server.title).css("width", 10 * getByteLen(server.title)).keydown((function() {
            event.ctrlKey,
            event.altKey,
            event.shiftKey;
            var e = event.keyCode
              , t = $(this);
            e == keycode.ENTER && t.blur().change()
        }
        )).bind("input propertychange", (function() {
            var e = 10 * getByteLen($(this).val())
              , t = $("#luckysheet_info_detail_export").outerWidth()
              , r = $("#luckysheet_info_detail_save").outerWidth()
              , f = $("#luckysheet_info_detail_save_as").outerWidth()
              , a = $("#luckysheet_info_detail_user").parent().outerWidth() + 60
              , n = $("#" + Store.container).outerWidth() - r - t - a - 100;
            e > n ? $("#luckysheet_info_detail_input").css("width", n) : $("#luckysheet_info_detail_input").css("width", e)
        }
        )).change((function() {
            server.saveParam("na", null, $(this).val())
        }
        )),
        $("#" + Store.container).add("input.luckysheet-mousedown-cancel").keydown((function(e) {
            var t = e.target.closest(".luckysheet-cols-menuitem");
            void 0 !== t && null != t && 13 === e.keyCode && $(t).trigger("click")
        }
        ))
    }
    function orderByInitial() {
        var e = locale();
        $("#luckysheetorderbyasc, #luckysheetorderbyasc_t").mousedown((function(e) {
            cleargridelement(e),
            sortColumnSeletion(Store.orderbyindex, !0),
            selectHightlightShow()
        }
        )),
        $("#luckysheetorderbydesc, #luckysheetorderbydesc_t").click((function(e) {
            cleargridelement(e),
            sortColumnSeletion(Store.orderbyindex, !1),
            selectHightlightShow()
        }
        ));
        var t = !0;
        $("#luckysheetorderby").click((function() {
            if (checkProtectionAuthorityNormal(Store.currentSheetIndex, "sort")) {
                $("body .luckysheet-cols-menu").hide();
                var r = e.sort;
                if (Store.luckysheet_select_save.length > 1)
                    isEditMode() ? alert(r.noRangeError) : tooltip.info(r.noRangeError, "");
                else {
                    var a = Store.luckysheet_select_save[0]
                      , n = a.row[0]
                      , o = a.row[1]
                      , l = a.column[0]
                      , i = a.column[1];
                    if (t) {
                        t = !1;
                        var s = '<div style="overflow: hidden;" class="luckysheet-sort-modal"><div><label><input type="checkbox" id="luckysheet-sort-haveheader"/><span>'.concat(r.hasTitle, '</span></label></div><div style="overflow-y:auto;" id="luckysheet-sort-dialog-tablec"><table data-itemcount="0" cellspacing="0"> <tr><td>').concat(r.hasTitle, ' <select name="sort_0"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </td> <td> <div><label><input value="asc" type="radio" checked="checked" name="sort_0"><span>').concat(r.asc, 'A-Z</span></label></div> <div><label><input value="desc" type="radio" name="sort_0"><span>').concat(r.desc, 'Z-A</span></label></div></td></tr></table></div><div style="background: #e5e5e5;border-top: 1px solid #f5f5f5; height: 1px; width: 100%;margin:2px 0px;margin-bottom:10px;"></div> <div> <span style="font-weight: bold; text-decoration: underline;text-align:center;color: blue;cursor: pointer;" class="luckysheet-sort-dialog-additem">+ ').concat(r.addOthers, "</span> </div> </div>");
                        $("body").append(replaceHtml$1(modelHTML, {
                            id: "luckysheet-sort-dialog",
                            addclass: "",
                            title: e.sort.sortTitle,
                            content: s,
                            botton: '<button id="luckysheet-sort-modal-confirm" class="btn btn-primary">'.concat(r.confirm, '</button><button class="btn btn-default luckysheet-model-close-btn">').concat(r.close, "</button>")
                        })),
                        $("#luckysheet-sort-dialog .luckysheet-sort-dialog-additem").click((function() {
                            for (var e = Store.luckysheet_select_save[0], t = e.row[0], a = (e.row[1],
                            e.column[0]), n = e.column[1], o = "", l = $("#luckysheet-sort-dialog table").data("itemcount") + 1, i = $("#luckysheet-sort-haveheader").is(":checked"), s = a; s <= n; s++)
                                if (i) {
                                    var c = getcellvalue(t, s, Store.flowdata, "m");
                                    null == c && (c = r.columnOperation + (s - a + 1)),
                                    o += '<option value="' + s + '">' + c + "</option>"
                                } else
                                    o += '<option value="' + s + '">' + chatatABC(s) + "</option>";
                            $("#luckysheet-sort-dialog table").append('\n                    <tr class="luckysheet-sort-dialog-tr">\n                        <td><span class="luckysheet-sort-item-close" onclick="$(this).parent().parent().remove();"><i class="fa fa-times"\n                                    aria-hidden="true"></i></span>'.concat(r.secondaryTitle, ' <select\n                                name="sort_').concat(l, '">').concat(o, '</select> </td>\n                        <td>\n                            <div><label><input value="asc" type="radio" checked="checked"\n                                        name="sort_').concat(l, '"><span>').concat(r.asc, 'A-Z</span></label></div>\n                            <div><label><input value="desc" type="radio" name="sort_').concat(l, '"><span>').concat(r.desc, "Z-A</span></label>\n                            </div>\n                        </td>\n                    </tr>\n                ")),
                            $("#luckysheet-sort-dialog table").data("itemcount", l)
                        }
                        )),
                        $("#luckysheet-sort-haveheader").change((function() {
                            for (var e = Store.luckysheet_select_save[0], t = e.row[0], a = (e.row[1],
                            e.column[0]), n = e.column[1], o = $(this).is(":checked"), l = "", i = a; i <= n; i++)
                                if (o) {
                                    var s = getcellvalue(t, i, Store.flowdata, "m");
                                    null == s && (s = r.columnOperation + (i - a + 1)),
                                    l += '<option value="' + i + '">' + s + "</option>"
                                } else
                                    l += '<option value="' + i + '">' + chatatABC(i) + "</option>";
                            $("#luckysheet-sort-dialog tr select").each((function() {
                                $(this).html(l)
                            }
                            ))
                        }
                        )),
                        $("#luckysheet-sort-modal-confirm").click((function() {
                            if (Store.luckysheet_select_save.length > 1)
                                isEditMode() ? alert(r.noRangeError) : tooltip.info(r.noRangeError, "");
                            else {
                                for (var e, t = editor.deepCopyFlowData(Store.flowdata), a = Store.luckysheet_select_save[0], n = a.row[0], o = a.row[1], l = a.column[0], i = a.column[1], s = $("#luckysheet-sort-haveheader").is(":checked"), c = !1, u = [], h = e = s ? n + 1 : n; h <= o; h++) {
                                    for (var d = [], f = l; f <= i; f++) {
                                        if (null != t[h][f] && null != t[h][f].mc) {
                                            c = !0;
                                            break
                                        }
                                        d.push(t[h][f])
                                    }
                                    u.push(d)
                                }
                                if (c)
                                    isEditMode() ? alert(r.mergeError) : tooltip.info(r.mergeError, "");
                                else {
                                    $($("#luckysheet-sort-dialog table tr").toArray().reverse()).each((function() {
                                        var e = $(this).find("select").val()
                                          , t = $(this).find("input:radio:checked").val();
                                        e -= l,
                                        t = "asc" == t,
                                        u = orderbydata([].concat(u), e, t)
                                    }
                                    ));
                                    for (var m = e; m <= o; m++)
                                        for (var p = l; p <= i; p++)
                                            t[m][p] = u[m - e][p - l];
                                    var g = {};
                                    if (null != Store.config.rowlen) {
                                        var y = $.extend(!0, {}, Store.config);
                                        g = {
                                            cfg: y = rowlenByRange(t, e, o, y),
                                            RowlChange: !0
                                        }
                                    }
                                    jfrefreshgrid(t, [{
                                        row: [e, o],
                                        column: [l, i]
                                    }], g),
                                    $("#luckysheet-sort-dialog").hide(),
                                    $("#luckysheet-modal-dialog-mask").hide()
                                }
                            }
                        }
                        ))
                    }
                    for (var c = "", u = l; u <= i; u++)
                        c += '<option value="' + u + '">' + chatatABC(u) + "</option>";
                    $("#luckysheet-sort-dialog select").html(c),
                    $("#luckysheet-sort-dialog .luckysheet-sort-dialog-tr").remove(),
                    $("#luckysheet-sort-haveheader").prop("checked", !1),
                    $("#luckysheet-sort-dialog input:radio:first").prop("checked", "checked"),
                    $("#luckysheet-sort-dialog .luckysheet-modal-dialog-title-text").html(r.sortRangeTitle + "<span>" + chatatABC(l) + (n + 1) + "</span>" + r.sortRangeTitleTo + "<span>" + chatatABC(i) + (o + 1) + "</span>");
                    var h = $("#luckysheet-sort-dialog")
                      , d = h.outerHeight()
                      , f = h.outerWidth()
                      , m = $(window).width()
                      , p = $(window).height()
                      , g = $(document).scrollLeft()
                      , y = $(document).scrollTop();
                    $("#luckysheet-sort-dialog-tablec").css("max-height", (p - d) / 2),
                    $("#luckysheet-sort-dialog").css({
                        left: (m + g - f) / 2,
                        top: (p + y - d) / 2
                    }).show(),
                    $("#luckysheet-modal-dialog-mask").show(),
                    n < o && setTimeout((function() {
                        for (var e = Store.flowdata[n], t = Store.flowdata[n + 1], r = !1, a = l; a <= i; a++) {
                            isdatatype(e[a]) != isdatatype(t[a]) && (r = !0)
                        }
                        r && $("#luckysheet-sort-haveheader").prop("checked", !0).change()
                    }
                    ), 10)
                }
            }
        }
        ))
    }
    var pluginsObj = {
        chart: chart
    }
      , isDemo = !0;
    function initPlugins(e, t) {
        e.length && e.forEach((function(e) {
            pluginsObj[e](t, isDemo)
        }
        ))
    }
    var functionImplementation = {
        SUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if (isRealNum(a))
                        r.push(a);
                    else {
                        if ("boolean" != getObjType(a))
                            return luckysheetformula.error.v;
                        "true" == a.toString().toLowerCase() ? r.push(1) : "false" == a.toString().toLowerCase() && r.push(0)
                    }
                }
                var n = 0;
                if (r.length > 0)
                    for (e = 0; e < r.length; e++) {
                        if (valueIsError(r[e]))
                            return r[e];
                        isRealNum(r[e]) && (n = luckysheet_calcADPMM(n, "+", r[e]))
                    }
                return n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        AVERAGE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a, !0))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : r.push(a)
                }
                var n = 0
                  , o = 0;
                for (e = 0; e < r.length; e++) {
                    if (valueIsError(r[e]))
                        return r[e];
                    if (!isRealNum(r[e]))
                        return luckysheetformula.error.v;
                    n = luckysheet_calcADPMM(n, "+", r[e]),
                    o++
                }
                return 0 == o ? luckysheetformula.error.d : luckysheet_calcADPMM(n, "/", o)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        COUNT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a, !0))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : "boolean" == getObjType(a) ? "true" == a.toString().toLowerCase() ? r.push(1) : "false" == a.toString().toLowerCase() && r.push(0) : r.push(a)
                }
                var n = 0;
                for (e = 0; e < r.length; e++)
                    isRealNum(r[e]) && n++;
                return n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        COUNTA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : r.push(a)
                }
                return r.length
            } catch (e) {
                return e = luckysheetformula.errorInfo(e),
                [luckysheetformula.error.v, e]
            }
        },
        MAX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a, !0))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = null;
                for (e = 0; e < r.length; e++) {
                    if (valueIsError(r[e]))
                        return r[e];
                    isRealNum(r[e]) && ((null == n || parseFloat(r[e]) > n) && (n = parseFloat(r[e])))
                }
                return null == n ? 0 : n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        MIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a, !0))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = null;
                for (e = 0; e < r.length; e++) {
                    if (valueIsError(r[e]))
                        return r[e];
                    isRealNum(r[e]) && ((null == n || parseFloat(r[e]) < n) && (n = parseFloat(r[e])))
                }
                return null == n ? 0 : n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        AGE_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = window.luckysheet_function.BIRTHDAY_BY_IDCARD.f(r);
                if (valueIsError(a))
                    return a;
                a = moment(a);
                var n = moment();
                if (2 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[1])))
                        return n;
                    n = moment(n)
                }
                var o = n.diff(a, "years");
                return o < 0 || "NaN" == o.toString() ? luckysheetformula.error.v : o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        SEX_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]).toString();
                return valueIsError(r) ? r : window.luckysheet_function.ISIDCARD.f(r) ? parseInt(r.substr(16, 1)) % 2 == 1 ? "男" : "女" : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        BIRTHDAY_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]).toString();
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = "";
                if (15 == r.length)
                    a = "19" + r.substring(6, 8) + "/" + r.substring(8, 10) + "/" + r.substring(10, 12);
                else if (18 == r.length) {
                    a = r.substring(6, 10) + "/" + r.substring(10, 12) + "/" + r.substring(12, 14)
                }
                var n = 0;
                if (null != arguments[1] && valueIsError(n = func_methods.getFirstValue(arguments[1])))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                if ((n = parseInt(n)) < 0 || n > 2)
                    return luckysheetformula.error.v;
                if (0 == parseInt(n))
                    return a;
                if (1 == parseInt(n))
                    return moment(a).format("YYYY-MM-DD");
                if (2 == parseInt(n))
                    return moment(a).format("YYYY年M月D日")
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        PROVINCE_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]).toString();
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = "未知"
                  , n = luckysheetformula.classlist.province;
                return r.substring(0, 2)in n && (a = n[r.substring(0, 2)]),
                a
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        CITY_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]).toString();
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = cityData.length
                  , n = "未知";
                for (e = 0; e < a; e++)
                    if (r.substring(0, 6) == cityData[e].code) {
                        n = cityData[e].title;
                        break
                    }
                return n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        STAR_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = window.luckysheet_function.BIRTHDAY_BY_IDCARD.f(r);
                if (valueIsError(a))
                    return a;
                var n = (a = new Date(a)).getMonth()
                  , o = a.getDate()
                  , l = new Date(1999,n,o,0,0,0)
                  , i = [];
                i.push(["魔羯座", new Date(1999,0,1,0,0,0)]),
                i.push(["水瓶座", new Date(1999,0,20,0,0,0)]),
                i.push(["双鱼座", new Date(1999,1,19,0,0,0)]),
                i.push(["白羊座", new Date(1999,2,21,0,0,0)]),
                i.push(["金牛座", new Date(1999,3,21,0,0,0)]),
                i.push(["双子座", new Date(1999,4,21,0,0,0)]),
                i.push(["巨蟹座", new Date(1999,5,22,0,0,0)]),
                i.push(["狮子座", new Date(1999,6,23,0,0,0)]),
                i.push(["处女座", new Date(1999,7,23,0,0,0)]),
                i.push(["天秤座", new Date(1999,8,23,0,0,0)]),
                i.push(["天蝎座", new Date(1999,9,23,0,0,0)]),
                i.push(["射手座", new Date(1999,10,22,0,0,0)]),
                i.push(["魔羯座", new Date(1999,11,22,0,0,0)]);
                for (e = i.length - 1; e >= 0; e--)
                    if (l >= i[e][1])
                        return i[e][0];
                return "未找到匹配星座信息"
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        ANIMAL_BY_IDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!window.luckysheet_function.ISIDCARD.f(r))
                    return luckysheetformula.error.v;
                var a = window.luckysheet_function.BIRTHDAY_BY_IDCARD.f(r);
                if (valueIsError(a))
                    return a;
                a = new Date(a);
                var n = new Array("猪","鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗")
                  , o = (parseInt(a.getFullYear()) + 9) % 12;
                return null == o || isNaN(o) ? "未找到匹配生肖信息" : n[o]
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        ISIDCARD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
                return !!a.test(r)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DM_TEXT_CUTWORD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(o))
                    return o;
                var l = 0;
                return null != arguments[1] && valueIsError(l = func_methods.getFirstValue(arguments[1])) ? l : isRealNum(l) ? 0 != (l = parseInt(l)) && 1 != l && 2 != l ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/cutword", {
                    text: o,
                    type: l
                }, (function(e) {
                    var t = [].concat(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        DM_TEXT_TFIDF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(o))
                    return o;
                var l = 20;
                if (null != arguments[1] && valueIsError(l = func_methods.getFirstValue(arguments[1])))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = 0;
                return null != arguments[2] && valueIsError(i = func_methods.getFirstValue(arguments[2])) ? i : isRealNum(i) ? (i = parseInt(i),
                l < 0 || 0 != i && 1 != i && 2 != i ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/tfidf", {
                    text: o,
                    count: l,
                    set: i
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...")) : luckysheetformula.error.v
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        DM_TEXT_TEXTRANK: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(o))
                    return o;
                var l = 20;
                if (null != arguments[1] && valueIsError(l = func_methods.getFirstValue(arguments[1])))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = 0;
                return null != arguments[2] && valueIsError(i = func_methods.getFirstValue(arguments[2])) ? i : isRealNum(i) ? (i = parseInt(i),
                l < 0 || 0 != i && 1 != i && 2 != i ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/tfidf", {
                    text: o,
                    count: l,
                    set: i
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...")) : luckysheetformula.error.v
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        DATA_CN_STOCK_CLOSE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "0"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata)
                      , o = numFormat$1(e);
                    null == o && (o = e),
                    luckysheetformula.execFunctionGroup(r, a, o),
                    t[r][a] = {
                        v: o,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        DATA_CN_STOCK_OPEN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "1"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        DATA_CN_STOCK_MAX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "2"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        DATA_CN_STOCK_MIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "3"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        DATA_CN_STOCK_VOLUMN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "4"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        DATA_CN_STOCK_AMOUNT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = window.luckysheetCurrentFunction
                  , o = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(o))
                    return o;
                var l = null;
                if (null != arguments[1]) {
                    var i = arguments[1];
                    if ("array" == getObjType(i))
                        return luckysheetformula.error.v;
                    if ("object" == getObjType(i) && null != i.startCell) {
                        if (null == i.data || "array" == getObjType(i.data) || null == i.data.ct || "d" != i.data.ct.t)
                            return luckysheetformula.error.v;
                        l = update("yyyy-mm-dd", i.data.v)
                    } else
                        l = i;
                    if (!isdatetime(l))
                        return [luckysheetformula.error.v, "日期错误"];
                    l = moment(l).format("YYYY-MM-DD")
                }
                var s = 0;
                return null != arguments[2] && valueIsError(s = func_methods.getFirstValue(arguments[2])) ? s : isRealNum(s) ? 0 != (s = parseInt(s)) && 1 != s && 2 != s ? luckysheetformula.error.v : ($.post("/dataqk/tu/api/getstockinfo", {
                    stockCode: o,
                    date: l,
                    price: s,
                    type: "5"
                }, (function(e) {
                    var t = editor.deepCopyFlowData(Store.flowdata);
                    luckysheetformula.execFunctionGroup(r, a, e),
                    t[r][a] = {
                        v: e,
                        f: n
                    },
                    jfrefreshgrid(t, [{
                        row: [r, r],
                        column: [a, a]
                    }])
                }
                )),
                "loading...") : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        ISDATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : isdatetime(r)
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        SUMIF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 0
                  , a = arguments[0].data
                  , n = arguments[0].rowl
                  , o = arguments[0].coll
                  , l = luckysheet_parseData(arguments[1]);
                if (a = luckysheetformula.getRangeArray(a)[0],
                arguments[2]) {
                    var i = []
                      , s = arguments[2].startCell
                      , c = arguments[2].rowl
                      , u = arguments[2].coll
                      , h = arguments[2].sheetName;
                    if (n == c && o == u)
                        i = arguments[2].data;
                    else {
                        var d = []
                          , f = [];
                        d[0] = parseInt(s.replace(/[^0-9]/g, "")) - 1,
                        f[0] = ABCatNum(s.replace(/[^A-Za-z]/g, "")),
                        d[1] = d[0] + n - 1,
                        f[1] = f[0] + o - 1;
                        var m = chatatABC(f[1])
                          , p = d[1] + 1;
                        i = luckysheet_getcelldata(h + "!" + s + ":" + (m + p)).data
                    }
                    i = luckysheetformula.getRangeArray(i)[0];
                    for (e = 0; e < a.length; e++) {
                        if ((g = a[e]) && luckysheetformula.acompareb(g, l)) {
                            if (!isRealNum(i[e]))
                                continue;
                            r = luckysheet_calcADPMM(r, "+", i[e])
                        }
                    }
                } else
                    for (e = 0; e < a.length; e++) {
                        var g;
                        if ((g = a[e]) && luckysheetformula.acompareb(g, l)) {
                            if (!isRealNum(g))
                                continue;
                            r = luckysheet_calcADPMM(r, "", g)
                        }
                    }
                return r
            } catch (e) {
                var y = e;
                return y = luckysheetformula.errorInfo(y),
                [luckysheetformula.error.v, y]
            }
        },
        TAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.tan(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TANH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = Math.exp(2 * r);
                return (a - 1) / (a + 1)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        CEILING: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? 0 == (a = parseFloat(a)) ? 0 : r > 0 && a < 0 ? luckysheetformula.error.nm : Math.ceil(r / a) * a : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ATAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.atan(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ASINH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.log(r + Math.sqrt(r * r + 1))) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ABS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.abs(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ACOS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) < -1 || r > 1 ? luckysheetformula.error.nm : Math.acos(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ACOSH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) < 1 ? luckysheetformula.error.nm : Math.log(r + Math.sqrt(r * r - 1)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        MULTINOMIAL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = 0
                  , o = 1;
                for (e = 0; e < r.length; e++) {
                    var l = r[e];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    if ((l = parseFloat(l)) < 0)
                        return luckysheetformula.error.nm;
                    n += l,
                    o *= func_methods.factorial(l)
                }
                return func_methods.factorial(n) / o
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        ATANH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= -1 || r >= 1 ? luckysheetformula.error.nm : Math.log((1 + r) / (1 - r)) / 2 : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ATAN2: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseFloat(a),
                0 == r && 0 == a ? luckysheetformula.error.d : Math.atan2(a, r)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        COUNTBLANK: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = 0;
                if ("object" == getObjType(r) && null != r.startCell) {
                    if (null == r.data)
                        return 1;
                    if ("array" == getObjType(r.data))
                        for (var n = 0; n < r.data.length; n++)
                            for (var o = 0; o < r.data[n].length; o++)
                                (null == r.data[n][o] || isRealNull(r.data[n][o].v)) && a++;
                    else
                        isRealNull(r.data.v) && a++
                }
                return a
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        COSH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                (Math.exp(r) + Math.exp(-r)) / 2) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        INT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0];
                if ("array" == getObjType(r))
                    return "array" == getObjType(r[0]) ? func_methods.isDyadicArr(r) && isRealNum(r[0][0]) ? Math.floor(parseFloat(r[0][0])) : luckysheetformula.error.v : isRealNum(r[0]) ? Math.floor(parseFloat(r[0])) : luckysheetformula.error.v;
                if ("object" == getObjType(r) && null != r.startCell) {
                    if (r.coll > 1)
                        return luckysheetformula.error.v;
                    if (r.rowl > 1) {
                        var a = luckysheetformula.getcellrange(r.startCell)
                          , n = a.row[0];
                        if (window.luckysheetCurrentRow < n || window.luckysheetCurrentRow > n + r.rowl - 1)
                            return luckysheetformula.error.v;
                        var o = r.data[window.luckysheetCurrentRow - n][0]
                    } else
                        o = r.data;
                    return null == o || isRealNull(o.v) ? 0 : isRealNum(o.v) ? Math.floor(parseFloat(o.v)) : luckysheetformula.error.v
                }
                if ("boolean" == getObjType(r)) {
                    if ("true" == r.toString().toLowerCase())
                        return 1;
                    if ("false" == r.toString().toLowerCase())
                        return 0
                }
                return isRealNum(r) ? Math.floor(parseFloat(r)) : luckysheetformula.error.v
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        ISEVEN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseInt(r),
                !(1 & Math.abs(r))) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ISODD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseInt(r),
                !!(1 & Math.abs(r))) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        LCM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a))
                        if ("array" == getObjType(a[0])) {
                            if (!func_methods.isDyadicArr(a))
                                return luckysheetformula.error.v;
                            r = r.concat(func_methods.getDataArr(a))
                        } else
                            r = r.concat(a);
                    else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                for (var n = 0; n < r.length; n++) {
                    var o = r[n];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    if ((o = parseInt(o)) < 0)
                        return luckysheetformula.error.nm;
                    r[n] = o
                }
                for (var l, i, s, c = 1; void 0 !== (i = r.pop()); )
                    for (0 == i && (c = 0); i > 1; ) {
                        if (i % 2) {
                            for (e = 3,
                            l = Math.floor(Math.sqrt(i)); e <= l && i % e; e += 2)
                                ;
                            s = e <= l ? e : i
                        } else
                            s = 2;
                        for (i /= s,
                        c *= s,
                        e = r.length; e; r[--e] % s == 0 && 1 == (r[e] /= s) && r.splice(e, 1))
                            ;
                    }
                return c >= Math.pow(2, 53) ? luckysheetformula.error.nm : c
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        LN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= 0 ? luckysheetformula.error.nm : Math.log(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        LOG: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                if ((r = parseFloat(r)) <= 0)
                    return luckysheetformula.error.nm;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    if ((a = parseFloat(a)) <= 0)
                        return luckysheetformula.error.nm
                } else
                    var a = 10;
                return Math.log(r) / Math.log(a)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        LOG10: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= 0 ? luckysheetformula.error.nm : Math.log(r) / Math.log(10) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        MOD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if (0 == (a = parseFloat(a)))
                    return luckysheetformula.error.d;
                var n = Math.abs(r % a);
                return a > 0 ? n : -n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        MROUND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r * (a = parseFloat(a)) < 0 ? luckysheetformula.error.nm : Math.round(r / a) * a : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ODD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = Math.ceil(Math.abs(r));
                return a = 1 & a ? a : a + 1,
                r >= 0 ? a : -a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        SUMSQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = 0;
                if (r.length > 0)
                    for (e = 0; e < r.length; e++) {
                        var o = r[e];
                        if (!isRealNum(o))
                            return luckysheetformula.error.v;
                        n += (o = parseFloat(o)) * o
                    }
                return n
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        COMBIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r < 0 || a < 0 || r < a ? luckysheetformula.error.nm : func_methods.factorial(r) / (func_methods.factorial(a) * func_methods.factorial(r - a))) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        SUBTOTAL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = [];
                        for (e = 0; e < a.length; e++) {
                            for (var n = [], o = 0; o < a[e].length; o++)
                                n.push(a[e][o]);
                            r.push(n)
                        }
                    } else {
                        r = [];
                        for (e = 0; e < a.length; e++)
                            r.push(a[e])
                    }
                else
                    r = "object" == getObjType(a) && null != a.startCell ? func_methods.getFirstValue(a) : a;
                var l = Array.prototype.slice.apply(arguments);
                if (l.shift(),
                "array" == getObjType(r)) {
                    var i = [];
                    if ("array" == getObjType(r[0]))
                        for (e = 0; e < r.length; e++) {
                            for (n = [],
                            o = 0; o < r[e].length; o++) {
                                valueIsError(s = r[e][o]) ? n.push(s) : isRealNum(s) ? (s = parseInt(s)) < 1 || s > 111 || s > 11 && s < 101 ? n.push(luckysheetformula.error.v) : n.push(c(s)) : n.push(luckysheetformula.error.v)
                            }
                            i.push(n)
                        }
                    else
                        for (e = 0; e < r.length; e++) {
                            var s;
                            valueIsError(s = r[e]) ? i.push(s) : isRealNum(s) ? (s = parseInt(s)) < 1 || s > 111 || s > 11 && s < 101 ? i.push(luckysheetformula.error.v) : i.push(c(s)) : i.push(luckysheetformula.error.v)
                        }
                    return i
                }
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseInt(r)) < 1 || r > 111 || r > 11 && r < 101 ? luckysheetformula.error.v : c(r) : luckysheetformula.error.v;
                function c(e) {
                    switch (e) {
                    case 1:
                    case 101:
                        return window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, l);
                    case 2:
                    case 102:
                        return window.luckysheet_function.COUNT.f.apply(window.luckysheet_function.COUNT, l);
                    case 3:
                    case 103:
                        return window.luckysheet_function.COUNTA.f.apply(window.luckysheet_function.COUNTA, l);
                    case 4:
                    case 104:
                        return window.luckysheet_function.MAX.f.apply(window.luckysheet_function.MAX, l);
                    case 5:
                    case 105:
                        return window.luckysheet_function.MIN.f.apply(window.luckysheet_function.MIN, l);
                    case 6:
                    case 106:
                        return window.luckysheet_function.PRODUCT.f.apply(window.luckysheet_function.PRODUCT, l);
                    case 7:
                    case 107:
                        return window.luckysheet_function.STDEVA.f.apply(window.luckysheet_function.STDEVA, l);
                    case 8:
                    case 108:
                        return window.luckysheet_function.STDEVP.f.apply(window.luckysheet_function.STDEVP, l);
                    case 9:
                    case 109:
                        return window.luckysheet_function.SUM.f.apply(window.luckysheet_function.SUM, l);
                    case 10:
                    case 110:
                        return window.luckysheet_function.VAR_S.f.apply(window.luckysheet_function.VAR_S, l);
                    case 11:
                    case 111:
                        return window.luckysheet_function.VAR_P.f.apply(window.luckysheet_function.VAR_P, l)
                    }
                }
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        ASIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) < -1 || r > 1 ? luckysheetformula.error.nm : Math.asin(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        COUNTIF: function COUNTIF() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var i = 0; i < arguments.length; i++) {
                var p = luckysheetformula.errorParamCheck(this.p, arguments[i], i);
                if (!p[0])
                    return luckysheetformula.error.v
            }
            try {
                var data_range = arguments[0], range;
                if ("object" != getObjType(data_range) || null == data_range.startCell)
                    return luckysheetformula.error.v;
                range = data_range.data;
                var data_criteria = arguments[1], criteria;
                if ("array" == getObjType(data_criteria))
                    if (criteria = [],
                    "array" == getObjType(data_criteria[0])) {
                        if (!func_methods.isDyadicArr(data_criteria))
                            return luckysheetformula.error.v;
                        for (var i = 0; i < data_criteria.length; i++) {
                            for (var rowArr = [], j = 0; j < data_criteria[i].length; j++)
                                rowArr.push(data_criteria[i][j]);
                            criteria.push(rowArr)
                        }
                    } else
                        for (var i = 0; i < data_criteria.length; i++)
                            criteria.push(data_criteria[i]);
                else if ("object" == getObjType(data_criteria) && null != data_criteria.startCell) {
                    if (data_criteria.rowl > 1 || data_criteria.coll > 1)
                        return 0;
                    criteria = data_criteria.data
                } else
                    criteria = data_criteria;
                if ("array" == getObjType(criteria)) {
                    var result = [];
                    if ("array" == getObjType(criteria[0]))
                        for (var i = 0; i < criteria.length; i++) {
                            for (var rowArr = [], j = 0; j < criteria[i].length; j++)
                                rowArr.push(getCriteriaResult(range, criteria[i][j]));
                            result.push(rowArr)
                        }
                    else
                        for (var i = 0; i < criteria.length; i++)
                            result.push(getCriteriaResult(range, criteria[i]));
                    return result
                }
                return getCriteriaResult(range, criteria);
                function getCriteriaResult(range, criter) {
                    /[<>=!*?]/.test(criter) || (criter = '=="' + criter + '"'),
                    criter = criter.replace("<>", "!=");
                    var matches = 0;
                    if ("array" == getObjType(range)) {
                        for (var i = 0; i < range.length; i++)
                            for (var j = 0; j < range[i].length; j++)
                                if (null != range[i][j] && !isRealNull(range[i][j].v)) {
                                    var value = range[i][j].v;
                                    criter.indexOf("*") > -1 || criter.indexOf("?") > -1 ? luckysheetformula.isWildcard(value, criter) && matches++ : "string" != typeof value ? eval(value + criter) && matches++ : eval('"' + value + '"' + criter) && matches++
                                }
                    } else if (null != range && !isRealNull(range.v)) {
                        var value = range.v;
                        criter.indexOf("*") > -1 || criter.indexOf("?") > -1 ? luckysheetformula.isWildcard(value, criter) && matches++ : "string" != typeof value ? eval(value + criter) && matches++ : eval('"' + value + '"' + criter) && matches++
                    }
                    return matches
                }
            } catch (e) {
                var err = e;
                return err = luckysheetformula.errorInfo(err),
                [luckysheetformula.error.v, err]
            }
        },
        RADIANS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) * Math.PI / 180 : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        RAND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            try {
                return Math.floor(1e9 * Math.random()) / 1e9
            } catch (t) {
                var e = t;
                return e = luckysheetformula.errorInfo(e),
                [luckysheetformula.error.v, e]
            }
        },
        COUNTUNIQUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : r.push(a)
                }
                return window.luckysheet_function.UNIQUE.f(r)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DEGREES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? 180 * (r = parseFloat(r)) / Math.PI : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ERFC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                jStat.erfc(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        EVEN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = Math.ceil(Math.abs(r));
                return a = 1 & a ? a + 1 : a,
                r > 0 ? a : -a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        EXP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.exp(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        FACT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r)) {
                    if ("boolean" != getObjType(r))
                        return luckysheetformula.error.v;
                    "true" == r.toString().toLowerCase() ? r = 1 : "false" == r.toString().toLowerCase() && (r = 0)
                }
                return (r = parseInt(r)) < 0 ? luckysheetformula.error.nm : func_methods.factorial(r)
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        FACTDOUBLE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r)) {
                    if ("boolean" != getObjType(r))
                        return luckysheetformula.error.v;
                    "true" == r.toString().toLowerCase() ? r = 1 : "false" == r.toString().toLowerCase() && (r = 0)
                }
                return (r = parseInt(r)) < 0 ? luckysheetformula.error.nm : func_methods.factorialDouble(r)
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        PI: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            try {
                return Math.PI
            } catch (t) {
                var e = t;
                return e = luckysheetformula.errorInfo(e),
                [luckysheetformula.error.v, e]
            }
        },
        FLOOR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if (0 == (a = parseFloat(a)))
                    return luckysheetformula.error.d;
                if (r > 0 && a < 0)
                    return luckysheetformula.error.nm;
                var n = -Math.floor(Math.log(Math.abs(a)) / Math.log(10));
                return r >= 0 ? Math.floor(r / a) * a * Math.pow(10, n) / Math.pow(10, n) : -Math.ceil(Math.abs(r) / a) * a * Math.pow(10, n) / Math.pow(10, n)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        GCD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !1)) : r.push(a)
                }
                if (!isRealNum(r[0]))
                    return luckysheetformula.error.v;
                var n = parseInt(r[0]);
                if (n < 0 || n >= Math.pow(2, 53))
                    return luckysheetformula.error.nm;
                for (e = 1; e < r.length; e++) {
                    var o = r[e];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    if ((o = parseInt(o)) < 0 || o >= Math.pow(2, 53))
                        return luckysheetformula.error.nm;
                    for (; n && o; )
                        n > o ? n %= o : o %= n;
                    n += o
                }
                return n
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        RANDBETWEEN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r > (a = parseInt(a)) ? luckysheetformula.error.nm : r + Math.ceil((a - r + 1) * Math.random()) - 1 : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ROUND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = r > 0 ? 1 : -1;
                return n * Math.round(Math.abs(r) * Math.pow(10, a)) / Math.pow(10, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        ROUNDDOWN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = r > 0 ? 1 : -1;
                return n * Math.floor(Math.abs(r) * Math.pow(10, a)) / Math.pow(10, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        ROUNDUP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = r > 0 ? 1 : -1;
                return n * Math.ceil(Math.abs(r) * Math.pow(10, a)) / Math.pow(10, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        SERIESSUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = arguments[3]
                  , l = [];
                if ("array" == getObjType(o)) {
                    if ("array" == getObjType(o[0]) && !func_methods.isDyadicArr(o))
                        return luckysheetformula.error.v;
                    l = l.concat(func_methods.getDataArr(o, !1))
                } else
                    "object" == getObjType(o) && null != o.startCell ? l = l.concat(func_methods.getCellDataArr(o, "number", !1)) : l.push(o);
                if (!isRealNum(l[0]))
                    return luckysheetformula.error.v;
                var i = parseFloat(l[0]) * Math.pow(r, a);
                for (e = 1; e < l.length; e++) {
                    var s = l[e];
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    i += (s = parseFloat(s)) * Math.pow(r, a + e * n)
                }
                return i
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        SIGN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                if ((r = parseFloat(r)) > 0)
                    return 1;
                if (0 == r)
                    return 0;
                if (r < 0)
                    return -1
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        SIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.sin(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        SINH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                (Math.exp(r) - Math.exp(-r)) / 2) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        SQRT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) < 0 ? luckysheetformula.error.nm : Math.sqrt(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        SQRTPI: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) < 0 ? luckysheetformula.error.nm : Math.sqrt(r * Math.PI) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        GAMMALN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= 0 ? luckysheetformula.error.nm : jStat.gammaln(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        COS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r),
                Math.cos(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TRUNC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                if (r = parseFloat(r),
                2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                } else
                    var a = 0;
                var n = r > 0 ? 1 : -1;
                return n * Math.floor(Math.abs(r) * Math.pow(10, a)) / Math.pow(10, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        QUOTIENT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? 0 == (a = parseFloat(a)) ? luckysheetformula.error.d : parseInt(r / a, 10) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        POWER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseFloat(a),
                0 == r && 0 == a || r < 0 && a.toString().indexOf(".") > -1 ? luckysheetformula.error.nm : Math.pow(r, a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        SUMIFS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 0
                  , a = arguments;
                luckysheet_getValue(a);
                var n = luckysheetformula.getRangeArray(a[0])[0]
                  , o = new Array(n.length);
                for (e = 0; e < o.length; e++)
                    o[e] = !0;
                for (e = 1; e < a.length; e += 2)
                    for (var l = luckysheetformula.getRangeArray(a[e])[0], i = a[e + 1], s = 0; s < l.length; s++) {
                        var c = l[s];
                        o[s] = o[s] && !!c && luckysheetformula.acompareb(c, i)
                    }
                for (e = 0; e < n.length; e++)
                    o[e] && (r = luckysheet_calcADPMM(r, "+", n[e]));
                return r
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        COUNTIFS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments;
                luckysheet_getValue(r);
                var a = new Array(luckysheetformula.getRangeArray(r[0])[0].length);
                for (e = 0; e < a.length; e++)
                    a[e] = !0;
                for (e = 0; e < r.length; e += 2)
                    for (var n = luckysheetformula.getRangeArray(r[e])[0], o = r[e + 1], l = 0; l < n.length; l++) {
                        var i = n[l];
                        a[l] = a[l] && !!i && luckysheetformula.acompareb(i, o)
                    }
                var s = 0;
                for (e = 0; e < a.length; e++)
                    a[e] && s++;
                return s
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        PRODUCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = 1;
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    n *= o = parseFloat(o)
                }
                return n
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        HARMEAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "number", !0)) : r.push(a)
                }
                var n = 0
                  , o = 0;
                for (e = 0; e < r.length; e++) {
                    var l = r[e];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    if ((l = parseFloat(l)) <= 0)
                        return luckysheetformula.error.nm;
                    n += 1 / l,
                    o++
                }
                return o / n
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        HYPGEOMDIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = func_methods.getCellBoolen(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (r < 0 || r > Math.min(a, n) || r < Math.max(0, a - o + n))
                    return luckysheetformula.error.nm;
                if (a <= 0 || a > o)
                    return luckysheetformula.error.nm;
                if (n <= 0 || n > o)
                    return luckysheetformula.error.nm;
                if (o <= 0)
                    return luckysheetformula.error.nm;
                function i(e, t, r, a) {
                    return func_methods.factorial(r) / (func_methods.factorial(e) * func_methods.factorial(r - e)) * (func_methods.factorial(a - r) / (func_methods.factorial(t - e) * func_methods.factorial(a - r - t + e))) / (func_methods.factorial(a) / (func_methods.factorial(t) * func_methods.factorial(a - t)))
                }
                function s(e, t, r, a) {
                    for (var n = 0, o = 0; o <= e; o++)
                        n += i(o, t, r, a);
                    return n
                }
                return l ? s(r, a, n, o) : i(r, a, n, o)
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        INTERCEPT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 0
                  , a = arguments[0]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !1))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "text", !1)) : n.push(a);
                var o = arguments[1]
                  , l = [];
                if ("array" == getObjType(o)) {
                    if ("array" == getObjType(o[0]) && !func_methods.isDyadicArr(o))
                        return luckysheetformula.error.v;
                    l = l.concat(func_methods.getDataArr(o, !1))
                } else
                    "object" == getObjType(o) && null != o.startCell ? l = l.concat(func_methods.getCellDataArr(o, "text", !1)) : l.push(o);
                if (n.length != l.length)
                    return luckysheetformula.error.na;
                var i = []
                  , s = [];
                for (e = 0; e < n.length; e++) {
                    var c = n[e]
                      , u = l[e];
                    isRealNum(c) && isRealNum(u) && (i.push(parseFloat(c)),
                    s.push(parseFloat(u)))
                }
                if (0 == func_methods.variance_s(s))
                    return luckysheetformula.error.d;
                var h = jStat.mean(s)
                  , d = jStat.mean(i)
                  , f = s.length
                  , m = 0
                  , p = 0;
                for (e = 0; e < f; e++)
                    m += (s[e] - h) * (i[e] - d),
                    p += Math.pow(s[e] - h, 2);
                var g = m / p
                  , y = d - g * h;
                return y + g * r
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        KURT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : r.push(a)
                }
                for (var n = [], o = 0; o < r.length; o++) {
                    var l = r[o];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l),
                    n.push(l)
                }
                if (n.length < 4 || 0 == func_methods.standardDeviation_s(n))
                    return luckysheetformula.error.d;
                var i = jStat.mean(n)
                  , s = n.length
                  , c = 0;
                for (e = 0; e < s; e++)
                    c += Math.pow(n[e] - i, 4);
                return s * (s + 1) / ((s - 1) * (s - 2) * (s - 3)) * (c /= Math.pow(jStat.stdev(n, !0), 4)) - 3 * (s - 1) * (s - 1) / ((s - 2) * (s - 3))
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        LARGE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !0))
                } else
                    "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !0)) : r.push(arguments[0]);
                for (var a = [], n = 0; n < r.length; n++) {
                    var o = r[n];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o),
                    a.push(o)
                }
                if ("array" == getObjType(arguments[1])) {
                    if ("array" == getObjType(arguments[1][0]) && !func_methods.isDyadicArr(arguments[1]))
                        return luckysheetformula.error.v;
                    i = func_methods.getDataArr(arguments[1])
                } else if ("object" == getObjType(arguments[1]) && null != arguments[1].startCell) {
                    if (arguments[1].rowl > 1 || arguments[1].coll > 1)
                        return luckysheetformula.error.v;
                    var l = arguments[1].data;
                    if (null == l || isRealNull(l.v))
                        var i = 0;
                    else
                        i = l.v
                } else
                    i = arguments[1];
                if ("array" == getObjType(i)) {
                    if (0 == a.length)
                        return luckysheetformula.error.nm;
                    var s = [];
                    for (e = 0; e < i.length; e++)
                        isRealNum(i[e]) ? (i[e] = Math.ceil(parseFloat(i[e])),
                        i[e] <= 0 || i[e] > a.length ? s.push(luckysheetformula.error.nm) : s.push(r.sort((function(e, t) {
                            return t - e
                        }
                        ))[i[e] - 1])) : s.push(luckysheetformula.error.v);
                    return s
                }
                return isRealNum(i) ? (i = Math.ceil(parseFloat(i)),
                0 == a.length || i <= 0 || i > a.length ? luckysheetformula.error.nm : r.sort((function(e, t) {
                    return t - e
                }
                ))[i - 1]) : luckysheetformula.error.v
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        STDEVA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !1)) : r.push(a)
                }
                for (var n = [], o = 0; o < r.length; o++) {
                    var l = r[o];
                    l = isRealNum(l) ? parseFloat(l) : "true" == l.toString().toLowerCase() ? 1 : 0,
                    n.push(l)
                }
                return 0 == n.length ? 0 : 1 == n.length ? luckysheetformula.error.d : func_methods.standardDeviation_s(n)
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        STDEVP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else
                        "object" == getObjType(a) && null != a.startCell ? r = r.concat(func_methods.getCellDataArr(a, "text", !0)) : r.push(a)
                }
                for (var n = [], o = 0; o < r.length; o++) {
                    var l = r[o];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l),
                    n.push(l)
                }
                return 0 == n.length ? 0 : 1 == n.length ? luckysheetformula.error.d : func_methods.standardDeviation(n)
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        GEOMEAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "text", !0));
                    else if ("boolean" == getObjType(a))
                        "true" == a.toString().toLowerCase() ? r.push(1) : "false" == a.toString().toLowerCase() && r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                for (var n = [], o = 0; o < r.length; o++) {
                    var l = r[o];
                    if (isRealNum(l)) {
                        if ((l = parseFloat(l)) <= 0)
                            return luckysheetformula.error.nm;
                        n.push(l)
                    }
                }
                return 0 == n.length ? luckysheetformula.error.nm : jStat.geomean(n)
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        RANK_EQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !0))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "number", !0)) : n.push(a);
                for (var o = [], l = 0; l < n.length; l++) {
                    var i = n[l];
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i),
                    o.push(i)
                }
                if (3 == arguments.length) {
                    if (valueIsError(s = func_methods.getCellBoolen(arguments[2])))
                        return s
                } else
                    var s = !1;
                var c = s ? function(e, t) {
                    return e - t
                }
                : function(e, t) {
                    return t - e
                }
                  , u = (o = o.sort(c)).indexOf(r);
                return -1 == u ? luckysheetformula.error.na : u + 1
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        RANK_AVG: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !0))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "number", !0)) : n.push(a);
                for (var o = [], l = 0; l < n.length; l++) {
                    var i = n[l];
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i),
                    o.push(i)
                }
                if (3 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[2])))
                        return s;
                    if ("boolean" == getObjType(s))
                        ;
                    else if ("string" != getObjType(s) || "true" != s.toLowerCase() && "false" != s.toLowerCase()) {
                        if (!isRealNum(s))
                            return luckysheetformula.error.v;
                        s = 0 != (s = parseFloat(s))
                    } else
                        "true" == s.toLowerCase() && (s = !0),
                        "false" == s.toLowerCase() && (s = !1)
                } else
                    var s = !1;
                var c = s ? function(e, t) {
                    return e - t
                }
                : function(e, t) {
                    return t - e
                }
                ;
                o = o.sort(c);
                var u = 0;
                for (e = 0; e < o.length; e++)
                    o[e] == r && u++;
                return u > 1 ? (2 * o.indexOf(r) + u + 1) / 2 : o.indexOf(r) + 1
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        PERCENTRANK_EXC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !0))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !0)) : a.push(r);
                for (var n = [], o = 0; o < a.length; o++) {
                    var l = a[o];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l),
                    n.push(l)
                }
                var i = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                if (i = parseFloat(i),
                3 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[2])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = parseInt(s)
                } else
                    var s = 3;
                if (0 == n.length)
                    return luckysheetformula.error.nm;
                if (s < 1)
                    return luckysheetformula.error.nm;
                if (1 == n.length && n[0] == i)
                    return 1;
                n = n.sort((function(e, t) {
                    return e - t
                }
                ));
                var c = window.luckysheet_function.UNIQUE.f(n)[0]
                  , u = n.length
                  , h = c.length
                  , d = Math.pow(10, s)
                  , f = 0
                  , m = !1;
                for (e = 0; !m && e < h; )
                    i === c[e] ? (f = (n.indexOf(c[e]) + 1) / (u + 1),
                    m = !0) : i >= c[e] && (i < c[e + 1] || e === h - 1) && (f = (n.lastIndexOf(c[e]) + 1 + (i - c[e]) / (c[e + 1] - c[e])) / (u + 1),
                    m = !0),
                    e++;
                return isNaN(f) ? luckysheetformula.error.na : Math.floor(f * d) / d
            } catch (e) {
                var p = e;
                return p = luckysheetformula.errorInfo(p),
                [luckysheetformula.error.v, p]
            }
        },
        PERCENTRANK_INC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !0))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !0)) : a.push(r);
                for (var n = [], o = 0; o < a.length; o++) {
                    var l = a[o];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l),
                    n.push(l)
                }
                var i = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                if (i = parseFloat(i),
                3 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[2])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = parseInt(s)
                } else
                    var s = 3;
                if (0 == n.length)
                    return luckysheetformula.error.nm;
                if (s < 1)
                    return luckysheetformula.error.nm;
                if (1 == n.length && n[0] == i)
                    return 1;
                n = n.sort((function(e, t) {
                    return e - t
                }
                ));
                var c = window.luckysheet_function.UNIQUE.f(n)[0]
                  , u = n.length
                  , h = c.length
                  , d = Math.pow(10, s)
                  , f = 0
                  , m = !1;
                for (e = 0; !m && e < h; )
                    i === c[e] ? (f = n.indexOf(c[e]) / (u - 1),
                    m = !0) : i >= c[e] && (i < c[e + 1] || e === h - 1) && (f = (n.lastIndexOf(c[e]) + (i - c[e]) / (c[e + 1] - c[e])) / (u - 1),
                    m = !0),
                    e++;
                return isNaN(f) ? luckysheetformula.error.na : Math.floor(f * d) / d
            } catch (e) {
                var p = e;
                return p = luckysheetformula.errorInfo(p),
                [luckysheetformula.error.v, p]
            }
        },
        FORECAST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !1))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "text", !1)) : n.push(a);
                var o = arguments[2]
                  , l = [];
                if ("array" == getObjType(o)) {
                    if ("array" == getObjType(o[0]) && !func_methods.isDyadicArr(o))
                        return luckysheetformula.error.v;
                    l = l.concat(func_methods.getDataArr(o, !1))
                } else
                    "object" == getObjType(o) && null != o.startCell ? l = l.concat(func_methods.getCellDataArr(o, "text", !1)) : l.push(o);
                if (n.length != l.length)
                    return luckysheetformula.error.na;
                var i = []
                  , s = [];
                for (e = 0; e < n.length; e++) {
                    var c = n[e]
                      , u = l[e];
                    isRealNum(c) && isRealNum(u) && (i.push(parseFloat(c)),
                    s.push(parseFloat(u)))
                }
                if (0 == func_methods.variance_s(s))
                    return luckysheetformula.error.d;
                var h = jStat.mean(s)
                  , d = jStat.mean(i)
                  , f = s.length
                  , m = 0
                  , p = 0;
                for (e = 0; e < f; e++)
                    m += (s[e] - h) * (i[e] - d),
                    p += Math.pow(s[e] - h, 2);
                var g = m / p
                  , y = d - g * h;
                return y + g * r
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        FISHERINV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = Math.exp(2 * r);
                return (a - 1) / (a + 1)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        FISHER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= -1 || r >= 1 ? luckysheetformula.error.nm : Math.log((1 + r) / (1 - r)) / 2 : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        MODE_SNGL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                var l, i = {}, s = [], c = 0;
                for (e = 0; e < n.length; e++)
                    i[l = n[e]] = i[l] ? i[l] + 1 : 1,
                    i[l] > c && (c = i[l],
                    s = []),
                    i[l] == c && (s[s.length] = l);
                if (c <= 1)
                    return luckysheetformula.error.na;
                for (var u = n.indexOf(s[0]), h = 0; h < s.length; h++) {
                    var d = n.indexOf(s[h]);
                    d < u && (u = d)
                }
                return n[u]
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        WEIBULL_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : r < 0 || a <= 0 || n <= 0 ? luckysheetformula.error.nm : o ? 1 - Math.exp(-Math.pow(r / n, a)) : Math.pow(r, a - 1) * Math.exp(-Math.pow(r / n, a)) * a / Math.pow(n, a)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        AVEDEV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                return 0 == n.length ? luckysheetformula.error.nm : jStat.sum(jStat(n).subtract(jStat.mean(n)).abs()[0]) / n.length
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        AVERAGEA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if ("true" == l.toString.toLowerCase())
                        r.push(1);
                    else if ("false" == l.toString.toLowerCase())
                        r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = 0
                  , o = 0;
                for (e = 0; e < r.length; e++) {
                    var l = r[e];
                    isRealNum(l) ? n += parseFloat(l) : "true" == l.toString().toLowerCase() ? n += 1 : n += 0,
                    o++
                }
                return 0 == o ? luckysheetformula.error.d : n / o
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        BINOM_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : r < 0 || r > a || n < 0 || n > 1 ? luckysheetformula.error.nm : o ? jStat.binomial.cdf(r, a, n) : jStat.binomial.pdf(r, a, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        BINOM_INV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                if (n = parseFloat(n),
                r < 0)
                    return luckysheetformula.error.nm;
                if (a < 0 || a > 1)
                    return luckysheetformula.error.nm;
                if (n < 0 || n > 1)
                    return luckysheetformula.error.nm;
                for (var o = 0; o <= r; ) {
                    if (jStat.binomial.cdf(o, r, a) >= n)
                        return o;
                    o++
                }
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        CONFIDENCE_NORM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseInt(n),
                r <= 0 || r >= 1 || a <= 0 || n < 1 ? luckysheetformula.error.nm : jStat.normalci(1, r, a, n)[1] - 1) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        CORREL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                return 0 == l.length || 0 == i.length || 0 == func_methods.standardDeviation(l) || 0 == func_methods.standardDeviation(i) ? luckysheetformula.error.d : jStat.corrcoeff(l, i)
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        COVARIANCE_P: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                if (0 == l.length || 0 == i.length)
                    return luckysheetformula.error.d;
                var u = jStat.mean(l)
                  , h = jStat.mean(i)
                  , d = 0;
                for (e = 0; e < l.length; e++)
                    d += (l[e] - u) * (i[e] - h);
                return d /= l.length
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        COVARIANCE_S: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                return 0 == l.length || 0 == i.length ? luckysheetformula.error.d : jStat.covariance(l, i)
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        DEVSQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if (isRealNum(a))
                        r.push(a);
                    else {
                        if ("boolean" != getObjType(a))
                            return luckysheetformula.error.v;
                        "true" == a.toString().toLowerCase() ? r.push(1) : "false" == a.toString().toLowerCase() && r.push(0)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                var l = jStat.mean(n)
                  , i = 0;
                for (e = 0; e < n.length; e++)
                    i += Math.pow(n[e] - l, 2);
                return i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        EXPON_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getCellBoolen(arguments[2]);
                return valueIsError(n) ? n : r < 0 || a < 0 ? luckysheetformula.error.nm : n ? jStat.exponential.cdf(r, a) : jStat.exponential.pdf(r, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        AVERAGEIF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 0
                  , a = 0
                  , n = arguments[0].data
                  , o = arguments[0].rowl
                  , l = arguments[0].coll
                  , i = luckysheet_parseData(arguments[1])
                  , s = [];
                if (arguments[2]) {
                    var c = arguments[2].startCell
                      , u = arguments[2].rowl
                      , h = arguments[2].coll
                      , d = arguments[2].sheetName;
                    if (o == u && l == h)
                        s = arguments[2].data;
                    else {
                        var f = []
                          , m = [];
                        f[0] = parseInt(c.replace(/[^0-9]/g, "")) - 1,
                        m[0] = ABCatNum(c.replace(/[^A-Za-z]/g, "")),
                        f[1] = f[0] + o - 1,
                        m[1] = m[0] + l - 1;
                        var p = chatatABC(m[1])
                          , g = f[1] + 1;
                        s = luckysheet_getcelldata(d + "!" + c + ":" + (p + g)).data
                    }
                    s = luckysheetformula.getRangeArray(s)[0]
                }
                n = luckysheetformula.getRangeArray(n)[0];
                for (e = 0; e < n.length; e++) {
                    var y = n[e];
                    if (y && luckysheetformula.acompareb(y, i)) {
                        var v = s[e] || y;
                        if (!isRealNum(v))
                            continue;
                        r += parseFloat(v),
                        a++
                    }
                }
                return 0 == r || 0 == a ? luckysheetformula.error.d : numFormat$1(r / a)
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        AVERAGEIFS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 0
                  , a = 0
                  , n = arguments;
                luckysheet_getValue(n);
                var o = luckysheetformula.getRangeArray(n[0])[0]
                  , l = new Array(o.length);
                for (e = 0; e < l.length; e++)
                    l[e] = !0;
                for (e = 1; e < n.length; e += 2)
                    for (var i = luckysheetformula.getRangeArray(n[e])[0], s = n[e + 1], c = 0; c < i.length; c++) {
                        var u = i[c];
                        l[c] = l[c] && !!u && luckysheetformula.acompareb(u, s)
                    }
                for (e = 0; e < o.length; e++)
                    l[e] && isRealNum(o[e]) && (r += parseFloat(o[e]),
                    a++);
                return 0 == r || 0 == a ? luckysheetformula.error.d : numFormat$1(r / a)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        PERMUT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r <= 0 || a < 0 || r < a ? luckysheetformula.error.nm : func_methods.factorial(r) / func_methods.factorial(r - a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        TRIMMEAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !1)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                var l = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                if (l = parseFloat(l),
                0 == n.length)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 1)
                    return luckysheetformula.error.nm;
                function i(e, t) {
                    return t = t || 1,
                    e && "function" == typeof e.slice ? e.slice(t) : e
                }
                function s(e, t) {
                    return t = t || 1,
                    e && "function" == typeof e.slice ? e.slice(0, e.length - t) : e
                }
                n.sort((function(e, t) {
                    return e - t
                }
                ));
                var c = window.luckysheet_function.FLOOR.f(n.length * l, 2) / 2
                  , u = i(n, c);
                return u = s(u, c),
                u = jStat.mean(u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        PERCENTILE_EXC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !1)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                var l = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                if (l = parseFloat(l),
                0 == n.length)
                    return luckysheetformula.error.nm;
                if (l <= 0 || l >= 1)
                    return luckysheetformula.error.nm;
                var i = (n = n.sort((function(e, t) {
                    return e - t
                }
                ))).length;
                if (l < 1 / (i + 1) || l > 1 - 1 / (i + 1))
                    return luckysheetformula.error.nm;
                var s = l * (i + 1) - 1
                  , c = Math.floor(s);
                return s === c ? n[s] : n[c] + (s - c) * (n[c + 1] - n[c])
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        PERCENTILE_INC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !1)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                var l = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                if (l = parseFloat(l),
                0 == n.length)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 1)
                    return luckysheetformula.error.nm;
                var i = (n = n.sort((function(e, t) {
                    return e - t
                }
                ))).length
                  , s = l * (i - 1)
                  , c = Math.floor(s);
                return s === c ? n[s] : n[c] + (s - c) * (n[c + 1] - n[c])
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        PEARSON: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                if (0 == i.length || 0 == l.length)
                    return luckysheetformula.error.d;
                var u = jStat.mean(l)
                  , h = jStat.mean(i)
                  , d = l.length
                  , f = 0
                  , m = 0
                  , p = 0;
                for (e = 0; e < d; e++)
                    f += (l[e] - u) * (i[e] - h),
                    m += Math.pow(l[e] - u, 2),
                    p += Math.pow(i[e] - h, 2);
                return f / Math.sqrt(m * p)
            } catch (e) {
                var g = e;
                return g = luckysheetformula.errorInfo(g),
                [luckysheetformula.error.v, g]
            }
        },
        NORM_S_INV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseFloat(r)) <= 0 || r >= 1 ? luckysheetformula.error.nm : jStat.normal.inv(r, 0, 1) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        NORM_S_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getCellBoolen(arguments[1]);
                return valueIsError(a) ? a : a ? jStat.normal.cdf(r, 0, 1) : jStat.normal.pdf(r, 0, 1)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        NORM_INV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r)) {
                    if ("boolean" != getObjType(r))
                        return luckysheetformula.error.v;
                    "true" == r.toString().toLowerCase() ? r = 1 : "false" == r.toString().toLowerCase() && (r = 0)
                }
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a)) {
                    if ("boolean" != getObjType(a))
                        return luckysheetformula.error.v;
                    "true" == a.toString().toLowerCase() ? a = 1 : "false" == a.toString().toLowerCase() && (a = 0)
                }
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n)) {
                    if ("boolean" != getObjType(n))
                        return luckysheetformula.error.v;
                    "true" == n.toString().toLowerCase() ? n = 1 : "false" == n.toString().toLowerCase() && (n = 0)
                }
                return n = parseFloat(n),
                r <= 0 || r >= 1 || n <= 0 ? luckysheetformula.error.nm : jStat.normal.inv(r, a, n)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        NORM_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r)) {
                    if ("boolean" != getObjType(r))
                        return luckysheetformula.error.v;
                    "true" == r.toString().toLowerCase() ? r = 1 : "false" == r.toString().toLowerCase() && (r = 0)
                }
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : n <= 0 ? luckysheetformula.error.nm : o ? jStat.normal.cdf(r, a, n) : jStat.normal.pdf(r, a, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        NEGBINOM_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : n < 0 || n > 1 || r < 0 || a < 1 ? luckysheetformula.error.nm : o ? jStat.negbin.cdf(r, a, n) : jStat.negbin.pdf(r, a, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        MINA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if ("true" == o.toString.toLowerCase())
                        r.push(1);
                    else if ("false" == o.toString.toLowerCase())
                        r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) ? n.push(parseFloat(o)) : "true" == o.toString().toLowerCase() ? n.push(1) : n.push(0)
                }
                return 0 === n.length ? 0 : Math.min.apply(Math, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        MEDIAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                return jStat.median(n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        MAXA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if ("true" == o.toString.toLowerCase())
                        r.push(1);
                    else if ("false" == o.toString.toLowerCase())
                        r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) ? n.push(parseFloat(o)) : "true" == o.toString().toLowerCase() ? n.push(1) : n.push(0)
                }
                return 0 === n.length ? 0 : Math.max.apply(Math, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        LOGNORM_INV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseFloat(n),
                r <= 0 || r >= 1 || n <= 0 ? luckysheetformula.error.nm : jStat.lognormal.inv(r, a, n)) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        LOGNORM_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : r <= 0 || n <= 0 ? luckysheetformula.error.nm : o ? jStat.lognormal.cdf(r, a, n) : jStat.lognormal.pdf(r, a, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        Z_TEST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !0))
                } else
                    "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !0)) : r.push(arguments[0]);
                for (var a = [], n = 0; n < r.length; n++) {
                    var o = r[n];
                    isRealNum(o) && a.push(parseFloat(o))
                }
                var l = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                if (l = parseFloat(l),
                0 == a.length)
                    return luckysheetformula.error.na;
                var i = func_methods.standardDeviation_s(a);
                if (3 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[2])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                var s = a.length
                  , c = window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, a);
                return 1 - window.luckysheet_function.NORM_S_DIST.f((c - l) / (i / Math.sqrt(s)), "true")
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        PROB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !1))
                } else
                    "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !1)) : r.push(arguments[0]);
                var a = [];
                if ("array" == getObjType(arguments[1])) {
                    if ("array" == getObjType(arguments[1][0]) && !func_methods.isDyadicArr(arguments[1]))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(arguments[1], !1))
                } else
                    "object" == getObjType(arguments[1]) && null != arguments[1].startCell ? a = a.concat(func_methods.getCellDataArr(arguments[1], "text", !1)) : a.push(arguments[1]);
                if (r.length != a.length)
                    return luckysheetformula.error.na;
                var n = []
                  , o = []
                  , l = 0;
                for (e = 0; e < r.length; e++) {
                    var i = r[e]
                      , s = a[e];
                    if (isRealNum(i) && isRealNum(s) && (n.push(parseFloat(i)),
                    o.push(parseFloat(s)),
                    l += parseFloat(s),
                    parseFloat(s) <= 0 || parseFloat(s) > 1))
                        return luckysheetformula.error.nm
                }
                if (1 != l)
                    return luckysheetformula.error.nm;
                var c = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(c))
                    return c;
                if (!isRealNum(c))
                    return luckysheetformula.error.v;
                var u = c = parseFloat(c);
                if (4 == arguments.length) {
                    if (valueIsError(u = func_methods.getFirstValue(arguments[3])))
                        return u;
                    if (!isRealNum(u))
                        return luckysheetformula.error.v;
                    u = parseFloat(u)
                }
                var h = 0;
                for (e = 0; e < n.length; e++)
                    n[e] >= c && n[e] <= u && (h += o[e]);
                return h
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        QUARTILE_EXC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !0))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !0));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = [];
                for (e = 0; e < r.length; e++) {
                    var n = r[e];
                    isRealNum(n) && a.push(parseFloat(n))
                }
                var o = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                if (o = parseInt(o),
                0 == a.length)
                    return luckysheetformula.error.nm;
                if (o <= 0 || o >= 4)
                    return luckysheetformula.error.nm;
                switch (o) {
                case 1:
                    return window.luckysheet_function.PERCENTILE_EXC.f(a, .25);
                case 2:
                    return window.luckysheet_function.PERCENTILE_EXC.f(a, .5);
                case 3:
                    return window.luckysheet_function.PERCENTILE_EXC.f(a, .75)
                }
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        QUARTILE_INC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !0))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !0));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = [];
                for (e = 0; e < r.length; e++) {
                    var n = r[e];
                    isRealNum(n) && a.push(parseFloat(n))
                }
                var o = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                if (o = parseInt(o),
                0 == a.length)
                    return luckysheetformula.error.nm;
                if (o < 0 || o > 4)
                    return luckysheetformula.error.nm;
                switch (o) {
                case 0:
                    return Math.min.apply(Math, a);
                case 1:
                    return window.luckysheet_function.PERCENTILE_INC.f(a, .25);
                case 2:
                    return window.luckysheet_function.PERCENTILE_INC.f(a, .5);
                case 3:
                    return window.luckysheet_function.PERCENTILE_INC.f(a, .75);
                case 4:
                    return Math.max.apply(Math, a)
                }
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        POISSON_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getCellBoolen(arguments[2]);
                return valueIsError(n) ? n : r < 0 || a < 0 ? luckysheetformula.error.nm : n ? jStat.poisson.cdf(r, a) : jStat.poisson.pdf(r, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        RSQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = a.concat(func_methods.getCellDataArr(r, "text", !1));
                else {
                    if (!isRealNum(r))
                        return luckysheetformula.error.v;
                    a.push(r)
                }
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else if ("object" == getObjType(n) && null != n.startCell)
                    o = o.concat(func_methods.getCellDataArr(n, "text", !1));
                else {
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    o.push(n)
                }
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                return 0 == l.length || 0 == i.length ? luckysheetformula.error.d : Math.pow(window.luckysheet_function.PEARSON.f(l, i), 2)
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        T_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getCellBoolen(arguments[2]);
                return valueIsError(n) ? n : a < 1 ? luckysheetformula.error.nm : n ? jStat.studentt.cdf(r, a) : jStat.studentt.pdf(r, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        T_DIST_2T: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r < 0 || a < 1 ? luckysheetformula.error.nm : 2 * (1 - jStat.studentt.cdf(r, a))) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        T_DIST_RT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a)) < 1 ? luckysheetformula.error.nm : 1 - jStat.studentt.cdf(r, a) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        T_INV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r <= 0 || r > 1 || a < 1 ? luckysheetformula.error.nm : jStat.studentt.inv(r, a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        T_INV_2T: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r <= 0 || r > 1 || a < 1 ? luckysheetformula.error.nm : Math.abs(jStat.studentt.inv(r / 2, a))) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        T_TEST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !1))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !1));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = r
                  , n = [];
                if ("array" == getObjType(arguments[1])) {
                    if ("array" == getObjType(arguments[1][0]) && !func_methods.isDyadicArr(arguments[1]))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(arguments[1], !1))
                } else if ("object" == getObjType(arguments[1]) && null != arguments[1].startCell)
                    n = n.concat(func_methods.getCellDataArr(arguments[1], "text", !1));
                else {
                    if (!isRealNum(arguments[1]))
                        return luckysheetformula.error.v;
                    n.push(arguments[1])
                }
                var o = n
                  , l = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                if (i = parseInt(i),
                -1 == [1, 2].indexOf(l))
                    return luckysheetformula.error.nm;
                if (-1 == [1, 2, 3].indexOf(i))
                    return luckysheetformula.error.nm;
                var s = null
                  , c = null;
                if (1 == i) {
                    var u = [];
                    for (e = 0; e < a.length; e++)
                        u.push(a[e] - o[e]);
                    var h = Math.abs(jStat.mean(u))
                      , d = func_methods.standardDeviation_s(u);
                    s = h / (d / Math.sqrt(a.length)),
                    c = a.length - 1
                } else {
                    var f = jStat.mean(a)
                      , m = jStat.mean(o)
                      , p = func_methods.variance_s(a)
                      , g = func_methods.variance_s(o);
                    switch (s = Math.abs(f - m) / Math.sqrt(p / a.length + g / o.length),
                    i) {
                    case 2:
                        c = a.length + o.length - 2;
                        break;
                    case 3:
                        c = Math.pow(p / a.length + g / o.length, 2) / (Math.pow(p / a.length, 2) / (a.length - 1) + Math.pow(g / o.length, 2) / (o.length - 1))
                    }
                }
                if (1 == l)
                    var y = window.luckysheet_function.T_DIST_RT.f(s, c);
                else if (2 == l)
                    y = window.luckysheet_function.T_DIST_2T.f(s, c);
                return y
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        F_DIST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = func_methods.getCellBoolen(arguments[3]);
                return valueIsError(o) ? o : r < 0 || a < 1 || n < 1 ? luckysheetformula.error.nm : o ? jStat.centralF.cdf(r, a, n) : jStat.centralF.pdf(r, a, n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        F_DIST_RT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseInt(n),
                r < 0 || a < 1 || n < 1 ? luckysheetformula.error.nm : 1 - jStat.centralF.cdf(r, a, n)) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        VAR_P: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                if (0 == n.length)
                    return luckysheetformula.error.d;
                var l = n.length
                  , i = 0
                  , s = window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, n);
                for (e = 0; e < l; e++)
                    i += Math.pow(n[e] - s, 2);
                return i / l
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        VAR_S: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                if (0 == n.length)
                    return luckysheetformula.error.d;
                var l = n.length
                  , i = 0
                  , s = window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, n);
                for (e = 0; e < l; e++)
                    i += Math.pow(n[e] - s, 2);
                return i / (l - 1)
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        VARA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if ("true" == o.toString.toLowerCase())
                        r.push(1);
                    else if ("false" == o.toString.toLowerCase())
                        r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) ? n.push(parseFloat(o)) : "true" == o.toString().toLowerCase() ? n.push(1) : n.push(0)
                }
                var l = n.length
                  , i = 0
                  , s = window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, n);
                for (e = 0; e < l; e++)
                    i += Math.pow(n[e] - s, 2);
                return i / (l - 1)
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        VARPA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !1))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else if ("true" == o.toString.toLowerCase())
                        r.push(1);
                    else if ("false" == o.toString.toLowerCase())
                        r.push(0);
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) ? n.push(parseFloat(o)) : "true" == o.toString().toLowerCase() ? n.push(1) : n.push(0)
                }
                var l = n.length
                  , i = 0
                  , s = window.luckysheet_function.AVERAGE.f.apply(window.luckysheet_function.AVERAGE, n);
                for (e = 0; e < l; e++)
                    i += Math.pow(n[e] - s, 2);
                return i / l
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        STEYX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !1))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !1));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = [];
                if ("array" == getObjType(arguments[1])) {
                    if ("array" == getObjType(arguments[1][0]) && !func_methods.isDyadicArr(arguments[1]))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(arguments[1], !1))
                } else if ("object" == getObjType(arguments[1]) && null != arguments[1].startCell)
                    a = a.concat(func_methods.getCellDataArr(arguments[1], "text", !1));
                else {
                    if (!isRealNum(arguments[1]))
                        return luckysheetformula.error.v;
                    a.push(arguments[1])
                }
                if (r.length != a.length)
                    return luckysheetformula.error.na;
                var n = []
                  , o = [];
                for (e = 0; e < r.length; e++) {
                    var l = r[e]
                      , i = a[e];
                    isRealNum(l) && isRealNum(i) && (n.push(parseFloat(l)),
                    o.push(parseFloat(i)))
                }
                if (n.length < 3 || o.length < 3)
                    return luckysheetformula.error.d;
                var s = jStat.mean(o)
                  , c = jStat.mean(n)
                  , u = o.length
                  , h = 0
                  , d = 0
                  , f = 0;
                for (e = 0; e < u; e++)
                    h += Math.pow(n[e] - c, 2),
                    d += (o[e] - s) * (n[e] - c),
                    f += Math.pow(o[e] - s, 2);
                return Math.sqrt((h - d * d / f) / (u - 2))
            } catch (e) {
                var m = e;
                return m = luckysheetformula.errorInfo(m),
                [luckysheetformula.error.v, m]
            }
        },
        STANDARDIZE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseFloat(n)) <= 0 ? luckysheetformula.error.nm : (r - a) / n : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        SMALL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !0))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "number", !0));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = [];
                for (e = 0; e < r.length; e++) {
                    var n = r[e];
                    isRealNum(n) && a.push(parseFloat(n))
                }
                var o = func_methods.getFirstValue(arguments[1]);
                return valueIsError(o) ? o : isRealNum(o) ? (o = parseInt(o),
                0 == a.length || o <= 0 || o > a.length ? luckysheetformula.error.nm : a.sort((function(e, t) {
                    return e - t
                }
                ))[o - 1]) : luckysheetformula.error.v
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        SLOPE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                if ("array" == getObjType(arguments[0])) {
                    if ("array" == getObjType(arguments[0][0]) && !func_methods.isDyadicArr(arguments[0]))
                        return luckysheetformula.error.v;
                    r = r.concat(func_methods.getDataArr(arguments[0], !1))
                } else if ("object" == getObjType(arguments[0]) && null != arguments[0].startCell)
                    r = r.concat(func_methods.getCellDataArr(arguments[0], "text", !1));
                else {
                    if (!isRealNum(arguments[0]))
                        return luckysheetformula.error.v;
                    r.push(arguments[0])
                }
                var a = [];
                if ("array" == getObjType(arguments[1])) {
                    if ("array" == getObjType(arguments[1][0]) && !func_methods.isDyadicArr(arguments[1]))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(arguments[1], !1))
                } else if ("object" == getObjType(arguments[1]) && null != arguments[1].startCell)
                    a = a.concat(func_methods.getCellDataArr(arguments[1], "text", !1));
                else {
                    if (!isRealNum(arguments[1]))
                        return luckysheetformula.error.v;
                    a.push(arguments[1])
                }
                if (r.length != a.length)
                    return luckysheetformula.error.na;
                var n = []
                  , o = [];
                for (e = 0; e < r.length; e++) {
                    var l = r[e]
                      , i = a[e];
                    isRealNum(l) && isRealNum(i) && (n.push(parseFloat(l)),
                    o.push(parseFloat(i)))
                }
                if (n.length < 3 || o.length < 3)
                    return luckysheetformula.error.d;
                var s = jStat.mean(o)
                  , c = jStat.mean(n)
                  , u = o.length
                  , h = 0
                  , d = 0;
                for (e = 0; e < u; e++)
                    h += (o[e] - s) * (n[e] - c),
                    d += Math.pow(o[e] - s, 2);
                return h / d
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        SKEW: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                if (n.length < 3 || 0 == func_methods.standardDeviation_s(n))
                    return luckysheetformula.error.d;
                var l = jStat.mean(n)
                  , i = n.length
                  , s = 0;
                for (e = 0; e < i; e++)
                    s += Math.pow(n[e] - l, 3);
                return i * s / ((i - 1) * (i - 2) * Math.pow(jStat.stdev(n, !0), 3))
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        SKEW_P: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [];
                for (e = 0; e < arguments.length; e++) {
                    var a = arguments[e];
                    if ("array" == getObjType(a)) {
                        if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = r.concat(func_methods.getDataArr(a, !0))
                    } else if ("object" == getObjType(a) && null != a.startCell)
                        r = r.concat(func_methods.getCellDataArr(a, "number", !0));
                    else {
                        if (!isRealNum(a))
                            return luckysheetformula.error.v;
                        r.push(a)
                    }
                }
                var n = [];
                for (e = 0; e < r.length; e++) {
                    var o = r[e];
                    isRealNum(o) && n.push(parseFloat(o))
                }
                if (n.length < 3 || 0 == func_methods.standardDeviation_s(n))
                    return luckysheetformula.error.d;
                var l = jStat.mean(n)
                  , i = n.length
                  , s = 0
                  , c = 0;
                for (e = 0; e < i; e++)
                    c += Math.pow(n[e] - l, 3),
                    s += Math.pow(n[e] - l, 2);
                return s /= i,
                (c /= i) / Math.pow(s, 1.5)
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        ADDRESS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = 1;
                if (arguments.length >= 3) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseInt(n)
                }
                var o, l = !0;
                if (arguments.length >= 4 && valueIsError(l = func_methods.getCellBoolen(arguments[3])))
                    return l;
                if (r <= 0 || a <= 0)
                    return luckysheetformula.error.v;
                if (-1 == [1, 2, 3, 4].indexOf(n))
                    return luckysheetformula.error.v;
                if (l)
                    switch (a = chatatABC(a - 1),
                    n) {
                    case 1:
                        o = "$" + a + "$" + r;
                        break;
                    case 2:
                        o = a + "$" + r;
                        break;
                    case 3:
                        o = "$" + a + r;
                        break;
                    case 4:
                        o = a + r
                    }
                else
                    switch (n) {
                    case 1:
                        o = "R" + r + "C" + a;
                        break;
                    case 2:
                        o = "R" + r + "C[" + a + "]";
                        break;
                    case 3:
                        o = "R[" + r + "]C" + a;
                        break;
                    case 4:
                        o = "R[" + r + "]C[" + a + "]"
                    }
                if (5 == arguments.length) {
                    var i = func_methods.getFirstValue(arguments[4]);
                    return valueIsError(i) ? i : i + "!" + o
                }
                return o
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        INDIRECT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = !0;
                if (2 == arguments.length && valueIsError(a = func_methods.getCellBoolen(arguments[1])))
                    return a;
                var n = getluckysheetfile()
                  , o = getSheetIndex(Store.calculateSheetIndex)
                  , l = n[o]
                  , i = l.data;
                if (luckysheetformula.iscelldata(r)) {
                    var s = luckysheetformula.getcellrange(r)
                      , c = s.row[0]
                      , u = s.column[0];
                    if (c < 0 || c >= i.length || u < 0 || u >= i[0].length)
                        return luckysheetformula.error.r;
                    if (null == i[c][u] || isRealNull(i[c][u].v))
                        return 0;
                    var h = i[c][u].v;
                    if (null != luckysheetformula.execFunctionGlobalData) {
                        var d = luckysheetformula.execFunctionGlobalData[c + "_" + u + "_" + Store.calculateSheetIndex];
                        null != d && (h = d.v)
                    }
                    var f = {
                        sheetName: l.name,
                        startCell: r,
                        rowl: c,
                        coll: u,
                        data: h
                    };
                    return f
                }
                return luckysheetformula.error.r
            } catch (e) {
                var m = e;
                return m = luckysheetformula.errorInfo(m),
                [luckysheetformula.error.v, m]
            }
        },
        ROW: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                if (1 == arguments.length) {
                    var r;
                    if ("array" == getObjType(arguments[0]))
                        return luckysheetformula.error.v;
                    if (r = "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? arguments[0].startCell : arguments[0],
                    luckysheetformula.iscelldata(r)) {
                        var a = luckysheetformula.getcellrange(r);
                        return a.row[0] + 1
                    }
                    return luckysheetformula.error.v
                }
                return window.luckysheetCurrentRow + 1
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ROWS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return "array" == getObjType(arguments[0]) ? "array" == getObjType(arguments[0][0]) ? arguments[0].length : 1 : "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? arguments[0].rowl : 1
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        COLUMN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                if (1 == arguments.length) {
                    var r;
                    if ("array" == getObjType(arguments[0]))
                        return luckysheetformula.error.v;
                    if (r = "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? arguments[0].startCell : arguments[0],
                    luckysheetformula.iscelldata(r)) {
                        var a = luckysheetformula.getcellrange(r);
                        return a.column[0] + 1
                    }
                    return luckysheetformula.error.v
                }
                return window.luckysheetCurrentColumn + 1
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        COLUMNS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return "array" == getObjType(arguments[0]) ? "array" == getObjType(arguments[0][0]) ? arguments[0][0].length : arguments[0].length : "object" == getObjType(arguments[0]) && null != arguments[0].startCell ? arguments[0].coll : 1
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        OFFSET: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                if ("object" != getObjType(arguments[0]) || null == arguments[0].startCell)
                    return luckysheetformula.error.v;
                var r = arguments[0].startCell
                  , a = arguments[0].sheetName
                  , n = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = arguments[0].rowl;
                if (arguments.length >= 4) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                var i = arguments[0].coll;
                if (5 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[4])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseInt(i)
                }
                if (l < 1 || i < 1)
                    return luckysheetformula.error.r;
                var s = luckysheetformula.getcellrange(r)
                  , c = s.row[0]
                  , u = s.column[0]
                  , h = (c += n) + l - 1
                  , d = (u += o) + i - 1
                  , f = getluckysheetfile()
                  , m = getSheetIndex(Store.calculateSheetIndex)
                  , p = f[m].data;
                if (c < 0 || h >= p.length || u < 0 || d >= p[0].length)
                    return luckysheetformula.error.r;
                for (var g = [], y = c; y <= h; y++) {
                    for (var v = [], A = u; A <= d; A++)
                        if (null != luckysheetformula.execFunctionGlobalData && null != luckysheetformula.execFunctionGlobalData[y + "_" + A + "_" + Store.calculateSheetIndex]) {
                            var b = luckysheetformula.execFunctionGlobalData[y + "_" + A + "_" + Store.calculateSheetIndex];
                            null != b ? v.push(b.v) : v.push(0)
                        } else
                            null == p[y][A] || isRealNull(p[y][A].v) ? v.push(0) : v.push(p[y][A].v);
                    g.push(v)
                }
                var k = {
                    sheetName: a,
                    startCell: getRangetxt(Store.calculateSheetIndex, {
                        row: [c, h],
                        column: [u, d]
                    }),
                    rowl: c,
                    coll: u,
                    data: g
                };
                return k
            } catch (e) {
                var w = e;
                return w = luckysheetformula.errorInfo(w),
                [luckysheetformula.error.v, w]
            }
        },
        MATCH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]))
                        return func_methods.isDyadicArr(a) ? luckysheetformula.error.na : luckysheetformula.error.v;
                    for (e = 0; e < a.length; e++)
                        n.push(a[e])
                } else if ("object" == getObjType(a) && null != a.startCell) {
                    if (a.rowl > 1 && a.coll > 1)
                        return luckysheetformula.error.na;
                    if (null != a.data)
                        if ("array" == getObjType(a.data))
                            for (e = 0; e < a.data.length; e++)
                                for (var o = 0; o < a.data[e].length; o++)
                                    null == a.data[e][o] || isRealNull(a.data[e][o].v) || n.push(a.data[e][o].v);
                        else
                            n.push(a.data.v)
                }
                var l, i, s = 1;
                if (3 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[2])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = Math.ceil(parseFloat(s))
                }
                if (-1 == [-1, 0, 1].indexOf(s))
                    return luckysheetformula.error.na;
                for (var c = 0; c < n.length; c++)
                    if (1 === s) {
                        if (n[c] === r)
                            return c + 1;
                        n[c] < r && (i ? n[c] > i && (l = c + 1,
                        i = n[c]) : (l = c + 1,
                        i = n[c]))
                    } else if (0 === s) {
                        if ("string" == typeof r) {
                            if (r = r.replace(/\?/g, "."),
                            n[c].toLowerCase().match(r.toLowerCase()))
                                return c + 1
                        } else if (n[c] === r)
                            return c + 1
                    } else if (-1 === s) {
                        if (n[c] === r)
                            return c + 1;
                        n[c] > r && (i ? n[c] < i && (l = c + 1,
                        i = n[c]) : (l = c + 1,
                        i = n[c]))
                    }
                return l || luckysheetformula.error.na
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        VLOOKUP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                if ("" == r.toString().replace(/\s/g, ""))
                    return luckysheetformula.error.na;
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        for (e = 0; e < a.length; e++) {
                            for (var o = [], l = 0; l < a[e].length; l++)
                                o.push(a[e][l]);
                            n.push(o)
                        }
                    } else {
                        for (o = [],
                        e = 0; e < a.length; e++)
                            o.push(a[e]);
                        n.push(o)
                    }
                else {
                    if ("object" != getObjType(a) || null == a.startCell)
                        return luckysheetformula.error.v;
                    n = func_methods.getCellDataDyadicArr(a, "text")
                }
                var i = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseInt(i);
                var s = !0;
                if (4 == arguments.length && valueIsError(s = func_methods.getCellBoolen(arguments[3])))
                    return s;
                if (i < 1)
                    return luckysheetformula.error.v;
                if (i > n[0].length)
                    return luckysheetformula.error.r;
                if (!s) {
                    var c = null;
                    for (u = 0; u < n.length; u++)
                        if (r.toString() == n[u][0].toString()) {
                            c = u;
                            break
                        }
                    return null == c ? luckysheetformula.error.na : n[c][i - 1]
                }
                n = orderbydata(n, 0, !0);
                for (var u = 0; u < n.length; u++) {
                    var h, d = n[u][0];
                    if (isdatetime(r) && isdatetime(d) ? h = diff(r, d) : isRealNum(r) && isRealNum(d) ? h = numeral(r).value() - numeral(d).value() : isRealNum(r) || isRealNum(d) ? isRealNum(r) ? isRealNum(d) || (h = -1) : h = 1 : h = r.localeCompare(d, "zh"),
                    h < 0)
                        return 0 == u ? luckysheetformula.error.na : n[u - 1][i - 1];
                    if (u == n.length - 1)
                        return n[u][i - 1]
                }
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        HLOOKUP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                window.luckysheetCurrentRow,
                window.luckysheetCurrentColumn;
                var a = arguments[0];
                "object" == _typeof(a) && ("array" == getObjType(a = arguments[0].data) ? "array" == getObjType(a = a[r]) && (a = a[s]) : a = a.v);
                var n = arguments[1].data
                  , o = arguments[2]
                  , l = !1;
                if (arguments.length > 3 && (l = !!arguments[3]),
                o > n.rowl)
                    return [luckysheetformula.error.v, "索引超过了范围的长度，" + n[0].length];
                if (o < 1)
                    return [luckysheetformula.error.v, "索引必须大于1"];
                for (var i = luckysheetformula.error.na, s = 0; s < n[0].length; s++) {
                    var c = getcellvalue(0, s, n)
                      , u = getcellvalue(o - 1, s, n);
                    if (l)
                        c.indexOf(a) > -1 && (i = u);
                    else if (luckysheetformula.acompareb(c, a))
                        return i = u
                }
                return i
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        LOOKUP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                window.luckysheetCurrentRow,
                window.luckysheetCurrentColumn;
                var a = arguments[0];
                "object" == _typeof(a) && ("array" == getObjType(a = arguments[0].data) ? "array" == getObjType(a = a[r]) && (a = a[c]) : a = a.v);
                var n, o = arguments[1].data, l = luckysheetformula.error.na;
                function i(e, t) {
                    return t - e
                }
                if (o = luckysheetformula.getRangeArray(o)[0],
                arguments[2] && (n = arguments[2].data,
                n = luckysheetformula.getRangeArray(n)[0]),
                "string" == typeof a)
                    for (e = 0; e < o.length; e++) {
                        var s = o[e];
                        arguments[2] ? (h = n[e],
                        s == a && (l = h)) : luckysheetformula.acompareb(s, a) && (l = s)
                    }
                else if ("num" == isdatatype(a)) {
                    var u = [];
                    for (e = 0; e < o.length; e++) {
                        var h;
                        s = o[e];
                        if (arguments[2]) {
                            if (h = n[e],
                            s == a)
                                return l = h;
                            s != a && "num" == isdatatype(s) && u.push(s)
                        } else {
                            if (s == a)
                                return l = s;
                            s != a && "num" == isdatatype(s) && u.push(s)
                        }
                    }
                    if (0 != u.length) {
                        u.push(a),
                        u.sort(i);
                        var d = u.indexOf(a);
                        if (d == u.length - 1)
                            return [luckysheetformula.error.na, "找不到对应参数"];
                        var f = u[d + 1];
                        l = arguments[2] ? n[e = o.indexOf(f)] : f
                    }
                }
                return l
            } catch (e) {
                var m = e;
                return m = luckysheetformula.errorInfo(m),
                [luckysheetformula.error.v, m]
            }
        },
        INDEX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = []
                  , n = !1;
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else
                    "object" == getObjType(r) && null != r.startCell && (a = func_methods.getCellDataDyadicArr(r, "number"),
                    n = !0);
                var o = a.length
                  , l = a[0].length
                  , i = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseInt(i);
                var s = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(s))
                    return s;
                if (i < 0 || isRealNum(s) && s < 0)
                    return luckysheetformula.error.v;
                if (i > o || isRealNum(s) && s > l)
                    return luckysheetformula.error.r;
                if (n) {
                    var c = luckysheetformula.getcellrange(r.startCell)
                      , u = c.row[0]
                      , h = c.column[0]
                      , d = a;
                    0 == i || 0 == s ? (0 == i ? (d = a[0],
                    i = 1) : d = a[i - 1],
                    isRealNum(s) ? 0 == s ? (d = d[0],
                    s = 1) : d = d[s - 1] : s = 1) : (isRealNum(i) || (i = 1),
                    isRealNum(s) || (s = 1),
                    d = a[i - 1][s - 1]);
                    var f = u + i - 1
                      , m = h + s - 1
                      , p = {
                        sheetName: r.sheetName,
                        startCell: getRangetxt(Store.calculateSheetIndex, {
                            row: [f, f],
                            column: [m, m]
                        }),
                        rowl: f,
                        coll: m,
                        data: d
                    };
                    return p
                }
                return isRealNum(s) ? (s = parseInt(s),
                i <= 0 || s <= 0 ? luckysheetformula.error.v : a[i - 1][s - 1]) : luckysheetformula.error.v
            } catch (e) {
                var g = e;
                return g = luckysheetformula.errorInfo(g),
                [luckysheetformula.error.v, g]
            }
        },
        GETPIVOTDATA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return luckysheetformula.error.v
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        CHOOSE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                if ((r = parseInt(r)) < 1 || r > arguments.length - 1)
                    return luckysheetformula.error.v;
                var a = arguments[r];
                if ("array" == getObjType(a))
                    return "array" != getObjType(a[0]) || func_methods.isDyadicArr(a) ? a : luckysheetformula.error.v;
                if ("object" == getObjType(a) && null != a.startCell) {
                    if (null == a.data)
                        return 0;
                    if ("array" == getObjType(a.data)) {
                        var n = func_methods.getCellDataDyadicArr(a.data, "number");
                        return n
                    }
                    return isRealNull(a.data.v) ? 0 : a.data.v
                }
                return a
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        HYPERLINK: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return luckysheetformula.error.v
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        TIME: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                if (n = parseInt(n),
                r < 0 || r > 32767)
                    return luckysheetformula.error.nm;
                if (r > 24 && (r %= 24),
                a < 0 || a > 32767)
                    return luckysheetformula.error.nm;
                if (n < 0 || n > 32767)
                    return luckysheetformula.error.nm;
                var o = moment().set({
                    hour: r,
                    minute: a,
                    second: n
                });
                return moment(o).format("h:mm:ss a")
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        TIMEVALUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                return valueIsError(r) ? r : moment(r).isValid() ? (3600 * moment(r).get("hour") + 60 * moment(r).get("minute") + moment(r).get("second")) / 86400 : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        EOMONTH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if (a = parseInt(a),
                !moment(r).isValid())
                    return luckysheetformula.error.v;
                var n = moment(r).add(a + 1, "months").set("date", 1).subtract(1, "days")
                  , o = genarate(moment(n).format("YYYY-MM-DD H:mm:ss"))
                  , l = o[2];
                return l
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        EDATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if (a = parseInt(a),
                !moment(r).isValid())
                    return luckysheetformula.error.v;
                var n = moment(r).add(a, "months")
                  , o = genarate(moment(n).format("YYYY-MM-DD h:mm:ss"))
                  , l = o[2];
                return l
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        SECOND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = moment(r).seconds();
                return a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        MINUTE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = moment(r).minutes();
                return a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        HOUR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = moment(r).hours();
                return a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        NOW: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return moment().format("YYYY-M-D HH:mm")
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        NETWORKDAYS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                if (3 == arguments.length)
                    var r = window.luckysheet_function.NETWORKDAYS_INTL.f(arguments[0], arguments[1], 1, arguments[2]);
                else
                    r = window.luckysheet_function.NETWORKDAYS_INTL.f(arguments[0], arguments[1], 1);
                return r
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        NETWORKDAYS_INTL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [[], [6, 0], [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], void 0, void 0, void 0, [0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6]]
                  , a = func_methods.getCellDate(arguments[0]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getCellDate(arguments[1]);
                if (valueIsError(n))
                    return n;
                if (!moment(n).isValid())
                    return luckysheetformula.error.v;
                var o = r[1];
                if (arguments.length >= 3)
                    if ("string" == typeof (o = arguments[2]) && "7" == o.length && /^[0-1]{7}$/g.test(o))
                        ;
                    else {
                        if (valueIsError(o = func_methods.getFirstValue(arguments[2])))
                            return o;
                        if (!isRealNum(o))
                            return luckysheetformula.error.v;
                        if ((o = parseInt(o)) < 1 || o > 7 && o < 11 || o > 17)
                            return luckysheetformula.error.nm;
                        o = r[o]
                    }
                var l = [];
                if (4 == arguments.length && valueIsError(l = func_methods.getCellrangeDate(arguments[3])))
                    return l;
                for (e = 0; e < l.length; e++)
                    if (!moment(l[e]).isValid())
                        return luckysheetformula.error.v;
                var i = moment(n).diff(moment(a), "days") + 1
                  , s = i
                  , c = moment(a);
                for (e = 0; e < i; e++) {
                    var u = moment(c).weekday()
                      , h = !1;
                    "array" == getObjType(o) ? u !== o[0] && u !== o[1] || (h = !0) : (0 == u && (u = 7),
                    "0" == o.charAt(u - 1) && (h = !0));
                    for (var d = 0; d < l.length; d++)
                        if (0 === moment(c).diff(moment(l[d]), "days")) {
                            h = !0;
                            break
                        }
                    h && s--,
                    c = moment(c).add(1, "days")
                }
                return s
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        ISOWEEKNUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                return valueIsError(r) ? r : moment(r).isValid() ? moment(r).isoWeeks() : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        WEEKNUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [void 0, 7, 1, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, 1, 2, 3, 4, 5, 6, 7]
                  , a = func_methods.getCellDate(arguments[0]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = 1;
                if (2 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[1])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseInt(n)
                }
                if (21 == n)
                    return window.luckysheet_function.ISOWEEKNUM.f(arguments[0]);
                if (-1 == [1, 2, 11, 12, 13, 14, 15, 16, 17].indexOf(n))
                    return luckysheetformula.error.nm;
                var o = r[n]
                  , l = moment(a).isoWeekday() >= o ? 1 : 0
                  , i = moment(a).isoWeeks() + l;
                return i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        WEEKDAY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [[], [1, 2, 3, 4, 5, 6, 7], [7, 1, 2, 3, 4, 5, 6], [6, 0, 1, 2, 3, 4, 5], [], [], [], [], [], [], [], [7, 1, 2, 3, 4, 5, 6], [6, 7, 1, 2, 3, 4, 5], [5, 6, 7, 1, 2, 3, 4], [4, 5, 6, 7, 1, 2, 3], [3, 4, 5, 6, 7, 1, 2], [2, 3, 4, 5, 6, 7, 1], [1, 2, 3, 4, 5, 6, 7]]
                  , a = func_methods.getCellDate(arguments[0]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = 1;
                if (2 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[1])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseInt(n)
                }
                if (-1 == [1, 2, 3, 11, 12, 13, 14, 15, 16, 17].indexOf(n))
                    return luckysheetformula.error.nm;
                var o = r[n][moment(a).day()];
                return o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        DAY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                return valueIsError(r) ? r : moment(r).isValid() ? moment(r).date() : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        DAYS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = moment(r).diff(moment(a), "days");
                return n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DAYS360: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = !1;
                if (3 == arguments.length && valueIsError(n = func_methods.getCellBoolen(arguments[2])))
                    return n;
                var o, l, i = moment(r).month(), s = moment(a).month();
                if (n)
                    o = 31 === moment(r).date() ? 30 : moment(r).date(),
                    l = 31 === moment(a).date() ? 30 : moment(a).date();
                else {
                    var c = moment().set({
                        year: moment(r).year(),
                        month: i + 1,
                        date: 0
                    }).date()
                      , u = moment().set({
                        year: moment(a).year(),
                        month: s + 1,
                        date: 0
                    }).date();
                    o = moment(r).date() === c ? 30 : moment(r).date(),
                    moment(a).date() === u ? o < 30 ? (s++,
                    l = 1) : l = 30 : l = moment(a).date()
                }
                var h = 360 * moment(a).diff(moment(r), "years") + 30 * (s - i) + (l - o);
                return h
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        DATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                if (n = parseInt(n),
                r < 0 || r >= 1e4)
                    return luckysheetformula.error.nm;
                r >= 0 && r <= 1899 && (r += 1900);
                var o = moment().set({
                    year: r,
                    month: a - 1,
                    date: n
                });
                return moment(o).year() < 1900 ? luckysheetformula.error.nm : moment(o).format("YYYY-MM-DD")
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        DATEVALUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = genarate(r = moment(r).format("YYYY-MM-DD"))[2];
                return a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DATEDIF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                luckysheet_getValue(arguments);
                for (e = 0; e < arguments.length - 1; e++)
                    if (arguments[e] = moment.fromOADate(arguments[e]).format("l"),
                    !isdatetime(arguments[e]))
                        return luckysheetformula.error.v;
                var r = moment(arguments[0])
                  , a = moment(arguments[1])
                  , n = arguments[2]
                  , o = luckysheetformula.error.v;
                if (window.luckysheet_function.DAYS.f(a, r) < 0)
                    return luckysheetformula.error.v;
                switch (n) {
                case "Y":
                case "y":
                    o = a.diff(r, "years", !1);
                    break;
                case "M":
                case "m":
                    o = a.diff(r, "months", !1);
                    break;
                case "D":
                case "d":
                    o = a.diff(r, "days", !1);
                    break;
                case "MD":
                case "md":
                    o = a.format("DD") - r.format("DD");
                    break;
                case "YM":
                case "ym":
                    o = (l = parseInt(r.format("M"))) <= (i = parseInt(a.format("M"))) ? i - l : i + 12 - l;
                    break;
                case "YD":
                case "yd":
                    var l, i;
                    o = (l = genarate(r.format("MM-DD"))[2]) <= (i = genarate(a.format("MM-DD"))[2]) ? i - l : i + 365 - l;
                    break;
                default:
                    o = luckysheetformula.error.v
                }
                return o
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        WORKDAY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                if (3 == arguments.length)
                    var r = window.luckysheet_function.WORKDAY_INTL.f(arguments[0], arguments[1], 1, arguments[2]);
                else
                    r = window.luckysheet_function.WORKDAY_INTL.f(arguments[0], arguments[1], 1);
                return r
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        WORKDAY_INTL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = [[], [6, 0], [0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], void 0, void 0, void 0, [0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6]]
                  , a = func_methods.getCellDate(arguments[0]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = r[1];
                if (arguments.length >= 3)
                    if ("string" == typeof (o = arguments[2]) && "7" == o.length && /^[0-1]{7}$/g.test(o))
                        ;
                    else {
                        if (valueIsError(o = func_methods.getFirstValue(arguments[2])))
                            return o;
                        if (!isRealNum(o))
                            return luckysheetformula.error.v;
                        if ((o = parseInt(o)) < 1 || o > 7 && o < 11 || o > 17)
                            return luckysheetformula.error.nm;
                        o = r[o]
                    }
                var l = [];
                if (4 == arguments.length && valueIsError(l = func_methods.getCellrangeDate(arguments[3])))
                    return l;
                for (e = 0; e < l.length; e++)
                    if (!moment(l[e]).isValid())
                        return luckysheetformula.error.v;
                for (var i = 0; i < n; ) {
                    a = moment(a).add(1, "days");
                    var s = moment(a).weekday();
                    if (getObjType(o)) {
                        if (s === o[0] || s === o[1])
                            continue
                    } else if (0 == s && (s = 7),
                    "0" == o.charAt(s - 1))
                        continue;
                    for (var c = 0; c < l.length; c++)
                        if (0 === moment(a).diff(moment(l[c]), "days")) {
                            i--;
                            break
                        }
                    i++
                }
                return moment(a).format("YYYY-MM-DD")
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        YEAR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                return valueIsError(r) ? r : moment(r).isValid() ? moment(r).year() : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        YEARFRAC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = 0;
                if (3 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseInt(n)
                }
                if (n < 0 || n > 4)
                    return luckysheetformula.error.nm;
                var o, l = moment(r).date(), i = moment(r).month() + 1, s = moment(r).year(), c = moment(a).date(), u = moment(a).month() + 1, h = moment(a).year();
                switch (n) {
                case 0:
                    31 === l && 31 === c ? (l = 30,
                    c = 30) : 31 === l ? l = 30 : 30 === l && 31 === c && (c = 30),
                    o = (c + 30 * u + 360 * h - (l + 30 * i + 360 * s)) / 360;
                    break;
                case 1:
                    var d = 365;
                    if (s === h || s + 1 === h && (i > u || i === u && l >= c))
                        return (s === h && func_methods.isLeapYear(s) || func_methods.feb29Between(r, a) || 1 === u && 29 === c) && (d = 366),
                        moment(a).diff(moment(r), "days") / d;
                    var f = h - s + 1
                      , m = (moment().set({
                        year: h + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: s,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , p = m / f;
                    o = moment(a).diff(moment(r), "days") / p;
                    break;
                case 2:
                    o = moment(a).diff(moment(r), "days") / 360;
                    break;
                case 3:
                    o = moment(a).diff(moment(r), "days") / 365;
                    break;
                case 4:
                    o = (c + 30 * u + 360 * h - (l + 30 * i + 360 * s)) / 360
                }
                return o
            } catch (e) {
                var g = e;
                return g = luckysheetformula.errorInfo(g),
                [luckysheetformula.error.v, g]
            }
        },
        TODAY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return moment().format("YYYY-MM-DD")
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        MONTH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                return valueIsError(r) ? r : moment(r).isValid() ? moment(r).month() + 1 : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        EFFECT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r <= 0 || a < 1 ? luckysheetformula.error.nm : Math.pow(1 + r / a, a) - 1) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DOLLAR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = 2;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                a > 9 && (a = 9);
                for (e = 1; e <= a; e++)
                    "0";
                var n = r > 0 ? 1 : -1;
                return n * Math.floor(Math.abs(r) * Math.pow(10, a)) / Math.pow(10, a)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DOLLARDE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if ((a = parseInt(a)) < 0)
                    return luckysheetformula.error.nm;
                if (0 == a)
                    return luckysheetformula.error.d;
                var n = parseInt(r, 10);
                n += r % 1 * Math.pow(10, Math.ceil(Math.log(a) / Math.LN10)) / a;
                var o = Math.pow(10, Math.ceil(Math.log(a) / Math.LN2) + 1);
                return n = Math.round(n * o) / o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        DOLLARFR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                if ((a = parseInt(a)) < 0)
                    return luckysheetformula.error.nm;
                if (0 == a)
                    return luckysheetformula.error.d;
                var n = parseInt(r, 10);
                return n += r % 1 * Math.pow(10, -Math.ceil(Math.log(a) / Math.LN10)) * a
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = 12;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (r < 0 || a < 0 || n < 0 || o < 0)
                    return luckysheetformula.error.nm;
                if (l < 1 || l > 12)
                    return luckysheetformula.error.nm;
                if (o > n)
                    return luckysheetformula.error.nm;
                if (a >= r)
                    return 0;
                var i = (1 - Math.pow(a / r, 1 / n)).toFixed(3)
                  , s = r * i * l / 12
                  , c = s
                  , u = 0
                  , h = o === n ? n - 1 : o;
                for (e = 2; e <= h; e++)
                    c += u = (r - c) * i;
                if (1 === o)
                    var d = s;
                else if (o === n)
                    d = (r - c) * i;
                else
                    d = u;
                return d
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        DDB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = 2;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                if (r < 0 || a < 0 || n < 0 || o < 0 || l <= 0)
                    return luckysheetformula.error.nm;
                if (o > n)
                    return luckysheetformula.error.nm;
                if (a >= r)
                    return 0;
                var i = 0
                  , s = 0;
                for (e = 1; e <= o; e++)
                    i += s = Math.min(l / n * (r - i), r - a - i);
                return s
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        RATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = 0;
                if (arguments.length >= 4) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                var l = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                var i = .1;
                if (6 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                if (0 != l && 1 != l)
                    return luckysheetformula.error.nm;
                for (var s = 1e-6, c = 100, u = 0, h = !1, d = i; u < c && !h; ) {
                    var f = Math.pow(d + 1, r)
                      , m = Math.pow(d + 1, r - 1)
                      , p = o + f * n + a * (f - 1) * (d * l + 1) / d
                      , g = r * m * n - a * (f - 1) * (d * l + 1) / Math.pow(d, 2)
                      , y = r * a * m * (d * l + 1) / d + a * (f - 1) * l / d
                      , v = d - p / (g + y);
                    Math.abs(v - d) < s && (h = !0),
                    u++,
                    d = v
                }
                return h ? d : luckysheetformula.error.nm
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        CUMPRINC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = func_methods.getFirstValue(arguments[5]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                if (i = parseFloat(i),
                r <= 0 || a <= 0 || n <= 0)
                    return luckysheetformula.error.nm;
                if (o < 1 || l < 1 || o > l)
                    return luckysheetformula.error.nm;
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.PMT.f(r, a, n, 0, i)
                  , c = 0;
                1 === o && (c = 0 === i ? s + n * r : s,
                o++);
                for (e = o; e <= l; e++)
                    c += i > 0 ? s - (window.luckysheet_function.FV.f(r, e - 2, s, n, 1) - s) * r : s - window.luckysheet_function.FV.f(r, e - 1, s, n, 0) * r;
                return c
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        COUPNUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = 0;
                if (4 == arguments.length) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseInt(o)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (o < 0 || o > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var l, i = moment(r).date(), s = moment(r).month() + 1, c = moment(r).year(), u = moment(a).date(), h = moment(a).month() + 1, d = moment(a).year();
                switch (o) {
                case 0:
                    31 === i && 31 === u ? (i = 30,
                    u = 30) : 31 === i ? i = 30 : 30 === i && 31 === u && (u = 30),
                    l = (u + 30 * h + 360 * d - (i + 30 * s + 360 * c)) / (360 / n);
                    break;
                case 1:
                    var f = 365;
                    if (c === d || c + 1 === d && (s > h || s === h && i >= u))
                        return (c === d && func_methods.isLeapYear(c) || func_methods.feb29Between(r, a) || 1 === h && 29 === u) && (f = 366),
                        moment(a).diff(moment(r), "days") / (f / n);
                    var m = d - c + 1
                      , p = (moment().set({
                        year: d + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: c,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , g = p / m;
                    l = moment(a).diff(moment(r), "days") / (g / n);
                    break;
                case 2:
                    l = moment(a).diff(moment(r), "days") / (360 / n);
                    break;
                case 3:
                    l = moment(a).diff(moment(r), "days") / (365 / n);
                    break;
                case 4:
                    l = (u + 30 * h + 360 * d - (i + 30 * s + 360 * c)) / (360 / n)
                }
                return Math.round(l)
            } catch (e) {
                var y = e;
                return y = luckysheetformula.errorInfo(y),
                [luckysheetformula.error.v, y]
            }
        },
        SYD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                return valueIsError(o) ? o : isRealNum(o) ? (o = parseInt(o),
                0 == n || o < 1 || o > n ? luckysheetformula.error.nm : (r - a) * (n - o + 1) * 2 / (n * (n + 1))) : luckysheetformula.error.v
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        TBILLEQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseFloat(n)) <= 0 || moment(r) - moment(a) > 0 || moment(a) - moment(r) > 31536e6 ? luckysheetformula.error.nm : 365 * n / (360 - n * moment(a).diff(moment(r), "days")) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        TBILLYIELD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseFloat(n)) <= 0 || moment(r) - moment(a) >= 0 || moment(a) - moment(r) > 31536e6 ? luckysheetformula.error.nm : (100 - n) / n * (360 / moment(a).diff(moment(r), "days")) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        TBILLPRICE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseFloat(n)) <= 0 || moment(r) - moment(a) > 0 || moment(a) - moment(r) > 31536e6 ? luckysheetformula.error.nm : 100 * (1 - n * moment(a).diff(moment(r), "days") / 360) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        PV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = 0;
                if (arguments.length >= 4) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                var l = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                if (0 != l && 1 != l)
                    return luckysheetformula.error.nm;
                if (0 === r)
                    var i = -n * a - o;
                else
                    i = ((1 - Math.pow(1 + r, a)) / r * n * (1 + r * l) - o) / Math.pow(1 + r, a);
                return i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        ACCRINT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getCellDate(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!moment(n).isValid())
                    return luckysheetformula.error.v;
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseFloat(l);
                var i = func_methods.getFirstValue(arguments[5]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseInt(i);
                var s = 0;
                if (arguments.length >= 7) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[6])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = parseInt(s)
                }
                var c, u = !0;
                if (8 == arguments.length && valueIsError(u = func_methods.getCellBoolen(arguments[7])))
                    return u;
                if (o <= 0 || l <= 0)
                    return luckysheetformula.error.nm;
                if (1 != i && 2 != i && 4 != i)
                    return luckysheetformula.error.nm;
                if (s < 0 || s > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(n) >= 0)
                    return luckysheetformula.error.nm;
                if (moment(n) - moment(a) >= 0 && !u) {
                    var h = moment(a).date()
                      , d = moment(a).month() + 1
                      , f = moment(a).year()
                      , m = moment(n).date()
                      , p = moment(n).month() + 1
                      , g = moment(n).year();
                    switch (s) {
                    case 0:
                        31 === h && 31 === m ? (h = 30,
                        m = 30) : 31 === h ? h = 30 : 30 === h && 31 === m && (m = 30),
                        c = (m + 30 * p + 360 * g - (h + 30 * d + 360 * f)) / 360;
                        break;
                    case 1:
                        var y = 365;
                        if (f === g || f + 1 === g && (d > p || d === p && h >= m))
                            return (f === g && func_methods.isLeapYear(f) || func_methods.feb29Between(a, n) || 1 === p && 29 === m) && (y = 366),
                            moment(n).diff(moment(a), "days") / y;
                        var v = g - f + 1
                          , A = (moment().set({
                            year: g + 1,
                            month: 0,
                            date: 1
                        }) - moment().set({
                            year: f,
                            month: 0,
                            date: 1
                        })) / 1e3 / 60 / 60 / 24 / v;
                        c = moment(n).diff(moment(a), "days") / A;
                        break;
                    case 2:
                        c = moment(n).diff(moment(a), "days") / 360;
                        break;
                    case 3:
                        c = moment(n).diff(moment(a), "days") / 365;
                        break;
                    case 4:
                        c = (m + 30 * p + 360 * g - (h + 30 * d + 360 * f)) / 360
                    }
                } else {
                    h = moment(r).date(),
                    d = moment(r).month() + 1,
                    f = moment(r).year(),
                    m = moment(n).date(),
                    p = moment(n).month() + 1,
                    g = moment(n).year();
                    switch (s) {
                    case 0:
                        31 === h && 31 === m ? (h = 30,
                        m = 30) : 31 === h ? h = 30 : 30 === h && 31 === m && (m = 30),
                        c = (m + 30 * p + 360 * g - (h + 30 * d + 360 * f)) / 360;
                        break;
                    case 1:
                        y = 365;
                        if (f === g || f + 1 === g && (d > p || d === p && h >= m))
                            return (f === g && func_methods.isLeapYear(f) || func_methods.feb29Between(r, n) || 1 === p && 29 === m) && (y = 366),
                            moment(n).diff(moment(r), "days") / y;
                        v = g - f + 1,
                        A = (moment().set({
                            year: g + 1,
                            month: 0,
                            date: 1
                        }) - moment().set({
                            year: f,
                            month: 0,
                            date: 1
                        })) / 1e3 / 60 / 60 / 24 / v;
                        c = moment(n).diff(moment(r), "days") / A;
                        break;
                    case 2:
                        c = moment(n).diff(moment(r), "days") / 360;
                        break;
                    case 3:
                        c = moment(n).diff(moment(r), "days") / 365;
                        break;
                    case 4:
                        c = (m + 30 * p + 360 * g - (h + 30 * d + 360 * f)) / 360
                    }
                }
                return l * o * c
            } catch (e) {
                var b = e;
                return b = luckysheetformula.errorInfo(b),
                [luckysheetformula.error.v, b]
            }
        },
        ACCRINTM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i, s = moment(r).date(), c = moment(r).month() + 1, u = moment(r).year(), h = moment(a).date(), d = moment(a).month() + 1, f = moment(a).year();
                switch (l) {
                case 0:
                    31 === s && 31 === h ? (s = 30,
                    h = 30) : 31 === s ? s = 30 : 30 === s && 31 === h && (h = 30),
                    i = (h + 30 * d + 360 * f - (s + 30 * c + 360 * u)) / 360;
                    break;
                case 1:
                    var m = 365;
                    if (u === f || u + 1 === f && (c > d || c === d && s >= h))
                        return (u === f && func_methods.isLeapYear(u) || func_methods.feb29Between(r, a) || 1 === d && 29 === h) && (m = 366),
                        moment(a).diff(moment(r), "days") / m;
                    var p = f - u + 1
                      , g = (moment().set({
                        year: f + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: u,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , y = g / p;
                    i = moment(a).diff(moment(r), "days") / y;
                    break;
                case 2:
                    i = moment(a).diff(moment(r), "days") / 360;
                    break;
                case 3:
                    i = moment(a).diff(moment(r), "days") / 365;
                    break;
                case 4:
                    i = (h + 30 * d + 360 * f - (s + 30 * c + 360 * u)) / 360
                }
                return o * n * i
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        COUPDAYBS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o, l = 0;
                if (4 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i, s = Math.ceil(moment(a).diff(moment(r), "months") / (12 / n)) + 1;
                for (e = 1; e <= s; e++) {
                    var c = moment(a).subtract(12 / n * e, "months");
                    if (c <= moment(r)) {
                        o = c;
                        break
                    }
                }
                switch (l) {
                case 0:
                    var u = moment(o).date()
                      , h = moment(o).month() + 1
                      , d = moment(o).year()
                      , f = moment(r).date()
                      , m = moment(r).month() + 1
                      , p = moment(r).year();
                    31 === u && 31 === f ? (u = 30,
                    f = 30) : 31 === u ? u = 30 : 30 === u && 31 === f && (f = 30),
                    i = f + 30 * m + 360 * p - (u + 30 * h + 360 * d);
                    break;
                case 1:
                case 2:
                case 3:
                    i = moment(r).diff(moment(o), "days");
                    break;
                case 4:
                    u = moment(o).date(),
                    h = moment(o).month() + 1,
                    d = moment(o).year();
                    i = (f = moment(r).date()) + 30 * (m = moment(r).month() + 1) + 360 * (p = moment(r).year()) - (u + 30 * h + 360 * d)
                }
                return i
            } catch (e) {
                var g = e;
                return g = luckysheetformula.errorInfo(g),
                [luckysheetformula.error.v, g]
            }
        },
        COUPDAYS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o, l = 0;
                if (4 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                switch (l) {
                case 0:
                    o = 360 / n;
                    break;
                case 1:
                    var i = Math.ceil(moment(a).diff(moment(r), "months") / (12 / n)) + 1;
                    for (e = 1; e <= i; e++) {
                        var s = moment(a).subtract(12 / n * e, "months");
                        if (s <= moment(r)) {
                            var c = moment(a).subtract(12 / n * (e - 1), "months");
                            o = moment(c).diff(moment(s), "days");
                            break
                        }
                    }
                    break;
                case 2:
                    o = 360 / n;
                    break;
                case 3:
                    o = 365 / n;
                    break;
                case 4:
                    o = 360 / n
                }
                return o
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        COUPDAYSNC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o, l = 0;
                if (4 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i, s = Math.ceil(moment(a).diff(moment(r), "months") / (12 / n)) + 1;
                for (e = 1; e <= s; e++) {
                    var c = moment(a).subtract(12 / n * e, "months");
                    if (c <= moment(r)) {
                        o = moment(a).subtract(12 / n * (e - 1), "months");
                        break
                    }
                }
                switch (l) {
                case 0:
                    var u = moment(r).date()
                      , h = moment(r).month() + 1
                      , d = moment(r).year()
                      , f = moment(o).date()
                      , m = moment(o).month() + 1
                      , p = moment(o).year();
                    31 === u && 31 === f ? (u = 30,
                    f = 30) : 31 === u ? u = 30 : 30 === u && 31 === f && (f = 30),
                    i = f + 30 * m + 360 * p - (u + 30 * h + 360 * d);
                    break;
                case 1:
                case 2:
                case 3:
                    i = moment(o).diff(moment(r), "days");
                    break;
                case 4:
                    u = moment(r).date(),
                    h = moment(r).month() + 1,
                    d = moment(r).year();
                    i = (f = moment(o).date()) + 30 * (m = moment(o).month() + 1) + 360 * (p = moment(o).year()) - (u + 30 * h + 360 * d)
                }
                return i
            } catch (e) {
                var g = e;
                return g = luckysheetformula.errorInfo(g),
                [luckysheetformula.error.v, g]
            }
        },
        COUPNCD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o, l = 0;
                if (4 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i = Math.ceil(moment(a).diff(moment(r), "months") / (12 / n)) + 1;
                for (e = 1; e <= i; e++) {
                    var s = moment(a).subtract(12 / n * e, "months");
                    if (s <= moment(r)) {
                        o = moment(a).subtract(12 / n * (e - 1), "months");
                        break
                    }
                }
                return moment(o).format("YYYY-MM-DD")
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        COUPPCD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o, l = 0;
                if (4 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[3])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (1 != n && 2 != n && 4 != n)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i = Math.ceil(moment(a).diff(moment(r), "months") / (12 / n)) + 1;
                for (e = 1; e <= i; e++) {
                    var s = moment(a).subtract(12 / n * e, "months");
                    if (s <= moment(r)) {
                        o = s;
                        break
                    }
                }
                return moment(o).format("YYYY-MM-DD")
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        FV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = 0;
                if (arguments.length >= 4) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                var l, i = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[4])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                if (0 === r)
                    l = o + n * a;
                else {
                    var s = Math.pow(1 + r, a);
                    l = 1 === i ? o * s + n * (1 + r) * (s - 1) / r : o * s + n * (s - 1) / r
                }
                return -l
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        FVSCHEDULE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !1))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "number", !1)) : n.push(a);
                var o = [];
                for (e = 0; e < n.length; e++) {
                    var l = n[e];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    o.push(parseFloat(l))
                }
                var i = o.length
                  , s = r;
                for (e = 0; e < i; e++)
                    s *= 1 + o[e];
                return s
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        YIELD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseFloat(l);
                var i = func_methods.getFirstValue(arguments[5]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseInt(i);
                var s = 0;
                if (7 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[6])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = parseInt(s)
                }
                if (n < 0)
                    return luckysheetformula.error.nm;
                if (o <= 0 || l <= 0)
                    return luckysheetformula.error.nm;
                if (1 != i && 2 != i && 4 != i)
                    return luckysheetformula.error.nm;
                if (s < 0 || s > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var c = window.luckysheet_function.COUPNUM.f(r, a, i, s);
                if (c > 1) {
                    var u = 1
                      , h = 0
                      , d = u;
                    for (e = 1; e <= 100; e++) {
                        var f = window.luckysheet_function.PRICE.f(r, a, n, d, l, i, s);
                        if (Math.abs(f - o) < 1e-6)
                            break;
                        f > o ? h = d : u = d,
                        d = (u + h) / 2
                    }
                    var m = d
                } else {
                    var p = window.luckysheet_function.COUPDAYSNC.f(r, a, i, s)
                      , g = window.luckysheet_function.COUPDAYS.f(r, a, i, s)
                      , y = window.luckysheet_function.COUPDAYBS.f(r, a, i, s)
                      , v = l / 100 + n / i
                      , A = o / 100 + y / g * (n / i)
                      , b = i * g / p;
                    m = (v - A) / A * b
                }
                return m
            } catch (e) {
                var k = e;
                return k = luckysheetformula.errorInfo(k),
                [luckysheetformula.error.v, k]
            }
        },
        YIELDDISC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i = window.luckysheet_function.YEARFRAC.f(r, a, l);
                return (o / n - 1) / i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        NOMINAL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a),
                r <= 0 || a < 1 ? luckysheetformula.error.nm : (Math.pow(r + 1, 1 / a) - 1) * a) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        XIRR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !1)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    n.push(parseFloat(o))
                }
                var l = func_methods.getCellrangeDate(arguments[1]);
                if (valueIsError(l))
                    return l;
                for (e = 0; e < l.length; e++)
                    if (!moment(l[e]).isValid())
                        return luckysheetformula.error.v;
                var i = .1;
                if (3 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[2])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                var s = !1
                  , c = !1;
                for (e = 0; e < n.length && (n[e] > 0 && (s = !0),
                n[e] < 0 && (c = !0),
                !s || !c); e++)
                    ;
                if (!s || !c)
                    return luckysheetformula.error.nm;
                if (n.length != l.length)
                    return luckysheetformula.error.nm;
                var u, h, d, f = function(e, t, r) {
                    for (var a = r + 1, n = e[0], o = 1; o < e.length; o++)
                        n += e[o] / Math.pow(a, window.luckysheet_function.DAYS.f(t[o], t[0]) / 365);
                    return n
                }, m = function(e, t, r) {
                    for (var a = r + 1, n = 0, o = 1; o < e.length; o++) {
                        var l = window.luckysheet_function.DAYS.f(t[o], t[0]) / 365;
                        n -= l * e[o] / Math.pow(a, l + 1)
                    }
                    return n
                }, p = i, g = 1e-10, y = !0;
                do {
                    u = p - (d = f(n, l, p)) / m(n, l, p),
                    h = Math.abs(u - p),
                    p = u,
                    y = h > g && Math.abs(d) > g
                } while (y);return p
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        MIRR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !1)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    n.push(parseFloat(o))
                }
                var l = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseFloat(l);
                var i = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseFloat(i);
                var s = n.length
                  , c = []
                  , u = [];
                for (e = 0; e < s; e++)
                    n[e] < 0 ? c.push(n[e]) : u.push(n[e]);
                if (0 == c.length || 0 == u.length)
                    return luckysheetformula.error.d;
                var h = -window.luckysheet_function.NPV.f(i, u) * Math.pow(1 + i, s - 1)
                  , d = window.luckysheet_function.NPV.f(l, c) * (1 + l);
                return Math.pow(h / d, 1 / (s - 1)) - 1
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        IRR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "number", !0)) : a.push(r);
                var n = [];
                for (e = 0; e < a.length; e++) {
                    var o = a[e];
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    n.push(parseFloat(o))
                }
                var l = .1;
                if (2 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[1])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                var i = []
                  , s = !1
                  , c = !1;
                for (e = 0; e < a.length; e++)
                    i[e] = 0 === e ? 0 : i[e - 1] + 365,
                    a[e] > 0 && (s = !0),
                    a[e] < 0 && (c = !0);
                if (!s || !c)
                    return luckysheetformula.error.nm;
                var u, h, d, f = function(e, t, r) {
                    for (var a = r + 1, n = e[0], o = 1; o < e.length; o++)
                        n += e[o] / Math.pow(a, (t[o] - t[0]) / 365);
                    return n
                }, m = function(e, t, r) {
                    for (var a = r + 1, n = 0, o = 1; o < e.length; o++) {
                        var l = (t[o] - t[0]) / 365;
                        n -= l * e[o] / Math.pow(a, l + 1)
                    }
                    return n
                }, p = l, g = 1e-10, y = !0;
                do {
                    u = p - (d = f(n, i, p)) / m(n, i, p),
                    h = Math.abs(u - p),
                    p = u,
                    y = h > g && Math.abs(d) > g
                } while (y);return p
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        NPV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = [];
                for (e = 1; e < arguments.length; e++) {
                    var n = arguments[e];
                    if ("array" == getObjType(n)) {
                        if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                            return luckysheetformula.error.v;
                        a = a.concat(func_methods.getDataArr(n, !0))
                    } else
                        "object" == getObjType(n) && null != n.startCell ? a = a.concat(func_methods.getCellDataArr(n, "number", !0)) : a.push(n)
                }
                var o = [];
                for (e = 0; e < a.length; e++) {
                    var l = a[e];
                    isRealNum(l) && o.push(parseFloat(l))
                }
                var i = 0;
                if (o.length > 0)
                    for (e = 0; e < o.length; e++)
                        i += o[e] / Math.pow(1 + r, e + 1);
                return i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        XNPV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = arguments[1]
                  , n = [];
                if ("array" == getObjType(a)) {
                    if ("array" == getObjType(a[0]) && !func_methods.isDyadicArr(a))
                        return luckysheetformula.error.v;
                    n = n.concat(func_methods.getDataArr(a, !1))
                } else
                    "object" == getObjType(a) && null != a.startCell ? n = n.concat(func_methods.getCellDataArr(a, "number", !1)) : n.push(a);
                var o = [];
                for (e = 0; e < n.length; e++) {
                    var l = n[e];
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    o.push(parseFloat(l))
                }
                var i = func_methods.getCellrangeDate(arguments[2]);
                if (valueIsError(i))
                    return i;
                for (e = 0; e < i.length; e++)
                    if (!moment(i[e]).isValid())
                        return luckysheetformula.error.v;
                if (o.length != i.length)
                    return luckysheetformula.error.nm;
                var s = 0;
                for (e = 0; e < o.length; e++)
                    s += o[e] / Math.pow(1 + r, window.luckysheet_function.DAYS.f(i[e], i[0]) / 365);
                return s
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        CUMIPMT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseInt(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = func_methods.getFirstValue(arguments[5]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                if (i = parseFloat(i),
                r <= 0 || a <= 0 || n <= 0)
                    return luckysheetformula.error.nm;
                if (o < 1 || l < 1 || o > l)
                    return luckysheetformula.error.nm;
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.PMT.f(r, a, n, 0, i)
                  , c = 0;
                1 === o && 0 === i && (c = -n,
                o++);
                for (e = o; e <= l; e++)
                    c += 1 === i ? window.luckysheet_function.FV.f(r, e - 2, s, n, 1) - s : window.luckysheet_function.FV.f(r, e - 1, s, n, 0);
                return c *= r
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        PMT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = 0;
                if (arguments.length >= 4) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                var l, i = 0;
                if (5 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[4])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                if (0 === r)
                    l = (n + o) / a;
                else {
                    var s = Math.pow(1 + r, a);
                    l = 1 === i ? (o * r / (s - 1) + n * r / (1 - 1 / s)) / (1 + r) : o * r / (s - 1) + n * r / (1 - 1 / s)
                }
                return -l
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        IPMT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                var i = 0;
                if (arguments.length >= 6) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                if (a < 1 || a > n)
                    return luckysheetformula.error.nm;
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.PMT.f(r, n, o, l, i)
                  , c = (1 === a ? 1 === i ? 0 : -o : 1 === i ? window.luckysheet_function.FV.f(r, a - 2, s, o, 1) - s : window.luckysheet_function.FV.f(r, a - 1, s, o, 0)) * r;
                return c
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        PPMT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                var i = 0;
                if (arguments.length >= 6) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseFloat(i)
                }
                if (a < 1 || a > n)
                    return luckysheetformula.error.nm;
                if (0 != i && 1 != i)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.PMT.f(r, n, o, l, i)
                  , c = window.luckysheet_function.IPMT.f(r, a, n, o, l, i);
                return s - c
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        INTRATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i, s = moment(r).date(), c = moment(r).month() + 1, u = moment(r).year(), h = moment(a).date(), d = moment(a).month() + 1, f = moment(a).year();
                switch (l) {
                case 0:
                    31 === s && 31 === h ? (s = 30,
                    h = 30) : 31 === s ? s = 30 : 30 === s && 31 === h && (h = 30),
                    i = 360 / (h + 30 * d + 360 * f - (s + 30 * c + 360 * u));
                    break;
                case 1:
                    var m = 365;
                    if (u === f || u + 1 === f && (c > d || c === d && s >= h))
                        return (u === f && func_methods.isLeapYear(u) || func_methods.feb29Between(r, a) || 1 === d && 29 === h) && (m = 366),
                        i = m / moment(a).diff(moment(r), "days"),
                        i *= (o - n) / n;
                    var p = f - u + 1
                      , g = (moment().set({
                        year: f + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: u,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , y = g / p;
                    i = y / moment(a).diff(moment(r), "days");
                    break;
                case 2:
                    i = 360 / moment(a).diff(moment(r), "days");
                    break;
                case 3:
                    i = 365 / moment(a).diff(moment(r), "days");
                    break;
                case 4:
                    i = 360 / (h + 30 * d + 360 * f - (s + 30 * c + 360 * u))
                }
                return i *= (o - n) / n
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        PRICE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseFloat(l);
                var i = func_methods.getFirstValue(arguments[5]);
                if (valueIsError(i))
                    return i;
                if (!isRealNum(i))
                    return luckysheetformula.error.v;
                i = parseInt(i);
                var s = 0;
                if (7 == arguments.length) {
                    if (valueIsError(s = func_methods.getFirstValue(arguments[6])))
                        return s;
                    if (!isRealNum(s))
                        return luckysheetformula.error.v;
                    s = parseInt(s)
                }
                if (n < 0 || o < 0)
                    return luckysheetformula.error.nm;
                if (l <= 0)
                    return luckysheetformula.error.nm;
                if (1 != i && 2 != i && 4 != i)
                    return luckysheetformula.error.nm;
                if (s < 0 || s > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var c = window.luckysheet_function.COUPDAYSNC.f(r, a, i, s)
                  , u = window.luckysheet_function.COUPDAYS.f(r, a, i, s)
                  , h = window.luckysheet_function.COUPDAYBS.f(r, a, i, s)
                  , d = window.luckysheet_function.COUPNUM.f(r, a, i, s);
                if (d > 1) {
                    var f = l / Math.pow(1 + o / i, d - 1 + c / u)
                      , m = 0;
                    for (e = 1; e <= d; e++)
                        m += 100 * n / i / Math.pow(1 + o / i, e - 1 + c / u);
                    var p = f + m - n / i * 100 * (h / u)
                } else {
                    var g = u - h;
                    p = (f = n / i * 100 + l) / (m = o / i * (g / u) + 1) - n / i * 100 * (h / u)
                }
                return p
            } catch (e) {
                var y = e;
                return y = luckysheetformula.errorInfo(y),
                [luckysheetformula.error.v, y]
            }
        },
        PRICEDISC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseInt(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i, s = moment(r).date(), c = moment(r).month() + 1, u = moment(r).year(), h = moment(a).date(), d = moment(a).month() + 1, f = moment(a).year();
                switch (l) {
                case 0:
                    31 === s && 31 === h ? (s = 30,
                    h = 30) : 31 === s ? s = 30 : 30 === s && 31 === h && (h = 30),
                    i = (h + 30 * d + 360 * f - (s + 30 * c + 360 * u)) / 360;
                    break;
                case 1:
                    var m = 365;
                    if (u === f || u + 1 === f && (c > d || c === d && s >= h))
                        return (u === f && func_methods.isLeapYear(u) || func_methods.feb29Between(r, a) || 1 === d && 29 === h) && (m = 366),
                        i = o - n * o * (i = moment(a).diff(moment(r), "days") / m);
                    var p = f - u + 1
                      , g = (moment().set({
                        year: f + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: u,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , y = g / p;
                    i = moment(a).diff(moment(r), "days") / y;
                    break;
                case 2:
                    i = moment(a).diff(moment(r), "days") / 360;
                    break;
                case 3:
                    i = moment(a).diff(moment(r), "days") / 365;
                    break;
                case 4:
                    i = (h + 30 * d + 360 * f - (s + 30 * c + 360 * u)) / 360
                }
                return i = o - n * o * i
            } catch (e) {
                var v = e;
                return v = luckysheetformula.errorInfo(v),
                [luckysheetformula.error.v, v]
            }
        },
        PRICEMAT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getCellDate(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!moment(n).isValid())
                    return luckysheetformula.error.v;
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseFloat(l);
                var i = 0;
                if (6 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseInt(i)
                }
                if (o < 0 || l < 0)
                    return luckysheetformula.error.nm;
                if (i < 0 || i > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var s = moment(r).date()
                  , c = moment(r).month() + 1
                  , u = moment(r).year()
                  , h = moment(a).date()
                  , d = moment(a).month() + 1
                  , f = moment(a).year()
                  , m = moment(n).date()
                  , p = moment(n).month() + 1
                  , g = moment(n).year();
                switch (i) {
                case 0:
                    31 == s && (s = 30),
                    31 == h && (h = 30),
                    31 == m && (m = 30);
                    var y = 360
                      , v = h + 30 * d + 360 * f - (s + 30 * c + 360 * u)
                      , A = h + 30 * d + 360 * f - (m + 30 * p + 360 * g)
                      , b = s + 30 * c + 360 * u - (m + 30 * p + 360 * g);
                    break;
                case 1:
                    var k = 365;
                    if (u === f || u + 1 === f && (c > d || c === d && s >= h)) {
                        (u === f && func_methods.isLeapYear(u) || func_methods.feb29Between(r, a) || 1 === d && 29 === h) && (k = 366);
                        y = k,
                        v = moment(a).diff(moment(r), "days");
                        return (100 + (A = moment(r).diff(moment(n), "days")) / y * o * 100) / (1 + v / y * l) - (b = moment(a).diff(moment(n), "days")) / y * o * 100
                    }
                    var w = f - u + 1
                      , x = (moment().set({
                        year: f + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: u,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , S = x / w;
                    y = S,
                    v = moment(a).diff(moment(r), "days"),
                    A = moment(r).diff(moment(n), "days"),
                    b = moment(a).diff(moment(n), "days");
                    break;
                case 2:
                    y = 360,
                    v = moment(a).diff(moment(r), "days"),
                    A = moment(r).diff(moment(n), "days"),
                    b = moment(a).diff(moment(n), "days");
                    break;
                case 3:
                    y = 365,
                    v = moment(a).diff(moment(r), "days"),
                    A = moment(r).diff(moment(n), "days"),
                    b = moment(a).diff(moment(n), "days");
                    break;
                case 4:
                    y = 360,
                    v = h + 30 * d + 360 * f - (s + 30 * c + 360 * u),
                    A = h + 30 * d + 360 * f - (m + 30 * p + 360 * g),
                    b = s + 30 * c + 360 * u - (m + 30 * p + 360 * g)
                }
                return (100 + A / y * o * 100) / (1 + v / y * l) - b / y * o * 100
            } catch (e) {
                var _ = e;
                return _ = luckysheetformula.errorInfo(_),
                [luckysheetformula.error.v, _]
            }
        },
        RECEIVED: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i = moment(r).date()
                  , s = moment(r).month() + 1
                  , c = moment(r).year()
                  , u = moment(a).date()
                  , h = moment(a).month() + 1
                  , d = moment(a).year();
                switch (l) {
                case 0:
                    31 == i && (i = 30),
                    31 == u && (u = 30);
                    var f = 360
                      , m = u + 30 * h + 360 * d - (i + 30 * s + 360 * c);
                    break;
                case 1:
                    var p = 365;
                    if (c === d || c + 1 === d && (s > h || s === h && i >= u)) {
                        (c === d && func_methods.isLeapYear(c) || func_methods.feb29Between(r, a) || 1 === h && 29 === u) && (p = 366);
                        f = p;
                        return n / (1 - o * (m = moment(a).diff(moment(r), "days")) / f)
                    }
                    var g = d - c + 1
                      , y = (moment().set({
                        year: d + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: c,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , v = y / g;
                    f = v,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 2:
                    f = 360,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 3:
                    f = 365,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 4:
                    f = 360,
                    m = u + 30 * h + 360 * d - (i + 30 * s + 360 * c)
                }
                return n / (1 - o * m / f)
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        DISC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = 0;
                if (5 == arguments.length) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                if (n <= 0 || o <= 0)
                    return luckysheetformula.error.nm;
                if (l < 0 || l > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var i = moment(r).date()
                  , s = moment(r).month() + 1
                  , c = moment(r).year()
                  , u = moment(a).date()
                  , h = moment(a).month() + 1
                  , d = moment(a).year();
                switch (l) {
                case 0:
                    31 == i && (i = 30),
                    31 == u && (u = 30);
                    var f = 360
                      , m = u + 30 * h + 360 * d - (i + 30 * s + 360 * c);
                    break;
                case 1:
                    var p = 365;
                    if (c === d || c + 1 === d && (s > h || s === h && i >= u))
                        return (c === d && func_methods.isLeapYear(c) || func_methods.feb29Between(r, a) || 1 === h && 29 === u) && (p = 366),
                        (o - n) / o * ((f = p) / (m = moment(a).diff(moment(r), "days")));
                    var g = d - c + 1
                      , y = (moment().set({
                        year: d + 1,
                        month: 0,
                        date: 1
                    }) - moment().set({
                        year: c,
                        month: 0,
                        date: 1
                    })) / 1e3 / 60 / 60 / 24
                      , v = y / g;
                    f = v,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 2:
                    f = 360,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 3:
                    f = 365,
                    m = moment(a).diff(moment(r), "days");
                    break;
                case 4:
                    f = 360,
                    m = u + 30 * h + 360 * d - (i + 30 * s + 360 * c)
                }
                return (o - n) / o * (f / m)
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        NPER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = 0;
                if (arguments.length >= 4) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                var l = 0;
                if (arguments.length >= 5) {
                    if (valueIsError(l = func_methods.getFirstValue(arguments[4])))
                        return l;
                    if (!isRealNum(l))
                        return luckysheetformula.error.v;
                    l = parseFloat(l)
                }
                if (0 != l && 1 != l)
                    return luckysheetformula.error.nm;
                var i = a * (1 + r * l) - o * r
                  , s = n * r + a * (1 + r * l);
                return Math.log(i / s) / Math.log(1 + r)
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        SLN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? 0 == (n = parseFloat(n)) ? luckysheetformula.error.d : (r - a) / n : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DURATION: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = 0;
                if (6 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseInt(i)
                }
                if (n < 0 || o < 0)
                    return luckysheetformula.error.nm;
                if (1 != l && 2 != l && 4 != l)
                    return luckysheetformula.error.nm;
                if (i < 0 || i > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.COUPNUM.f(r, a, l, i)
                  , c = 0
                  , u = 0;
                for (e = 1; e <= s; e++)
                    c += n / l * 100 * e / Math.pow(1 + o / l, e),
                    u += n / l * 100 / Math.pow(1 + o / l, e);
                var h = (c + 100 * s / Math.pow(1 + o / l, s)) / (u + 100 / Math.pow(1 + o / l, s));
                return h /= l
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        MDURATION: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellDate(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!moment(r).isValid())
                    return luckysheetformula.error.v;
                var a = func_methods.getCellDate(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!moment(a).isValid())
                    return luckysheetformula.error.v;
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseFloat(n);
                var o = func_methods.getFirstValue(arguments[3]);
                if (valueIsError(o))
                    return o;
                if (!isRealNum(o))
                    return luckysheetformula.error.v;
                o = parseFloat(o);
                var l = func_methods.getFirstValue(arguments[4]);
                if (valueIsError(l))
                    return l;
                if (!isRealNum(l))
                    return luckysheetformula.error.v;
                l = parseInt(l);
                var i = 0;
                if (6 == arguments.length) {
                    if (valueIsError(i = func_methods.getFirstValue(arguments[5])))
                        return i;
                    if (!isRealNum(i))
                        return luckysheetformula.error.v;
                    i = parseInt(i)
                }
                if (n < 0 || o < 0)
                    return luckysheetformula.error.nm;
                if (1 != l && 2 != l && 4 != l)
                    return luckysheetformula.error.nm;
                if (i < 0 || i > 4)
                    return luckysheetformula.error.nm;
                if (moment(r) - moment(a) >= 0)
                    return luckysheetformula.error.nm;
                var s = window.luckysheet_function.DURATION.f(r, a, n, o, l, i);
                return s / (1 + o / l)
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        BIN2DEC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!/^[01]{1,10}$/g.test(r))
                    return luckysheetformula.error.nm;
                var a = parseInt(r, 2)
                  , n = r.toString();
                return 10 === n.length && "1" === n.substring(0, 1) ? parseInt(n.substring(1), 2) - 512 : a
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        BIN2HEX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[01]{1,10}$/g.test(r))
                    return luckysheetformula.error.nm;
                var n = parseInt(r, 2).toString(16).toUpperCase();
                return null == a ? n : a < 0 || a < n.length ? luckysheetformula.error.nm : new Array(a - n.length + 1).join("0") + n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        BIN2OCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[01]{1,10}$/g.test(r))
                    return luckysheetformula.error.nm;
                var n = r.toString();
                if (10 === n.length && "1" === n.substring(0, 1))
                    return (1073741312 + parseInt(n.substring(1), 2)).toString(8);
                var o = parseInt(r, 2).toString(8);
                return null == a ? o : a < 0 || a < o.length ? luckysheetformula.error.nm : new Array(a - o.length + 1).join("0") + o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        DEC2BIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^-?[0-9]{1,3}$/.test(r) || r < -512 || r > 511)
                    return luckysheetformula.error.nm;
                if (r < 0)
                    return "1" + new Array(9 - (512 + r).toString(2).length).join("0") + (512 + r).toString(2);
                var n = parseInt(r, 10).toString(2);
                return null == a ? n : a < 0 || a < n.length ? luckysheetformula.error.nm : new Array(a - n.length + 1).join("0") + n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DEC2HEX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^-?[0-9]{1,12}$/.test(r) || r < -549755813888 || r > 549755813887)
                    return luckysheetformula.error.nm;
                if (r < 0)
                    return (1099511627776 + r).toString(16).toUpperCase();
                var n = parseInt(r, 10).toString(16).toUpperCase();
                return null == a ? n : a < 0 || a < n.length ? luckysheetformula.error.nm : new Array(a - n.length + 1).join("0") + n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        DEC2OCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^-?[0-9]{1,9}$/.test(r) || r < -536870912 || r > 536870911)
                    return luckysheetformula.error.nm;
                if (r < 0)
                    return (1073741824 + r).toString(8);
                var n = parseInt(r, 10).toString(8);
                return null == a ? n : a < 0 || a < n.length ? luckysheetformula.error.nm : new Array(a - n.length + 1).join("0") + n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        HEX2BIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[0-9A-Fa-f]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var n = 10 === r.length && "f" === r.substring(0, 1).toLowerCase()
                  , o = n ? parseInt(r, 16) - 1099511627776 : parseInt(r, 16);
                if (o < -512 || o > 511)
                    return luckysheetformula.error.nm;
                if (n)
                    return "1" + new Array(9 - (512 + o).toString(2).length).join("0") + (512 + o).toString(2);
                var l = o.toString(2);
                return null == a ? l : a < 0 || a < l.length ? luckysheetformula.error.nm : new Array(a - l.length + 1).join("0") + l
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        HEX2DEC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!/^[0-9A-Fa-f]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var a = parseInt(r, 16);
                return a >= 549755813888 ? a - 1099511627776 : a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        HEX2OCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[0-9A-Fa-f]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var n = parseInt(r, 16);
                if (n > 536870911 && n < 0xffe0000000)
                    return luckysheetformula.error.nm;
                if (n >= 0xffe0000000)
                    return (n - 0xffc0000000).toString(8);
                var o = n.toString(8);
                return null == a ? o : a < 0 || a < o.length ? luckysheetformula.error.nm : new Array(a - o.length + 1).join("0") + o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        OCT2BIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[0-7]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var n = 10 === (r = r.toString()).length && "7" === r.substring(0, 1)
                  , o = n ? parseInt(r, 8) - 1073741824 : parseInt(r, 8);
                if (o < -512 || o > 511)
                    return error.num;
                if (n)
                    return "1" + new Array(9 - (512 + o).toString(2).length).join("0") + (512 + o).toString(2);
                var l = o.toString(2);
                return null == a ? l : a < 0 || a < l.length ? luckysheetformula.error.nm : new Array(a - l.length + 1).join("0") + l
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        OCT2DEC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!/^[0-7]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var a = parseInt(r, 8);
                return a >= 536870912 ? a - 1073741824 : a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        OCT2HEX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = null;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (!/^[0-7]{1,10}$/.test(r))
                    return luckysheetformula.error.nm;
                var n = parseInt(r, 8);
                if (n >= 536870912)
                    return "FF" + (n + 3221225472).toString(16).toUpperCase();
                var o = n.toString(16).toUpperCase();
                return null == a ? o : a < 0 || a < o.length ? luckysheetformula.error.nm : new Array(a - o.length + 1).join("0") + o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        COMPLEX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseFloat(a);
                var n = "i";
                if (3 == arguments.length && (n = arguments[2].toString()),
                "i" != n && "j" != n)
                    return luckysheetformula.error.v;
                if (0 === r && 0 === a)
                    return 0;
                if (0 === r)
                    return 1 === a ? n : a.toString() + n;
                if (0 === a)
                    return r.toString();
                var o = a > 0 ? "+" : "";
                return r.toString() + o + (1 === a ? n : a.toString() + n)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        IMREAL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if ("true" == (r = r.toString()).toLowerCase() || "false" == r.toLowerCase())
                    return luckysheetformula.error.v;
                if ("0" == r)
                    return 0;
                if (["i", "+i", "1i", "+1i", "-i", "-1i", "j", "+j", "1j", "+1j", "-j", "-1j"].indexOf(r) >= 0)
                    return 0;
                var a = r.indexOf("+")
                  , n = r.indexOf("-");
                0 === a && (a = r.indexOf("+", 1)),
                0 === n && (n = r.indexOf("-", 1));
                var o = r.substring(r.length - 1, r.length)
                  , l = "i" === o || "j" === o;
                return a >= 0 || n >= 0 ? l ? a >= 0 ? isNaN(r.substring(0, a)) || isNaN(r.substring(a + 1, r.length - 1)) ? luckysheetformula.error.nm : Number(r.substring(0, a)) : isNaN(r.substring(0, n)) || isNaN(r.substring(n + 1, r.length - 1)) ? luckysheetformula.error.nm : Number(r.substring(0, n)) : luckysheetformula.error.nm : l ? isNaN(r.substring(0, r.length - 1)) ? luckysheetformula.error.nm : 0 : isNaN(r) ? luckysheetformula.error.nm : r
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        IMAGINARY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if ("true" == (r = r.toString()).toLowerCase() || "false" == r.toLowerCase())
                    return luckysheetformula.error.v;
                if ("0" == r)
                    return 0;
                if (["i", "j"].indexOf(r) >= 0)
                    return 1;
                var a = (r = r.replace("+i", "+1i").replace("-i", "-1i").replace("+j", "+1j").replace("-j", "-1j")).indexOf("+")
                  , n = r.indexOf("-");
                0 === a && (a = r.indexOf("+", 1)),
                0 === n && (n = r.indexOf("-", 1));
                var o = r.substring(r.length - 1, r.length)
                  , l = "i" === o || "j" === o;
                return a >= 0 || n >= 0 ? l ? a >= 0 ? isNaN(r.substring(0, a)) || isNaN(r.substring(a + 1, r.length - 1)) ? luckysheetformula.error.nm : Number(r.substring(a + 1, r.length - 1)) : isNaN(r.substring(0, n)) || isNaN(r.substring(n + 1, r.length - 1)) ? luckysheetformula.error.nm : -Number(r.substring(n + 1, r.length - 1)) : luckysheetformula.error.nm : l ? isNaN(r.substring(0, r.length - 1)) ? luckysheetformula.error.nm : r.substring(0, r.length - 1) : isNaN(r) ? luckysheetformula.error.nm : 0
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        IMCONJUGATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = window.luckysheet_function.IMREAL.f(r);
                if (valueIsError(a))
                    return a;
                var n = window.luckysheet_function.IMAGINARY.f(r);
                if (valueIsError(n))
                    return n;
                var o = r.substring(r.length - 1);
                return o = "i" === o || "j" === o ? o : "i",
                0 !== n ? window.luckysheet_function.COMPLEX.f(a, -n, o) : r
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        IMABS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheet_function.IMREAL.f(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = window.luckysheet_function.IMAGINARY.f(arguments[0]);
                return valueIsError(a) ? a : Math.sqrt(Math.pow(r, 2) + Math.pow(a, 2))
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DELTA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = 0;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseFloat(a)
                }
                return r === a ? 1 : 0
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        IMSUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheet_function.IMREAL.f(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = window.luckysheet_function.IMAGINARY.f(arguments[0]);
                if (valueIsError(a))
                    return a;
                var n = arguments[0];
                for (e = 1; e < arguments.length; e++) {
                    var o = window.luckysheet_function.IMREAL.f(n);
                    if (valueIsError(o))
                        return o;
                    var l = window.luckysheet_function.IMAGINARY.f(n);
                    if (valueIsError(l))
                        return l;
                    var i = window.luckysheet_function.IMREAL.f(arguments[e]);
                    if (valueIsError(i))
                        return i;
                    var s = window.luckysheet_function.IMAGINARY.f(arguments[e]);
                    if (valueIsError(s))
                        return s;
                    n = window.luckysheet_function.COMPLEX.f(o + i, l + s)
                }
                return n
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        IMSUB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if ("true" == (r = r.toString()).toLowerCase() || "false" == r.toLowerCase())
                    return luckysheetformula.error.v;
                var a = window.luckysheet_function.IMREAL.f(r);
                if (valueIsError(a))
                    return a;
                var n = window.luckysheet_function.IMAGINARY.f(r);
                if (valueIsError(n))
                    return n;
                var o = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(o))
                    return o;
                if ("true" == (o = o.toString()).toLowerCase() || "false" == o.toLowerCase())
                    return luckysheetformula.error.v;
                var l = window.luckysheet_function.IMREAL.f(o);
                if (valueIsError(l))
                    return l;
                var i = window.luckysheet_function.IMAGINARY.f(o);
                if (valueIsError(i))
                    return i;
                var s = r.substring(r.length - 1)
                  , c = o.substring(o.length - 1)
                  , u = "i";
                return ("j" === s || "j" === c) && (u = "j"),
                window.luckysheet_function.COMPLEX.f(a - l, n - i, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        IMPRODUCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheet_function.IMREAL.f(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = window.luckysheet_function.IMAGINARY.f(arguments[0]);
                if (valueIsError(a))
                    return a;
                var n = arguments[0];
                for (e = 1; e < arguments.length; e++) {
                    var o = window.luckysheet_function.IMREAL.f(n);
                    if (valueIsError(o))
                        return o;
                    var l = window.luckysheet_function.IMAGINARY.f(n);
                    if (valueIsError(l))
                        return l;
                    var i = window.luckysheet_function.IMREAL.f(arguments[e]);
                    if (valueIsError(i))
                        return i;
                    var s = window.luckysheet_function.IMAGINARY.f(arguments[e]);
                    if (valueIsError(s))
                        return s;
                    n = window.luckysheet_function.COMPLEX.f(o * i - l * s, o * s + l * i)
                }
                return n
            } catch (e) {
                var c = e;
                return c = luckysheetformula.errorInfo(c),
                [luckysheetformula.error.v, c]
            }
        },
        IMDIV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if ("true" == (r = r.toString()).toLowerCase() || "false" == r.toLowerCase())
                    return luckysheetformula.error.v;
                var a = window.luckysheet_function.IMREAL.f(r);
                if (valueIsError(a))
                    return a;
                var n = window.luckysheet_function.IMAGINARY.f(r);
                if (valueIsError(n))
                    return n;
                var o = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(o))
                    return o;
                if ("true" == (o = o.toString()).toLowerCase() || "false" == o.toLowerCase())
                    return luckysheetformula.error.v;
                var l = window.luckysheet_function.IMREAL.f(o);
                if (valueIsError(l))
                    return l;
                var i = window.luckysheet_function.IMAGINARY.f(o);
                if (valueIsError(i))
                    return i;
                var s = r.substring(r.length - 1)
                  , c = o.substring(o.length - 1)
                  , u = "i";
                if (("j" === s || "j" === c) && (u = "j"),
                0 === l && 0 === i)
                    return luckysheetformula.error.nm;
                var h = l * l + i * i;
                return window.luckysheet_function.COMPLEX.f((a * l + n * i) / h, (n * l - a * i) / h, u)
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        NOT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellBoolen(arguments[0]);
                return valueIsError(r) ? r : !r
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TRUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return !0
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        FALSE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return !1
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        AND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = !0;
                for (e = 0; e < arguments.length; e++) {
                    var a = func_methods.getCellBoolen(arguments[e]);
                    if (valueIsError(a))
                        return a;
                    if (!a) {
                        r = !1;
                        break
                    }
                }
                return r
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        IFERROR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[1], "text")
                  , a = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(a) ? r : a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        IF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getCellBoolen(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a) && n != error.d)
                    return a;
                var n = "";
                return 3 == arguments.length && valueIsError(n = func_methods.getFirstValue(arguments[2], "text")) && n != error.d ? n : r ? a : n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        OR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = !1;
                for (e = 0; e < arguments.length; e++) {
                    var a = func_methods.getCellBoolen(arguments[e]);
                    if (valueIsError(a))
                        return a;
                    if (a) {
                        r = !0;
                        break
                    }
                }
                return r
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        NE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : r != a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        EQ: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : r == a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        GT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r > (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        GTE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r >= (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        LT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r < (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        LTE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r <= (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ADD: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r + (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        MINUS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r - (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        MULTIPLY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? r * (a = parseFloat(a)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        DIVIDE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? 0 == (a = parseFloat(a)) ? luckysheetformula.error.d : r / a : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        CONCAT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1], "text");
                return valueIsError(a) ? a : r + "" + a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        UNARY_PERCENT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                var a = (r = parseFloat(r)) / 100;
                return Math.round(100 * a) / 100
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        CONCATENATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = "";
                for (e = 0; e < arguments.length; e++) {
                    var a = func_methods.getFirstValue(arguments[e], "text");
                    if (valueIsError(a))
                        return a;
                    r = r + "" + a
                }
                return r
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        CODE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : "" == r ? luckysheetformula.error.v : r.charCodeAt(0)
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        CHAR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? (r = parseInt(r)) < 1 || r > 255 ? luckysheetformula.error.v : String.fromCharCode(r) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ARABIC: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                if (r = r.toString().toUpperCase(),
                !/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(r))
                    return luckysheetformula.error.v;
                var a = 0;
                return r.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (function(e) {
                    a += {
                        M: 1e3,
                        CM: 900,
                        D: 500,
                        CD: 400,
                        C: 100,
                        XC: 90,
                        L: 50,
                        XL: 40,
                        X: 10,
                        IX: 9,
                        V: 5,
                        IV: 4,
                        I: 1
                    }[e]
                }
                )),
                a
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ROMAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                if (0 == (r = parseInt(r)))
                    return "";
                if (r < 1 || r > 3999)
                    return luckysheetformula.error.v;
                function a(e) {
                    var t = [["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"], ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"], ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"], ["", "M", "MM", "MMM"]];
                    return t[3][Math.floor(e / 1e3)] + t[2][Math.floor(e % 1e3 / 100)] + t[1][Math.floor(e % 100 / 10)] + t[0][e % 10]
                }
                return a(r)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        REGEXEXTRACT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                var n = r.match(new RegExp(a));
                return n ? n[n.length > 1 ? n.length - 1 : 0] : null
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        REGEXMATCH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                var n = r.match(new RegExp(a));
                return !!n
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        REGEXREPLACE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                var n = func_methods.getFirstValue(arguments[2], "text");
                return valueIsError(n) ? n : r.replace(new RegExp(a), n)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        T: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) || "string" == getObjType(r) ? r : ""
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        FIXED: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = 2;
                if (arguments.length >= 2) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                var n = !1;
                if (3 == arguments.length && valueIsError(n = func_methods.getCellBoolen(arguments[2])))
                    return n;
                if (a > 127)
                    return luckysheetformula.error.v;
                var o = n ? "0" : "#,##0";
                return a <= 0 ? r = Math.round(r * Math.pow(10, a)) / Math.pow(10, a) : a > 0 && (o += "." + new Array(a + 1).join("0")),
                update(o, r)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        FIND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                a = a.toString();
                var n = 1;
                if (3 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseFloat(n)
                }
                if (n < 0 || n > a.length)
                    return luckysheetformula.error.v;
                if ("" == r)
                    return n;
                if (-1 == a.indexOf(r))
                    return luckysheetformula.error.v;
                var o = a.indexOf(r, n - 1) + 1;
                return o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        FINDB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                a = a.toString();
                var n = 1;
                if (3 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseFloat(n)
                }
                if (n < 0 || n > a.length)
                    return luckysheetformula.error.v;
                if ("" == r)
                    return n;
                if (-1 == a.indexOf(r))
                    return luckysheetformula.error.v;
                var o = a.split("")
                  , l = a.indexOf(r, n - 1)
                  , i = 0;
                for (e = 0; e < l; e++)
                    /[^\x00-\xff]/g.test(o[e]) ? i += 2 : i += 1;
                return i
            } catch (e) {
                var s = e;
                return s = luckysheetformula.errorInfo(s),
                [luckysheetformula.error.v, s]
            }
        },
        JOIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                var a = [];
                for (e = 1; e < arguments.length; e++) {
                    var n = arguments[e];
                    if ("array" == getObjType(n)) {
                        if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                            return luckysheetformula.error.v;
                        a = a.concat(func_methods.getDataArr(n, !1))
                    } else
                        "object" == getObjType(n) && null != n.startCell ? a = a.concat(func_methods.getCellDataArr(n, "text", !1)) : a.push(n)
                }
                return a.join(r)
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        LEFT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = 1;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                return a < 0 ? luckysheetformula.error.v : a >= r.length ? r : 0 == a ? "" : r.substr(0, a)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        RIGHT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = 1;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                return a < 0 ? luckysheetformula.error.v : a >= r.length ? r : 0 == a ? "" : r.substr(-a, a)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        MID: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                return valueIsError(n) ? n : isRealNum(n) ? (n = parseInt(n),
                a < 1 || n < 0 ? luckysheetformula.error.v : a > r.length ? "" : a + n > r.length ? r.substr(a - 1, r.length - a + 1) : r.substr(a - 1, n)) : luckysheetformula.error.v
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        LEN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString()).length
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        LENB: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString()).replace(/[^\x00-\xff]/g, "aa").length
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        LOWER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString()) ? r.toLowerCase() : r
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        UPPER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString()) ? r.toUpperCase() : r
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        EXACT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1], "text");
                return valueIsError(a) ? a : r === (a = a.toString())
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        REPLACE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1]);
                if (valueIsError(a))
                    return a;
                if (!isRealNum(a))
                    return luckysheetformula.error.v;
                a = parseInt(a);
                var n = func_methods.getFirstValue(arguments[2]);
                if (valueIsError(n))
                    return n;
                if (!isRealNum(n))
                    return luckysheetformula.error.v;
                n = parseInt(n);
                var o = func_methods.getFirstValue(arguments[3], "text");
                return valueIsError(o) ? o : (o = o.toString(),
                r.substr(0, a - 1) + o + r.substr(a - 1 + n))
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        REPT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1]);
                return valueIsError(a) ? a : isRealNum(a) ? (a = parseInt(a)) < 0 ? luckysheetformula.error.v : (a > 100 && (a = 100),
                new Array(a + 1).join(r)) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        SEARCH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                a = a.toString();
                var n = 1;
                if (3 == arguments.length) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseInt(n)
                }
                if (n <= 0 || n > a.length)
                    return luckysheetformula.error.v;
                var o = a.toLowerCase().indexOf(r.toLowerCase(), n - 1) + 1;
                return 0 === o ? luckysheetformula.error.v : o
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        SUBSTITUTE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                a = a.toString();
                var n = func_methods.getFirstValue(arguments[2], "text");
                if (valueIsError(n))
                    return n;
                n = n.toString();
                var o = null;
                if (4 == arguments.length) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseInt(o)
                }
                var l, i = new RegExp(a,"g");
                if (null == o)
                    l = r.replace(i, n);
                else {
                    if (o <= 0)
                        return luckysheetformula.error.v;
                    var s = r.match(i);
                    if (null == s || o > s.length)
                        return r;
                    var c = a.length
                      , u = 0;
                    for (e = 1; e <= o; e++)
                        u = r.indexOf(a, u) + 1;
                    l = r.substring(0, u - 1) + n + r.substring(u - 1 + c)
                }
                return l
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        CLEAN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                if (valueIsError(r))
                    return r;
                r = r.toString();
                var a = [];
                for (e = 0; e < r.length; e++) {
                    var n = r.charCodeAt(e);
                    (/[\u4e00-\u9fa5]/g.test(r.charAt(e)) || n > 31 && n < 127) && a.push(r.charAt(e))
                }
                return a.join("")
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        TEXT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1], "text");
                return valueIsError(a) ? a : update(a = a.toString(), r)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        TRIM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString()).replace(/ +/g, " ").trim()
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        VALUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : genarate(r = r.toString())[2]
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        PROPER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : (r = r.toString().toLowerCase()).replace(/[a-zA-Z]+/g, (function(e) {
                    return e.substring(0, 1).toUpperCase() + e.substring(1)
                }
                ))
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        CONVERT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseFloat(r);
                var a = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(a))
                    return a;
                a = a.toString();
                var n = func_methods.getFirstValue(arguments[2], "text");
                if (valueIsError(n))
                    return n;
                n = n.toString();
                var o, l = [["a.u. of action", "?", null, "action", !1, !1, 105457168181818e-48], ["a.u. of charge", "e", null, "electric_charge", !1, !1, 160217653141414e-33], ["a.u. of energy", "Eh", null, "energy", !1, !1, 435974417757576e-32], ["a.u. of length", "a?", null, "length", !1, !1, 529177210818182e-25], ["a.u. of mass", "m?", null, "mass", !1, !1, 910938261616162e-45], ["a.u. of time", "?/Eh", null, "time", !1, !1, 241888432650516e-31], ["admiralty knot", "admkn", null, "speed", !1, !0, .514773333], ["ampere", "A", null, "electric_current", !0, !1, 1], ["ampere per meter", "A/m", null, "magnetic_field_intensity", !0, !1, 1], ["ångström", "Å", ["ang"], "length", !1, !0, 1e-10], ["are", "ar", null, "area", !1, !0, 100], ["astronomical unit", "ua", null, "length", !1, !1, 149597870691667e-25], ["bar", "bar", null, "pressure", !1, !1, 1e5], ["barn", "b", null, "area", !1, !1, 1e-28], ["becquerel", "Bq", null, "radioactivity", !0, !1, 1], ["bit", "bit", ["b"], "information", !1, !0, 1], ["btu", "BTU", ["btu"], "energy", !1, !0, 1055.05585262], ["byte", "byte", null, "information", !1, !0, 8], ["candela", "cd", null, "luminous_intensity", !0, !1, 1], ["candela per square metre", "cd/m?", null, "luminance", !0, !1, 1], ["coulomb", "C", null, "electric_charge", !0, !1, 1], ["cubic ångström", "ang3", ["ang^3"], "volume", !1, !0, 1e-30], ["cubic foot", "ft3", ["ft^3"], "volume", !1, !0, .028316846592], ["cubic inch", "in3", ["in^3"], "volume", !1, !0, 16387064e-12], ["cubic light-year", "ly3", ["ly^3"], "volume", !1, !0, 846786664623715e-61], ["cubic metre", "m?", null, "volume", !0, !0, 1], ["cubic mile", "mi3", ["mi^3"], "volume", !1, !0, 4168181825.44058], ["cubic nautical mile", "Nmi3", ["Nmi^3"], "volume", !1, !0, 6352182208], ["cubic Pica", "Pica3", ["Picapt3", "Pica^3", "Picapt^3"], "volume", !1, !0, 7.58660370370369e-8], ["cubic yard", "yd3", ["yd^3"], "volume", !1, !0, .764554857984], ["cup", "cup", null, "volume", !1, !0, .0002365882365], ["dalton", "Da", ["u"], "mass", !1, !1, 166053886282828e-41], ["day", "d", ["day"], "time", !1, !0, 86400], ["degree", "°", null, "angle", !1, !1, .0174532925199433], ["degrees Rankine", "Rank", null, "temperature", !1, !0, .555555555555556], ["dyne", "dyn", ["dy"], "force", !1, !0, 1e-5], ["electronvolt", "eV", ["ev"], "energy", !1, !0, 1.60217656514141], ["ell", "ell", null, "length", !1, !0, 1.143], ["erg", "erg", ["e"], "energy", !1, !0, 1e-7], ["farad", "F", null, "electric_capacitance", !0, !1, 1], ["fluid ounce", "oz", null, "volume", !1, !0, 295735295625e-16], ["foot", "ft", null, "length", !1, !0, .3048], ["foot-pound", "flb", null, "energy", !1, !0, 1.3558179483314], ["gal", "Gal", null, "acceleration", !1, !1, .01], ["gallon", "gal", null, "volume", !1, !0, .003785411784], ["gauss", "G", ["ga"], "magnetic_flux_density", !1, !0, 1], ["grain", "grain", null, "mass", !1, !0, 647989e-10], ["gram", "g", null, "mass", !1, !0, .001], ["gray", "Gy", null, "absorbed_dose", !0, !1, 1], ["gross registered ton", "GRT", ["regton"], "volume", !1, !0, 2.8316846592], ["hectare", "ha", null, "area", !1, !0, 1e4], ["henry", "H", null, "inductance", !0, !1, 1], ["hertz", "Hz", null, "frequency", !0, !1, 1], ["horsepower", "HP", ["h"], "power", !1, !0, 745.69987158227], ["horsepower-hour", "HPh", ["hh", "hph"], "energy", !1, !0, 2684519.538], ["hour", "h", ["hr"], "time", !1, !0, 3600], ["imperial gallon (U.K.)", "uk_gal", null, "volume", !1, !0, .00454609], ["imperial hundredweight", "lcwt", ["uk_cwt", "hweight"], "mass", !1, !0, 50.802345], ["imperial quart (U.K)", "uk_qt", null, "volume", !1, !0, .0011365225], ["imperial ton", "brton", ["uk_ton", "LTON"], "mass", !1, !0, 1016.046909], ["inch", "in", null, "length", !1, !0, .0254], ["international acre", "uk_acre", null, "area", !1, !0, 4046.8564224], ["IT calorie", "cal", null, "energy", !1, !0, 4.1868], ["joule", "J", null, "energy", !0, !0, 1], ["katal", "kat", null, "catalytic_activity", !0, !1, 1], ["kelvin", "K", ["kel"], "temperature", !0, !0, 1], ["kilogram", "kg", null, "mass", !0, !0, 1], ["knot", "kn", null, "speed", !1, !0, .514444444444444], ["light-year", "ly", null, "length", !1, !0, 9460730472580800], ["litre", "L", ["l", "lt"], "volume", !1, !0, .001], ["lumen", "lm", null, "luminous_flux", !0, !1, 1], ["lux", "lx", null, "illuminance", !0, !1, 1], ["maxwell", "Mx", null, "magnetic_flux", !1, !1, 1e-18], ["measurement ton", "MTON", null, "volume", !1, !0, 1.13267386368], ["meter per hour", "m/h", ["m/hr"], "speed", !1, !0, .00027777777777778], ["meter per second", "m/s", ["m/sec"], "speed", !0, !0, 1], ["meter per second squared", "m?s??", null, "acceleration", !0, !1, 1], ["parsec", "pc", ["parsec"], "length", !1, !0, 0x6da012f958ee1c], ["meter squared per second", "m?/s", null, "kinematic_viscosity", !0, !1, 1], ["metre", "m", null, "length", !0, !0, 1], ["miles per hour", "mph", null, "speed", !1, !0, .44704], ["millimetre of mercury", "mmHg", null, "pressure", !1, !1, 133.322], ["minute", "?", null, "angle", !1, !1, .000290888208665722], ["minute", "min", ["mn"], "time", !1, !0, 60], ["modern teaspoon", "tspm", null, "volume", !1, !0, 5e-6], ["mole", "mol", null, "amount_of_substance", !0, !1, 1], ["morgen", "Morgen", null, "area", !1, !0, 2500], ["n.u. of action", "?", null, "action", !1, !1, 105457168181818e-48], ["n.u. of mass", "m?", null, "mass", !1, !1, 910938261616162e-45], ["n.u. of speed", "c?", null, "speed", !1, !1, 299792458], ["n.u. of time", "?/(me?c??)", null, "time", !1, !1, 128808866778687e-35], ["nautical mile", "M", ["Nmi"], "length", !1, !0, 1852], ["newton", "N", null, "force", !0, !0, 1], ["œrsted", "Oe ", null, "magnetic_field_intensity", !1, !1, 79.5774715459477], ["ohm", "Ω", null, "electric_resistance", !0, !1, 1], ["ounce mass", "ozm", null, "mass", !1, !0, .028349523125], ["pascal", "Pa", null, "pressure", !0, !1, 1], ["pascal second", "Pa?s", null, "dynamic_viscosity", !0, !1, 1], ["pferdestärke", "PS", null, "power", !1, !0, 735.49875], ["phot", "ph", null, "illuminance", !1, !1, 1e-4], ["pica (1/6 inch)", "pica", null, "length", !1, !0, .00035277777777778], ["pica (1/72 inch)", "Pica", ["Picapt"], "length", !1, !0, .00423333333333333], ["poise", "P", null, "dynamic_viscosity", !1, !1, .1], ["pond", "pond", null, "force", !1, !0, .00980665], ["pound force", "lbf", null, "force", !1, !0, 4.4482216152605], ["pound mass", "lbm", null, "mass", !1, !0, .45359237], ["quart", "qt", null, "volume", !1, !0, .000946352946], ["radian", "rad", null, "angle", !0, !1, 1], ["second", "?", null, "angle", !1, !1, 484813681109536e-20], ["second", "s", ["sec"], "time", !0, !0, 1], ["short hundredweight", "cwt", ["shweight"], "mass", !1, !0, 45.359237], ["siemens", "S", null, "electrical_conductance", !0, !1, 1], ["sievert", "Sv", null, "equivalent_dose", !0, !1, 1], ["slug", "sg", null, "mass", !1, !0, 14.59390294], ["square ångström", "ang2", ["ang^2"], "area", !1, !0, 1e-20], ["square foot", "ft2", ["ft^2"], "area", !1, !0, .09290304], ["square inch", "in2", ["in^2"], "area", !1, !0, 64516e-8], ["square light-year", "ly2", ["ly^2"], "area", !1, !0, 895054210748189e17], ["square meter", "m?", null, "area", !0, !0, 1], ["square mile", "mi2", ["mi^2"], "area", !1, !0, 2589988.110336], ["square nautical mile", "Nmi2", ["Nmi^2"], "area", !1, !0, 3429904], ["square Pica", "Pica2", ["Picapt2", "Pica^2", "Picapt^2"], "area", !1, !0, 1792111111111e-17], ["square yard", "yd2", ["yd^2"], "area", !1, !0, .83612736], ["statute mile", "mi", null, "length", !1, !0, 1609.344], ["steradian", "sr", null, "solid_angle", !0, !1, 1], ["stilb", "sb", null, "luminance", !1, !1, 1e-4], ["stokes", "St", null, "kinematic_viscosity", !1, !1, 1e-4], ["stone", "stone", null, "mass", !1, !0, 6.35029318], ["tablespoon", "tbs", null, "volume", !1, !0, 147868e-10], ["teaspoon", "tsp", null, "volume", !1, !0, 492892e-11], ["tesla", "T", null, "magnetic_flux_density", !0, !0, 1], ["thermodynamic calorie", "c", null, "energy", !1, !0, 4.184], ["ton", "ton", null, "mass", !1, !0, 907.18474], ["tonne", "t", null, "mass", !1, !1, 1e3], ["U.K. pint", "uk_pt", null, "volume", !1, !0, .00056826125], ["U.S. bushel", "bushel", null, "volume", !1, !0, .03523907], ["U.S. oil barrel", "barrel", null, "volume", !1, !0, .158987295], ["U.S. pint", "pt", ["us_pt"], "volume", !1, !0, .000473176473], ["U.S. survey mile", "survey_mi", null, "length", !1, !0, 1609.347219], ["U.S. survey/statute acre", "us_acre", null, "area", !1, !0, 4046.87261], ["volt", "V", null, "voltage", !0, !1, 1], ["watt", "W", null, "power", !0, !0, 1], ["watt-hour", "Wh", ["wh"], "energy", !1, !0, 3600], ["weber", "Wb", null, "magnetic_flux", !0, !1, 1], ["yard", "yd", null, "length", !1, !0, .9144], ["year", "yr", null, "time", !1, !0, 31557600]], i = {
                    Yi: ["yobi", 80, 12089258196146292e8, "Yi", "yotta"],
                    Zi: ["zebi", 70, 11805916207174113e5, "Zi", "zetta"],
                    Ei: ["exbi", 60, 0x1000000000000000, "Ei", "exa"],
                    Pi: ["pebi", 50, 0x4000000000000, "Pi", "peta"],
                    Ti: ["tebi", 40, 1099511627776, "Ti", "tera"],
                    Gi: ["gibi", 30, 1073741824, "Gi", "giga"],
                    Mi: ["mebi", 20, 1048576, "Mi", "mega"],
                    ki: ["kibi", 10, 1024, "ki", "kilo"]
                }, s = {
                    Y: ["yotta", 1e24, "Y"],
                    Z: ["zetta", 1e21, "Z"],
                    E: ["exa", 1e18, "E"],
                    P: ["peta", 1e15, "P"],
                    T: ["tera", 1e12, "T"],
                    G: ["giga", 1e9, "G"],
                    M: ["mega", 1e6, "M"],
                    k: ["kilo", 1e3, "k"],
                    h: ["hecto", 100, "h"],
                    e: ["dekao", 10, "e"],
                    d: ["deci", .1, "d"],
                    c: ["centi", .01, "c"],
                    m: ["milli", .001, "m"],
                    u: ["micro", 1e-6, "u"],
                    n: ["nano", 1e-9, "n"],
                    p: ["pico", 1e-12, "p"],
                    f: ["femto", 1e-15, "f"],
                    a: ["atto", 1e-18, "a"],
                    z: ["zepto", 1e-21, "z"],
                    y: ["yocto", 1e-24, "y"]
                }, c = null, u = null, h = a, d = n, f = 1, m = 1;
                for (e = 0; e < l.length; e++)
                    o = null === l[e][2] ? [] : l[e][2],
                    (l[e][1] === h || o.indexOf(h) >= 0) && (c = l[e]),
                    (l[e][1] === d || o.indexOf(d) >= 0) && (u = l[e]);
                if (null === c) {
                    var p = i[a.substring(0, 2)]
                      , g = s[a.substring(0, 1)];
                    "da" === a.substring(0, 2) && (g = ["dekao", 10, "da"]),
                    p ? (f = p[2],
                    h = a.substring(2)) : g && (f = g[1],
                    h = a.substring(g[2].length));
                    for (var y = 0; y < l.length; y++)
                        o = null === l[y][2] ? [] : l[y][2],
                        (l[y][1] === h || o.indexOf(h) >= 0) && (c = l[y])
                }
                if (null === u) {
                    var v = i[n.substring(0, 2)]
                      , A = s[n.substring(0, 1)];
                    "da" === n.substring(0, 2) && (A = ["dekao", 10, "da"]),
                    v ? (m = v[2],
                    d = n.substring(2)) : A && (m = A[1],
                    d = n.substring(A[2].length));
                    for (var b = 0; b < l.length; b++)
                        o = null === l[b][2] ? [] : l[b][2],
                        (l[b][1] === d || o.indexOf(d) >= 0) && (u = l[b])
                }
                return null === c || null === u || c[3] !== u[3] ? luckysheetformula.error.na : r * c[6] * f / (u[6] * m)
            } catch (e) {
                var k = e;
                return k = luckysheetformula.errorInfo(k),
                [luckysheetformula.error.v, k]
            }
        },
        SUMX2MY2: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                var u = 0;
                for (e = 0; e < l.length; e++)
                    u += Math.pow(l[e], 2) - Math.pow(i[e], 2);
                return u
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        SUMX2PY2: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                var u = 0;
                for (e = 0; e < l.length; e++)
                    u += Math.pow(l[e], 2) + Math.pow(i[e], 2);
                return u
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        SUMXMY2: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !1))
                } else
                    "object" == getObjType(r) && null != r.startCell ? a = a.concat(func_methods.getCellDataArr(r, "text", !1)) : a.push(r);
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = o.concat(func_methods.getDataArr(n, !1))
                } else
                    "object" == getObjType(n) && null != n.startCell ? o = o.concat(func_methods.getCellDataArr(n, "text", !1)) : o.push(n);
                if (a.length != o.length)
                    return luckysheetformula.error.na;
                var l = []
                  , i = [];
                for (e = 0; e < a.length; e++) {
                    var s = a[e]
                      , c = o[e];
                    isRealNum(s) && isRealNum(c) && (l.push(parseFloat(s)),
                    i.push(parseFloat(c)))
                }
                var u = 0;
                for (e = 0; e < l.length; e++)
                    u += Math.pow(l[e] - i[e], 2);
                return u
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        TRANSPOSE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else
                    "object" == getObjType(r) && null != r.startCell && (a = func_methods.getCellDataDyadicArr(r, "number"));
                return a = a[0].map((function(e, t) {
                    return a.map((function(e) {
                        return e[t]
                    }
                    ))
                }
                ))
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        TREND: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "text");
                else {
                    if (!isRealNum(r))
                        return luckysheetformula.error.v;
                    (m = []).push(parseFloat(r)),
                    a.push(m)
                }
                var n = a.length
                  , o = a[0].length;
                for (e = 0; e < n; e++)
                    for (var l = 0; l < o; l++) {
                        if (!isRealNum(a[e][l]))
                            return luckysheetformula.error.v;
                        a[e][l] = parseFloat(a[e][l])
                    }
                var i = [];
                for (e = 1; e <= n; e++)
                    for (l = 1; l <= o; l++) {
                        var s = (e - 1) * o + l;
                        i.push(s)
                    }
                if (arguments.length >= 2) {
                    var c = arguments[1];
                    if (i = [],
                    "array" == getObjType(c)) {
                        if ("array" == getObjType(c[0]) && !func_methods.isDyadicArr(c))
                            return luckysheetformula.error.v;
                        i = func_methods.getDataDyadicArr(c)
                    } else if ("object" == getObjType(c) && null != c.startCell)
                        i = func_methods.getCellDataDyadicArr(c, "text");
                    else {
                        if (!isRealNum(c))
                            return luckysheetformula.error.v;
                        (m = []).push(parseFloat(c)),
                        i.push(m)
                    }
                    for (e = 0; e < i.length; e++)
                        for (l = 0; l < i[0].length; l++) {
                            if (!isRealNum(i[e][l]))
                                return luckysheetformula.error.v;
                            i[e][l] = parseFloat(i[e][l])
                        }
                }
                var u = i.length
                  , h = i[0].length
                  , d = i;
                if (arguments.length >= 3) {
                    var f = arguments[2];
                    if (d = [],
                    "array" == getObjType(f)) {
                        if ("array" == getObjType(f[0]) && !func_methods.isDyadicArr(f))
                            return luckysheetformula.error.v;
                        d = func_methods.getDataDyadicArr(f)
                    } else if ("object" == getObjType(f) && null != f.startCell)
                        d = func_methods.getCellDataDyadicArr(f, "text");
                    else {
                        if (!isRealNum(f))
                            return luckysheetformula.error.v;
                        var m;
                        (m = []).push(parseFloat(f)),
                        d.push(m)
                    }
                    for (e = 0; e < d.length; e++)
                        for (l = 0; l < d[0].length; l++) {
                            if (!isRealNum(d[e][l]))
                                return luckysheetformula.error.v;
                            d[e][l] = parseFloat(d[e][l])
                        }
                }
                var p = !0;
                if (4 == arguments.length && valueIsError(p = func_methods.getCellBoolen(arguments[3])))
                    return p;
                if (n != u || o != h)
                    return luckysheetformula.error.r;
                function g(e, t) {
                    for (var r = 0, a = 0, n = 0, o = 0, l = 0; l < e.length; l++)
                        for (var i = 0; i < e[l].length; i++)
                            r += e[l][i],
                            a += t[l][i],
                            n += e[l][i] * t[l][i],
                            o += e[l][i] * e[l][i];
                    var s = e.length * e[0].length
                      , c = r / s
                      , u = a / s
                      , h = (n / s - c * u) / (o / s - c * c);
                    return [h, u - h * c]
                }
                var y = g(i, a)
                  , v = y[0];
                if (p)
                    var A = y[1];
                else
                    A = 0;
                var b = [];
                for (e = 0; e < d.length; e++)
                    for (l = 0; l < d[e].length; l++) {
                        var k = d[e][l]
                          , w = v * k + A;
                        b.push(Math.round(1e9 * w) / 1e9)
                    }
                return b
            } catch (e) {
                var x = e;
                return x = luckysheetformula.errorInfo(x),
                [luckysheetformula.error.v, x]
            }
        },
        FREQUENCY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = a.concat(func_methods.getDataArr(r, !0))
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = a.concat(func_methods.getCellDataArr(r, "number", !0));
                else {
                    if (!isRealNum(r))
                        return luckysheetformula.error.v;
                    a.push(r)
                }
                var n = [];
                for (e = 0; e < a.length; e++)
                    isRealNum(a[e]) && n.push(parseFloat(a[e]));
                var o = arguments[1]
                  , l = [];
                if ("array" == getObjType(o)) {
                    if ("array" == getObjType(o[0]) && !func_methods.isDyadicArr(o))
                        return luckysheetformula.error.v;
                    l = l.concat(func_methods.getDataArr(o, !0))
                } else if ("object" == getObjType(o) && null != o.startCell)
                    l = l.concat(func_methods.getCellDataArr(o, "number", !0));
                else {
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    l.push(o)
                }
                var i = [];
                for (e = 0; e < l.length; e++)
                    isRealNum(l[e]) && i.push(parseFloat(l[e]));
                if (0 == n.length && 0 == i.length)
                    return [[0], [0]];
                if (0 == n.length) {
                    var s = [[0]];
                    for (e = 0; e < i.length; e++)
                        s.push([0]);
                    return s
                }
                if (0 == i.length)
                    return [[0], [n.length]];
                i.sort((function(e, t) {
                    return e - t
                }
                ));
                for (s = [],
                e = 0; e < i.length; e++)
                    if (0 == e) {
                        for (var c = 0, u = 0; u < n.length; u++)
                            n[u] <= i[0] && c++;
                        s.push([c])
                    } else if (e == i.length - 1) {
                        var h = 0
                          , d = 0;
                        for (u = 0; u < n.length; u++)
                            n[u] <= i[e] && n[u] > i[e - 1] && h++,
                            n[u] > i[e] && d++;
                        s.push([h]),
                        s.push([d])
                    } else {
                        for (c = 0,
                        u = 0; u < n.length; u++)
                            n[u] <= i[e] && n[u] > i[e - 1] && c++;
                        s.push([c])
                    }
                return s
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        GROWTH: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "text");
                else {
                    if (!isRealNum(r))
                        return luckysheetformula.error.v;
                    (m = []).push(parseFloat(r)),
                    a.push(m)
                }
                var n = a.length
                  , o = a[0].length;
                for (e = 0; e < n; e++)
                    for (var l = 0; l < o; l++) {
                        if (!isRealNum(a[e][l]))
                            return luckysheetformula.error.v;
                        a[e][l] = parseFloat(a[e][l])
                    }
                var i = [];
                for (e = 1; e <= n; e++)
                    for (l = 1; l <= o; l++) {
                        var s = (e - 1) * o + l;
                        i.push(s)
                    }
                if (arguments.length >= 2) {
                    var c = arguments[1];
                    if (i = [],
                    "array" == getObjType(c)) {
                        if ("array" == getObjType(c[0]) && !func_methods.isDyadicArr(c))
                            return luckysheetformula.error.v;
                        i = func_methods.getDataDyadicArr(c)
                    } else if ("object" == getObjType(c) && null != c.startCell)
                        i = func_methods.getCellDataDyadicArr(c, "text");
                    else {
                        if (!isRealNum(c))
                            return luckysheetformula.error.v;
                        (m = []).push(parseFloat(c)),
                        i.push(m)
                    }
                    for (e = 0; e < i.length; e++)
                        for (l = 0; l < i[0].length; l++) {
                            if (!isRealNum(i[e][l]))
                                return luckysheetformula.error.v;
                            i[e][l] = parseFloat(i[e][l])
                        }
                }
                var u = i.length
                  , h = i[0].length
                  , d = i;
                if (arguments.length >= 3) {
                    var f = arguments[2];
                    if (d = [],
                    "array" == getObjType(f)) {
                        if ("array" == getObjType(f[0]) && !func_methods.isDyadicArr(f))
                            return luckysheetformula.error.v;
                        d = func_methods.getDataDyadicArr(f)
                    } else if ("object" == getObjType(f) && null != f.startCell)
                        d = func_methods.getCellDataDyadicArr(f, "text");
                    else {
                        if (!isRealNum(f))
                            return luckysheetformula.error.v;
                        var m;
                        (m = []).push(parseFloat(f)),
                        d.push(m)
                    }
                    for (e = 0; e < d.length; e++)
                        for (l = 0; l < d[0].length; l++) {
                            if (!isRealNum(d[e][l]))
                                return luckysheetformula.error.v;
                            d[e][l] = parseFloat(d[e][l])
                        }
                }
                var p = !0;
                if (4 == arguments.length && valueIsError(p = func_methods.getCellBoolen(arguments[3])))
                    return p;
                if (n != u || o != h)
                    return luckysheetformula.error.r;
                function g(e, t) {
                    for (var r = 0, a = 0, n = 0, o = 0, l = 0; l < e.length; l++)
                        for (var i = 0; i < e[l].length; i++)
                            r += e[l][i],
                            a += Math.log(t[l][i]),
                            n += e[l][i] * Math.log(t[l][i]),
                            o += e[l][i] * e[l][i];
                    var s = e.length * e[0].length
                      , c = r / s
                      , u = a / s
                      , h = (n / s - c * u) / (o / s - c * c)
                      , d = u - h * c;
                    return [Math.exp(h), Math.exp(d)]
                }
                var y = g(i, a)
                  , v = y[0];
                if (p)
                    var A = y[1];
                else
                    A = 1;
                var b = [];
                for (e = 0; e < d.length; e++)
                    for (l = 0; l < d[e].length; l++) {
                        var k = d[e][l]
                          , w = A * Math.pow(v, k);
                        b.push(Math.round(1e9 * w) / 1e9)
                    }
                return b
            } catch (e) {
                var x = e;
                return x = luckysheetformula.errorInfo(x),
                [luckysheetformula.error.v, x]
            }
        },
        LINEST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return luckysheetformula.error.v
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        LOGEST: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return luckysheetformula.error.v
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        MDETERM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "text");
                else {
                    var n = [];
                    n.push(r),
                    a.push(n)
                }
                for (e = 0; e < a.length; e++)
                    for (var o = 0; o < a[e].length; o++) {
                        if (!isRealNum(a[e][o]))
                            return luckysheetformula.error.v;
                        a[e][o] = parseFloat(a[e][o])
                    }
                if (a.length != a[0].length)
                    return luckysheetformula.error.v;
                function l(e, t) {
                    var r, a = new Array;
                    if (1 == t)
                        return r = e[0][0];
                    if (2 == t)
                        return r = e[0][0] * e[1][1] - e[0][1] * e[1][0];
                    if (3 == t)
                        return r = e[0][0] * e[1][1] * e[2][2] + e[1][0] * e[2][1] * e[0][2] + e[2][0] * e[0][1] * e[1][2] - e[2][0] * e[1][1] * e[0][2] - e[0][0] * e[2][1] * e[1][2] - e[1][0] * e[0][1] * e[2][2];
                    r = 0;
                    for (var n = new Array, o = new Array, l = 0; l < t; l++)
                        a[l] = e[l][0] * Math.pow(-1, l + 1 + 1);
                    for (l = 0; l < t; l++) {
                        o[l] = new Array;
                        for (var i = 0; i < t - 1; i++)
                            o[l][i] = e[l][i + 1]
                    }
                    for (l = 0; l < t; l++) {
                        for (i = 0; i < t; i++) {
                            n[i] = new Array;
                            for (var s = 0; s < t - 1; s++)
                                l > i ? n[i][s] = o[i][s] : l < i && (n[i - 1][s] = o[i][s])
                        }
                        r += a[l] * arguments.callee(n, t - 1)
                    }
                    return r
                }
                return l(a, a.length)
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        MINVERSE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "text");
                else {
                    var n = [];
                    n.push(r),
                    a.push(n)
                }
                for (e = 0; e < a.length; e++)
                    for (var o = 0; o < a[e].length; o++) {
                        if (!isRealNum(a[e][o]))
                            return luckysheetformula.error.v;
                        a[e][o] = parseFloat(a[e][o])
                    }
                return a.length != a[0].length ? luckysheetformula.error.v : inverse(a)
            } catch (e) {
                var l = e;
                return l = luckysheetformula.errorInfo(l),
                [luckysheetformula.error.v, l]
            }
        },
        MMULT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                if (!(f = luckysheetformula.errorParamCheck(this.p, arguments[e], e))[0])
                    return luckysheetformula.error.v
            }
            try {
                var t = arguments[0]
                  , r = [];
                if ("array" == getObjType(t)) {
                    if ("array" == getObjType(t[0]) && !func_methods.isDyadicArr(t))
                        return luckysheetformula.error.v;
                    r = func_methods.getDataDyadicArr(t)
                } else if ("object" == getObjType(t) && null != t.startCell)
                    r = func_methods.getCellDataDyadicArr(t, "text");
                else {
                    (u = []).push(t),
                    r.push(u)
                }
                for (e = 0; e < r.length; e++)
                    for (var a = 0; a < r[e].length; a++) {
                        if (!isRealNum(r[e][a]))
                            return luckysheetformula.error.v;
                        r[e][a] = parseFloat(r[e][a])
                    }
                var n = arguments[1]
                  , o = [];
                if ("array" == getObjType(n)) {
                    if ("array" == getObjType(n[0]) && !func_methods.isDyadicArr(n))
                        return luckysheetformula.error.v;
                    o = func_methods.getDataDyadicArr(n)
                } else if ("object" == getObjType(n) && null != n.startCell)
                    o = func_methods.getCellDataDyadicArr(n, "text");
                else {
                    (u = []).push(n),
                    o.push(u)
                }
                for (e = 0; e < o.length; e++)
                    for (a = 0; a < o[e].length; a++) {
                        if (!isRealNum(o[e][a]))
                            return luckysheetformula.error.v;
                        o[e][a] = parseFloat(o[e][a])
                    }
                if (r[0].length != o.length)
                    return luckysheetformula.error.v;
                for (var l = r.length, i = o[0].length, s = [], c = 0; c < l; c++) {
                    for (var u = [], h = 0; h < i; h++) {
                        for (var d = 0, f = 0; f < r[0].length; f++)
                            d += r[c][f] * o[f][h];
                        u.push(d)
                    }
                    s.push(u)
                }
                return s
            } catch (e) {
                var m = e;
                return m = luckysheetformula.errorInfo(m),
                [luckysheetformula.error.v, m]
            }
        },
        SUMPRODUCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "text");
                else {
                    (c = []).push(r),
                    a.push(c)
                }
                for (e = 0; e < a.length; e++)
                    for (var n = 0; n < a[e].length; n++)
                        isRealNum(a[e][n]) ? a[e][n] = parseFloat(a[e][n]) : a[e][n] = 0;
                var o = a.length
                  , l = a[0].length;
                if (arguments.length >= 2)
                    for (e = 1; e < arguments.length; e++) {
                        var i = arguments[e]
                          , s = [];
                        if ("array" == getObjType(i)) {
                            if ("array" == getObjType(i[0]) && !func_methods.isDyadicArr(i))
                                return luckysheetformula.error.v;
                            s = func_methods.getDataDyadicArr(i)
                        } else if ("object" == getObjType(i) && null != i.startCell)
                            s = func_methods.getCellDataDyadicArr(i, "text");
                        else {
                            var c;
                            (c = []).push(i),
                            s.push(c)
                        }
                        if (s.length != o || s[0].length != l)
                            return luckysheetformula.error.v;
                        for (var u = 0; u < o; u++)
                            for (var h = 0; h < l; h++)
                                isRealNum(s[u][h]) ? a[u][h] = a[u][h] * parseFloat(s[u][h]) : a[u][h] = 0
                    }
                var d = 0;
                for (u = 0; u < o; u++)
                    for (h = 0; h < l; h++)
                        d += a[u][h];
                return d
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        ISFORMULA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                return "object" == getObjType(a) && null != a.startCell ? null != a.data && (null != (r = "array" == getObjType(a.data) ? a.data[0][0] : a.data) && null != r.f) : luckysheetformula.error.v
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        CELL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if (null == a.data)
                        return luckysheetformula.error.v;
                    if ("array" == getObjType(a.data))
                        return luckysheetformula.error.v;
                    if (isRealNull(r = a.data.v))
                        return luckysheetformula.error.v
                } else
                    r = a;
                var n, o = arguments[1];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (n = o.startCell,
                -1 == ["address", "col", "color", "contents", "filename", "format", "parentheses", "prefix", "protect", "row", "type", "width"].indexOf(r))
                    return luckysheetformula.error.v;
                var l, i = getluckysheetfile()[getSheetIndex(Store.currentSheetIndex)], s = luckysheetformula.getcellrange(n), c = s.row[0], u = s.column[0], h = getluckysheetfile(), d = getSheetIndex(Store.calculateSheetIndex), f = h[d].data;
                switch (null != luckysheetformula.execFunctionGlobalData && null != luckysheetformula.execFunctionGlobalData[c + "_" + u + "_" + Store.calculateSheetIndex] ? l = luckysheetformula.execFunctionGlobalData[c + "_" + u + "_" + Store.calculateSheetIndex].v : null != f[c][u] && null != f[c][u].v && "" != f[c][u].v ? (l = f[c][u])instanceof Object && (l = l.v) : l = 0,
                r) {
                case "address":
                    return n;
                case "col":
                    return u + 1;
                case "color":
                    return 0;
                case "contents":
                    return l;
                case "filename":
                    return i.name;
                case "format":
                    return null == f[c][u] || null == f[c][u].ct ? "G" : f[c][u].ct.fa;
                case "parentheses":
                    return null == f[c][u] || null == f[c][u].v || "" == f[c][u].v ? 0 : f[c][u].v > 0 ? 1 : 0;
                case "prefix":
                    return 0 == l ? "" : 0 == f[c][u].ht ? "^" : 1 == f[c][u].ht ? "'" : 2 == f[c][u].ht ? '"' : "";
                case "protect":
                    return 0;
                case "row":
                    return c + 1;
                case "type":
                    return 0 == l ? "b" : "l";
                case "width":
                    var m = i.config;
                    return null != m.columnlen && u in m.columnlen ? m.columnlen[u] : Store.defaultcollen
                }
            } catch (e) {
                var p = e;
                return p = luckysheetformula.errorInfo(p),
                [luckysheetformula.error.v, p]
            }
        },
        NA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return luckysheetformula.error.na
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        ERROR_TYPE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if (null == a.data)
                        return luckysheetformula.error.na;
                    if ("array" == getObjType(a.data)) {
                        if (null == (r = a.data[0][0]) || isRealNull(r.v))
                            return luckysheetformula.error.na;
                        r = r.v
                    } else {
                        if (isRealNull(a.data.v))
                            return luckysheetformula.error.na;
                        r = a.data.v
                    }
                } else
                    r = a;
                var n = {
                    "#NULL!": 1,
                    "#DIV/0!": 2,
                    "#VALUE!": 3,
                    "#REF!": 4,
                    "#NAME?": 5,
                    "#NUM!": 6,
                    "#N/A": 7,
                    "#GETTING_DATA": 8
                };
                return r in n ? n[r] : luckysheetformula.error.na
            } catch (e) {
                var o = e;
                return o = luckysheetformula.errorInfo(o),
                [luckysheetformula.error.v, o]
            }
        },
        ISBLANK: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0];
                return "object" == getObjType(r) && null != r.startCell && null == r.data
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        ISERR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !0;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return ["#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISERROR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !0;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return ["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISLOGICAL: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !1;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return "true" == r.toString().toLowerCase() || "false" == r.toString().toLowerCase()
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISNA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !1;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return "#N/A" == r.toString()
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISNONTEXT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !0;
                    if (null == a.data || isRealNull(a.data.v))
                        return !0;
                    r = a.data.v
                } else
                    r = a;
                return ["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1 || ("true" == r.toString().toLowerCase() || "false" == r.toString().toLowerCase() || !!isRealNum(r))
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISNUMBER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !1;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return !!isRealNum(r)
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        ISREF: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                return "object" == getObjType(arguments[0]) && null != arguments[0].startCell
            } catch (e) {
                var r = e;
                return r = luckysheetformula.errorInfo(r),
                [luckysheetformula.error.v, r]
            }
        },
        ISTEXT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return !1;
                    if (null == a.data || isRealNull(a.data.v))
                        return !1;
                    r = a.data.v
                } else
                    r = a;
                return !(["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1) && ("true" != r.toString().toLowerCase() && "false" != r.toString().toLowerCase() && !isRealNum(r))
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        TYPE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    return 64;
                if ("object" == getObjType(a) && null != a.startCell) {
                    if ("array" == getObjType(a.data))
                        return 16;
                    if (null == a.data || isRealNull(a.data.v))
                        return 1;
                    r = a.data.v
                } else
                    r = a;
                return ["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1 ? 16 : "true" == r.toString().toLowerCase() || "false" == r.toString().toLowerCase() ? 4 : isRealNum(r) ? 1 : 2
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        N: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r, a = arguments[0];
                if ("array" == getObjType(a))
                    if ("array" == getObjType(a[0])) {
                        if (!func_methods.isDyadicArr(a))
                            return luckysheetformula.error.v;
                        r = a[0][0]
                    } else
                        r = a[0];
                else if ("object" == getObjType(a) && null != a.startCell)
                    if ("array" == getObjType(a.data)) {
                        if (null == (r = a.data[0][0]) || isRealNull(r.v))
                            return 0;
                        r = r.v
                    } else {
                        if (null == a.data || isRealNull(a.data.v))
                            return 0;
                        r = a.data.v
                    }
                else
                    r = a;
                return ["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NUM!", "#NAME?", "#NULL!"].indexOf(r) > -1 ? r : "true" == r.toString().toLowerCase() || "false" == r.toString().toLowerCase() ? "true" == r.toString().toLowerCase() ? 1 : 0 : isRealNum(r) ? parseFloat(r) : 0
            } catch (e) {
                var n = e;
                return n = luckysheetformula.errorInfo(n),
                [luckysheetformula.error.v, n]
            }
        },
        TO_DATE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? update("yyyy-mm-dd", r = parseFloat(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TO_PURE_NUMBER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : moment(r).isValid() ? genarate(r)[2] : null == numeral(r).value() ? r : numeral(r).value()
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TO_TEXT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0], "text");
                return valueIsError(r) ? r : update("@", r)
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TO_DOLLARS: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? update("$ 0.00", r = parseFloat(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        TO_PERCENT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                return valueIsError(r) ? r : isRealNum(r) ? update("0%", r = parseFloat(r)) : luckysheetformula.error.v
            } catch (e) {
                var a = e;
                return a = luckysheetformula.errorInfo(a),
                [luckysheetformula.error.v, a]
            }
        },
        DGET: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                return 0 === i.length ? luckysheetformula.error.v : i.length > 1 ? luckysheetformula.error.nm : s[i[0]]
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        },
        DMAX: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = s[i[0]];
                for (e = 1; e < i.length; e++)
                    u < s[i[e]] && (u = s[i[e]]);
                return u
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DMIN: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = findField(a, n);
                    s = rest(a[c])
                } else
                    s = rest(a[n]);
                var u = s[i[0]];
                for (e = 1; e < i.length; e++)
                    u > s[i[e]] && (u = s[i[e]]);
                return u
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DAVERAGE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = 0;
                for (e = 0; e < i.length; e++)
                    u += s[i[e]];
                return 0 === i.length ? luckysheetformula.error.d : u / i.length
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DCOUNT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return window.luckysheet_function.COUNT.f.apply(window.luckysheet_function.COUNT, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DCOUNTA: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return window.luckysheet_function.COUNTA.f.apply(window.luckysheet_function.COUNTA, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DPRODUCT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                u = func_methods.compact(u);
                var h = 1;
                for (e = 0; e < u.length; e++)
                    h *= u[e];
                return h
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        DSTDEV: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return u = func_methods.compact(u),
                window.luckysheet_function.STDEVA.f.apply(window.luckysheet_function.STDEVA, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DSTDEVP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return u = func_methods.compact(u),
                window.luckysheet_function.STDEVP.f.apply(window.luckysheet_function.STDEVP, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DSUM: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                u = func_methods.compact(u);
                var h = 0;
                for (e = 0; e < u.length; e++)
                    h += u[e];
                return h
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        DVAR: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return u = func_methods.compact(u),
                window.luckysheet_function.VAR_S.f.apply(window.luckysheet_function.VAR_S, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        DVARP: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("object" != getObjType(r) || null == r.startCell)
                    return luckysheetformula.error.v;
                if (null == r.data)
                    return luckysheetformula.error.v;
                a = func_methods.getCellDataDyadicArr(r, "text");
                var n = func_methods.getFirstValue(arguments[1], "text");
                if (valueIsError(n))
                    return n;
                if (isRealNull(n))
                    return luckysheetformula.error.v;
                var o = arguments[2]
                  , l = [];
                if ("object" != getObjType(o) || null == o.startCell)
                    return luckysheetformula.error.v;
                if (null == o.data)
                    return luckysheetformula.error.v;
                if (l = func_methods.getCellDataDyadicArr(o, "text"),
                !isRealNum(n) && "string" !== getObjType(n))
                    return luckysheetformula.error.v;
                var i = func_methods.findResultIndex(a, l)
                  , s = [];
                if ("string" === getObjType(n)) {
                    var c = func_methods.findField(a, n);
                    s = func_methods.rest(a[c])
                } else
                    s = func_methods.rest(a[n]);
                var u = [];
                for (e = 0; e < i.length; e++)
                    u[e] = s[i[e]];
                return u = func_methods.compact(u),
                window.luckysheet_function.VAR_P.f.apply(window.luckysheet_function.VAR_P, u)
            } catch (e) {
                var h = e;
                return h = luckysheetformula.errorInfo(h),
                [luckysheetformula.error.v, h]
            }
        },
        LINESPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = arguments[1]
                  , i = arguments[2]
                  , s = arguments[3]
                  , c = arguments[4]
                  , u = arguments[5]
                  , h = arguments[6]
                  , d = arguments[7]
                  , f = getluckysheetfile()
                  , m = getSheetIndex(Store.calculateSheetIndex)
                  , p = f[m].data
                  , g = luckysheetformula.readCellDataToOneArray(o)
                  , y = menuButton.getCellRealSize(p, r, a)
                  , v = y[0]
                  , A = y[1]
                  , b = {};
                null == i && (i = 1),
                b.lineWidth = i,
                b.offsetY = i + 1,
                b.height = A - (i + 1),
                b.width = v;
                var k = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    b[e] = t)
                };
                if (null == l && (l = "#2ec7c9"),
                k("lineColor", l),
                b.fillColor = 0,
                s)
                    if ("string" == typeof s) {
                        s = s.toLowerCase();
                        var w = null;
                        "min" == s ? w = window.luckysheet_function.MIN.f({
                            data: g
                        }) : "max" == s ? w = window.luckysheet_function.MAX.f({
                            data: g
                        }) : "avg" == s || "mean" == s ? w = window.luckysheet_function.AVERAGE.f({
                            data: g
                        }) : "median" == s && (w = window.luckysheet_function.MEDIAN.f({
                            data: g
                        })),
                        w && (b.normalRangeMin = w,
                        b.normalRangeMax = w)
                    } else
                        b.normalRangeMin = s,
                        b.normalRangeMax = s;
                null == c && (c = "#000"),
                k("normalRangeColor", c),
                k("maxSpotColor", u),
                k("minSpotColor", h),
                null == d && (d = "1.5"),
                b.spotRadius = d;
                var x = luckysheetSparkline.init(g, b);
                return x
            } catch (e) {
                var S = e;
                return S = luckysheetformula.errorInfo(S),
                [luckysheetformula.error.v, S]
            }
        },
        AREASPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = arguments[1]
                  , i = arguments[2]
                  , s = arguments[3]
                  , c = arguments[4]
                  , u = arguments[5]
                  , h = luckysheetformula.readCellDataToOneArray(o)
                  , d = getluckysheetfile()
                  , f = getSheetIndex(Store.calculateSheetIndex)
                  , m = d[f].data
                  , p = menuButton.getCellRealSize(m, r, a)
                  , g = p[0]
                  , y = p[1]
                  , v = {};
                null == s && (s = 1),
                v.lineWidth = s,
                v.offsetY = s + 1,
                v.height = y - (s + 1),
                v.width = g;
                var A = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    v[e] = t)
                };
                if (null == l && (l = "#2ec7c9"),
                A("lineColor", l),
                A("fillColor", i),
                null == s && (s = "1"),
                v.lineWidth = s,
                c)
                    if ("string" == typeof c) {
                        c = c.toLowerCase();
                        var b = null;
                        "min" == c ? b = window.luckysheet_function.MIN.f({
                            data: h
                        }) : "max" == c ? b = window.luckysheet_function.MAX.f({
                            data: h
                        }) : "avg" == c || "mean" == c ? b = window.luckysheet_function.AVERAGE.f({
                            data: h
                        }) : "median" == c && (b = window.luckysheet_function.MEDIAN.f({
                            data: h
                        })),
                        b && (v.normalRangeMin = b,
                        v.normalRangeMax = b)
                    } else
                        v.normalRangeMin = c,
                        v.normalRangeMax = c;
                null == u && (u = "#000"),
                A("normalRangeColor", u);
                var k = luckysheetSparkline.init(h, v);
                return k
            } catch (e) {
                var w = e;
                return w = luckysheetformula.errorInfo(w),
                [luckysheetformula.error.v, w]
            }
        },
        COLUMNSPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3]
                  , v = arguments[4];
                f.type = "column",
                null == p && (p = "1"),
                f.barSpacing = p,
                null == g && (g = "#fc5c5c"),
                m("barColor", g),
                null == y && (y = "#97b552"),
                m("negBarColor", y),
                f.chartRangeMax = null == v || !1 === v || "number" != typeof v ? void 0 : v;
                var A = luckysheetformula.sparklinesColorMap(arguments);
                A && (f.colorMap = A);
                var b = luckysheetSparkline.init(l, f);
                return b
            } catch (e) {
                var k = e;
                return k = luckysheetformula.errorInfo(k),
                [luckysheetformula.error.v, k]
            }
        },
        STACKCOLUMNSPLINES: function STACKCOLUMNSPLINES() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var i = 0; i < arguments.length; i++) {
                var p = luckysheetformula.errorParamCheck(this.p, arguments[i], i);
                if (!p[0])
                    return luckysheetformula.error.v
            }
            try {
                var cell_r = window.luckysheetCurrentRow
                  , cell_c = window.luckysheetCurrentColumn
                  , cell_fp = window.luckysheetCurrentFunction
                  , colorList = luckysheetformula.colorList
                  , rangeValue = arguments[0]
                  , dataformat = []
                  , data = [];
                if (null != rangeValue && null != rangeValue.data && (data = rangeValue.data),
                "array" == getObjType(data))
                    data = luckysheetformula.getPureValueByData(data);
                else {
                    if ("object" == getObjType(data))
                        return data = data.v,
                        [data];
                    /\{.*?\}/.test(data) && (data = data.replace(/\{/g, "[").replace(/\}/g, "]")),
                    data = eval("(" + data + ")")
                }
                var stackconfig = arguments[1]
                  , offsetY = data.length;
                if (null == stackconfig || stackconfig)
                    for (var c = 0; c < data[0].length; c++) {
                        for (var colstr = "", r = 0; r < data.length; r++)
                            colstr += data[r][c] + ":";
                        colstr = colstr.substr(0, colstr.length - 1),
                        dataformat.push(colstr)
                    }
                else {
                    for (var r = 0; r < data.length; r++) {
                        for (var rowstr = "", c = 0; c < data[0].length; c++)
                            rowstr += data[r][c] + ":";
                        rowstr = rowstr.substr(0, rowstr.length - 1),
                        dataformat.push(rowstr)
                    }
                    var offsetY = data[0].length
                }
                var luckysheetfile = getluckysheetfile()
                  , index = getSheetIndex(Store.calculateSheetIndex)
                  , sheetdata = luckysheetfile[index].data
                  , cellSize = menuButton.getCellRealSize(sheetdata, cell_r, cell_c)
                  , width = cellSize[0]
                  , height = cellSize[1]
                  , sparksetting = {};
                sparksetting.height = height,
                sparksetting.width = width;
                var sparkColorSetting = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = colorList[t]),
                    sparksetting[e] = t)
                }
                  , barSpacing = arguments[2]
                  , chartRangeMax = arguments[3];
                sparksetting.type = "column",
                null == barSpacing && (barSpacing = "1"),
                sparksetting.barSpacing = barSpacing,
                sparksetting.chartRangeMax = null == chartRangeMax || !1 === chartRangeMax || "number" != typeof chartRangeMax ? void 0 : chartRangeMax;
                var colorLists = luckysheetformula.sparklinesColorMap(arguments, 4);
                colorLists && (sparksetting.colorMap = colorLists);
                var temp1 = luckysheetSparkline.init(dataformat, sparksetting);
                return temp1
            } catch (e) {
                var err = e;
                return err = luckysheetformula.errorInfo(err),
                [luckysheetformula.error.v, err]
            }
        },
        BARSPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3]
                  , v = arguments[4];
                f.type = "bar",
                null == p && (p = "1"),
                f.barSpacing = p,
                null == g && (g = "#fc5c5c"),
                m("barColor", g),
                null == y && (y = "#97b552"),
                m("negBarColor", y),
                f.chartRangeMax = null == v || !1 === v || "number" != typeof v ? void 0 : v;
                var A = luckysheetformula.sparklinesColorMap(arguments);
                A && (f.colorMap = A);
                var b = luckysheetSparkline.init(l, f);
                return b
            } catch (e) {
                var k = e;
                return k = luckysheetformula.errorInfo(k),
                [luckysheetformula.error.v, k]
            }
        },
        STACKBARSPLINES: function STACKBARSPLINES() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var i = 0; i < arguments.length; i++) {
                var p = luckysheetformula.errorParamCheck(this.p, arguments[i], i);
                if (!p[0])
                    return luckysheetformula.error.v
            }
            try {
                var cell_r = window.luckysheetCurrentRow
                  , cell_c = window.luckysheetCurrentColumn
                  , cell_fp = window.luckysheetCurrentFunction
                  , colorList = luckysheetformula.colorList
                  , rangeValue = arguments[0]
                  , dataformat = []
                  , data = [];
                if (null != rangeValue && null != rangeValue.data && (data = rangeValue.data),
                "array" == getObjType(data))
                    data = luckysheetformula.getPureValueByData(data);
                else {
                    if ("object" == getObjType(data))
                        return data = data.v,
                        [data];
                    /\{.*?\}/.test(data) && (data = data.replace(/\{/g, "[").replace(/\}/g, "]")),
                    data = eval("(" + data + ")")
                }
                var stackconfig = arguments[1]
                  , offsetY = data.length;
                if (null == stackconfig || stackconfig)
                    for (var c = 0; c < data[0].length; c++) {
                        for (var colstr = "", r = 0; r < data.length; r++)
                            colstr += data[r][c] + ":";
                        colstr = colstr.substr(0, colstr.length - 1),
                        dataformat.push(colstr)
                    }
                else {
                    for (var r = 0; r < data.length; r++) {
                        for (var rowstr = "", c = 0; c < data[0].length; c++)
                            rowstr += data[r][c] + ":";
                        rowstr = rowstr.substr(0, rowstr.length - 1),
                        dataformat.push(rowstr)
                    }
                    var offsetY = data[0].length
                }
                var luckysheetfile = getluckysheetfile()
                  , index = getSheetIndex(Store.calculateSheetIndex)
                  , sheetdata = luckysheetfile[index].data
                  , cellSize = menuButton.getCellRealSize(sheetdata, cell_r, cell_c)
                  , width = cellSize[0]
                  , height = cellSize[1]
                  , sparksetting = {};
                sparksetting.height = height,
                sparksetting.width = width;
                var sparkColorSetting = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = colorList[t]),
                    sparksetting[e] = t)
                }
                  , barSpacing = arguments[2]
                  , chartRangeMax = arguments[3];
                sparksetting.type = "bar",
                null == barSpacing && (barSpacing = "1"),
                sparksetting.barSpacing = barSpacing,
                sparksetting.chartRangeMax = null == chartRangeMax || !1 === chartRangeMax || "number" != typeof chartRangeMax ? void 0 : chartRangeMax;
                var colorLists = luckysheetformula.sparklinesColorMap(arguments, 4);
                colorLists && (sparksetting.colorMap = colorLists);
                var temp1 = luckysheetSparkline.init(dataformat, sparksetting);
                return temp1
            } catch (e) {
                var err = e;
                return err = luckysheetformula.errorInfo(err),
                [luckysheetformula.error.v, err]
            }
        },
        DISCRETESPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3];
                f.type = "discrete",
                null == p && (p = 0),
                f.thresholdValue = p,
                null == g && (g = "#2ec7c9"),
                m("lineColor", g),
                null == y && (y = "#fc5c5c"),
                m("thresholdColor", y);
                var v = luckysheetSparkline.init(l, f);
                return v
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        TRISTATESPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3]
                  , v = arguments[4];
                f.type = "tristate",
                null == p && (p = "1"),
                f.barSpacing = p,
                null == g && (g = "#fc5c5c"),
                m("barColor", g),
                null == y && (y = "#97b552"),
                m("negBarColor", y),
                null == v && (v = "#999"),
                m("zeroBarColor", v);
                var A = luckysheetformula.sparklinesColorMap(arguments);
                A && (f.colorMap = A);
                var b = luckysheetSparkline.init(l, f);
                return b
            } catch (e) {
                var k = e;
                return k = luckysheetformula.errorInfo(k),
                [luckysheetformula.error.v, k]
            }
        },
        PIESPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3];
                f.type = "pie",
                null == p && (p = 0),
                f.offset = p,
                null == g && (g = 0),
                m("borderWidth", g),
                null == y && (y = "#97b552"),
                m("borderColor", y);
                var v = luckysheetformula.sparklinesColorMap(arguments, 4);
                v && (f.colorMap = v);
                var A = luckysheetSparkline.init(l, f);
                return A
            } catch (e) {
                var b = e;
                return b = luckysheetformula.errorInfo(b),
                [luckysheetformula.error.v, b]
            }
        },
        BOXSPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList)
                  , o = arguments[0]
                  , l = luckysheetformula.readCellDataToOneArray(o)
                  , i = getluckysheetfile()
                  , s = getSheetIndex(Store.calculateSheetIndex)
                  , c = i[s].data
                  , u = menuButton.getCellRealSize(c, r, a)
                  , h = u[0]
                  , d = u[1]
                  , f = {};
                f.height = d,
                f.width = h;
                var m = function(e, t) {
                    t && ("number" == typeof t && (t > 19 && (t %= 20),
                    t = n[t]),
                    f[e] = t)
                }
                  , p = arguments[1]
                  , g = arguments[2]
                  , y = arguments[3];
                f.type = "box",
                null == p && (p = 1.5),
                f.outlierIQR = p,
                null == g ? g = 0 : m("target", g),
                null == y && (y = 1.5),
                m("spotRadius", y);
                var v = luckysheetSparkline.init(l, f);
                return v
            } catch (e) {
                var A = e;
                return A = luckysheetformula.errorInfo(A),
                [luckysheetformula.error.v, A]
            }
        },
        BULLETSPLINES: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = window.luckysheetCurrentRow
                  , a = window.luckysheetCurrentColumn
                  , n = (window.luckysheetCurrentFunction,
                luckysheetformula.colorList,
                getluckysheetfile())
                  , o = getSheetIndex(Store.calculateSheetIndex)
                  , l = n[o].data
                  , i = menuButton.getCellRealSize(l, r, a)
                  , s = i[0]
                  , c = i[1]
                  , u = {};
                u.height = c,
                u.width = s;
                var h = [];
                luckysheet_getValue(arguments);
                var d = luckysheetformula.getValueByFuncData(arguments[0])
                  , f = luckysheetformula.getValueByFuncData(arguments[1]);
                h.push(d),
                h.push(f);
                for (e = 2; e < arguments.length; e++)
                    h.push(luckysheetformula.getValueByFuncData(arguments[e]));
                u.type = "bullet";
                var m = luckysheetSparkline.init(h, u);
                return m
            } catch (e) {
                var p = e;
                return p = luckysheetformula.errorInfo(p),
                [luckysheetformula.error.v, p]
            }
        },
        SORT: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = []
                  , n = 1
                  , o = 1;
                if ("array" == getObjType(r))
                    if ("array" == getObjType(r[0])) {
                        if (!func_methods.isDyadicArr(r))
                            return luckysheetformula.error.v;
                        for (e = 0; e < r.length; e++) {
                            for (var l = [], i = 0; i < r[e].length; i++) {
                                var s = r[e][i];
                                l.push(s)
                            }
                            a.push(l)
                        }
                        n = a.length,
                        o = a[0].length
                    } else {
                        for (e = 0; e < r.length; e++) {
                            s = r[e];
                            a.push(s)
                        }
                        n = a.length
                    }
                else if ("object" == getObjType(r) && null != r.startCell)
                    if (null != r.data)
                        if ("array" == getObjType(r.data)) {
                            for (e = 0; e < r.data.length; e++) {
                                for (l = [],
                                i = 0; i < r.data[e].length; i++) {
                                    if (null != r.data[e][i])
                                        isRealNull(s = r.data[e][i].v) && (s = 0),
                                        l.push(s);
                                    else
                                        l.push(0)
                                }
                                a.push(l)
                            }
                            n = a.length,
                            o = a[0].length
                        } else {
                            isRealNull(s = r.data.v) && (s = 0),
                            a.push(s)
                        }
                    else
                        a.push(0);
                else {
                    s = r;
                    a.push(s)
                }
                var c = 1;
                if (arguments.length >= 2) {
                    if (valueIsError(c = func_methods.getFirstValue(arguments[1])))
                        return c;
                    if (!isRealNum(c))
                        return luckysheetformula.error.v;
                    c = parseInt(c)
                }
                var u = 1;
                if (arguments.length >= 3) {
                    if (valueIsError(u = func_methods.getFirstValue(arguments[2])))
                        return u;
                    if (!isRealNum(u))
                        return luckysheetformula.error.v;
                    u = Math.floor(parseFloat(u))
                }
                var h = !1;
                if (4 == arguments.length && valueIsError(h = func_methods.getCellBoolen(arguments[3])))
                    return h;
                if (h) {
                    if (c < 1 || c > n)
                        return luckysheetformula.error.v
                } else if (c < 1 || c > o)
                    return luckysheetformula.error.v;
                if (1 != u && -1 != u)
                    return luckysheetformula.error.v;
                var d = function(e, t) {
                    return "array" == getObjType(e) && (e = e[c - 1]),
                    "array" == getObjType(t) && (t = t[c - 1]),
                    isNaN(e) || isNaN(t) ? isNaN(e) ? isNaN(t) ? e > t ? 1 : e < t ? -1 : void 0 : 1 : -1 : e - t
                }
                  , f = function(e, t) {
                    return "array" == getObjType(e) && (e = e[c - 1]),
                    "array" == getObjType(t) && (t = t[c - 1]),
                    isNaN(e) || isNaN(t) ? isNaN(e) ? isNaN(t) ? e > t ? -1 : e < t ? 1 : void 0 : -1 : 1 : t - e
                };
                return h ? (a = a[0].map((function(e, t) {
                    return a.map((function(e) {
                        return e[t]
                    }
                    ))
                }
                )),
                1 == u && a.sort(d),
                -1 == u && a.sort(f),
                a = a[0].map((function(e, t) {
                    return a.map((function(e) {
                        return e[t]
                    }
                    ))
                }
                ))) : (1 == u && a.sort(d),
                -1 == u && a.sort(f)),
                a
            } catch (e) {
                var m = e;
                return m = luckysheetformula.errorInfo(m),
                [luckysheetformula.error.v, m]
            }
        },
        FILTER: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "number");
                else {
                    (u = []).push(parseFloat(r)),
                    a.push(u)
                }
                a.length,
                a[0].length;
                var n = arguments[1]
                  , o = []
                  , l = "row";
                if ("array" == getObjType(n))
                    if ("array" == getObjType(n[0])) {
                        if (!func_methods.isDyadicArr(n))
                            return luckysheetformula.error.v;
                        if (n.length > 1 && n[0].length > 1)
                            return luckysheetformula.error.v;
                        if (n.length > 1) {
                            if (n.length != a.length)
                                return luckysheetformula.error.v;
                            l = "row";
                            for (e = 0; e < n.length; e++) {
                                if ("boolean" == getObjType(i = n[e][0]))
                                    ;
                                else if ("string" != getObjType(i) || "true" != i.toLowerCase() && "false" != i.toLowerCase()) {
                                    if (!isRealNum(i))
                                        return luckysheetformula.error.v;
                                    i = 0 != (i = parseFloat(i))
                                } else
                                    "true" == i.toLowerCase() ? i = !0 : "false" == i.toLowerCase() && (i = !1);
                                o.push(i)
                            }
                        }
                        if (n[0].length > 1) {
                            if (n[0].length != a[0].length)
                                return luckysheetformula.error.v;
                            l = "col";
                            for (e = 0; e < n[0].length; e++) {
                                if ("boolean" == getObjType(i = n[0][e]))
                                    ;
                                else if ("string" != getObjType(i) || "true" != i.toLowerCase() && "false" != i.toLowerCase()) {
                                    if (!isRealNum(i))
                                        return luckysheetformula.error.v;
                                    i = 0 != (i = parseFloat(i))
                                } else
                                    "true" == i.toLowerCase() ? i = !0 : "false" == i.toLowerCase() && (i = !1);
                                o.push(i)
                            }
                        }
                    } else {
                        if (n.length != a[0].length)
                            return luckysheetformula.error.v;
                        l = "col";
                        for (e = 0; e < n.length; e++) {
                            if ("boolean" == getObjType(i = n[e]))
                                ;
                            else if ("string" != getObjType(i) || "true" != i.toLowerCase() && "false" != i.toLowerCase()) {
                                if (!isRealNum(i))
                                    return luckysheetformula.error.v;
                                i = 0 != (i = parseFloat(i))
                            } else
                                "true" == i.toLowerCase() ? i = !0 : "false" == i.toLowerCase() && (i = !1);
                            o.push(i)
                        }
                    }
                else {
                    if ("object" != getObjType(n) || null == n.data || "array" != getObjType(n.data))
                        return luckysheetformula.error.v;
                    if (n.data.length > 1 && n.data[0].length > 1)
                        return luckysheetformula.error.v;
                    if (n.data.length > 1) {
                        if (n.data.length != a.length)
                            return luckysheetformula.error.v;
                        l = "row";
                        for (e = 0; e < n.data.length; e++) {
                            if (isRealNull(i = n.data[e][0].v) && (i = 0),
                            "boolean" == getObjType(i))
                                ;
                            else if ("string" != getObjType(i) || "true" != i.toLowerCase() && "false" != i.toLowerCase()) {
                                if (!isRealNum(i))
                                    return luckysheetformula.error.v;
                                i = 0 != (i = parseFloat(i))
                            } else
                                "true" == i.toLowerCase() ? i = !0 : "false" == i.toLowerCase() && (i = !1);
                            o.push(i)
                        }
                    }
                    if (n.data[0].length > 1) {
                        if (n.data[0].length != a[0].length)
                            return luckysheetformula.error.v;
                        l = "col";
                        for (e = 0; e < n.data[0].length; e++) {
                            var i;
                            if (isRealNull(i = n.data[0][e].v) && (i = 0),
                            "boolean" == getObjType(i))
                                ;
                            else if ("string" != getObjType(i) || "true" != i.toLowerCase() && "false" != i.toLowerCase()) {
                                if (!isRealNum(i))
                                    return luckysheetformula.error.v;
                                i = 0 != (i = parseFloat(i))
                            } else
                                "true" == i.toLowerCase() ? i = !0 : "false" == i.toLowerCase() && (i = !1);
                            o.push(i)
                        }
                    }
                }
                var s = "";
                if (3 == arguments.length && valueIsError(s = func_methods.getFirstValue(arguments[2], "text")))
                    return s;
                var c = [];
                if ("row" == l)
                    for (e = 0; e < a.length; e++)
                        o[e] && c.push(a[e]);
                else
                    for (e = 0; e < a.length; e++) {
                        for (var u = [], h = 0; h < a[0].length; h++)
                            o[h] && u.push(a[e][h]);
                        u.length > 0 && c.push(u)
                    }
                return 0 == c.length ? s : c
            } catch (e) {
                var d = e;
                return d = luckysheetformula.errorInfo(d),
                [luckysheetformula.error.v, d]
            }
        },
        UNIQUE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = arguments[0]
                  , a = [];
                if ("array" == getObjType(r)) {
                    if ("array" == getObjType(r[0]) && !func_methods.isDyadicArr(r))
                        return luckysheetformula.error.v;
                    a = func_methods.getDataDyadicArr(r)
                } else if ("object" == getObjType(r) && null != r.startCell)
                    a = func_methods.getCellDataDyadicArr(r, "number");
                else {
                    var n = [];
                    n.push(parseFloat(r)),
                    a.push(n)
                }
                var o = !1;
                if (arguments.length >= 2 && valueIsError(o = func_methods.getCellBoolen(arguments[1])))
                    return o;
                var l = !1;
                if (3 == arguments.length && valueIsError(l = func_methods.getCellBoolen(arguments[2])))
                    return l;
                if (o) {
                    a = a[0].map((function(e, t) {
                        return a.map((function(e) {
                            return e[t]
                        }
                        ))
                    }
                    ));
                    var i = {}
                      , s = []
                      , c = [];
                    for (e = 0; e < a.length; e++) {
                        for (var u = "", h = 0; h < a[e].length; h++)
                            u += a[e][h].toString() + "|||";
                        s.push(u),
                        u in i || (i[u] = 0,
                        c.push(a[e]))
                    }
                    if (l) {
                        var d = [];
                        for (e = 0; e < s.length; e++)
                            s.indexOf(s[e]) == s.lastIndexOf(s[e]) && d.push(a[e]);
                        return d = d[0].map((function(e, t) {
                            return d.map((function(e) {
                                return e[t]
                            }
                            ))
                        }
                        ))
                    }
                    return c = c[0].map((function(e, t) {
                        return c.map((function(e) {
                            return e[t]
                        }
                        ))
                    }
                    ))
                }
                for (i = {},
                s = [],
                c = [],
                e = 0; e < a.length; e++) {
                    for (u = "",
                    h = 0; h < a[e].length; h++)
                        u += a[e][h].toString() + "|||";
                    s.push(u),
                    u in i || (i[u] = 0,
                    c.push(a[e]))
                }
                if (l) {
                    for (d = [],
                    e = 0; e < s.length; e++)
                        s.indexOf(s[e]) == s.lastIndexOf(s[e]) && d.push(a[e]);
                    return d
                }
                return c
            } catch (e) {
                var f = e;
                return f = luckysheetformula.errorInfo(f),
                [luckysheetformula.error.v, f]
            }
        },
        RANDARRAY: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = 1;
                if (arguments.length >= 1) {
                    if (valueIsError(r = func_methods.getFirstValue(arguments[0])))
                        return r;
                    if (!isRealNum(r))
                        return luckysheetformula.error.v;
                    r = parseInt(r)
                }
                var a = 1;
                if (2 == arguments.length) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                if (r <= 0 || a <= 0)
                    return luckysheetformula.error.v;
                var n = [];
                for (e = 0; e < r; e++) {
                    for (var o = [], l = 0; l < a; l++)
                        o.push(Math.random().toFixed(9));
                    n.push(o)
                }
                return n
            } catch (e) {
                var i = e;
                return i = luckysheetformula.errorInfo(i),
                [luckysheetformula.error.v, i]
            }
        },
        SEQUENCE: function() {
            if (arguments.length < this.m[0] || arguments.length > this.m[1])
                return luckysheetformula.error.na;
            for (var e = 0; e < arguments.length; e++) {
                var t = luckysheetformula.errorParamCheck(this.p, arguments[e], e);
                if (!t[0])
                    return luckysheetformula.error.v
            }
            try {
                var r = func_methods.getFirstValue(arguments[0]);
                if (valueIsError(r))
                    return r;
                if (!isRealNum(r))
                    return luckysheetformula.error.v;
                r = parseInt(r);
                var a = 1;
                if (arguments.length >= 2) {
                    if (valueIsError(a = func_methods.getFirstValue(arguments[1])))
                        return a;
                    if (!isRealNum(a))
                        return luckysheetformula.error.v;
                    a = parseInt(a)
                }
                var n = 1;
                if (arguments.length >= 3) {
                    if (valueIsError(n = func_methods.getFirstValue(arguments[2])))
                        return n;
                    if (!isRealNum(n))
                        return luckysheetformula.error.v;
                    n = parseFloat(n)
                }
                var o = 1;
                if (4 == arguments.length) {
                    if (valueIsError(o = func_methods.getFirstValue(arguments[3])))
                        return o;
                    if (!isRealNum(o))
                        return luckysheetformula.error.v;
                    o = parseFloat(o)
                }
                if (r <= 0 || a <= 0)
                    return luckysheetformula.error.v;
                var l = [];
                for (e = 0; e < r; e++) {
                    for (var i = [], s = 0; s < a; s++) {
                        var c = n + o * (s + a * e);
                        i.push(c)
                    }
                    l.push(i)
                }
                return l
            } catch (e) {
                var u = e;
                return u = luckysheetformula.errorInfo(u),
                [luckysheetformula.error.v, u]
            }
        }
    }
      , functionlist = function() {
        for (var e = locale().functionlist, t = 0; t < e.length; t++) {
            var r = e[t];
            r.f = functionImplementation[r.n]
        }
        Store.functionlist = e;
        for (var a = {}, n = 0; n < e.length; n++) {
            var o = e[n];
            a[o.n] = o
        }
        window.luckysheet_function = a,
        Store.luckysheet_function = a
    }
      , t = function() {
        return "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this
    }();
    function e() {
        t.console && "function" == typeof t.console.log && t.console.log.apply(t.console, arguments)
    }
    var n = {
        log: e,
        warn: function(r) {
            t.console && ("function" == typeof t.console.warn ? t.console.warn.apply(t.console, arguments) : e.call(null, arguments))
        },
        error: function(r) {
            t.console && ("function" == typeof t.console.error ? t.console.error.apply(t.console, arguments) : e(r))
        }
    };
    /**
     * @license
     * FileSaver.js
     * A saveAs() FileSaver implementation.
     *
     * By Eli Grey, http://eligrey.com
     *
     * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
     * source  : http://purl.eligrey.com/github/FileSaver.js
     */
    function r$1(e, t, r) {
        var a = new XMLHttpRequest;
        a.open("GET", e),
        a.responseType = "blob",
        a.onload = function() {
            u(a.response, t, r)
        }
        ,
        a.onerror = function() {
            n.error("could not download file")
        }
        ,
        a.send()
    }
    function i$1(e) {
        var t = new XMLHttpRequest;
        t.open("HEAD", e, !1);
        try {
            t.send()
        } catch (e) {}
        return t.status >= 200 && t.status <= 299
    }
    function a(e) {
        try {
            e.dispatchEvent(new MouseEvent("click"))
        } catch (r) {
            var t = document.createEvent("MouseEvents");
            t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null),
            e.dispatchEvent(t)
        }
    }
    var o, s, u = t.saveAs || ("object" != typeof window || window !== t ? function() {}
    : "download"in HTMLAnchorElement.prototype ? function(e, r, n) {
        var o = t.URL || t.webkitURL
          , l = document.createElement("a");
        r = r || e.name || "download",
        l.download = r,
        l.rel = "noopener",
        "string" == typeof e ? (l.href = e,
        l.origin !== location.origin ? i$1(l.href) ? r$1(e, r, n) : a(l, l.target = "_blank") : a(l)) : (l.href = o.createObjectURL(e),
        setTimeout((function() {
            o.revokeObjectURL(l.href)
        }
        ), 4e4),
        setTimeout((function() {
            a(l)
        }
        ), 0))
    }
    : "msSaveOrOpenBlob"in navigator ? function(e, t, r) {
        if (t = t || e.name || "download",
        "string" == typeof e)
            if (i$1(e))
                r$1(e, t, r);
            else {
                var o = document.createElement("a");
                o.href = e,
                o.target = "_blank",
                setTimeout((function() {
                    a(o)
                }
                ))
            }
        else
            navigator.msSaveOrOpenBlob(function(e, t) {
                return void 0 === t ? t = {
                    autoBom: !1
                } : "object" != typeof t && (n.warn("Deprecated: Expected third argument to be a object"),
                t = {
                    autoBom: !t
                }),
                t.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob([String.fromCharCode(65279), e],{
                    type: e.type
                }) : e
            }(e, r), t)
    }
    : function(e, r, a, n) {
        if ((n = n || open("", "_blank")) && (n.document.title = n.document.body.innerText = "downloading..."),
        "string" == typeof e)
            return r$1(e, r, a);
        var o = "application/octet-stream" === e.type
          , l = /constructor/i.test(t.HTMLElement) || t.safari
          , i = /CriOS\/[\d]+/.test(navigator.userAgent);
        if ((i || o && l) && "object" == typeof FileReader) {
            var s = new FileReader;
            s.onloadend = function() {
                var e = s.result;
                e = i ? e : e.replace(/^data:[^;]*;/, "data:attachment/file;"),
                n ? n.location.href = e : location = e,
                n = null
            }
            ,
            s.readAsDataURL(e)
        } else {
            var c = t.URL || t.webkitURL
              , u = c.createObjectURL(e);
            n ? n.location = u : location.href = u,
            n = null,
            setTimeout((function() {
                c.revokeObjectURL(u)
            }
            ), 4e4)
        }
    }
    );
    /**
     * A class to parse color values
     * @author Stoyan Stefanov <sstoo@gmail.com>
     * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
     * @license Use it if you like it
     */
    function c$1(e) {
        var t;
        e = e || "",
        this.ok = !1,
        "#" == e.charAt(0) && (e = e.substr(1, 6)),
        e = {
            aliceblue: "f0f8ff",
            antiquewhite: "faebd7",
            aqua: "00ffff",
            aquamarine: "7fffd4",
            azure: "f0ffff",
            beige: "f5f5dc",
            bisque: "ffe4c4",
            black: "000000",
            blanchedalmond: "ffebcd",
            blue: "0000ff",
            blueviolet: "8a2be2",
            brown: "a52a2a",
            burlywood: "deb887",
            cadetblue: "5f9ea0",
            chartreuse: "7fff00",
            chocolate: "d2691e",
            coral: "ff7f50",
            cornflowerblue: "6495ed",
            cornsilk: "fff8dc",
            crimson: "dc143c",
            cyan: "00ffff",
            darkblue: "00008b",
            darkcyan: "008b8b",
            darkgoldenrod: "b8860b",
            darkgray: "a9a9a9",
            darkgreen: "006400",
            darkkhaki: "bdb76b",
            darkmagenta: "8b008b",
            darkolivegreen: "556b2f",
            darkorange: "ff8c00",
            darkorchid: "9932cc",
            darkred: "8b0000",
            darksalmon: "e9967a",
            darkseagreen: "8fbc8f",
            darkslateblue: "483d8b",
            darkslategray: "2f4f4f",
            darkturquoise: "00ced1",
            darkviolet: "9400d3",
            deeppink: "ff1493",
            deepskyblue: "00bfff",
            dimgray: "696969",
            dodgerblue: "1e90ff",
            feldspar: "d19275",
            firebrick: "b22222",
            floralwhite: "fffaf0",
            forestgreen: "228b22",
            fuchsia: "ff00ff",
            gainsboro: "dcdcdc",
            ghostwhite: "f8f8ff",
            gold: "ffd700",
            goldenrod: "daa520",
            gray: "808080",
            green: "008000",
            greenyellow: "adff2f",
            honeydew: "f0fff0",
            hotpink: "ff69b4",
            indianred: "cd5c5c",
            indigo: "4b0082",
            ivory: "fffff0",
            khaki: "f0e68c",
            lavender: "e6e6fa",
            lavenderblush: "fff0f5",
            lawngreen: "7cfc00",
            lemonchiffon: "fffacd",
            lightblue: "add8e6",
            lightcoral: "f08080",
            lightcyan: "e0ffff",
            lightgoldenrodyellow: "fafad2",
            lightgrey: "d3d3d3",
            lightgreen: "90ee90",
            lightpink: "ffb6c1",
            lightsalmon: "ffa07a",
            lightseagreen: "20b2aa",
            lightskyblue: "87cefa",
            lightslateblue: "8470ff",
            lightslategray: "778899",
            lightsteelblue: "b0c4de",
            lightyellow: "ffffe0",
            lime: "00ff00",
            limegreen: "32cd32",
            linen: "faf0e6",
            magenta: "ff00ff",
            maroon: "800000",
            mediumaquamarine: "66cdaa",
            mediumblue: "0000cd",
            mediumorchid: "ba55d3",
            mediumpurple: "9370d8",
            mediumseagreen: "3cb371",
            mediumslateblue: "7b68ee",
            mediumspringgreen: "00fa9a",
            mediumturquoise: "48d1cc",
            mediumvioletred: "c71585",
            midnightblue: "191970",
            mintcream: "f5fffa",
            mistyrose: "ffe4e1",
            moccasin: "ffe4b5",
            navajowhite: "ffdead",
            navy: "000080",
            oldlace: "fdf5e6",
            olive: "808000",
            olivedrab: "6b8e23",
            orange: "ffa500",
            orangered: "ff4500",
            orchid: "da70d6",
            palegoldenrod: "eee8aa",
            palegreen: "98fb98",
            paleturquoise: "afeeee",
            palevioletred: "d87093",
            papayawhip: "ffefd5",
            peachpuff: "ffdab9",
            peru: "cd853f",
            pink: "ffc0cb",
            plum: "dda0dd",
            powderblue: "b0e0e6",
            purple: "800080",
            red: "ff0000",
            rosybrown: "bc8f8f",
            royalblue: "4169e1",
            saddlebrown: "8b4513",
            salmon: "fa8072",
            sandybrown: "f4a460",
            seagreen: "2e8b57",
            seashell: "fff5ee",
            sienna: "a0522d",
            silver: "c0c0c0",
            skyblue: "87ceeb",
            slateblue: "6a5acd",
            slategray: "708090",
            snow: "fffafa",
            springgreen: "00ff7f",
            steelblue: "4682b4",
            tan: "d2b48c",
            teal: "008080",
            thistle: "d8bfd8",
            tomato: "ff6347",
            turquoise: "40e0d0",
            violet: "ee82ee",
            violetred: "d02090",
            wheat: "f5deb3",
            white: "ffffff",
            whitesmoke: "f5f5f5",
            yellow: "ffff00",
            yellowgreen: "9acd32"
        }[e = (e = e.replace(/ /g, "")).toLowerCase()] || e;
        for (var r = [{
            re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
            example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
            process: function(e) {
                return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3])]
            }
        }, {
            re: /^(\w{2})(\w{2})(\w{2})$/,
            example: ["#00ff00", "336699"],
            process: function(e) {
                return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
            }
        }, {
            re: /^(\w{1})(\w{1})(\w{1})$/,
            example: ["#fb0", "f0f"],
            process: function(e) {
                return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
            }
        }], a = 0; a < r.length; a++) {
            var n = r[a].re
              , o = r[a].process
              , l = n.exec(e);
            l && (t = o(l),
            this.r = t[0],
            this.g = t[1],
            this.b = t[2],
            this.ok = !0)
        }
        this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r,
        this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g,
        this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b,
        this.toRGB = function() {
            return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")"
        }
        ,
        this.toHex = function() {
            var e = this.r.toString(16)
              , t = this.g.toString(16)
              , r = this.b.toString(16);
            return 1 == e.length && (e = "0" + e),
            1 == t.length && (t = "0" + t),
            1 == r.length && (r = "0" + r),
            "#" + e + t + r
        }
    }
    function h(e) {
        if ("object" != typeof e)
            throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
        var r = {};
        this.subscribe = function(e, t, a) {
            if (a = a || !1,
            "string" != typeof e || "function" != typeof t || "boolean" != typeof a)
                throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
            r.hasOwnProperty(e) || (r[e] = {});
            var n = Math.random().toString(35);
            return r[e][n] = [t, !!a],
            n
        }
        ,
        this.unsubscribe = function(e) {
            for (var t in r)
                if (r[t][e])
                    return delete r[t][e],
                    0 === Object.keys(r[t]).length && delete r[t],
                    !0;
            return !1
        }
        ,
        this.publish = function(a) {
            if (r.hasOwnProperty(a)) {
                var o = Array.prototype.slice.call(arguments, 1)
                  , l = [];
                for (var i in r[a]) {
                    var s = r[a][i];
                    try {
                        s[0].apply(e, o)
                    } catch (e) {
                        t.console && n.error("jsPDF PubSub Error", e.message, e)
                    }
                    s[1] && l.push(i)
                }
                l.length && l.forEach(this.unsubscribe)
            }
        }
        ,
        this.getTopics = function() {
            return r
        }
    }
    function l(e) {
        if (!(this instanceof l))
            return new l(e);
        var t = "opacity,stroke-opacity".split(",");
        for (var r in e)
            e.hasOwnProperty(r) && t.indexOf(r) >= 0 && (this[r] = e[r]);
        this.id = "",
        this.objectNumber = -1
    }
    function f$6(e, t) {
        this.gState = e,
        this.matrix = t,
        this.id = "",
        this.objectNumber = -1
    }
    function d(e, t, r, a, n) {
        if (!(this instanceof d))
            return new d(e,t,r,a,n);
        this.type = "axial" === e ? 2 : 3,
        this.coords = t,
        this.colors = r,
        f$6.call(this, a, n)
    }
    function p(e, t, r, a, n) {
        if (!(this instanceof p))
            return new p(e,t,r,a,n);
        this.boundingBox = e,
        this.xStep = t,
        this.yStep = r,
        this.stream = "",
        this.cloneIndex = 0,
        f$6.call(this, a, n)
    }
    function g(e) {
        var r, a = "string" == typeof arguments[0] ? arguments[0] : "p", o = arguments[1], i = arguments[2], c = arguments[3], f = [], m = 1, y = 16, v = "S";
        "object" == typeof (e = e || {}) && (a = e.orientation,
        o = e.unit || o,
        i = e.format || i,
        c = e.compress || e.compressPdf || c,
        m = "number" == typeof e.userUnit ? Math.abs(e.userUnit) : 1,
        void 0 !== e.precision && (r = e.precision),
        void 0 !== e.floatPrecision && (y = e.floatPrecision),
        v = e.defaultPathOperation || "S"),
        f = e.filters || (!0 === c ? ["FlateEncode"] : f),
        o = o || "mm",
        a = ("" + (a || "P")).toLowerCase();
        var A = e.putOnlyUsedFonts || !1
          , b = {}
          , k = {
            internal: {},
            __private__: {}
        };
        k.__private__.PubSub = h;
        var w = "1.3"
          , x = k.__private__.getPdfVersion = function() {
            return w
        }
        ;
        k.__private__.setPdfVersion = function(e) {
            w = e
        }
        ;
        var S = {
            a0: [2383.94, 3370.39],
            a1: [1683.78, 2383.94],
            a2: [1190.55, 1683.78],
            a3: [841.89, 1190.55],
            a4: [595.28, 841.89],
            a5: [419.53, 595.28],
            a6: [297.64, 419.53],
            a7: [209.76, 297.64],
            a8: [147.4, 209.76],
            a9: [104.88, 147.4],
            a10: [73.7, 104.88],
            b0: [2834.65, 4008.19],
            b1: [2004.09, 2834.65],
            b2: [1417.32, 2004.09],
            b3: [1000.63, 1417.32],
            b4: [708.66, 1000.63],
            b5: [498.9, 708.66],
            b6: [354.33, 498.9],
            b7: [249.45, 354.33],
            b8: [175.75, 249.45],
            b9: [124.72, 175.75],
            b10: [87.87, 124.72],
            c0: [2599.37, 3676.54],
            c1: [1836.85, 2599.37],
            c2: [1298.27, 1836.85],
            c3: [918.43, 1298.27],
            c4: [649.13, 918.43],
            c5: [459.21, 649.13],
            c6: [323.15, 459.21],
            c7: [229.61, 323.15],
            c8: [161.57, 229.61],
            c9: [113.39, 161.57],
            c10: [79.37, 113.39],
            dl: [311.81, 623.62],
            letter: [612, 792],
            "government-letter": [576, 756],
            legal: [612, 1008],
            "junior-legal": [576, 360],
            ledger: [1224, 792],
            tabloid: [792, 1224],
            "credit-card": [153, 243]
        };
        k.__private__.getPageFormats = function() {
            return S
        }
        ;
        var _ = k.__private__.getPageFormat = function(e) {
            return S[e]
        }
        ;
        i = i || "a4";
        var C = {
            COMPAT: "compat",
            ADVANCED: "advanced"
        }
          , T = C.COMPAT;
        function E() {
            this.saveGraphicsState(),
            oe(new Me(be,0,0,-be,0,Ir() * be).toString() + " cm"),
            this.setFontSize(this.getFontSize() / be),
            v = "n",
            T = C.ADVANCED
        }
        function I() {
            this.restoreGraphicsState(),
            v = "S",
            T = C.COMPAT
        }
        k.advancedAPI = function(e) {
            var t = T === C.COMPAT;
            return t && E.call(this),
            "function" != typeof e || (e(this),
            t && I.call(this)),
            this
        }
        ,
        k.compatAPI = function(e) {
            var t = T === C.ADVANCED;
            return t && I.call(this),
            "function" != typeof e || (e(this),
            t && E.call(this)),
            this
        }
        ,
        k.isAdvancedAPI = function() {
            return T === C.ADVANCED
        }
        ;
        var R, B = function(e) {
            if (T !== C.ADVANCED)
                throw new Error(e + " is only available in 'advanced' API mode. You need to call advancedAPI() first.")
        }, N = k.roundToPrecision = k.__private__.roundToPrecision = function(e, t) {
            var a = r || t;
            if (isNaN(e) || isNaN(a))
                throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
            return e.toFixed(a).replace(/0+$/, "")
        }
        ;
        R = k.hpf = k.__private__.hpf = "number" == typeof y ? function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.hpf");
            return N(e, y)
        }
        : "smart" === y ? function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.hpf");
            return N(e, e > -1 && e < 1 ? 16 : 5)
        }
        : function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.hpf");
            return N(e, 16)
        }
        ;
        var F = k.f2 = k.__private__.f2 = function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.f2");
            return N(e, 2)
        }
          , P = k.__private__.f3 = function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.f3");
            return N(e, 3)
        }
          , $ = k.scale = k.__private__.scale = function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.scale");
            return T === C.COMPAT ? e * be : T === C.ADVANCED ? e : void 0
        }
          , L = function(e) {
            return T === C.COMPAT ? Ir() - e : T === C.ADVANCED ? e : void 0
        }
          , O = function(e) {
            return $(L(e))
        };
        k.__private__.setPrecision = k.setPrecision = function(e) {
            "number" == typeof parseInt(e, 10) && (r = parseInt(e, 10))
        }
        ;
        var D, M = "00000000000000000000000000000000", U = k.__private__.getFileId = function() {
            return M
        }
        , H = k.__private__.setFileId = function(e) {
            return M = void 0 !== e && /^[a-fA-F0-9]{32}$/.test(e) ? e.toUpperCase() : M.split("").map((function() {
                return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()))
            }
            )).join("")
        }
        ;
        k.setFileId = function(e) {
            return H(e),
            this
        }
        ,
        k.getFileId = function() {
            return U()
        }
        ;
        var q = k.__private__.convertDateToPDFDate = function(e) {
            var t = e.getTimezoneOffset()
              , r = t < 0 ? "+" : "-"
              , a = Math.floor(Math.abs(t / 60))
              , n = Math.abs(t % 60)
              , o = [r, G(a), "'", G(n), "'"].join("");
            return ["D:", e.getFullYear(), G(e.getMonth() + 1), G(e.getDate()), G(e.getHours()), G(e.getMinutes()), G(e.getSeconds()), o].join("")
        }
          , z = k.__private__.convertPDFDateToDate = function(e) {
            var t = parseInt(e.substr(2, 4), 10)
              , r = parseInt(e.substr(6, 2), 10) - 1
              , a = parseInt(e.substr(8, 2), 10)
              , n = parseInt(e.substr(10, 2), 10)
              , o = parseInt(e.substr(12, 2), 10)
              , l = parseInt(e.substr(14, 2), 10);
            return new Date(t,r,a,n,o,l,0)
        }
          , j = k.__private__.setCreationDate = function(e) {
            var t;
            if (void 0 === e && (e = new Date),
            e instanceof Date)
                t = q(e);
            else {
                if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))
                    throw new Error("Invalid argument passed to jsPDF.setCreationDate");
                t = e
            }
            return D = t
        }
          , V = k.__private__.getCreationDate = function(e) {
            var t = D;
            return "jsDate" === e && (t = z(D)),
            t
        }
        ;
        k.setCreationDate = function(e) {
            return j(e),
            this
        }
        ,
        k.getCreationDate = function(e) {
            return V(e)
        }
        ;
        var Q, G = k.__private__.padd2 = function(e) {
            return ("0" + parseInt(e)).slice(-2)
        }
        , K = k.__private__.padd2Hex = function(e) {
            return ("00" + (e = e.toString())).substr(e.length)
        }
        , W = 0, Y = [], X = [], J = 0, Z = [], ee = [], te = !1, re = X, ae = function() {
            W = 0,
            J = 0,
            X = [],
            Y = [],
            Z = [],
            Ge = je(),
            Ke = je()
        };
        k.__private__.setCustomOutputDestination = function(e) {
            te = !0,
            re = e
        }
        ;
        var ne = function(e) {
            te || (re = e)
        };
        k.__private__.resetCustomOutputDestination = function() {
            te = !1,
            re = X
        }
        ;
        var oe = k.__private__.out = function(e) {
            return e = e.toString(),
            J += e.length + 1,
            re.push(e),
            re
        }
          , le = k.__private__.write = function(e) {
            return oe(1 === arguments.length ? e.toString() : Array.prototype.join.call(arguments, " "))
        }
          , ie = k.__private__.getArrayBuffer = function(e) {
            for (var t = e.length, r = new ArrayBuffer(t), a = new Uint8Array(r); t--; )
                a[t] = e.charCodeAt(t);
            return r
        }
          , se = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
        k.__private__.getStandardFonts = function() {
            return se
        }
        ;
        var ce = e.fontSize || 16;
        k.__private__.setFontSize = k.setFontSize = function(e) {
            return ce = T === C.ADVANCED ? e / be : e,
            this
        }
        ;
        var ue, he = k.__private__.getFontSize = k.getFontSize = function() {
            return T === C.COMPAT ? ce : ce * be
        }
        , de = e.R2L || !1;
        k.__private__.setR2L = k.setR2L = function(e) {
            return de = e,
            this
        }
        ,
        k.__private__.getR2L = k.getR2L = function() {
            return de
        }
        ;
        var fe, me = k.__private__.setZoomMode = function(e) {
            if (/^\d*\.?\d*%$/.test(e))
                ue = e;
            else if (isNaN(e)) {
                if (-1 === [void 0, null, "fullwidth", "fullheight", "fullpage", "original"].indexOf(e))
                    throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + e + '" is not recognized.');
                ue = e
            } else
                ue = parseInt(e, 10)
        }
        ;
        k.__private__.getZoomMode = function() {
            return ue
        }
        ;
        var pe, ge = k.__private__.setPageMode = function(e) {
            if (-1 == [void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(e))
                throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + e + '" is not recognized.');
            fe = e
        }
        ;
        k.__private__.getPageMode = function() {
            return fe
        }
        ;
        var ye = k.__private__.setLayoutMode = function(e) {
            if (-1 == [void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(e))
                throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + e + '" is not recognized.');
            pe = e
        }
        ;
        k.__private__.getLayoutMode = function() {
            return pe
        }
        ,
        k.__private__.setDisplayMode = k.setDisplayMode = function(e, t, r) {
            return me(e),
            ye(t),
            ge(r),
            this
        }
        ;
        var ve = {
            title: "",
            subject: "",
            author: "",
            keywords: "",
            creator: ""
        };
        k.__private__.getDocumentProperty = function(e) {
            if (-1 === Object.keys(ve).indexOf(e))
                throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
            return ve[e]
        }
        ,
        k.__private__.getDocumentProperties = function() {
            return ve
        }
        ,
        k.__private__.setDocumentProperties = k.setProperties = k.setDocumentProperties = function(e) {
            for (var t in ve)
                ve.hasOwnProperty(t) && e[t] && (ve[t] = e[t]);
            return this
        }
        ,
        k.__private__.setDocumentProperty = function(e, t) {
            if (-1 === Object.keys(ve).indexOf(e))
                throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
            return ve[e] = t
        }
        ;
        var Ae, be, ke, we, xe, Se = {}, _e = {}, Ce = [], Te = {}, Ee = {}, Ie = {}, Re = {}, Be = null, Ne = 0, Fe = [], Pe = new h(k), $e = e.hotfixes || [], Le = {}, Oe = {}, De = [], Me = function(e, t, r, a, n, o) {
            if (!(this instanceof Me))
                return new Me(e,t,r,a,n,o);
            isNaN(e) && (e = 1),
            isNaN(t) && (t = 0),
            isNaN(r) && (r = 0),
            isNaN(a) && (a = 1),
            isNaN(n) && (n = 0),
            isNaN(o) && (o = 0),
            this._matrix = [e, t, r, a, n, o]
        };
        Object.defineProperty(Me.prototype, "sx", {
            get: function() {
                return this._matrix[0]
            },
            set: function(e) {
                this._matrix[0] = e
            }
        }),
        Object.defineProperty(Me.prototype, "shy", {
            get: function() {
                return this._matrix[1]
            },
            set: function(e) {
                this._matrix[1] = e
            }
        }),
        Object.defineProperty(Me.prototype, "shx", {
            get: function() {
                return this._matrix[2]
            },
            set: function(e) {
                this._matrix[2] = e
            }
        }),
        Object.defineProperty(Me.prototype, "sy", {
            get: function() {
                return this._matrix[3]
            },
            set: function(e) {
                this._matrix[3] = e
            }
        }),
        Object.defineProperty(Me.prototype, "tx", {
            get: function() {
                return this._matrix[4]
            },
            set: function(e) {
                this._matrix[4] = e
            }
        }),
        Object.defineProperty(Me.prototype, "ty", {
            get: function() {
                return this._matrix[5]
            },
            set: function(e) {
                this._matrix[5] = e
            }
        }),
        Object.defineProperty(Me.prototype, "a", {
            get: function() {
                return this._matrix[0]
            },
            set: function(e) {
                this._matrix[0] = e
            }
        }),
        Object.defineProperty(Me.prototype, "b", {
            get: function() {
                return this._matrix[1]
            },
            set: function(e) {
                this._matrix[1] = e
            }
        }),
        Object.defineProperty(Me.prototype, "c", {
            get: function() {
                return this._matrix[2]
            },
            set: function(e) {
                this._matrix[2] = e
            }
        }),
        Object.defineProperty(Me.prototype, "d", {
            get: function() {
                return this._matrix[3]
            },
            set: function(e) {
                this._matrix[3] = e
            }
        }),
        Object.defineProperty(Me.prototype, "e", {
            get: function() {
                return this._matrix[4]
            },
            set: function(e) {
                this._matrix[4] = e
            }
        }),
        Object.defineProperty(Me.prototype, "f", {
            get: function() {
                return this._matrix[5]
            },
            set: function(e) {
                this._matrix[5] = e
            }
        }),
        Object.defineProperty(Me.prototype, "rotation", {
            get: function() {
                return Math.atan2(this.shx, this.sx)
            }
        }),
        Object.defineProperty(Me.prototype, "scaleX", {
            get: function() {
                return this.decompose().scale.sx
            }
        }),
        Object.defineProperty(Me.prototype, "scaleY", {
            get: function() {
                return this.decompose().scale.sy
            }
        }),
        Object.defineProperty(Me.prototype, "isIdentity", {
            get: function() {
                return 1 === this.sx && 0 === this.shy && 0 === this.shx && 1 === this.sy && 0 === this.tx && 0 === this.ty
            }
        }),
        Me.prototype.join = function(e) {
            return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(R).join(e)
        }
        ,
        Me.prototype.multiply = function(e) {
            var t = e.sx * this.sx + e.shy * this.shx
              , r = e.sx * this.shy + e.shy * this.sy
              , a = e.shx * this.sx + e.sy * this.shx
              , n = e.shx * this.shy + e.sy * this.sy
              , o = e.tx * this.sx + e.ty * this.shx + this.tx
              , l = e.tx * this.shy + e.ty * this.sy + this.ty;
            return new Me(t,r,a,n,o,l)
        }
        ,
        Me.prototype.decompose = function() {
            var e = this.sx
              , t = this.shy
              , r = this.shx
              , a = this.sy
              , n = this.tx
              , o = this.ty
              , l = Math.sqrt(e * e + t * t)
              , i = (e /= l) * r + (t /= l) * a;
            r -= e * i,
            a -= t * i;
            var s = Math.sqrt(r * r + a * a);
            return i /= s,
            e * (a /= s) < t * (r /= s) && (e = -e,
            t = -t,
            i = -i,
            l = -l),
            {
                scale: new Me(l,0,0,s,0,0),
                translate: new Me(1,0,0,1,n,o),
                rotate: new Me(e,t,-t,e,0,0),
                skew: new Me(1,0,i,1,0,0)
            }
        }
        ,
        Me.prototype.toString = function(e) {
            return this.join(" ")
        }
        ,
        Me.prototype.inversed = function() {
            var e = this.sx
              , t = this.shy
              , r = this.shx
              , a = this.sy
              , n = this.tx
              , o = this.ty
              , l = 1 / (e * a - t * r)
              , i = a * l
              , s = -t * l
              , c = -r * l
              , u = e * l;
            return new Me(i,s,c,u,-i * n - c * o,-s * n - u * o)
        }
        ,
        Me.prototype.applyToPoint = function(e) {
            var t = e.x * this.sx + e.y * this.shx + this.tx
              , r = e.x * this.shy + e.y * this.sy + this.ty;
            return new kr(t,r)
        }
        ,
        Me.prototype.applyToRectangle = function(e) {
            var t = this.applyToPoint(e)
              , r = this.applyToPoint(new kr(e.x + e.w,e.y + e.h));
            return new wr(t.x,t.y,r.x - t.x,r.y - t.y)
        }
        ,
        Me.prototype.clone = function() {
            var e = this.sx
              , t = this.shy
              , r = this.shx
              , a = this.sy
              , n = this.tx
              , o = this.ty;
            return new Me(e,t,r,a,n,o)
        }
        ,
        k.Matrix = Me;
        var Ue = k.matrixMult = function(e, t) {
            return t.multiply(e)
        }
          , He = new Me(1,0,0,1,0,0);
        k.unitMatrix = k.identityMatrix = He;
        var qe = function(e, t) {
            if (!Ee[e]) {
                var r = (t instanceof d ? "Sh" : "P") + (Object.keys(Te).length + 1).toString(10);
                t.id = r,
                Ee[e] = r,
                Te[r] = t,
                Pe.publish("addPattern", t)
            }
        };
        k.ShadingPattern = d,
        k.TilingPattern = p,
        k.addShadingPattern = function(e, t) {
            return B("addShadingPattern()"),
            qe(e, t),
            this
        }
        ,
        k.beginTilingPattern = function(e) {
            B("beginTilingPattern()"),
            Sr(e.boundingBox[0], e.boundingBox[1], e.boundingBox[2] - e.boundingBox[0], e.boundingBox[3] - e.boundingBox[1], e.matrix)
        }
        ,
        k.endTilingPattern = function(e, t) {
            B("endTilingPattern()"),
            t.stream = ee[Q].join("\n"),
            qe(e, t),
            Pe.publish("endTilingPattern", t),
            De.pop().restore()
        }
        ;
        var ze = k.__private__.newObject = function() {
            var e = je();
            return Ve(e, !0),
            e
        }
          , je = k.__private__.newObjectDeferred = function() {
            return W++,
            Y[W] = function() {
                return J
            }
            ,
            W
        }
          , Ve = function(e, t) {
            return t = "boolean" == typeof t && t,
            Y[e] = J,
            t && oe(e + " 0 obj"),
            e
        }
          , Qe = k.__private__.newAdditionalObject = function() {
            var e = {
                objId: je(),
                content: ""
            };
            return Z.push(e),
            e
        }
          , Ge = je()
          , Ke = je()
          , We = k.__private__.decodeColorString = function(e) {
            var t = e.split(" ");
            if (2 !== t.length || "g" !== t[1] && "G" !== t[1])
                5 !== t.length || "k" !== t[4] && "K" !== t[4] || (t = [(1 - t[0]) * (1 - t[3]), (1 - t[1]) * (1 - t[3]), (1 - t[2]) * (1 - t[3]), "r"]);
            else {
                var r = parseFloat(t[0]);
                t = [r, r, r, "r"]
            }
            for (var a = "#", n = 0; n < 3; n++)
                a += ("0" + Math.floor(255 * parseFloat(t[n])).toString(16)).slice(-2);
            return a
        }
          , Ye = k.__private__.encodeColorString = function(e) {
            var t;
            "string" == typeof e && (e = {
                ch1: e
            });
            var r = e.ch1
              , a = e.ch2
              , n = e.ch3
              , o = e.ch4
              , l = "draw" === e.pdfColorType ? ["G", "RG", "K"] : ["g", "rg", "k"];
            if ("string" == typeof r && "#" !== r.charAt(0)) {
                var i = new c$1(r);
                if (i.ok)
                    r = i.toHex();
                else if (!/^\d*\.?\d*$/.test(r))
                    throw new Error('Invalid color "' + r + '" passed to jsPDF.encodeColorString.')
            }
            if ("string" == typeof r && /^#[0-9A-Fa-f]{3}$/.test(r) && (r = "#" + r[1] + r[1] + r[2] + r[2] + r[3] + r[3]),
            "string" == typeof r && /^#[0-9A-Fa-f]{6}$/.test(r)) {
                var s = parseInt(r.substr(1), 16);
                r = s >> 16 & 255,
                a = s >> 8 & 255,
                n = 255 & s
            }
            if (void 0 === a || void 0 === o && r === a && a === n)
                if ("string" == typeof r)
                    t = r + " " + l[0];
                else
                    switch (e.precision) {
                    case 2:
                        t = F(r / 255) + " " + l[0];
                        break;
                    case 3:
                    default:
                        t = P(r / 255) + " " + l[0]
                    }
            else if (void 0 === o || "object" == typeof o) {
                if (o && !isNaN(o.a) && 0 === o.a)
                    return ["1.", "1.", "1.", l[1]].join(" ");
                if ("string" == typeof r)
                    t = [r, a, n, l[1]].join(" ");
                else
                    switch (e.precision) {
                    case 2:
                        t = [F(r / 255), F(a / 255), F(n / 255), l[1]].join(" ");
                        break;
                    default:
                    case 3:
                        t = [P(r / 255), P(a / 255), P(n / 255), l[1]].join(" ")
                    }
            } else if ("string" == typeof r)
                t = [r, a, n, o, l[2]].join(" ");
            else
                switch (e.precision) {
                case 2:
                    t = [F(r), F(a), F(n), F(o), l[2]].join(" ");
                    break;
                case 3:
                default:
                    t = [P(r), P(a), P(n), P(o), l[2]].join(" ")
                }
            return t
        }
          , Xe = k.__private__.getFilters = function() {
            return f
        }
          , Je = k.__private__.putStream = function(e) {
            var t = (e = e || {}).data || ""
              , r = e.filters || Xe()
              , a = e.alreadyAppliedFilters || []
              , n = e.addLength1 || !1
              , o = t.length
              , l = {};
            !0 === r && (r = ["FlateEncode"]);
            var i = e.additionalKeyValues || []
              , s = (l = void 0 !== g.API.processDataByFilters ? g.API.processDataByFilters(t, r) : {
                data: t,
                reverseChain: []
            }).reverseChain + (Array.isArray(a) ? a.join(" ") : a.toString());
            if (0 !== l.data.length && (i.push({
                key: "Length",
                value: l.data.length
            }),
            !0 === n && i.push({
                key: "Length1",
                value: o
            })),
            0 != s.length)
                if (s.split("/").length - 1 == 1)
                    i.push({
                        key: "Filter",
                        value: s
                    });
                else {
                    i.push({
                        key: "Filter",
                        value: "[" + s + "]"
                    });
                    for (var c = 0; c < i.length; c += 1)
                        if ("DecodeParms" === i[c].key) {
                            for (var u = [], h = 0; h < l.reverseChain.split("/").length - 1; h += 1)
                                u.push("null");
                            u.push(i[c].value),
                            i[c].value = "[" + u.join(" ") + "]"
                        }
                }
            oe("<<");
            for (var d = 0; d < i.length; d++)
                oe("/" + i[d].key + " " + i[d].value);
            oe(">>"),
            0 !== l.data.length && (oe("stream"),
            oe(l.data),
            oe("endstream"))
        }
          , Ze = k.__private__.putPage = function(e) {
            var t = e.number
              , r = e.data
              , a = e.objId
              , n = e.contentsObjId;
            Ve(a, !0),
            oe("<</Type /Page"),
            oe("/Parent " + e.rootDictionaryObjId + " 0 R"),
            oe("/Resources " + e.resourceDictionaryObjId + " 0 R"),
            oe("/MediaBox [" + parseFloat(R(e.mediaBox.bottomLeftX)) + " " + parseFloat(R(e.mediaBox.bottomLeftY)) + " " + R(e.mediaBox.topRightX) + " " + R(e.mediaBox.topRightY) + "]"),
            null !== e.cropBox && oe("/CropBox [" + R(e.cropBox.bottomLeftX) + " " + R(e.cropBox.bottomLeftY) + " " + R(e.cropBox.topRightX) + " " + R(e.cropBox.topRightY) + "]"),
            null !== e.bleedBox && oe("/BleedBox [" + R(e.bleedBox.bottomLeftX) + " " + R(e.bleedBox.bottomLeftY) + " " + R(e.bleedBox.topRightX) + " " + R(e.bleedBox.topRightY) + "]"),
            null !== e.trimBox && oe("/TrimBox [" + R(e.trimBox.bottomLeftX) + " " + R(e.trimBox.bottomLeftY) + " " + R(e.trimBox.topRightX) + " " + R(e.trimBox.topRightY) + "]"),
            null !== e.artBox && oe("/ArtBox [" + R(e.artBox.bottomLeftX) + " " + R(e.artBox.bottomLeftY) + " " + R(e.artBox.topRightX) + " " + R(e.artBox.topRightY) + "]"),
            "number" == typeof e.userUnit && 1 !== e.userUnit && oe("/UserUnit " + e.userUnit),
            Pe.publish("putPage", {
                objId: a,
                pageContext: Fe[t],
                pageNumber: t,
                page: r
            }),
            oe("/Contents " + n + " 0 R"),
            oe(">>"),
            oe("endobj");
            var o = r.join("\n");
            return T === C.ADVANCED && (o += "\nQ"),
            Ve(n, !0),
            Je({
                data: o,
                filters: Xe()
            }),
            oe("endobj"),
            a
        }
          , et = k.__private__.putPages = function() {
            var e, t, r = [];
            for (e = 1; e <= Ne; e++)
                Fe[e].objId = je(),
                Fe[e].contentsObjId = je();
            for (e = 1; e <= Ne; e++)
                r.push(Ze({
                    number: e,
                    data: ee[e],
                    objId: Fe[e].objId,
                    contentsObjId: Fe[e].contentsObjId,
                    mediaBox: Fe[e].mediaBox,
                    cropBox: Fe[e].cropBox,
                    bleedBox: Fe[e].bleedBox,
                    trimBox: Fe[e].trimBox,
                    artBox: Fe[e].artBox,
                    userUnit: Fe[e].userUnit,
                    rootDictionaryObjId: Ge,
                    resourceDictionaryObjId: Ke
                }));
            Ve(Ge, !0),
            oe("<</Type /Pages");
            var a = "/Kids [";
            for (t = 0; t < Ne; t++)
                a += r[t] + " 0 R ";
            oe(a + "]"),
            oe("/Count " + Ne),
            oe(">>"),
            oe("endobj"),
            Pe.publish("postPutPages")
        }
          , tt = function(e) {
            var t = function(e, t) {
                return -1 !== e.indexOf(" ") ? "(" + St(e, t) + ")" : St(e, t)
            };
            Pe.publish("putFont", {
                font: e,
                out: oe,
                newObject: ze,
                putStream: Je,
                pdfEscapeWithNeededParanthesis: t
            }),
            !0 !== e.isAlreadyPutted && (e.objectNumber = ze(),
            oe("<<"),
            oe("/Type /Font"),
            oe("/BaseFont /" + t(e.postScriptName)),
            oe("/Subtype /Type1"),
            "string" == typeof e.encoding && oe("/Encoding /" + e.encoding),
            oe("/FirstChar 32"),
            oe("/LastChar 255"),
            oe(">>"),
            oe("endobj"))
        }
          , rt = function() {
            for (var e in Se)
                Se.hasOwnProperty(e) && (!1 === A || !0 === A && b.hasOwnProperty(e)) && tt(Se[e])
        }
          , at = function(e) {
            e.objectNumber = ze();
            var t = [];
            t.push({
                key: "Type",
                value: "/XObject"
            }),
            t.push({
                key: "Subtype",
                value: "/Form"
            }),
            t.push({
                key: "BBox",
                value: "[" + [R(e.x), R(e.y), R(e.x + e.width), R(e.y + e.height)].join(" ") + "]"
            }),
            t.push({
                key: "Matrix",
                value: "[" + e.matrix.toString() + "]"
            });
            var r = e.pages[1].join("\n");
            Je({
                data: r,
                additionalKeyValues: t
            }),
            oe("endobj")
        }
          , nt = function() {
            for (var e in Le)
                Le.hasOwnProperty(e) && at(Le[e])
        }
          , ot = function(e, t) {
            var r, a = [], n = 1 / (t - 1);
            for (r = 0; r < 1; r += n)
                a.push(r);
            if (a.push(1),
            0 != e[0].offset) {
                var o = {
                    offset: 0,
                    color: e[0].color
                };
                e.unshift(o)
            }
            if (1 != e[e.length - 1].offset) {
                var l = {
                    offset: 1,
                    color: e[e.length - 1].color
                };
                e.push(l)
            }
            for (var i = "", s = 0, c = 0; c < a.length; c++) {
                for (r = a[c]; r > e[s + 1].offset; )
                    s++;
                var u = e[s].offset
                  , h = (r - u) / (e[s + 1].offset - u)
                  , d = e[s].color
                  , f = e[s + 1].color;
                i += K(Math.round((1 - h) * d[0] + h * f[0]).toString(16)) + K(Math.round((1 - h) * d[1] + h * f[1]).toString(16)) + K(Math.round((1 - h) * d[2] + h * f[2]).toString(16))
            }
            return i.trim()
        }
          , lt = function(e, t) {
            t || (t = 21);
            var r = ze()
              , a = ot(e.colors, t)
              , n = [];
            n.push({
                key: "FunctionType",
                value: "0"
            }),
            n.push({
                key: "Domain",
                value: "[0.0 1.0]"
            }),
            n.push({
                key: "Size",
                value: "[" + t + "]"
            }),
            n.push({
                key: "BitsPerSample",
                value: "8"
            }),
            n.push({
                key: "Range",
                value: "[0.0 1.0 0.0 1.0 0.0 1.0]"
            }),
            n.push({
                key: "Decode",
                value: "[0.0 1.0 0.0 1.0 0.0 1.0]"
            }),
            Je({
                data: a,
                additionalKeyValues: n,
                alreadyAppliedFilters: ["/ASCIIHexDecode"]
            }),
            oe("endobj"),
            e.objectNumber = ze(),
            oe("<< /ShadingType " + e.type),
            oe("/ColorSpace /DeviceRGB");
            var o = "/Coords [" + R(parseFloat(e.coords[0])) + " " + R(parseFloat(e.coords[1])) + " ";
            2 === e.type ? o += R(parseFloat(e.coords[2])) + " " + R(parseFloat(e.coords[3])) : o += R(parseFloat(e.coords[2])) + " " + R(parseFloat(e.coords[3])) + " " + R(parseFloat(e.coords[4])) + " " + R(parseFloat(e.coords[5])),
            oe(o += "]"),
            e.matrix && oe("/Matrix [" + e.matrix.toString() + "]"),
            oe("/Function " + r + " 0 R"),
            oe("/Extend [true true]"),
            oe(">>"),
            oe("endobj")
        }
          , it = function(e, t) {
            var r = je()
              , a = ze();
            t.push({
                resourcesOid: r,
                objectOid: a
            }),
            e.objectNumber = a;
            var n = [];
            n.push({
                key: "Type",
                value: "/Pattern"
            }),
            n.push({
                key: "PatternType",
                value: "1"
            }),
            n.push({
                key: "PaintType",
                value: "1"
            }),
            n.push({
                key: "TilingType",
                value: "1"
            }),
            n.push({
                key: "BBox",
                value: "[" + e.boundingBox.map(R).join(" ") + "]"
            }),
            n.push({
                key: "XStep",
                value: R(e.xStep)
            }),
            n.push({
                key: "YStep",
                value: R(e.yStep)
            }),
            n.push({
                key: "Resources",
                value: r + " 0 R"
            }),
            e.matrix && n.push({
                key: "Matrix",
                value: "[" + e.matrix.toString() + "]"
            }),
            Je({
                data: e.stream,
                additionalKeyValues: n
            }),
            oe("endobj")
        }
          , st = function(e) {
            var t;
            for (t in Te)
                Te.hasOwnProperty(t) && (Te[t]instanceof d ? lt(Te[t]) : Te[t]instanceof p && it(Te[t], e))
        }
          , ct = function(e) {
            for (var t in e.objectNumber = ze(),
            oe("<<"),
            e)
                switch (t) {
                case "opacity":
                    oe("/ca " + F(e[t]));
                    break;
                case "stroke-opacity":
                    oe("/CA " + F(e[t]))
                }
            oe(">>"),
            oe("endobj")
        }
          , ut = function() {
            var e;
            for (e in Ie)
                Ie.hasOwnProperty(e) && ct(Ie[e])
        }
          , ht = function() {
            for (var e in oe("/XObject <<"),
            Le)
                Le.hasOwnProperty(e) && Le[e].objectNumber >= 0 && oe("/" + e + " " + Le[e].objectNumber + " 0 R");
            Pe.publish("putXobjectDict"),
            oe(">>")
        }
          , dt = function() {
            for (var e in oe("/Font <<"),
            Se)
                Se.hasOwnProperty(e) && (!1 === A || !0 === A && b.hasOwnProperty(e)) && oe("/" + e + " " + Se[e].objectNumber + " 0 R");
            oe(">>")
        }
          , ft = function() {
            if (Object.keys(Te).length > 0) {
                for (var e in oe("/Shading <<"),
                Te)
                    Te.hasOwnProperty(e) && Te[e]instanceof d && Te[e].objectNumber >= 0 && oe("/" + e + " " + Te[e].objectNumber + " 0 R");
                Pe.publish("putShadingPatternDict"),
                oe(">>")
            }
        }
          , mt = function(e) {
            if (Object.keys(Te).length > 0) {
                for (var t in oe("/Pattern <<"),
                Te)
                    Te.hasOwnProperty(t) && Te[t]instanceof k.TilingPattern && Te[t].objectNumber >= 0 && Te[t].objectNumber < e && oe("/" + t + " " + Te[t].objectNumber + " 0 R");
                Pe.publish("putTilingPatternDict"),
                oe(">>")
            }
        }
          , pt = function() {
            if (Object.keys(Ie).length > 0) {
                var e;
                for (e in oe("/ExtGState <<"),
                Ie)
                    Ie.hasOwnProperty(e) && Ie[e].objectNumber >= 0 && oe("/" + e + " " + Ie[e].objectNumber + " 0 R");
                Pe.publish("putGStateDict"),
                oe(">>")
            }
        }
          , gt = function(e) {
            Ve(e.resourcesOid, !0),
            oe("<<"),
            oe("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),
            dt(),
            ft(),
            mt(e.objectOid),
            pt(),
            ht(),
            oe(">>"),
            oe("endobj")
        }
          , yt = function() {
            var e = [];
            rt(),
            ut(),
            nt(),
            st(e),
            Pe.publish("putResources"),
            e.forEach(gt),
            gt({
                resourcesOid: Ke,
                objectOid: Number.MAX_SAFE_INTEGER
            }),
            Pe.publish("postPutResources")
        }
          , vt = function() {
            Pe.publish("putAdditionalObjects");
            for (var e = 0; e < Z.length; e++) {
                var t = Z[e];
                Ve(t.objId, !0),
                oe(t.content),
                oe("endobj")
            }
            Pe.publish("postPutAdditionalObjects")
        }
          , At = function(e) {
            _e[e.fontName] = _e[e.fontName] || {},
            _e[e.fontName][e.fontStyle] = e.id
        }
          , bt = function(e, t, r, a, n) {
            var o = {
                id: "F" + (Object.keys(Se).length + 1).toString(10),
                postScriptName: e,
                fontName: t,
                fontStyle: r,
                encoding: a,
                isStandardFont: n || !1,
                metadata: {}
            };
            return Pe.publish("addFont", {
                font: o,
                instance: this
            }),
            Se[o.id] = o,
            At(o),
            o.id
        }
          , kt = function(e) {
            for (var t = 0, r = se.length; t < r; t++) {
                var a = bt.call(this, e[t][0], e[t][1], e[t][2], se[t][3], !0);
                !1 === A && (b[a] = !0);
                var n = e[t][0].split("-");
                At({
                    id: a,
                    fontName: n[0],
                    fontStyle: n[1] || ""
                })
            }
            Pe.publish("addFonts", {
                fonts: Se,
                dictionary: _e
            })
        }
          , wt = function(e) {
            return e.foo = function() {
                try {
                    return e.apply(this, arguments)
                } catch (e) {
                    var r = e.stack || "";
                    ~r.indexOf(" at ") && (r = r.split(" at ")[1]);
                    var a = "Error in function " + r.split("\n")[0].split("<")[0] + ": " + e.message;
                    if (!t.console)
                        throw new Error(a);
                    t.console.error(a, e),
                    t.alert && alert(a)
                }
            }
            ,
            e.foo.bar = e,
            e.foo
        }
          , xt = function(e, t) {
            var r, a, n, o, l, i, s, c, u;
            if (n = (t = t || {}).sourceEncoding || "Unicode",
            l = t.outputEncoding,
            (t.autoencode || l) && Se[Ae].metadata && Se[Ae].metadata[n] && Se[Ae].metadata[n].encoding && (o = Se[Ae].metadata[n].encoding,
            !l && Se[Ae].encoding && (l = Se[Ae].encoding),
            !l && o.codePages && (l = o.codePages[0]),
            "string" == typeof l && (l = o[l]),
            l)) {
                for (s = !1,
                i = [],
                r = 0,
                a = e.length; r < a; r++)
                    (c = l[e.charCodeAt(r)]) ? i.push(String.fromCharCode(c)) : i.push(e[r]),
                    i[r].charCodeAt(0) >> 8 && (s = !0);
                e = i.join("")
            }
            for (r = e.length; void 0 === s && 0 !== r; )
                e.charCodeAt(r - 1) >> 8 && (s = !0),
                r--;
            if (!s)
                return e;
            for (i = t.noBOM ? [] : [254, 255],
            r = 0,
            a = e.length; r < a; r++) {
                if ((u = (c = e.charCodeAt(r)) >> 8) >> 8)
                    throw new Error("Character at position " + r + " of string '" + e + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
                i.push(u),
                i.push(c - (u << 8))
            }
            return String.fromCharCode.apply(void 0, i)
        }
          , St = k.__private__.pdfEscape = k.pdfEscape = function(e, t) {
            return xt(e, t).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)")
        }
          , _t = k.__private__.beginPage = function(e) {
            ee[++Ne] = [],
            Fe[Ne] = {
                objId: 0,
                contentsObjId: 0,
                userUnit: Number(m),
                artBox: null,
                bleedBox: null,
                cropBox: null,
                trimBox: null,
                mediaBox: {
                    bottomLeftX: 0,
                    bottomLeftY: 0,
                    topRightX: Number(e[0]),
                    topRightY: Number(e[1])
                }
            },
            Et(Ne),
            ne(ee[Q])
        }
          , Ct = function(e, t) {
            var r, o, l;
            switch (a = t || a,
            "string" == typeof e && (r = _(e.toLowerCase()),
            Array.isArray(r) && (o = r[0],
            l = r[1])),
            Array.isArray(e) && (o = e[0] * be,
            l = e[1] * be),
            isNaN(o) && (o = i[0],
            l = i[1]),
            (o > 14400 || l > 14400) && (n.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),
            o = Math.min(14400, o),
            l = Math.min(14400, l)),
            i = [o, l],
            a.substr(0, 1)) {
            case "l":
                l > o && (i = [l, o]);
                break;
            case "p":
                o > l && (i = [l, o])
            }
            _t(i),
            nr(ar),
            oe(dr),
            0 !== vr && oe(vr + " J"),
            0 !== Ar && oe(Ar + " j"),
            Pe.publish("addPage", {
                pageNumber: Ne
            })
        }
          , Tt = function(e) {
            e > 0 && e <= Ne && (ee.splice(e, 1),
            Fe.splice(e, 1),
            Ne--,
            Q > Ne && (Q = Ne),
            this.setPage(Q))
        }
          , Et = function(e) {
            e > 0 && e <= Ne && (Q = e)
        }
          , It = k.__private__.getNumberOfPages = k.getNumberOfPages = function() {
            return ee.length - 1
        }
          , Rt = function(e, t, r) {
            var a, o = void 0;
            return r = r || {},
            e = void 0 !== e ? e : Se[Ae].fontName,
            t = void 0 !== t ? t : Se[Ae].fontStyle,
            a = e.toLowerCase(),
            void 0 !== _e[a] && void 0 !== _e[a][t] ? o = _e[a][t] : void 0 !== _e[e] && void 0 !== _e[e][t] ? o = _e[e][t] : !1 === r.disableWarning && n.warn("Unable to look up font label for font '" + e + "', '" + t + "'. Refer to getFontList() for available fonts."),
            o || r.noFallback || null == (o = _e.times[t]) && (o = _e.times.normal),
            o
        }
          , Bt = k.__private__.putInfo = function() {
            for (var e in ze(),
            oe("<<"),
            oe("/Producer (jsPDF " + g.version + ")"),
            ve)
                ve.hasOwnProperty(e) && ve[e] && oe("/" + e.substr(0, 1).toUpperCase() + e.substr(1) + " (" + St(ve[e]) + ")");
            oe("/CreationDate (" + D + ")"),
            oe(">>"),
            oe("endobj")
        }
          , Nt = k.__private__.putCatalog = function(e) {
            var t = (e = e || {}).rootDictionaryObjId || Ge;
            switch (ze(),
            oe("<<"),
            oe("/Type /Catalog"),
            oe("/Pages " + t + " 0 R"),
            ue || (ue = "fullwidth"),
            ue) {
            case "fullwidth":
                oe("/OpenAction [3 0 R /FitH null]");
                break;
            case "fullheight":
                oe("/OpenAction [3 0 R /FitV null]");
                break;
            case "fullpage":
                oe("/OpenAction [3 0 R /Fit]");
                break;
            case "original":
                oe("/OpenAction [3 0 R /XYZ null null 1]");
                break;
            default:
                var r = "" + ue;
                "%" === r.substr(r.length - 1) && (ue = parseInt(ue) / 100),
                "number" == typeof ue && oe("/OpenAction [3 0 R /XYZ null null " + F(ue) + "]")
            }
            switch (pe || (pe = "continuous"),
            pe) {
            case "continuous":
                oe("/PageLayout /OneColumn");
                break;
            case "single":
                oe("/PageLayout /SinglePage");
                break;
            case "two":
            case "twoleft":
                oe("/PageLayout /TwoColumnLeft");
                break;
            case "tworight":
                oe("/PageLayout /TwoColumnRight")
            }
            fe && oe("/PageMode /" + fe),
            Pe.publish("putCatalog"),
            oe(">>"),
            oe("endobj")
        }
          , Ft = k.__private__.putTrailer = function() {
            oe("trailer"),
            oe("<<"),
            oe("/Size " + (W + 1)),
            oe("/Root " + W + " 0 R"),
            oe("/Info " + (W - 1) + " 0 R"),
            oe("/ID [ <" + M + "> <" + M + "> ]"),
            oe(">>")
        }
          , Pt = k.__private__.putHeader = function() {
            oe("%PDF-" + w),
            oe("%ºß¬à")
        }
          , $t = k.__private__.putXRef = function() {
            var e = "0000000000";
            oe("xref"),
            oe("0 " + (W + 1)),
            oe("0000000000 65535 f ");
            for (var t = 1; t <= W; t++)
                "function" == typeof Y[t] ? oe((e + Y[t]()).slice(-10) + " 00000 n ") : void 0 !== Y[t] ? oe((e + Y[t]).slice(-10) + " 00000 n ") : oe("0000000000 00000 n ")
        }
          , Lt = k.__private__.buildDocument = function() {
            ae(),
            ne(X),
            Pe.publish("buildDocument"),
            Pt(),
            et(),
            vt(),
            yt(),
            Bt(),
            Nt();
            var e = J;
            return $t(),
            Ft(),
            oe("startxref"),
            oe("" + e),
            oe("%%EOF"),
            ne(ee[Q]),
            X.join("\n")
        }
          , Ot = k.__private__.getBlob = function(e) {
            return new Blob([ie(e)],{
                type: "application/pdf"
            })
        }
          , Dt = k.output = k.__private__.output = wt((function(e, r) {
            switch ("string" == typeof (r = r || {}) ? r = {
                filename: r
            } : r.filename = r.filename || "generated.pdf",
            e) {
            case void 0:
                return Lt();
            case "save":
                k.save(r.filename);
                break;
            case "arraybuffer":
                return ie(Lt());
            case "blob":
                return Ot(Lt());
            case "bloburi":
            case "bloburl":
                if (void 0 !== t.URL && "function" == typeof t.URL.createObjectURL)
                    return t.URL && t.URL.createObjectURL(Ot(Lt())) || void 0;
                n.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
                break;
            case "datauristring":
            case "dataurlstring":
                var a = ""
                  , o = Lt();
                try {
                    a = s(o)
                } catch (e) {
                    a = s(unescape(encodeURIComponent(o)))
                }
                return "data:application/pdf;filename=" + r.filename + ";base64," + a;
            case "pdfobjectnewwindow":
                if ("[object Window]" === Object.prototype.toString.call(t)) {
                    var l = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="' + (r.pdfObjectUrl || "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js") + '"><\/script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(r) + ");<\/script></body></html>"
                      , i = t.open();
                    return null !== i && i.document.write(l),
                    i
                }
                throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
            case "pdfjsnewwindow":
                if ("[object Window]" === Object.prototype.toString.call(t)) {
                    var c = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="' + (r.pdfJsUrl || "examples/PDF.js/web/viewer.html") + "?file=&downloadName=" + r.filename + '" width="500px" height="400px" /></body></html>'
                      , u = t.open();
                    if (null !== u) {
                        u.document.write(c);
                        var h = this;
                        u.document.documentElement.querySelector("#pdfViewer").onload = function() {
                            u.document.title = r.filename,
                            u.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(h.output("bloburl"))
                        }
                    }
                    return u
                }
                throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
            case "dataurlnewwindow":
                if ("[object Window]" !== Object.prototype.toString.call(t))
                    throw new Error("The option dataurlnewwindow just works in a browser-environment.");
                var d = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="' + this.output("datauristring", r) + '"></iframe></body></html>'
                  , f = t.open();
                if (null !== f && (f.document.write(d),
                f.document.title = r.filename),
                f || "undefined" == typeof safari)
                    return f;
                break;
            case "datauri":
            case "dataurl":
                return t.document.location.href = this.output("datauristring", r);
            default:
                return null
            }
        }
        ))
          , Mt = function(e) {
            return !0 === Array.isArray($e) && $e.indexOf(e) > -1
        };
        switch (o) {
        case "pt":
            be = 1;
            break;
        case "mm":
            be = 72 / 25.4;
            break;
        case "cm":
            be = 72 / 2.54;
            break;
        case "in":
            be = 72;
            break;
        case "px":
            be = 1 == Mt("px_scaling") ? .75 : 96 / 72;
            break;
        case "pc":
        case "em":
            be = 12;
            break;
        case "ex":
            be = 6;
            break;
        default:
            throw new Error("Invalid unit: " + o)
        }
        j(),
        H();
        var Ut = k.__private__.getPageInfo = k.getPageInfo = function(e) {
            if (isNaN(e) || e % 1 != 0)
                throw new Error("Invalid argument passed to jsPDF.getPageInfo");
            return {
                objId: Fe[e].objId,
                pageNumber: e,
                pageContext: Fe[e]
            }
        }
          , Ht = k.__private__.getPageInfoByObjId = function(e) {
            if (isNaN(e) || e % 1 != 0)
                throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
            for (var t in Fe)
                if (Fe[t].objId === e)
                    break;
            return Ut(t)
        }
          , qt = k.__private__.getCurrentPageInfo = k.getCurrentPageInfo = function() {
            return {
                objId: Fe[Q].objId,
                pageNumber: Q,
                pageContext: Fe[Q]
            }
        }
        ;
        k.addPage = function() {
            return Ct.apply(this, arguments),
            this
        }
        ,
        k.setPage = function() {
            return Et.apply(this, arguments),
            ne.call(this, ee[Q]),
            this
        }
        ,
        k.insertPage = function(e) {
            return this.addPage(),
            this.movePage(Q, e),
            this
        }
        ,
        k.movePage = function(e, t) {
            var r, a;
            if (e > t) {
                r = ee[e],
                a = Fe[e];
                for (var n = e; n > t; n--)
                    ee[n] = ee[n - 1],
                    Fe[n] = Fe[n - 1];
                ee[t] = r,
                Fe[t] = a,
                this.setPage(t)
            } else if (e < t) {
                r = ee[e],
                a = Fe[e];
                for (var o = e; o < t; o++)
                    ee[o] = ee[o + 1],
                    Fe[o] = Fe[o + 1];
                ee[t] = r,
                Fe[t] = a,
                this.setPage(t)
            }
            return this
        }
        ,
        k.deletePage = function() {
            return Tt.apply(this, arguments),
            this
        }
        ,
        k.__private__.text = k.text = function(e, t, r, a, n) {
            var o, l, i, s, c, u, h, d, f = (a = a || {}).scope || this;
            if ("number" == typeof e && "number" == typeof t && ("string" == typeof r || Array.isArray(r))) {
                var m = r;
                r = t,
                t = e,
                e = m
            }
            if (arguments[3]instanceof Me == 0 ? (i = arguments[4],
            s = arguments[5],
            "object" == typeof (h = arguments[3]) && null !== h || ("string" == typeof i && (s = i,
            i = null),
            "string" == typeof h && (s = h,
            h = null),
            "number" == typeof h && (i = h,
            h = null),
            a = {
                flags: h,
                angle: i,
                align: s
            })) : (B("The transform parameter of text() with a Matrix value"),
            d = n),
            isNaN(t) || isNaN(r) || null == e)
                throw new Error("Invalid arguments passed to jsPDF.text");
            if (0 === e.length)
                return f;
            var p = ""
              , g = !1
              , y = "number" == typeof a.lineHeightFactor ? a.lineHeightFactor : rr
              , v = f.internal.scaleFactor;
            function A(e) {
                return e = e.split("\t").join(Array(a.TabLen || 9).join(" ")),
                St(e, h)
            }
            function k(e) {
                for (var t, r = e.concat(), a = [], n = r.length; n--; )
                    "string" == typeof (t = r.shift()) ? a.push(t) : Array.isArray(e) && (1 === t.length || void 0 === t[1] && void 0 === t[2]) ? a.push(t[0]) : a.push([t[0], t[1], t[2]]);
                return a
            }
            function w(e, t) {
                var r;
                if ("string" == typeof e)
                    r = t(e)[0];
                else if (Array.isArray(e)) {
                    for (var a, n, o = e.concat(), l = [], i = o.length; i--; )
                        "string" == typeof (a = o.shift()) ? l.push(t(a)[0]) : Array.isArray(a) && "string" == typeof a[0] && (n = t(a[0], a[1], a[2]),
                        l.push([n[0], n[1], n[2]]));
                    r = l
                }
                return r
            }
            var x = !1
              , S = !0;
            if ("string" == typeof e)
                x = !0;
            else if (Array.isArray(e)) {
                var _ = e.concat();
                l = [];
                for (var E, I = _.length; I--; )
                    ("string" != typeof (E = _.shift()) || Array.isArray(E) && "string" != typeof E[0]) && (S = !1);
                x = S
            }
            if (!1 === x)
                throw new Error('Type of text must be string or Array. "' + e + '" is not recognized.');
            "string" == typeof e && (e = e.match(/[\r?\n]/) ? e.split(/\r\n|\r|\n/g) : [e]);
            var N = ce / f.internal.scaleFactor
              , F = N * (rr - 1);
            switch (a.baseline) {
            case "bottom":
                r -= F;
                break;
            case "top":
                r += N - F;
                break;
            case "hanging":
                r += N - 2 * F;
                break;
            case "middle":
                r += N / 2 - F
            }
            if ((u = a.maxWidth || 0) > 0 && ("string" == typeof e ? e = f.splitTextToSize(e, u) : "[object Array]" === Object.prototype.toString.call(e) && (e = f.splitTextToSize(e.join(" "), u))),
            o = {
                text: e,
                x: t,
                y: r,
                options: a,
                mutex: {
                    pdfEscape: St,
                    activeFontKey: Ae,
                    fonts: Se,
                    activeFontSize: ce
                }
            },
            Pe.publish("preProcessText", o),
            e = o.text,
            i = (a = o.options).angle,
            d instanceof Me == 0 && i && "number" == typeof i) {
                i *= Math.PI / 180,
                0 === a.rotationDirection && (i = -i),
                T === C.ADVANCED && (i = -i);
                var P = Math.cos(i)
                  , L = Math.sin(i);
                d = new Me(P,L,-L,P,0,0)
            } else
                i && i instanceof Me && (d = i);
            T !== C.ADVANCED || d || (d = He),
            void 0 !== (c = a.charSpace || gr) && (p += R($(c)) + " Tc\n",
            this.setCharSpace(this.getCharSpace() || 0)),
            a.lang;
            var O = -1
              , D = void 0 !== a.renderingMode ? a.renderingMode : a.stroke
              , M = f.internal.getCurrentPageInfo().pageContext;
            switch (D) {
            case 0:
            case !1:
            case "fill":
                O = 0;
                break;
            case 1:
            case !0:
            case "stroke":
                O = 1;
                break;
            case 2:
            case "fillThenStroke":
                O = 2;
                break;
            case 3:
            case "invisible":
                O = 3;
                break;
            case 4:
            case "fillAndAddForClipping":
                O = 4;
                break;
            case 5:
            case "strokeAndAddPathForClipping":
                O = 5;
                break;
            case 6:
            case "fillThenStrokeAndAddToPathForClipping":
                O = 6;
                break;
            case 7:
            case "addToPathForClipping":
                O = 7
            }
            var U = void 0 !== M.usedRenderingMode ? M.usedRenderingMode : -1;
            -1 !== O ? p += O + " Tr\n" : -1 !== U && (p += "0 Tr\n"),
            -1 !== O && (M.usedRenderingMode = O),
            s = a.align || "left";
            var H, q = ce * y, z = f.internal.pageSize.getWidth(), j = Se[Ae];
            c = a.charSpace || gr,
            u = a.maxWidth || 0,
            h = {};
            var V = [];
            if ("[object Array]" === Object.prototype.toString.call(e)) {
                var Q;
                l = k(e),
                "left" !== s && (H = l.map((function(e) {
                    return f.getStringUnitWidth(e, {
                        font: j,
                        charSpace: c,
                        fontSize: ce,
                        doKerning: !1
                    }) * ce / v
                }
                )));
                var G, K = 0;
                if ("right" === s) {
                    t -= H[0],
                    e = [],
                    I = l.length;
                    for (var W = 0; W < I; W++)
                        0 === W ? (G = sr(t),
                        Q = cr(r)) : (G = $(K - H[W]),
                        Q = -q),
                        e.push([l[W], G, Q]),
                        K = H[W]
                } else if ("center" === s) {
                    t -= H[0] / 2,
                    e = [],
                    I = l.length;
                    for (var Y = 0; Y < I; Y++)
                        0 === Y ? (G = sr(t),
                        Q = cr(r)) : (G = $((K - H[Y]) / 2),
                        Q = -q),
                        e.push([l[Y], G, Q]),
                        K = H[Y]
                } else if ("left" === s) {
                    e = [],
                    I = l.length;
                    for (var X = 0; X < I; X++)
                        e.push(l[X])
                } else {
                    if ("justify" !== s)
                        throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
                    e = [],
                    I = l.length,
                    u = 0 !== u ? u : z;
                    for (var J = 0; J < I; J++)
                        Q = 0 === J ? cr(r) : -q,
                        G = 0 === J ? sr(t) : 0,
                        J < I - 1 && V.push(R($((u - H[J]) / (l[J].split(" ").length - 1)))),
                        e.push([l[J], G, Q])
                }
            }
            var Z = "boolean" == typeof a.R2L ? a.R2L : de;
            !0 === Z && (e = w(e, (function(e, t, r) {
                return [e.split("").reverse().join(""), t, r]
            }
            ))),
            o = {
                text: e,
                x: t,
                y: r,
                options: a,
                mutex: {
                    pdfEscape: St,
                    activeFontKey: Ae,
                    fonts: Se,
                    activeFontSize: ce
                }
            },
            Pe.publish("postProcessText", o),
            e = o.text,
            g = o.mutex.isHex || !1;
            var ee = Se[Ae].encoding;
            "WinAnsiEncoding" !== ee && "StandardEncoding" !== ee || (e = w(e, (function(e, t, r) {
                return [A(e), t, r]
            }
            ))),
            l = k(e),
            e = [];
            for (var te, re, ae, ne = 0, le = 1, ie = Array.isArray(l[0]) ? le : ne, se = "", ue = function(e, t, r) {
                var n = "";
                return r instanceof Me ? (r = "number" == typeof a.angle ? Ue(r, new Me(1,0,0,1,e,t)) : Ue(new Me(1,0,0,1,e,t), r),
                T === C.ADVANCED && (r = Ue(new Me(1,0,0,-1,0,0), r)),
                n = r.join(" ") + " Tm\n") : n = R(e) + " " + R(t) + " Td\n",
                n
            }, he = 0; he < l.length; he++) {
                switch (se = "",
                ie) {
                case le:
                    ae = (g ? "<" : "(") + l[he][0] + (g ? ">" : ")"),
                    te = parseFloat(l[he][1]),
                    re = parseFloat(l[he][2]);
                    break;
                case ne:
                    ae = (g ? "<" : "(") + l[he] + (g ? ">" : ")"),
                    te = sr(t),
                    re = cr(r)
                }
                void 0 !== V && void 0 !== V[he] && (se = V[he] + " Tw\n"),
                0 === he ? e.push(se + ue(te, re, d) + ae) : ie === ne ? e.push(se + ae) : ie === le && e.push(se + ue(te, re, d) + ae)
            }
            e = ie === ne ? e.join(" Tj\nT* ") : e.join(" Tj\n"),
            e += " Tj\n";
            var fe = "BT\n/";
            return fe += Ae + " " + ce + " Tf\n",
            fe += R(ce * y) + " TL\n",
            fe += mr + "\n",
            fe += p,
            fe += e,
            oe(fe += "ET"),
            b[Ae] = !0,
            f
        }
        ;
        var zt = k.__private__.clip = k.clip = function(e) {
            return oe("evenodd" === e ? "W*" : "W"),
            this
        }
        ;
        k.clipEvenOdd = function() {
            return zt("evenodd")
        }
        ,
        k.__private__.discardPath = k.discardPath = function() {
            return oe("n"),
            this
        }
        ;
        var jt = k.__private__.isValidStyle = function(e) {
            var t = !1;
            return -1 !== [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(e) && (t = !0),
            t
        }
        ;
        k.__private__.setDefaultPathOperation = k.setDefaultPathOperation = function(e) {
            return jt(e) && (v = e),
            this
        }
        ;
        var Vt = k.__private__.getStyle = k.getStyle = function(e) {
            var t = v;
            switch (e) {
            case "D":
            case "S":
                t = "S";
                break;
            case "F":
                t = "f";
                break;
            case "FD":
            case "DF":
                t = "B";
                break;
            case "f":
            case "f*":
            case "B":
            case "B*":
                t = e
            }
            return t
        }
          , Qt = k.close = function() {
            return oe("h"),
            this
        }
        ;
        k.stroke = function() {
            return oe("S"),
            this
        }
        ,
        k.fill = function(e) {
            return Gt("f", e),
            this
        }
        ,
        k.fillEvenOdd = function(e) {
            return Gt("f*", e),
            this
        }
        ,
        k.fillStroke = function(e) {
            return Gt("B", e),
            this
        }
        ,
        k.fillStrokeEvenOdd = function(e) {
            return Gt("B*", e),
            this
        }
        ;
        var Gt = function(e, t) {
            "object" == typeof t ? Yt(t, e) : oe(e)
        }
          , Kt = function(e) {
            null === e || T === C.ADVANCED && void 0 === e || (e = Vt(e),
            oe(e))
        };
        function Wt(e, t, r, a, n) {
            var o = new p(t || this.boundingBox,r || this.xStep,a || this.yStep,this.gState,n || this.matrix);
            o.stream = this.stream;
            var l = e + "$$" + this.cloneIndex++ + "$$";
            return qe(l, o),
            o
        }
        var Yt = function(e, t) {
            var r = Ee[e.key]
              , a = Te[r];
            if (a instanceof d)
                oe("q"),
                oe(Xt(t)),
                a.gState && k.setGState(a.gState),
                oe(e.matrix.toString() + " cm"),
                oe("/" + r + " sh"),
                oe("Q");
            else if (a instanceof p) {
                var n = new Me(1,0,0,-1,0,Ir());
                e.matrix && (n = n.multiply(e.matrix || He),
                r = Wt.call(a, e.key, e.boundingBox, e.xStep, e.yStep, n).id),
                oe("q"),
                oe("/Pattern cs"),
                oe("/" + r + " scn"),
                a.gState && k.setGState(a.gState),
                oe(t),
                oe("Q")
            }
        }
          , Xt = function(e) {
            switch (e) {
            case "f":
            case "F":
                return "W n";
            case "f*":
                return "W* n";
            case "B":
                return "W S";
            case "B*":
                return "W* S";
            case "S":
                return "W S";
            case "n":
                return "W n"
            }
        }
          , Jt = k.moveTo = function(e, t) {
            return oe(R($(e)) + " " + R(O(t)) + " m"),
            this
        }
          , Zt = k.lineTo = function(e, t) {
            return oe(R($(e)) + " " + R(O(t)) + " l"),
            this
        }
          , er = k.curveTo = function(e, t, r, a, n, o) {
            return oe([R($(e)), R(O(t)), R($(r)), R(O(a)), R($(n)), R(O(o)), "c"].join(" ")),
            this
        }
        ;
        k.__private__.line = k.line = function(e, t, r, a, n) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || !jt(n))
                throw new Error("Invalid arguments passed to jsPDF.line");
            return T === C.COMPAT ? this.lines([[r - e, a - t]], e, t, [1, 1], n || "S") : this.lines([[r - e, a - t]], e, t, [1, 1]).stroke()
        }
        ,
        k.__private__.lines = k.lines = function(e, t, r, a, n, o) {
            var l, i, s, c, u, h, d, f, m, p, g, y;
            if ("number" == typeof e && (y = r,
            r = t,
            t = e,
            e = y),
            a = a || [1, 1],
            o = o || !1,
            isNaN(t) || isNaN(r) || !Array.isArray(e) || !Array.isArray(a) || !jt(n) || "boolean" != typeof o)
                throw new Error("Invalid arguments passed to jsPDF.lines");
            for (Jt(t, r),
            l = a[0],
            i = a[1],
            c = e.length,
            p = t,
            g = r,
            s = 0; s < c; s++)
                2 === (u = e[s]).length ? (p = u[0] * l + p,
                g = u[1] * i + g,
                Zt(p, g)) : (h = u[0] * l + p,
                d = u[1] * i + g,
                f = u[2] * l + p,
                m = u[3] * i + g,
                p = u[4] * l + p,
                g = u[5] * i + g,
                er(h, d, f, m, p, g));
            return o && Qt(),
            Kt(n),
            this
        }
        ,
        k.path = function(e) {
            for (var t = 0; t < e.length; t++) {
                var r = e[t]
                  , a = r.c;
                switch (r.op) {
                case "m":
                    Jt(a[0], a[1]);
                    break;
                case "l":
                    Zt(a[0], a[1]);
                    break;
                case "c":
                    er.apply(this, a);
                    break;
                case "h":
                    Qt()
                }
            }
            return this
        }
        ,
        k.__private__.rect = k.rect = function(e, t, r, a, n) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || !jt(n))
                throw new Error("Invalid arguments passed to jsPDF.rect");
            return T === C.COMPAT && (a = -a),
            oe([R($(e)), R(O(t)), R($(r)), R($(a)), "re"].join(" ")),
            Kt(n),
            this
        }
        ,
        k.__private__.triangle = k.triangle = function(e, t, r, a, n, o, l) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || isNaN(n) || isNaN(o) || !jt(l))
                throw new Error("Invalid arguments passed to jsPDF.triangle");
            return this.lines([[r - e, a - t], [n - r, o - a], [e - n, t - o]], e, t, [1, 1], l, !0),
            this
        }
        ,
        k.__private__.roundedRect = k.roundedRect = function(e, t, r, a, n, o, l) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || isNaN(n) || isNaN(o) || !jt(l))
                throw new Error("Invalid arguments passed to jsPDF.roundedRect");
            var i = 4 / 3 * (Math.SQRT2 - 1);
            return n = Math.min(n, .5 * r),
            o = Math.min(o, .5 * a),
            this.lines([[r - 2 * n, 0], [n * i, 0, n, o - o * i, n, o], [0, a - 2 * o], [0, o * i, -n * i, o, -n, o], [2 * n - r, 0], [-n * i, 0, -n, -o * i, -n, -o], [0, 2 * o - a], [0, -o * i, n * i, -o, n, -o]], e + n, t, [1, 1], l, !0),
            this
        }
        ,
        k.__private__.ellipse = k.ellipse = function(e, t, r, a, n) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || !jt(n))
                throw new Error("Invalid arguments passed to jsPDF.ellipse");
            var o = 4 / 3 * (Math.SQRT2 - 1) * r
              , l = 4 / 3 * (Math.SQRT2 - 1) * a;
            return Jt(e + r, t),
            er(e + r, t - l, e + o, t - a, e, t - a),
            er(e - o, t - a, e - r, t - l, e - r, t),
            er(e - r, t + l, e - o, t + a, e, t + a),
            er(e + o, t + a, e + r, t + l, e + r, t),
            Kt(n),
            this
        }
        ,
        k.__private__.circle = k.circle = function(e, t, r, a) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || !jt(a))
                throw new Error("Invalid arguments passed to jsPDF.circle");
            return this.ellipse(e, t, r, r, a)
        }
        ,
        k.setFont = function(e, t) {
            return Ae = Rt(e, t, {
                disableWarning: !1
            }),
            this
        }
        ;
        var tr = k.__private__.getFont = k.getFont = function() {
            return Se[Rt.apply(k, arguments)]
        }
        ;
        k.__private__.getFontList = k.getFontList = function() {
            var e, t, r = {};
            for (e in _e)
                if (_e.hasOwnProperty(e))
                    for (t in r[e] = [],
                    _e[e])
                        _e[e].hasOwnProperty(t) && r[e].push(t);
            return r
        }
        ,
        k.addFont = function(e, t, r, a) {
            return a = a || "Identity-H",
            bt.call(this, e, t, r, a)
        }
        ;
        var rr, ar = e.lineWidth || .200025, nr = k.__private__.setLineWidth = k.setLineWidth = function(e) {
            return oe(R($(e)) + " w"),
            this
        }
        ;
        k.__private__.setLineDash = g.API.setLineDash = g.API.setLineDashPattern = function(e, t) {
            if (e = e || [],
            t = t || 0,
            isNaN(t) || !Array.isArray(e))
                throw new Error("Invalid arguments passed to jsPDF.setLineDash");
            return e = e.map((function(e) {
                return R($(e))
            }
            )).join(" "),
            t = R($(t)),
            oe("[" + e + "] " + t + " d"),
            this
        }
        ;
        var or = k.__private__.getLineHeight = k.getLineHeight = function() {
            return ce * rr
        }
        ;
        k.__private__.getLineHeight = k.getLineHeight = function() {
            return ce * rr
        }
        ;
        var lr = k.__private__.setLineHeightFactor = k.setLineHeightFactor = function(e) {
            return "number" == typeof (e = e || 1.15) && (rr = e),
            this
        }
          , ir = k.__private__.getLineHeightFactor = k.getLineHeightFactor = function() {
            return rr
        }
        ;
        lr(e.lineHeight);
        var sr = k.__private__.getHorizontalCoordinate = function(e) {
            return $(e)
        }
          , cr = k.__private__.getVerticalCoordinate = function(e) {
            return T === C.ADVANCED ? e : Fe[Q].mediaBox.topRightY - Fe[Q].mediaBox.bottomLeftY - $(e)
        }
          , ur = k.__private__.getHorizontalCoordinateString = k.getHorizontalCoordinateString = function(e) {
            return R(sr(e))
        }
          , hr = k.__private__.getVerticalCoordinateString = k.getVerticalCoordinateString = function(e) {
            return R(cr(e))
        }
          , dr = e.strokeColor || "0 G";
        k.__private__.getStrokeColor = k.getDrawColor = function() {
            return We(dr)
        }
        ,
        k.__private__.setStrokeColor = k.setDrawColor = function(e, t, r, a) {
            return dr = Ye({
                ch1: e,
                ch2: t,
                ch3: r,
                ch4: a,
                pdfColorType: "draw",
                precision: 2
            }),
            oe(dr),
            this
        }
        ;
        var fr = e.fillColor || "0 g";
        k.__private__.getFillColor = k.getFillColor = function() {
            return We(fr)
        }
        ,
        k.__private__.setFillColor = k.setFillColor = function(e, t, r, a) {
            return fr = Ye({
                ch1: e,
                ch2: t,
                ch3: r,
                ch4: a,
                pdfColorType: "fill",
                precision: 2
            }),
            oe(fr),
            this
        }
        ;
        var mr = e.textColor || "0 g"
          , pr = k.__private__.getTextColor = k.getTextColor = function() {
            return We(mr)
        }
        ;
        k.__private__.setTextColor = k.setTextColor = function(e, t, r, a) {
            return mr = Ye({
                ch1: e,
                ch2: t,
                ch3: r,
                ch4: a,
                pdfColorType: "text",
                precision: 3
            }),
            this
        }
        ;
        var gr = e.charSpace
          , yr = k.__private__.getCharSpace = k.getCharSpace = function() {
            return parseFloat(gr || 0)
        }
        ;
        k.__private__.setCharSpace = k.setCharSpace = function(e) {
            if (isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.setCharSpace");
            return gr = e,
            this
        }
        ;
        var vr = 0;
        k.CapJoinStyles = {
            0: 0,
            butt: 0,
            but: 0,
            miter: 0,
            1: 1,
            round: 1,
            rounded: 1,
            circle: 1,
            2: 2,
            projecting: 2,
            project: 2,
            square: 2,
            bevel: 2
        },
        k.__private__.setLineCap = k.setLineCap = function(e) {
            var t = k.CapJoinStyles[e];
            if (void 0 === t)
                throw new Error("Line cap style of '" + e + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
            return vr = t,
            oe(t + " J"),
            this
        }
        ;
        var Ar = 0;
        k.__private__.setLineJoin = k.setLineJoin = function(e) {
            var t = k.CapJoinStyles[e];
            if (void 0 === t)
                throw new Error("Line join style of '" + e + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
            return Ar = t,
            oe(t + " j"),
            this
        }
        ,
        k.__private__.setLineMiterLimit = k.__private__.setMiterLimit = k.setLineMiterLimit = k.setMiterLimit = function(e) {
            if (e = e || 0,
            isNaN(e))
                throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
            return oe(R($(e)) + " M"),
            this
        }
        ,
        k.GState = l,
        k.setGState = function(e) {
            (e = "string" == typeof e ? Ie[Re[e]] : br(null, e)).equals(Be) || (oe("/" + e.id + " gs"),
            Be = e)
        }
        ;
        var br = function(e, t) {
            if (!e || !Re[e]) {
                var r = !1;
                for (var a in Ie)
                    if (Ie.hasOwnProperty(a) && Ie[a].equals(t)) {
                        r = !0;
                        break
                    }
                if (r)
                    t = Ie[a];
                else {
                    var n = "GS" + (Object.keys(Ie).length + 1).toString(10);
                    Ie[n] = t,
                    t.id = n
                }
                return e && (Re[e] = t.id),
                Pe.publish("addGState", t),
                t
            }
        };
        k.addGState = function(e, t) {
            return br(e, t),
            this
        }
        ,
        k.saveGraphicsState = function() {
            return oe("q"),
            Ce.push({
                key: Ae,
                size: ce,
                color: mr
            }),
            this
        }
        ,
        k.restoreGraphicsState = function() {
            oe("Q");
            var e = Ce.pop();
            return Ae = e.key,
            ce = e.size,
            mr = e.color,
            Be = null,
            this
        }
        ,
        k.setCurrentTransformationMatrix = function(e) {
            return oe(e.toString() + " cm"),
            this
        }
        ,
        k.comment = function(e) {
            return oe("#" + e),
            this
        }
        ;
        var kr = function(e, t) {
            var r = e || 0;
            Object.defineProperty(this, "x", {
                enumerable: !0,
                get: function() {
                    return r
                },
                set: function(e) {
                    isNaN(e) || (r = parseFloat(e))
                }
            });
            var a = t || 0;
            Object.defineProperty(this, "y", {
                enumerable: !0,
                get: function() {
                    return a
                },
                set: function(e) {
                    isNaN(e) || (a = parseFloat(e))
                }
            });
            var n = "pt";
            return Object.defineProperty(this, "type", {
                enumerable: !0,
                get: function() {
                    return n
                },
                set: function(e) {
                    n = e.toString()
                }
            }),
            this
        }
          , wr = function(e, t, r, a) {
            kr.call(this, e, t),
            this.type = "rect";
            var n = r || 0;
            Object.defineProperty(this, "w", {
                enumerable: !0,
                get: function() {
                    return n
                },
                set: function(e) {
                    isNaN(e) || (n = parseFloat(e))
                }
            });
            var o = a || 0;
            return Object.defineProperty(this, "h", {
                enumerable: !0,
                get: function() {
                    return o
                },
                set: function(e) {
                    isNaN(e) || (o = parseFloat(e))
                }
            }),
            this
        }
          , xr = function() {
            this.page = Ne,
            this.currentPage = Q,
            this.pages = ee.slice(0),
            this.pagesContext = Fe.slice(0),
            this.x = ke,
            this.y = we,
            this.matrix = xe,
            this.width = Tr(Q),
            this.height = Ir(Q),
            this.outputDestination = re,
            this.id = "",
            this.objectNumber = -1
        };
        xr.prototype.restore = function() {
            Ne = this.page,
            Q = this.currentPage,
            Fe = this.pagesContext,
            ee = this.pages,
            ke = this.x,
            we = this.y,
            xe = this.matrix,
            Er(Q, this.width),
            Rr(Q, this.height),
            re = this.outputDestination
        }
        ;
        var Sr = function(e, t, r, a, n) {
            De.push(new xr),
            Ne = Q = 0,
            ee = [],
            ke = e,
            we = t,
            xe = n,
            _t([r, a])
        }
          , _r = function(e) {
            if (!Oe[e]) {
                var t = new xr
                  , r = "Xo" + (Object.keys(Le).length + 1).toString(10);
                t.id = r,
                Oe[e] = r,
                Le[r] = t,
                Pe.publish("addFormObject", t),
                De.pop().restore()
            }
        };
        for (var Cr in k.beginFormObject = function(e, t, r, a, n) {
            return Sr(e, t, r, a, n),
            this
        }
        ,
        k.endFormObject = function(e) {
            return _r(e),
            this
        }
        ,
        k.doFormObject = function(e, t) {
            var r = Le[Oe[e]];
            return oe("q"),
            oe(t.toString() + " cm"),
            oe("/" + r.id + " Do"),
            oe("Q"),
            this
        }
        ,
        k.getFormObject = function(e) {
            var t = Le[Oe[e]];
            return {
                x: t.x,
                y: t.y,
                width: t.width,
                height: t.height,
                matrix: t.matrix
            }
        }
        ,
        k.save = function(e, r) {
            return e = e || "generated.pdf",
            (r = r || {}).returnPromise = r.returnPromise || !1,
            !1 === r.returnPromise ? (u(Ot(Lt()), e),
            "function" == typeof u.unload && t.setTimeout && setTimeout(u.unload, 911),
            this) : new Promise((function(r, a) {
                try {
                    var n = u(Ot(Lt()), e);
                    "function" == typeof u.unload && t.setTimeout && setTimeout(u.unload, 911),
                    r(n)
                } catch (e) {
                    a(e.message)
                }
            }
            ))
        }
        ,
        g.API)
            g.API.hasOwnProperty(Cr) && ("events" === Cr && g.API.events.length ? function(e, t) {
                var r, a, n;
                for (n = t.length - 1; -1 !== n; n--)
                    r = t[n][0],
                    a = t[n][1],
                    e.subscribe.apply(e, [r].concat("function" == typeof a ? [a] : a))
            }(Pe, g.API.events) : k[Cr] = g.API[Cr]);
        var Tr = k.getPageWidth = function(e) {
            return (Fe[e = e || Q].mediaBox.topRightX - Fe[e].mediaBox.bottomLeftX) / be
        }
          , Er = k.setPageWidth = function(e, t) {
            Fe[e].mediaBox.topRightX = t * be + Fe[e].mediaBox.bottomLeftX
        }
          , Ir = k.getPageHeight = function(e) {
            return (Fe[e = e || Q].mediaBox.topRightY - Fe[e].mediaBox.bottomLeftY) / be
        }
          , Rr = k.setPageHeight = function(e, t) {
            Fe[e].mediaBox.topRightY = t * be + Fe[e].mediaBox.bottomLeftY
        }
        ;
        return k.internal = {
            pdfEscape: St,
            getStyle: Vt,
            getFont: tr,
            getFontSize: he,
            getCharSpace: yr,
            getTextColor: pr,
            getLineHeight: or,
            getLineHeightFactor: ir,
            write: le,
            getHorizontalCoordinate: sr,
            getVerticalCoordinate: cr,
            getCoordinateString: ur,
            getVerticalCoordinateString: hr,
            collections: {},
            newObject: ze,
            newAdditionalObject: Qe,
            newObjectDeferred: je,
            newObjectDeferredBegin: Ve,
            getFilters: Xe,
            putStream: Je,
            events: Pe,
            scaleFactor: be,
            pageSize: {
                getWidth: function() {
                    return Tr(Q)
                },
                setWidth: function(e) {
                    Er(Q, e)
                },
                getHeight: function() {
                    return Ir(Q)
                },
                setHeight: function(e) {
                    Rr(Q, e)
                }
            },
            output: Dt,
            getNumberOfPages: It,
            pages: ee,
            out: oe,
            f2: F,
            f3: P,
            getPageInfo: Ut,
            getPageInfoByObjId: Ht,
            getCurrentPageInfo: qt,
            getPDFVersion: x,
            Point: kr,
            Rectangle: wr,
            Matrix: Me,
            hasHotfix: Mt
        },
        Object.defineProperty(k.internal.pageSize, "width", {
            get: function() {
                return Tr(Q)
            },
            set: function(e) {
                Er(Q, e)
            },
            enumerable: !0,
            configurable: !0
        }),
        Object.defineProperty(k.internal.pageSize, "height", {
            get: function() {
                return Ir(Q)
            },
            set: function(e) {
                Rr(Q, e)
            },
            enumerable: !0,
            configurable: !0
        }),
        kt.call(k, se),
        Ae = "F1",
        Ct(i, a),
        Pe.publish("initialized"),
        k
    }
    o = t.atob,
    s = t.btoa,
    l.prototype.equals = function(e) {
        var t, r = "id,objectNumber,equals";
        if (!e || typeof e != typeof this)
            return !1;
        var a = 0;
        for (t in this)
            if (!(r.indexOf(t) >= 0)) {
                if (this.hasOwnProperty(t) && !e.hasOwnProperty(t))
                    return !1;
                if (this[t] !== e[t])
                    return !1;
                a++
            }
        for (t in e)
            e.hasOwnProperty(t) && r.indexOf(t) < 0 && a--;
        return 0 === a
    }
    ,
    g.API = {
        events: []
    },
    g.version = "2.1.1";
    var m, v = g.API, b = 1, y = function(e) {
        return e.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)")
    }, w = function(e) {
        return e.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")")
    }, N = function(e) {
        return e.toFixed(2)
    }, L = function(e) {
        return e.toFixed(5)
    };
    v.__acroform__ = {};
    var x = function(e, t) {
        e.prototype = Object.create(t.prototype),
        e.prototype.constructor = e
    }
      , A = function(e) {
        return e * b
    }
      , _ = function(e) {
        var t = new J
          , r = ut.internal.getHeight(e) || 0
          , a = ut.internal.getWidth(e) || 0;
        return t.BBox = [0, 0, Number(N(a)), Number(N(r))],
        t
    }
      , S = v.__acroform__.setBit = function(e, t) {
        if (e = e || 0,
        t = t || 0,
        isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
        return e | 1 << t
    }
      , P = v.__acroform__.clearBit = function(e, t) {
        if (e = e || 0,
        t = t || 0,
        isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
        return e & ~(1 << t)
    }
      , k = v.__acroform__.getBit = function(e, t) {
        if (isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
        return 0 == (e & 1 << t) ? 0 : 1
    }
      , F = v.__acroform__.getBitForPdf = function(e, t) {
        if (isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
        return k(e, t - 1)
    }
      , I = v.__acroform__.setBitForPdf = function(e, t) {
        if (isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
        return S(e, t - 1)
    }
      , C = v.__acroform__.clearBitForPdf = function(e, t) {
        if (isNaN(e) || isNaN(t))
            throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
        return P(e, t - 1)
    }
      , j$2 = v.__acroform__.calculateCoordinates = function(e) {
        var t = this.internal.getHorizontalCoordinate
          , r = this.internal.getVerticalCoordinate
          , a = e[0]
          , n = e[1]
          , o = e[2]
          , l = e[3]
          , i = {};
        return i.lowerLeft_X = t(a) || 0,
        i.lowerLeft_Y = r(n + l) || 0,
        i.upperRight_X = t(a + o) || 0,
        i.upperRight_Y = r(n) || 0,
        [Number(N(i.lowerLeft_X)), Number(N(i.lowerLeft_Y)), Number(N(i.upperRight_X)), Number(N(i.upperRight_Y))]
    }
      , B = function(e) {
        if (e.appearanceStreamContent)
            return e.appearanceStreamContent;
        if (e.V || e.DV) {
            var t = []
              , r = e.V || e.DV
              , a = O(e, r)
              , n = m.internal.getFont(e.fontName, e.fontStyle).id;
            t.push("/Tx BMC"),
            t.push("q"),
            t.push("BT"),
            t.push(m.__private__.encodeColorString(e.color)),
            t.push("/" + n + " " + N(a.fontSize) + " Tf"),
            t.push("1 0 0 1 0 0 Tm"),
            t.push(a.text),
            t.push("ET"),
            t.push("Q"),
            t.push("EMC");
            var o = new _(e);
            return o.stream = t.join("\n"),
            o
        }
    }
      , O = function(e, t) {
        var r = 0 === e.fontSize ? e.maxFontSize : e.fontSize
          , a = {
            text: "",
            fontSize: ""
        }
          , n = (t = ")" == (t = "(" == t.substr(0, 1) ? t.substr(1) : t).substr(t.length - 1) ? t.substr(0, t.length - 1) : t).split(" ")
          , o = r
          , l = ut.internal.getHeight(e) || 0;
        l = l < 0 ? -l : l;
        var i = ut.internal.getWidth(e) || 0;
        i = i < 0 ? -i : i;
        var s = function(t, r, a) {
            if (t + 1 < n.length) {
                var o = r + " " + n[t + 1];
                return M(o, e, a).width <= i - 4
            }
            return !1
        };
        o++;
        e: for (; o > 0; ) {
            t = "",
            o--;
            var c, u, h = M("3", e, o).height, d = e.multiline ? l - o : (l - h) / 2, f = d += 2, m = 0, p = 0;
            if (o <= 0) {
                t = "(...) Tj\n",
                t += "% Width of Text: " + M(t, e, o = 12).width + ", FieldWidth:" + i + "\n";
                break
            }
            var g = ""
              , v = 0;
            for (var A in n)
                if (n.hasOwnProperty(A)) {
                    g = " " == (g += n[A] + " ").substr(g.length - 1) ? g.substr(0, g.length - 1) : g;
                    var b = parseInt(A)
                      , k = s(b, g, o)
                      , w = A >= n.length - 1;
                    if (k && !w) {
                        g += " ";
                        continue
                    }
                    if (k || w) {
                        if (w)
                            p = b;
                        else if (e.multiline && (h + 2) * (v + 2) + 2 > l)
                            continue e
                    } else {
                        if (!e.multiline)
                            continue e;
                        if ((h + 2) * (v + 2) + 2 > l)
                            continue e;
                        p = b
                    }
                    for (var x = "", S = m; S <= p; S++)
                        x += n[S] + " ";
                    switch (x = " " == x.substr(x.length - 1) ? x.substr(0, x.length - 1) : x,
                    u = M(x, e, o).width,
                    e.textAlign) {
                    case "right":
                        c = i - u - 2;
                        break;
                    case "center":
                        c = (i - u) / 2;
                        break;
                    case "left":
                    default:
                        c = 2
                    }
                    t += N(c) + " " + N(f) + " Td\n",
                    t += "(" + y(x) + ") Tj\n",
                    t += -N(c) + " 0 Td\n",
                    f = -(o + 2),
                    u = 0,
                    m = p + 1,
                    v++,
                    g = ""
                }
            break
        }
        return a.text = t,
        a.fontSize = o,
        a
    }
      , M = function(e, t, r) {
        var a = m.internal.getFont(t.fontName, t.fontStyle)
          , n = m.getStringUnitWidth(e, {
            font: a,
            fontSize: parseFloat(r),
            charSpace: 0
        }) * parseFloat(r);
        return {
            height: m.getStringUnitWidth("3", {
                font: a,
                fontSize: parseFloat(r),
                charSpace: 0
            }) * parseFloat(r) * 1.5,
            width: n
        }
    }
      , E = {
        fields: [],
        xForms: [],
        acroFormDictionaryRoot: null,
        printedOut: !1,
        internal: null,
        isInitialized: !1
    }
      , q = function() {
        m.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
        var e = m.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
        for (var t in e)
            if (e.hasOwnProperty(t)) {
                var r = e[t];
                r.objId = void 0,
                r.hasAnnotation && T.call(m, r)
            }
    }
      , R = function(e) {
        m.internal.acroformPlugin.printedOut && (m.internal.acroformPlugin.printedOut = !1,
        m.internal.acroformPlugin.acroFormDictionaryRoot = null),
        m.internal.acroformPlugin.acroFormDictionaryRoot || W.call(m),
        m.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e)
    }
      , T = function(e) {
        var t = {
            type: "reference",
            object: e
        };
        void 0 === m.internal.getPageInfo(e.page).pageContext.annotations.find((function(e) {
            return e.type === t.type && e.object === t.object
        }
        )) && m.internal.getPageInfo(e.page).pageContext.annotations.push(t)
    }
      , D = function() {
        if (void 0 === m.internal.acroformPlugin.acroFormDictionaryRoot)
            throw new Error("putCatalogCallback: Root missing.");
        m.internal.write("/AcroForm " + m.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R")
    }
      , U = function() {
        m.internal.events.unsubscribe(m.internal.acroformPlugin.acroFormDictionaryRoot._eventID),
        delete m.internal.acroformPlugin.acroFormDictionaryRoot._eventID,
        m.internal.acroformPlugin.printedOut = !0
    }
      , z = function(e) {
        var t = !e;
        for (var r in e || (m.internal.newObjectDeferredBegin(m.internal.acroformPlugin.acroFormDictionaryRoot.objId, !0),
        m.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),
        e = e || m.internal.acroformPlugin.acroFormDictionaryRoot.Kids)
            if (e.hasOwnProperty(r)) {
                var a = e[r]
                  , n = []
                  , o = a.Rect;
                if (a.Rect && (a.Rect = j$2.call(this, a.Rect)),
                m.internal.newObjectDeferredBegin(a.objId, !0),
                a.DA = ut.createDefaultAppearanceStream(a),
                "object" == typeof a && "function" == typeof a.getKeyValueListForStream && (n = a.getKeyValueListForStream()),
                a.Rect = o,
                a.hasAppearanceStream && !a.appearanceStreamContent) {
                    var l = B.call(this, a);
                    n.push({
                        key: "AP",
                        value: "<</N " + l + ">>"
                    }),
                    m.internal.acroformPlugin.xForms.push(l)
                }
                if (a.appearanceStreamContent) {
                    var i = "";
                    for (var s in a.appearanceStreamContent)
                        if (a.appearanceStreamContent.hasOwnProperty(s)) {
                            var c = a.appearanceStreamContent[s];
                            if (i += "/" + s + " ",
                            i += "<<",
                            Object.keys(c).length >= 1 || Array.isArray(c)) {
                                for (var r in c)
                                    if (c.hasOwnProperty(r)) {
                                        var u = c[r];
                                        "function" == typeof u && (u = u.call(this, a)),
                                        i += "/" + r + " " + u + " ",
                                        m.internal.acroformPlugin.xForms.indexOf(u) >= 0 || m.internal.acroformPlugin.xForms.push(u)
                                    }
                            } else
                                "function" == typeof (u = c) && (u = u.call(this, a)),
                                i += "/" + r + " " + u,
                                m.internal.acroformPlugin.xForms.indexOf(u) >= 0 || m.internal.acroformPlugin.xForms.push(u);
                            i += ">>"
                        }
                    n.push({
                        key: "AP",
                        value: "<<\n" + i + ">>"
                    })
                }
                m.internal.putStream({
                    additionalKeyValues: n
                }),
                m.internal.out("endobj")
            }
        t && H.call(this, m.internal.acroformPlugin.xForms)
    }
      , H = function(e) {
        for (var t in e)
            if (e.hasOwnProperty(t)) {
                var r = t
                  , a = e[t];
                m.internal.newObjectDeferredBegin(a && a.objId, !0),
                "object" == typeof a && "function" == typeof a.putStream && a.putStream(),
                delete e[r]
            }
    }
      , W = function() {
        if (void 0 !== this.internal && (void 0 === this.internal.acroformPlugin || !1 === this.internal.acroformPlugin.isInitialized)) {
            if (m = this,
            K.FieldNum = 0,
            this.internal.acroformPlugin = JSON.parse(JSON.stringify(E)),
            this.internal.acroformPlugin.acroFormDictionaryRoot)
                throw new Error("Exception while creating AcroformDictionary");
            b = m.internal.scaleFactor,
            m.internal.acroformPlugin.acroFormDictionaryRoot = new X,
            m.internal.acroformPlugin.acroFormDictionaryRoot._eventID = m.internal.events.subscribe("postPutResources", U),
            m.internal.events.subscribe("buildDocument", q),
            m.internal.events.subscribe("putCatalog", D),
            m.internal.events.subscribe("postPutPages", z),
            m.internal.acroformPlugin.isInitialized = !0
        }
    }
      , V = v.__acroform__.arrayToPdfArray = function(e) {
        if (Array.isArray(e)) {
            for (var t = "[", r = 0; r < e.length; r++)
                switch (0 !== r && (t += " "),
                typeof e[r]) {
                case "boolean":
                case "number":
                case "object":
                    t += e[r].toString();
                    break;
                case "string":
                    "/" !== e[r].substr(0, 1) ? t += "(" + y(e[r].toString()) + ")" : t += e[r].toString()
                }
            return t + "]"
        }
        throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")
    }
      , G = function(e) {
        return (e = e || "").toString(),
        "(" + y(e) + ")"
    }
      , Y = function() {
        var e;
        Object.defineProperty(this, "objId", {
            configurable: !0,
            get: function() {
                return e || (e = m.internal.newObjectDeferred()),
                e
            },
            set: function(t) {
                e = t
            }
        })
    };
    Y.prototype.toString = function() {
        return this.objId + " 0 R"
    }
    ,
    Y.prototype.putStream = function() {
        var e = this.getKeyValueListForStream();
        m.internal.putStream({
            data: this.stream,
            additionalKeyValues: e
        }),
        m.internal.out("endobj")
    }
    ,
    Y.prototype.getKeyValueListForStream = function() {
        return function(e) {
            var t = []
              , r = Object.getOwnPropertyNames(e).filter((function(e) {
                return "content" != e && "appearanceStreamContent" != e && "_" != e.substring(0, 1)
            }
            ));
            for (var a in r)
                if (!1 === Object.getOwnPropertyDescriptor(e, r[a]).configurable) {
                    var n = r[a]
                      , o = e[n];
                    o && (Array.isArray(o) ? t.push({
                        key: n,
                        value: V(o)
                    }) : o instanceof Y ? t.push({
                        key: n,
                        value: o.objId + " 0 R"
                    }) : "function" != typeof o && t.push({
                        key: n,
                        value: o
                    }))
                }
            return t
        }(this)
    }
    ;
    var J = function() {
        Y.call(this),
        Object.defineProperty(this, "Type", {
            value: "/XObject",
            configurable: !1,
            writeable: !0
        }),
        Object.defineProperty(this, "Subtype", {
            value: "/Form",
            configurable: !1,
            writeable: !0
        }),
        Object.defineProperty(this, "FormType", {
            value: 1,
            configurable: !1,
            writeable: !0
        });
        var e, t = [];
        Object.defineProperty(this, "BBox", {
            configurable: !1,
            writeable: !0,
            get: function() {
                return t
            },
            set: function(e) {
                t = e
            }
        }),
        Object.defineProperty(this, "Resources", {
            value: "2 0 R",
            configurable: !1,
            writeable: !0
        }),
        Object.defineProperty(this, "stream", {
            enumerable: !1,
            configurable: !0,
            set: function(t) {
                e = t.trim()
            },
            get: function() {
                return e || null
            }
        })
    };
    x(J, Y);
    var X = function() {
        Y.call(this);
        var e, t = [];
        Object.defineProperty(this, "Kids", {
            enumerable: !1,
            configurable: !0,
            get: function() {
                return t.length > 0 ? t : void 0
            }
        }),
        Object.defineProperty(this, "Fields", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return t
            }
        }),
        Object.defineProperty(this, "DA", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                if (e)
                    return "(" + e + ")"
            },
            set: function(t) {
                e = t
            }
        })
    };
    x(X, Y);
    var K = function() {
        Y.call(this);
        var e = 4;
        Object.defineProperty(this, "F", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                if (isNaN(t))
                    throw new Error('Invalid value "' + t + '" for attribute F supplied.');
                e = t
            }
        }),
        Object.defineProperty(this, "showWhenPrinted", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(e, 3))
            },
            set: function(t) {
                !0 === Boolean(t) ? this.F = I(e, 3) : this.F = C(e, 3)
            }
        });
        var t = 0;
        Object.defineProperty(this, "Ff", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return t
            },
            set: function(e) {
                if (isNaN(e))
                    throw new Error('Invalid value "' + e + '" for attribute Ff supplied.');
                t = e
            }
        });
        var r = [];
        Object.defineProperty(this, "Rect", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                if (0 !== r.length)
                    return r
            },
            set: function(e) {
                r = void 0 !== e ? e : []
            }
        }),
        Object.defineProperty(this, "x", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return !r || isNaN(r[0]) ? 0 : r[0]
            },
            set: function(e) {
                r[0] = e
            }
        }),
        Object.defineProperty(this, "y", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return !r || isNaN(r[1]) ? 0 : r[1]
            },
            set: function(e) {
                r[1] = e
            }
        }),
        Object.defineProperty(this, "width", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return !r || isNaN(r[2]) ? 0 : r[2]
            },
            set: function(e) {
                r[2] = e
            }
        }),
        Object.defineProperty(this, "height", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return !r || isNaN(r[3]) ? 0 : r[3]
            },
            set: function(e) {
                r[3] = e
            }
        });
        var a = "";
        Object.defineProperty(this, "FT", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return a
            },
            set: function(e) {
                switch (e) {
                case "/Btn":
                case "/Tx":
                case "/Ch":
                case "/Sig":
                    a = e;
                    break;
                default:
                    throw new Error('Invalid value "' + e + '" for attribute FT supplied.')
                }
            }
        });
        var n = null;
        Object.defineProperty(this, "T", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                if (!n || n.length < 1) {
                    if (this instanceof it)
                        return;
                    n = "FieldObject" + K.FieldNum++
                }
                return "(" + y(n) + ")"
            },
            set: function(e) {
                n = e.toString()
            }
        }),
        Object.defineProperty(this, "fieldName", {
            configurable: !0,
            enumerable: !0,
            get: function() {
                return n
            },
            set: function(e) {
                n = e
            }
        });
        var o = "helvetica";
        Object.defineProperty(this, "fontName", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return o
            },
            set: function(e) {
                o = e
            }
        });
        var l = "normal";
        Object.defineProperty(this, "fontStyle", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return l
            },
            set: function(e) {
                l = e
            }
        });
        var i = 0;
        Object.defineProperty(this, "fontSize", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return i
            },
            set: function(e) {
                i = e
            }
        });
        var s = void 0;
        Object.defineProperty(this, "maxFontSize", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return void 0 === s ? 50 / b : s
            },
            set: function(e) {
                s = e
            }
        });
        var c = "black";
        Object.defineProperty(this, "color", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return c
            },
            set: function(e) {
                c = e
            }
        });
        var u = "/F1 0 Tf 0 g";
        Object.defineProperty(this, "DA", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                if (!(!u || this instanceof it || this instanceof ot))
                    return G(u)
            },
            set: function(e) {
                e = e.toString(),
                u = e
            }
        });
        var h = null;
        Object.defineProperty(this, "DV", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                if (h)
                    return this instanceof et == 0 ? G(h) : h
            },
            set: function(e) {
                e = e.toString(),
                h = this instanceof et == 0 ? "(" === e.substr(0, 1) ? w(e.substr(1, e.length - 2)) : w(e) : e
            }
        }),
        Object.defineProperty(this, "defaultValue", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return this instanceof et == 1 ? w(h.substr(1, h.length - 1)) : h
            },
            set: function(e) {
                e = e.toString(),
                h = this instanceof et == 1 ? "/" + e : e
            }
        });
        var d = null;
        Object.defineProperty(this, "V", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                if (d)
                    return this instanceof et == 0 ? G(d) : d
            },
            set: function(e) {
                e = e.toString(),
                d = this instanceof et == 0 ? "(" === e.substr(0, 1) ? w(e.substr(1, e.length - 2)) : w(e) : e
            }
        }),
        Object.defineProperty(this, "value", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return this instanceof et == 1 ? w(d.substr(1, d.length - 1)) : d
            },
            set: function(e) {
                e = e.toString(),
                d = this instanceof et == 1 ? "/" + e : e
            }
        }),
        Object.defineProperty(this, "hasAnnotation", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return this.Rect
            }
        }),
        Object.defineProperty(this, "Type", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return this.hasAnnotation ? "/Annot" : null
            }
        }),
        Object.defineProperty(this, "Subtype", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return this.hasAnnotation ? "/Widget" : null
            }
        });
        var f, m = !1;
        Object.defineProperty(this, "hasAppearanceStream", {
            enumerable: !0,
            configurable: !0,
            writeable: !0,
            get: function() {
                return m
            },
            set: function(e) {
                e = Boolean(e),
                m = e
            }
        }),
        Object.defineProperty(this, "page", {
            enumerable: !0,
            configurable: !0,
            writeable: !0,
            get: function() {
                if (f)
                    return f
            },
            set: function(e) {
                f = e
            }
        }),
        Object.defineProperty(this, "readOnly", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 1))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 1) : this.Ff = C(this.Ff, 1)
            }
        }),
        Object.defineProperty(this, "required", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 2))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 2) : this.Ff = C(this.Ff, 2)
            }
        }),
        Object.defineProperty(this, "noExport", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 3))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 3) : this.Ff = C(this.Ff, 3)
            }
        });
        var p = null;
        Object.defineProperty(this, "Q", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                if (null !== p)
                    return p
            },
            set: function(e) {
                if (-1 === [0, 1, 2].indexOf(e))
                    throw new Error('Invalid value "' + e + '" for attribute Q supplied.');
                p = e
            }
        }),
        Object.defineProperty(this, "textAlign", {
            get: function() {
                var e;
                switch (p) {
                case 0:
                default:
                    e = "left";
                    break;
                case 1:
                    e = "center";
                    break;
                case 2:
                    e = "right"
                }
                return e
            },
            configurable: !0,
            enumerable: !0,
            set: function(e) {
                switch (e) {
                case "right":
                case 2:
                    p = 2;
                    break;
                case "center":
                case 1:
                    p = 1;
                    break;
                case "left":
                case 0:
                default:
                    p = 0
                }
            }
        })
    };
    x(K, Y);
    var Z = function() {
        K.call(this),
        this.FT = "/Ch",
        this.V = "()",
        this.fontName = "zapfdingbats";
        var e = 0;
        Object.defineProperty(this, "TI", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                e = t
            }
        }),
        Object.defineProperty(this, "topIndex", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return e
            },
            set: function(t) {
                e = t
            }
        });
        var t = [];
        Object.defineProperty(this, "Opt", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return V(t)
            },
            set: function(e) {
                var r, a;
                a = [],
                "string" == typeof (r = e) && (a = function(e, t, r) {
                    r || (r = 1);
                    for (var a, n = []; a = t.exec(e); )
                        n.push(a[r]);
                    return n
                }(r, /\((.*?)\)/g)),
                t = a
            }
        }),
        this.getOptions = function() {
            return t
        }
        ,
        this.setOptions = function(e) {
            t = e,
            this.sort && t.sort()
        }
        ,
        this.addOption = function(e) {
            e = (e = e || "").toString(),
            t.push(e),
            this.sort && t.sort()
        }
        ,
        this.removeOption = function(e, r) {
            for (r = r || !1,
            e = (e = e || "").toString(); -1 !== t.indexOf(e) && (t.splice(t.indexOf(e), 1),
            !1 !== r); )
                ;
        }
        ,
        Object.defineProperty(this, "combo", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 18))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 18) : this.Ff = C(this.Ff, 18)
            }
        }),
        Object.defineProperty(this, "edit", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 19))
            },
            set: function(e) {
                !0 === this.combo && (!0 === Boolean(e) ? this.Ff = I(this.Ff, 19) : this.Ff = C(this.Ff, 19))
            }
        }),
        Object.defineProperty(this, "sort", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 20))
            },
            set: function(e) {
                !0 === Boolean(e) ? (this.Ff = I(this.Ff, 20),
                t.sort()) : this.Ff = C(this.Ff, 20)
            }
        }),
        Object.defineProperty(this, "multiSelect", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 22))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 22) : this.Ff = C(this.Ff, 22)
            }
        }),
        Object.defineProperty(this, "doNotSpellCheck", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 23))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 23) : this.Ff = C(this.Ff, 23)
            }
        }),
        Object.defineProperty(this, "commitOnSelChange", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 27))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 27) : this.Ff = C(this.Ff, 27)
            }
        }),
        this.hasAppearanceStream = !1
    };
    x(Z, K);
    var $$1 = function() {
        Z.call(this),
        this.fontName = "helvetica",
        this.combo = !1
    };
    x($$1, Z);
    var Q = function() {
        $$1.call(this),
        this.combo = !0
    };
    x(Q, $$1);
    var tt = function() {
        Q.call(this),
        this.edit = !0
    };
    x(tt, Q);
    var et = function() {
        K.call(this),
        this.FT = "/Btn",
        Object.defineProperty(this, "noToggleToOff", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 15))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 15) : this.Ff = C(this.Ff, 15)
            }
        }),
        Object.defineProperty(this, "radio", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 16))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 16) : this.Ff = C(this.Ff, 16)
            }
        }),
        Object.defineProperty(this, "pushButton", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 17))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 17) : this.Ff = C(this.Ff, 17)
            }
        }),
        Object.defineProperty(this, "radioIsUnison", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 26))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 26) : this.Ff = C(this.Ff, 26)
            }
        });
        var e, t = {};
        Object.defineProperty(this, "MK", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                if (0 !== Object.keys(t).length) {
                    var e, r = [];
                    for (e in r.push("<<"),
                    t)
                        r.push("/" + e + " (" + t[e] + ")");
                    return r.push(">>"),
                    r.join("\n")
                }
            },
            set: function(e) {
                "object" == typeof e && (t = e)
            }
        }),
        Object.defineProperty(this, "caption", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return t.CA || ""
            },
            set: function(e) {
                "string" == typeof e && (t.CA = e)
            }
        }),
        Object.defineProperty(this, "AS", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                e = t
            }
        }),
        Object.defineProperty(this, "appearanceState", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return e.substr(1, e.length - 1)
            },
            set: function(t) {
                e = "/" + t
            }
        })
    };
    x(et, K);
    var nt = function() {
        et.call(this),
        this.pushButton = !0
    };
    x(nt, et);
    var rt = function() {
        et.call(this),
        this.radio = !0,
        this.pushButton = !1;
        var e = [];
        Object.defineProperty(this, "Kids", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                e = void 0 !== t ? t : []
            }
        })
    };
    x(rt, et);
    var it = function() {
        var e, t;
        K.call(this),
        Object.defineProperty(this, "Parent", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                e = t
            }
        }),
        Object.defineProperty(this, "optionName", {
            enumerable: !1,
            configurable: !0,
            get: function() {
                return t
            },
            set: function(e) {
                t = e
            }
        });
        var r, a = {};
        Object.defineProperty(this, "MK", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                var e, t = [];
                for (e in t.push("<<"),
                a)
                    t.push("/" + e + " (" + a[e] + ")");
                return t.push(">>"),
                t.join("\n")
            },
            set: function(e) {
                "object" == typeof e && (a = e)
            }
        }),
        Object.defineProperty(this, "caption", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return a.CA || ""
            },
            set: function(e) {
                "string" == typeof e && (a.CA = e)
            }
        }),
        Object.defineProperty(this, "AS", {
            enumerable: !1,
            configurable: !1,
            get: function() {
                return r
            },
            set: function(e) {
                r = e
            }
        }),
        Object.defineProperty(this, "appearanceState", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return r.substr(1, r.length - 1)
            },
            set: function(e) {
                r = "/" + e
            }
        }),
        this.caption = "l",
        this.appearanceState = "Off",
        this._AppearanceType = ut.RadioButton.Circle,
        this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName)
    };
    x(it, K),
    rt.prototype.setAppearance = function(e) {
        if (!("createAppearanceStream"in e) || !("getCA"in e))
            throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
        for (var t in this.Kids)
            if (this.Kids.hasOwnProperty(t)) {
                var r = this.Kids[t];
                r.appearanceStreamContent = e.createAppearanceStream(r.optionName),
                r.caption = e.getCA()
            }
    }
    ,
    rt.prototype.createOption = function(e) {
        var t = new it;
        return t.Parent = this,
        t.optionName = e,
        this.Kids.push(t),
        ct.call(this, t),
        t
    }
    ;
    var at = function() {
        et.call(this),
        this.fontName = "zapfdingbats",
        this.caption = "3",
        this.appearanceState = "On",
        this.value = "On",
        this.textAlign = "center",
        this.appearanceStreamContent = ut.CheckBox.createAppearanceStream()
    };
    x(at, et);
    var ot = function() {
        K.call(this),
        this.FT = "/Tx",
        Object.defineProperty(this, "multiline", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 13))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 13) : this.Ff = C(this.Ff, 13)
            }
        }),
        Object.defineProperty(this, "fileSelect", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 21))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 21) : this.Ff = C(this.Ff, 21)
            }
        }),
        Object.defineProperty(this, "doNotSpellCheck", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 23))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 23) : this.Ff = C(this.Ff, 23)
            }
        }),
        Object.defineProperty(this, "doNotScroll", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 24))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 24) : this.Ff = C(this.Ff, 24)
            }
        }),
        Object.defineProperty(this, "comb", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 25))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 25) : this.Ff = C(this.Ff, 25)
            }
        }),
        Object.defineProperty(this, "richText", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 26))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 26) : this.Ff = C(this.Ff, 26)
            }
        });
        var e = null;
        Object.defineProperty(this, "MaxLen", {
            enumerable: !0,
            configurable: !1,
            get: function() {
                return e
            },
            set: function(t) {
                e = t
            }
        }),
        Object.defineProperty(this, "maxLength", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return e
            },
            set: function(t) {
                Number.isInteger(t) && (e = t)
            }
        }),
        Object.defineProperty(this, "hasAppearanceStream", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return this.V || this.DV
            }
        })
    };
    x(ot, K);
    var st = function() {
        ot.call(this),
        Object.defineProperty(this, "password", {
            enumerable: !0,
            configurable: !0,
            get: function() {
                return Boolean(F(this.Ff, 14))
            },
            set: function(e) {
                !0 === Boolean(e) ? this.Ff = I(this.Ff, 14) : this.Ff = C(this.Ff, 14)
            }
        }),
        this.password = !0
    };
    x(st, ot);
    var ut = {
        CheckBox: {
            createAppearanceStream: function() {
                return {
                    N: {
                        On: ut.CheckBox.YesNormal
                    },
                    D: {
                        On: ut.CheckBox.YesPushDown,
                        Off: ut.CheckBox.OffPushDown
                    }
                }
            },
            YesPushDown: function(e) {
                var t = new _(e)
                  , r = []
                  , a = m.internal.getFont(e.fontName, e.fontStyle).id
                  , n = m.__private__.encodeColorString(e.color)
                  , o = O(e, e.caption);
                return r.push("0.749023 g"),
                r.push("0 0 " + N(ut.internal.getWidth(e)) + " " + N(ut.internal.getHeight(e)) + " re"),
                r.push("f"),
                r.push("BMC"),
                r.push("q"),
                r.push("0 0 1 rg"),
                r.push("/" + a + " " + N(o.fontSize) + " Tf " + n),
                r.push("BT"),
                r.push(o.text),
                r.push("ET"),
                r.push("Q"),
                r.push("EMC"),
                t.stream = r.join("\n"),
                t
            },
            YesNormal: function(e) {
                var t = new _(e)
                  , r = m.internal.getFont(e.fontName, e.fontStyle).id
                  , a = m.__private__.encodeColorString(e.color)
                  , n = []
                  , o = ut.internal.getHeight(e)
                  , l = ut.internal.getWidth(e)
                  , i = O(e, e.caption);
                return n.push("1 g"),
                n.push("0 0 " + N(l) + " " + N(o) + " re"),
                n.push("f"),
                n.push("q"),
                n.push("0 0 1 rg"),
                n.push("0 0 " + N(l - 1) + " " + N(o - 1) + " re"),
                n.push("W"),
                n.push("n"),
                n.push("0 g"),
                n.push("BT"),
                n.push("/" + r + " " + N(i.fontSize) + " Tf " + a),
                n.push(i.text),
                n.push("ET"),
                n.push("Q"),
                t.stream = n.join("\n"),
                t
            },
            OffPushDown: function(e) {
                var t = new _(e)
                  , r = [];
                return r.push("0.749023 g"),
                r.push("0 0 " + N(ut.internal.getWidth(e)) + " " + N(ut.internal.getHeight(e)) + " re"),
                r.push("f"),
                t.stream = r.join("\n"),
                t
            }
        },
        RadioButton: {
            Circle: {
                createAppearanceStream: function(e) {
                    var t = {
                        D: {
                            Off: ut.RadioButton.Circle.OffPushDown
                        },
                        N: {}
                    };
                    return t.N[e] = ut.RadioButton.Circle.YesNormal,
                    t.D[e] = ut.RadioButton.Circle.YesPushDown,
                    t
                },
                getCA: function() {
                    return "l"
                },
                YesNormal: function(e) {
                    var t = new _(e)
                      , r = []
                      , a = ut.internal.getWidth(e) <= ut.internal.getHeight(e) ? ut.internal.getWidth(e) / 4 : ut.internal.getHeight(e) / 4;
                    a = Number((.9 * a).toFixed(5));
                    var n = ut.internal.Bezier_C
                      , o = Number((a * n).toFixed(5));
                    return r.push("q"),
                    r.push("1 0 0 1 " + L(ut.internal.getWidth(e) / 2) + " " + L(ut.internal.getHeight(e) / 2) + " cm"),
                    r.push(a + " 0 m"),
                    r.push(a + " " + o + " " + o + " " + a + " 0 " + a + " c"),
                    r.push("-" + o + " " + a + " -" + a + " " + o + " -" + a + " 0 c"),
                    r.push("-" + a + " -" + o + " -" + o + " -" + a + " 0 -" + a + " c"),
                    r.push(o + " -" + a + " " + a + " -" + o + " " + a + " 0 c"),
                    r.push("f"),
                    r.push("Q"),
                    t.stream = r.join("\n"),
                    t
                },
                YesPushDown: function(e) {
                    var t = new _(e)
                      , r = []
                      , a = ut.internal.getWidth(e) <= ut.internal.getHeight(e) ? ut.internal.getWidth(e) / 4 : ut.internal.getHeight(e) / 4
                      , n = (a = Number((.9 * a).toFixed(5)),
                    Number((2 * a).toFixed(5)))
                      , o = Number((n * ut.internal.Bezier_C).toFixed(5))
                      , l = Number((a * ut.internal.Bezier_C).toFixed(5));
                    return r.push("0.749023 g"),
                    r.push("q"),
                    r.push("1 0 0 1 " + L(ut.internal.getWidth(e) / 2) + " " + L(ut.internal.getHeight(e) / 2) + " cm"),
                    r.push(n + " 0 m"),
                    r.push(n + " " + o + " " + o + " " + n + " 0 " + n + " c"),
                    r.push("-" + o + " " + n + " -" + n + " " + o + " -" + n + " 0 c"),
                    r.push("-" + n + " -" + o + " -" + o + " -" + n + " 0 -" + n + " c"),
                    r.push(o + " -" + n + " " + n + " -" + o + " " + n + " 0 c"),
                    r.push("f"),
                    r.push("Q"),
                    r.push("0 g"),
                    r.push("q"),
                    r.push("1 0 0 1 " + L(ut.internal.getWidth(e) / 2) + " " + L(ut.internal.getHeight(e) / 2) + " cm"),
                    r.push(a + " 0 m"),
                    r.push(a + " " + l + " " + l + " " + a + " 0 " + a + " c"),
                    r.push("-" + l + " " + a + " -" + a + " " + l + " -" + a + " 0 c"),
                    r.push("-" + a + " -" + l + " -" + l + " -" + a + " 0 -" + a + " c"),
                    r.push(l + " -" + a + " " + a + " -" + l + " " + a + " 0 c"),
                    r.push("f"),
                    r.push("Q"),
                    t.stream = r.join("\n"),
                    t
                },
                OffPushDown: function(e) {
                    var t = new _(e)
                      , r = []
                      , a = ut.internal.getWidth(e) <= ut.internal.getHeight(e) ? ut.internal.getWidth(e) / 4 : ut.internal.getHeight(e) / 4;
                    a = Number((.9 * a).toFixed(5));
                    var n = Number((2 * a).toFixed(5))
                      , o = Number((n * ut.internal.Bezier_C).toFixed(5));
                    return r.push("0.749023 g"),
                    r.push("q"),
                    r.push("1 0 0 1 " + L(ut.internal.getWidth(e) / 2) + " " + L(ut.internal.getHeight(e) / 2) + " cm"),
                    r.push(n + " 0 m"),
                    r.push(n + " " + o + " " + o + " " + n + " 0 " + n + " c"),
                    r.push("-" + o + " " + n + " -" + n + " " + o + " -" + n + " 0 c"),
                    r.push("-" + n + " -" + o + " -" + o + " -" + n + " 0 -" + n + " c"),
                    r.push(o + " -" + n + " " + n + " -" + o + " " + n + " 0 c"),
                    r.push("f"),
                    r.push("Q"),
                    t.stream = r.join("\n"),
                    t
                }
            },
            Cross: {
                createAppearanceStream: function(e) {
                    var t = {
                        D: {
                            Off: ut.RadioButton.Cross.OffPushDown
                        },
                        N: {}
                    };
                    return t.N[e] = ut.RadioButton.Cross.YesNormal,
                    t.D[e] = ut.RadioButton.Cross.YesPushDown,
                    t
                },
                getCA: function() {
                    return "8"
                },
                YesNormal: function(e) {
                    var t = new _(e)
                      , r = []
                      , a = ut.internal.calculateCross(e);
                    return r.push("q"),
                    r.push("1 1 " + N(ut.internal.getWidth(e) - 2) + " " + N(ut.internal.getHeight(e) - 2) + " re"),
                    r.push("W"),
                    r.push("n"),
                    r.push(N(a.x1.x) + " " + N(a.x1.y) + " m"),
                    r.push(N(a.x2.x) + " " + N(a.x2.y) + " l"),
                    r.push(N(a.x4.x) + " " + N(a.x4.y) + " m"),
                    r.push(N(a.x3.x) + " " + N(a.x3.y) + " l"),
                    r.push("s"),
                    r.push("Q"),
                    t.stream = r.join("\n"),
                    t
                },
                YesPushDown: function(e) {
                    var t = new _(e)
                      , r = ut.internal.calculateCross(e)
                      , a = [];
                    return a.push("0.749023 g"),
                    a.push("0 0 " + N(ut.internal.getWidth(e)) + " " + N(ut.internal.getHeight(e)) + " re"),
                    a.push("f"),
                    a.push("q"),
                    a.push("1 1 " + N(ut.internal.getWidth(e) - 2) + " " + N(ut.internal.getHeight(e) - 2) + " re"),
                    a.push("W"),
                    a.push("n"),
                    a.push(N(r.x1.x) + " " + N(r.x1.y) + " m"),
                    a.push(N(r.x2.x) + " " + N(r.x2.y) + " l"),
                    a.push(N(r.x4.x) + " " + N(r.x4.y) + " m"),
                    a.push(N(r.x3.x) + " " + N(r.x3.y) + " l"),
                    a.push("s"),
                    a.push("Q"),
                    t.stream = a.join("\n"),
                    t
                },
                OffPushDown: function(e) {
                    var t = new _(e)
                      , r = [];
                    return r.push("0.749023 g"),
                    r.push("0 0 " + N(ut.internal.getWidth(e)) + " " + N(ut.internal.getHeight(e)) + " re"),
                    r.push("f"),
                    t.stream = r.join("\n"),
                    t
                }
            }
        },
        createDefaultAppearanceStream: function(e) {
            var t = m.internal.getFont(e.fontName, e.fontStyle).id
              , r = m.__private__.encodeColorString(e.color);
            return "/" + t + " " + e.fontSize + " Tf " + r
        }
    };
    ut.internal = {
        Bezier_C: .551915024494,
        calculateCross: function(e) {
            var t = ut.internal.getWidth(e)
              , r = ut.internal.getHeight(e)
              , a = Math.min(t, r);
            return {
                x1: {
                    x: (t - a) / 2,
                    y: (r - a) / 2 + a
                },
                x2: {
                    x: (t - a) / 2 + a,
                    y: (r - a) / 2
                },
                x3: {
                    x: (t - a) / 2,
                    y: (r - a) / 2
                },
                x4: {
                    x: (t - a) / 2 + a,
                    y: (r - a) / 2 + a
                }
            }
        }
    },
    ut.internal.getWidth = function(e) {
        var t = 0;
        return "object" == typeof e && (t = A(e.Rect[2])),
        t
    }
    ,
    ut.internal.getHeight = function(e) {
        var t = 0;
        return "object" == typeof e && (t = A(e.Rect[3])),
        t
    }
    ;
    var ct = v.addField = function(e) {
        if (W.call(this),
        !(e instanceof K))
            throw new Error("Invalid argument passed to jsPDF.addField.");
        return R.call(this, e),
        e.page = m.internal.getCurrentPageInfo().pageNumber,
        this
    }
    ;
    v.AcroFormChoiceField = Z,
    v.AcroFormListBox = $$1,
    v.AcroFormComboBox = Q,
    v.AcroFormEditBox = tt,
    v.AcroFormButton = et,
    v.AcroFormPushButton = nt,
    v.AcroFormRadioButton = rt,
    v.AcroFormCheckBox = at,
    v.AcroFormTextField = ot,
    v.AcroFormPasswordField = st,
    v.AcroFormAppearance = ut,
    v.AcroForm = {
        ChoiceField: Z,
        ListBox: $$1,
        ComboBox: Q,
        EditBox: tt,
        Button: et,
        PushButton: nt,
        RadioButton: rt,
        CheckBox: at,
        TextField: ot,
        PasswordField: st,
        Appearance: ut
    },
    g.AcroForm = {
        ChoiceField: Z,
        ListBox: $$1,
        ComboBox: Q,
        EditBox: tt,
        Button: et,
        PushButton: nt,
        RadioButton: rt,
        CheckBox: at,
        TextField: ot,
        PasswordField: st,
        Appearance: ut
    },
    function(e) {
        e.__addimage__ = {};
        var t = "UNKNOWN"
          , r = {
            PNG: [[137, 80, 78, 71]],
            TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]],
            JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]],
            JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]],
            GIF87a: [[71, 73, 70, 56, 55, 97]],
            GIF89a: [[71, 73, 70, 56, 57, 97]],
            WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]],
            BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]]
        }
          , a = e.__addimage__.getImageFileTypeByImageData = function(e, a) {
            var n, o;
            a = a || t;
            var l, i, s, c = t;
            if (S(e))
                for (s in r)
                    for (l = r[s],
                    n = 0; n < l.length; n += 1) {
                        for (i = !0,
                        o = 0; o < l[n].length; o += 1)
                            if (void 0 !== l[n][o] && l[n][o] !== e[o]) {
                                i = !1;
                                break
                            }
                        if (!0 === i) {
                            c = s;
                            break
                        }
                    }
            else
                for (s in r)
                    for (l = r[s],
                    n = 0; n < l.length; n += 1) {
                        for (i = !0,
                        o = 0; o < l[n].length; o += 1)
                            if (void 0 !== l[n][o] && l[n][o] !== e.charCodeAt(o)) {
                                i = !1;
                                break
                            }
                        if (!0 === i) {
                            c = s;
                            break
                        }
                    }
            return c === t && a !== t && (c = a),
            c
        }
          , n = function(e) {
            for (var t = this.internal.write, r = this.internal.putStream, a = (0,
            this.internal.getFilters)(); -1 !== a.indexOf("FlateEncode"); )
                a.splice(a.indexOf("FlateEncode"), 1);
            e.objectId = this.internal.newObject();
            var o = [];
            if (o.push({
                key: "Type",
                value: "/XObject"
            }),
            o.push({
                key: "Subtype",
                value: "/Image"
            }),
            o.push({
                key: "Width",
                value: e.width
            }),
            o.push({
                key: "Height",
                value: e.height
            }),
            e.colorSpace === v.INDEXED ? o.push({
                key: "ColorSpace",
                value: "[/Indexed /DeviceRGB " + (e.palette.length / 3 - 1) + " " + ("sMask"in e && void 0 !== e.sMask ? e.objectId + 2 : e.objectId + 1) + " 0 R]"
            }) : (o.push({
                key: "ColorSpace",
                value: "/" + e.colorSpace
            }),
            e.colorSpace === v.DEVICE_CMYK && o.push({
                key: "Decode",
                value: "[1 0 1 0 1 0 1 0]"
            })),
            o.push({
                key: "BitsPerComponent",
                value: e.bitsPerComponent
            }),
            "decodeParameters"in e && void 0 !== e.decodeParameters && o.push({
                key: "DecodeParms",
                value: "<<" + e.decodeParameters + ">>"
            }),
            "transparency"in e && Array.isArray(e.transparency)) {
                for (var l = "", i = 0, s = e.transparency.length; i < s; i++)
                    l += e.transparency[i] + " " + e.transparency[i] + " ";
                o.push({
                    key: "Mask",
                    value: "[" + l + "]"
                })
            }
            void 0 !== e.sMask && o.push({
                key: "SMask",
                value: e.objectId + 1 + " 0 R"
            });
            var c = void 0 !== e.filter ? ["/" + e.filter] : void 0;
            if (r({
                data: e.data,
                additionalKeyValues: o,
                alreadyAppliedFilters: c
            }),
            t("endobj"),
            "sMask"in e && void 0 !== e.sMask) {
                var u = "/Predictor " + e.predictor + " /Colors 1 /BitsPerComponent " + e.bitsPerComponent + " /Columns " + e.width
                  , h = {
                    width: e.width,
                    height: e.height,
                    colorSpace: "DeviceGray",
                    bitsPerComponent: e.bitsPerComponent,
                    decodeParameters: u,
                    data: e.sMask
                };
                "filter"in e && (h.filter = e.filter),
                n.call(this, h)
            }
            e.colorSpace === v.INDEXED && (this.internal.newObject(),
            r({
                data: C(new Uint8Array(e.palette))
            }),
            t("endobj"))
        }
          , l = function() {
            var e = this.internal.collections.addImage_images;
            for (var t in e)
                n.call(this, e[t])
        }
          , i = function() {
            var e, t = this.internal.collections.addImage_images, r = this.internal.write;
            for (var a in t)
                r("/I" + (e = t[a]).index, e.objectId, "0", "R")
        }
          , c = function() {
            this.internal.collections.addImage_images || (this.internal.collections.addImage_images = {},
            this.internal.events.subscribe("putResources", l),
            this.internal.events.subscribe("putXobjectDict", i))
        }
          , u = function() {
            var e = this.internal.collections.addImage_images;
            return c.call(this),
            e
        }
          , h = function() {
            return Object.keys(this.internal.collections.addImage_images).length
        }
          , d = function(t) {
            return "function" == typeof e["process" + t.toUpperCase()]
        }
          , f = function(e) {
            return "object" == typeof e && 1 === e.nodeType
        }
          , m = function(t, r) {
            if ("IMG" === t.nodeName && t.hasAttribute("src")) {
                var a = "" + t.getAttribute("src");
                if (0 === a.indexOf("data:image/"))
                    return o(unescape(a).split("base64,").pop());
                var n = e.loadFile(a, !0);
                if (void 0 !== n)
                    return n
            }
            if ("CANVAS" === t.nodeName) {
                var l;
                switch (r) {
                case "PNG":
                    l = "image/png";
                    break;
                case "WEBP":
                    l = "image/webp";
                    break;
                case "JPEG":
                case "JPG":
                default:
                    l = "image/jpeg"
                }
                return o(t.toDataURL(l, 1).split("base64,").pop())
            }
        }
          , p = function(e) {
            var t = this.internal.collections.addImage_images;
            if (t)
                for (var r in t)
                    if (e === t[r].alias)
                        return t[r]
        }
          , g = function(e, t, r) {
            return e || t || (e = -96,
            t = -96),
            e < 0 && (e = -1 * r.width * 72 / e / this.internal.scaleFactor),
            t < 0 && (t = -1 * r.height * 72 / t / this.internal.scaleFactor),
            0 === e && (e = t * r.width / r.height),
            0 === t && (t = e * r.height / r.width),
            [e, t]
        }
          , y = function(e, t, r, a, n, o) {
            var l = g.call(this, r, a, n)
              , i = this.internal.getCoordinateString
              , s = this.internal.getVerticalCoordinateString
              , c = u.call(this);
            if (r = l[0],
            a = l[1],
            c[n.index] = n,
            o) {
                o *= Math.PI / 180;
                var h = Math.cos(o)
                  , d = Math.sin(o)
                  , f = function(e) {
                    return e.toFixed(4)
                }
                  , m = [f(h), f(d), f(-1 * d), f(h), 0, 0, "cm"]
            }
            this.internal.write("q"),
            o ? (this.internal.write([1, "0", "0", 1, i(e), s(t + a), "cm"].join(" ")),
            this.internal.write(m.join(" ")),
            this.internal.write([i(r), "0", "0", i(a), "0", "0", "cm"].join(" "))) : this.internal.write([i(r), "0", "0", i(a), i(e), s(t + a), "cm"].join(" ")),
            this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")),
            this.internal.write("/I" + n.index + " Do"),
            this.internal.write("Q")
        }
          , v = e.color_spaces = {
            DEVICE_RGB: "DeviceRGB",
            DEVICE_GRAY: "DeviceGray",
            DEVICE_CMYK: "DeviceCMYK",
            CAL_GREY: "CalGray",
            CAL_RGB: "CalRGB",
            LAB: "Lab",
            ICC_BASED: "ICCBased",
            INDEXED: "Indexed",
            PATTERN: "Pattern",
            SEPARATION: "Separation",
            DEVICE_N: "DeviceN"
        };
        e.decode = {
            DCT_DECODE: "DCTDecode",
            FLATE_DECODE: "FlateDecode",
            LZW_DECODE: "LZWDecode",
            JPX_DECODE: "JPXDecode",
            JBIG2_DECODE: "JBIG2Decode",
            ASCII85_DECODE: "ASCII85Decode",
            ASCII_HEX_DECODE: "ASCIIHexDecode",
            RUN_LENGTH_DECODE: "RunLengthDecode",
            CCITT_FAX_DECODE: "CCITTFaxDecode"
        };
        var A = e.image_compression = {
            NONE: "NONE",
            FAST: "FAST",
            MEDIUM: "MEDIUM",
            SLOW: "SLOW"
        }
          , b = e.__addimage__.sHashCode = function(e) {
            var t, r, a = 0;
            if ("string" == typeof e)
                for (r = e.length,
                t = 0; t < r; t++)
                    a = (a << 5) - a + e.charCodeAt(t),
                    a |= 0;
            else if (S(e))
                for (r = e.byteLength / 2,
                t = 0; t < r; t++)
                    a = (a << 5) - a + e[t],
                    a |= 0;
            return a
        }
          , k = e.__addimage__.validateStringAsBase64 = function(e) {
            (e = e || "").toString().trim();
            var t = !0;
            return 0 === e.length && (t = !1),
            e.length % 4 != 0 && (t = !1),
            !1 === /^[A-Za-z0-9+/]+$/.test(e.substr(0, e.length - 2)) && (t = !1),
            !1 === /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2)) && (t = !1),
            t
        }
          , w = e.__addimage__.extractImageFromDataUrl = function(e) {
            var t = (e = e || "").split("base64,")
              , r = null;
            if (2 === t.length) {
                var a = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(t[0]);
                Array.isArray(a) && (r = {
                    mimeType: a[1],
                    charset: a[2],
                    data: t[1]
                })
            }
            return r
        }
          , x = e.__addimage__.supportsArrayBuffer = function() {
            return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array
        }
        ;
        e.__addimage__.isArrayBuffer = function(e) {
            return x() && e instanceof ArrayBuffer
        }
        ;
        var S = e.__addimage__.isArrayBufferView = function(e) {
            return x() && "undefined" != typeof Uint32Array && (e instanceof Int8Array || e instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array)
        }
          , _ = e.__addimage__.binaryStringToUint8Array = function(e) {
            for (var t = e.length, r = new Uint8Array(t), a = 0; a < t; a++)
                r[a] = e.charCodeAt(a);
            return r
        }
          , C = e.__addimage__.arrayBufferToBinaryString = function(e) {
            try {
                return o(s(String.fromCharCode.apply(null, e)))
            } catch (t) {
                if ("undefined" != typeof Uint8Array && void 0 !== Uint8Array.prototype.reduce)
                    return new Uint8Array(e).reduce((function(e, t) {
                        return e.push(String.fromCharCode(t)),
                        e
                    }
                    ), []).join("")
            }
        }
        ;
        e.addImage = function() {
            var e, r, a, n, o, l, i, s, u;
            if ("number" == typeof arguments[1] ? (r = t,
            a = arguments[1],
            n = arguments[2],
            o = arguments[3],
            l = arguments[4],
            i = arguments[5],
            s = arguments[6],
            u = arguments[7]) : (r = arguments[1],
            a = arguments[2],
            n = arguments[3],
            o = arguments[4],
            l = arguments[5],
            i = arguments[6],
            s = arguments[7],
            u = arguments[8]),
            "object" == typeof (e = arguments[0]) && !f(e) && "imageData"in e) {
                var h = e;
                e = h.imageData,
                r = h.format || r || t,
                a = h.x || a || 0,
                n = h.y || n || 0,
                o = h.w || h.width || o,
                l = h.h || h.height || l,
                i = h.alias || i,
                s = h.compression || s,
                u = h.rotation || h.angle || u
            }
            var d = this.internal.getFilters();
            if (void 0 === s && -1 !== d.indexOf("FlateEncode") && (s = "SLOW"),
            isNaN(a) || isNaN(n))
                throw new Error("Invalid coordinates passed to jsPDF.addImage");
            c.call(this);
            var m = T.call(this, e, r, i, s);
            return y.call(this, a, n, o, l, m, u),
            this
        }
        ;
        var T = function(r, n, o, l) {
            var i, s, c;
            if ("string" == typeof r && a(r) === t) {
                r = unescape(r);
                var u = E(r, !1);
                ("" !== u || void 0 !== (u = e.loadFile(r, !0))) && (r = u)
            }
            if (f(r) && (r = m(r, n)),
            n = a(r, n),
            !d(n))
                throw new Error("addImage does not support files of type '" + n + "', please ensure that a plugin for '" + n + "' support is added.");
            if ((null == (c = o) || 0 === c.length) && (o = function(e) {
                return "string" == typeof e || S(e) ? b(e) : null
            }(r)),
            (i = p.call(this, o)) || (x() && (r instanceof Uint8Array || (s = r,
            r = _(r))),
            i = this["process" + n.toUpperCase()](r, h.call(this), o, function(t) {
                return t && "string" == typeof t && (t = t.toUpperCase()),
                t in e.image_compression ? t : A.NONE
            }(l), s)),
            !i)
                throw new Error("An unknown error occurred whilst processing the image.");
            return i
        }
          , E = e.__addimage__.convertBase64ToBinaryString = function(e, t) {
            var r;
            t = "boolean" != typeof t || t;
            var a, n = "";
            if ("string" == typeof e) {
                a = null !== (r = w(e)) ? r.data : e;
                try {
                    n = o(a)
                } catch (e) {
                    if (t)
                        throw k(a) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + e.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")
                }
            }
            return n
        }
        ;
        e.getImageProperties = function(r) {
            var n, o, l = "";
            if (f(r) && (r = m(r)),
            "string" == typeof r && a(r) === t && ("" === (l = E(r, !1)) && (l = e.loadFile(r) || ""),
            r = l),
            o = a(r),
            !d(o))
                throw new Error("addImage does not support files of type '" + o + "', please ensure that a plugin for '" + o + "' support is added.");
            if (!x() || r instanceof Uint8Array || (r = _(r)),
            !(n = this["process" + o.toUpperCase()](r)))
                throw new Error("An unknown error occurred whilst processing the image");
            return n.fileType = o,
            n
        }
    }(g.API),
    /**
     * @license
     * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = function(e) {
            if (void 0 !== e && "" != e)
                return !0
        };
        g.API.events.push(["addPage", function(e) {
            this.internal.getPageInfo(e.pageNumber).pageContext.annotations = []
        }
        ]),
        e.events.push(["putPage", function(e) {
            for (var r, a, n, o = this.internal.getCoordinateString, l = this.internal.getVerticalCoordinateString, i = this.internal.getPageInfoByObjId(e.objId), s = e.pageContext.annotations, c = !1, u = 0; u < s.length && !c; u++)
                switch ((r = s[u]).type) {
                case "link":
                    (t(r.options.url) || t(r.options.pageNumber)) && (c = !0);
                    break;
                case "reference":
                case "text":
                case "freetext":
                    c = !0
                }
            if (0 != c) {
                this.internal.write("/Annots [");
                for (var h = 0; h < s.length; h++)
                    switch ((r = s[h]).type) {
                    case "reference":
                        this.internal.write(" " + r.object.objId + " 0 R ");
                        break;
                    case "text":
                        var d = this.internal.newAdditionalObject()
                          , f = this.internal.newAdditionalObject()
                          , m = r.title || "Note";
                        n = "<</Type /Annot /Subtype /Text " + (a = "/Rect [" + o(r.bounds.x) + " " + l(r.bounds.y + r.bounds.h) + " " + o(r.bounds.x + r.bounds.w) + " " + l(r.bounds.y) + "] ") + "/Contents (" + r.contents + ")",
                        n += " /Popup " + f.objId + " 0 R",
                        n += " /P " + i.objId + " 0 R",
                        n += " /T (" + m + ") >>",
                        d.content = n;
                        var p = d.objId + " 0 R";
                        n = "<</Type /Annot /Subtype /Popup " + (a = "/Rect [" + o(r.bounds.x + 30) + " " + l(r.bounds.y + r.bounds.h) + " " + o(r.bounds.x + r.bounds.w + 30) + " " + l(r.bounds.y) + "] ") + " /Parent " + p,
                        r.open && (n += " /Open true"),
                        n += " >>",
                        f.content = n,
                        this.internal.write(d.objId, "0 R", f.objId, "0 R");
                        break;
                    case "freetext":
                        a = "/Rect [" + o(r.bounds.x) + " " + l(r.bounds.y) + " " + o(r.bounds.x + r.bounds.w) + " " + l(r.bounds.y + r.bounds.h) + "] ";
                        var g = r.color || "#000000";
                        n = "<</Type /Annot /Subtype /FreeText " + a + "/Contents (" + r.contents + ")",
                        n += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + g + ")",
                        n += " /Border [0 0 0]",
                        n += " >>",
                        this.internal.write(n);
                        break;
                    case "link":
                        if (r.options.name) {
                            var y = this.annotations._nameMap[r.options.name];
                            r.options.pageNumber = y.page,
                            r.options.top = y.y
                        } else
                            r.options.top || (r.options.top = 0);
                        if (a = "/Rect [" + o(r.x) + " " + l(r.y) + " " + o(r.x + r.w) + " " + l(r.y + r.h) + "] ",
                        n = "",
                        r.options.url)
                            n = "<</Type /Annot /Subtype /Link " + a + "/Border [0 0 0] /A <</S /URI /URI (" + r.options.url + ") >>";
                        else if (r.options.pageNumber)
                            switch (n = "<</Type /Annot /Subtype /Link " + a + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(r.options.pageNumber).objId + " 0 R",
                            r.options.magFactor = r.options.magFactor || "XYZ",
                            r.options.magFactor) {
                            case "Fit":
                                n += " /Fit]";
                                break;
                            case "FitH":
                                n += " /FitH " + r.options.top + "]";
                                break;
                            case "FitV":
                                r.options.left = r.options.left || 0,
                                n += " /FitV " + r.options.left + "]";
                                break;
                            case "XYZ":
                            default:
                                var v = l(r.options.top);
                                r.options.left = r.options.left || 0,
                                void 0 === r.options.zoom && (r.options.zoom = 0),
                                n += " /XYZ " + r.options.left + " " + v + " " + r.options.zoom + "]"
                            }
                        "" != n && (n += " >>",
                        this.internal.write(n))
                    }
                this.internal.write("]")
            }
        }
        ]),
        e.createAnnotation = function(e) {
            var t = this.internal.getCurrentPageInfo();
            switch (e.type) {
            case "link":
                this.link(e.bounds.x, e.bounds.y, e.bounds.w, e.bounds.h, e);
                break;
            case "text":
            case "freetext":
                t.pageContext.annotations.push(e)
            }
        }
        ,
        e.link = function(e, t, r, a, n) {
            this.internal.getCurrentPageInfo().pageContext.annotations.push({
                x: e,
                y: t,
                w: r,
                h: a,
                options: n,
                type: "link"
            })
        }
        ,
        e.textWithLink = function(e, t, r, a) {
            var n = this.getTextWidth(e)
              , o = this.internal.getLineHeight() / this.internal.scaleFactor;
            return this.text(e, t, r, a),
            r += .2 * o,
            this.link(t, r - o, n, o, a),
            n
        }
        ,
        e.getTextWidth = function(e) {
            var t = this.internal.getFontSize();
            return this.getStringUnitWidth(e) * t / this.internal.scaleFactor
        }
    }(g.API),
    /**
     * @license
     * Copyright (c) 2017 Aras Abbasi
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = {
            1569: [65152],
            1570: [65153, 65154],
            1571: [65155, 65156],
            1572: [65157, 65158],
            1573: [65159, 65160],
            1574: [65161, 65162, 65163, 65164],
            1575: [65165, 65166],
            1576: [65167, 65168, 65169, 65170],
            1577: [65171, 65172],
            1578: [65173, 65174, 65175, 65176],
            1579: [65177, 65178, 65179, 65180],
            1580: [65181, 65182, 65183, 65184],
            1581: [65185, 65186, 65187, 65188],
            1582: [65189, 65190, 65191, 65192],
            1583: [65193, 65194],
            1584: [65195, 65196],
            1585: [65197, 65198],
            1586: [65199, 65200],
            1587: [65201, 65202, 65203, 65204],
            1588: [65205, 65206, 65207, 65208],
            1589: [65209, 65210, 65211, 65212],
            1590: [65213, 65214, 65215, 65216],
            1591: [65217, 65218, 65219, 65220],
            1592: [65221, 65222, 65223, 65224],
            1593: [65225, 65226, 65227, 65228],
            1594: [65229, 65230, 65231, 65232],
            1601: [65233, 65234, 65235, 65236],
            1602: [65237, 65238, 65239, 65240],
            1603: [65241, 65242, 65243, 65244],
            1604: [65245, 65246, 65247, 65248],
            1605: [65249, 65250, 65251, 65252],
            1606: [65253, 65254, 65255, 65256],
            1607: [65257, 65258, 65259, 65260],
            1608: [65261, 65262],
            1609: [65263, 65264, 64488, 64489],
            1610: [65265, 65266, 65267, 65268],
            1649: [64336, 64337],
            1655: [64477],
            1657: [64358, 64359, 64360, 64361],
            1658: [64350, 64351, 64352, 64353],
            1659: [64338, 64339, 64340, 64341],
            1662: [64342, 64343, 64344, 64345],
            1663: [64354, 64355, 64356, 64357],
            1664: [64346, 64347, 64348, 64349],
            1667: [64374, 64375, 64376, 64377],
            1668: [64370, 64371, 64372, 64373],
            1670: [64378, 64379, 64380, 64381],
            1671: [64382, 64383, 64384, 64385],
            1672: [64392, 64393],
            1676: [64388, 64389],
            1677: [64386, 64387],
            1678: [64390, 64391],
            1681: [64396, 64397],
            1688: [64394, 64395],
            1700: [64362, 64363, 64364, 64365],
            1702: [64366, 64367, 64368, 64369],
            1705: [64398, 64399, 64400, 64401],
            1709: [64467, 64468, 64469, 64470],
            1711: [64402, 64403, 64404, 64405],
            1713: [64410, 64411, 64412, 64413],
            1715: [64406, 64407, 64408, 64409],
            1722: [64414, 64415],
            1723: [64416, 64417, 64418, 64419],
            1726: [64426, 64427, 64428, 64429],
            1728: [64420, 64421],
            1729: [64422, 64423, 64424, 64425],
            1733: [64480, 64481],
            1734: [64473, 64474],
            1735: [64471, 64472],
            1736: [64475, 64476],
            1737: [64482, 64483],
            1739: [64478, 64479],
            1740: [64508, 64509, 64510, 64511],
            1744: [64484, 64485, 64486, 64487],
            1746: [64430, 64431],
            1747: [64432, 64433]
        }
          , r = {
            65247: {
                65154: 65269,
                65156: 65271,
                65160: 65273,
                65166: 65275
            },
            65248: {
                65154: 65270,
                65156: 65272,
                65160: 65274,
                65166: 65276
            },
            65165: {
                65247: {
                    65248: {
                        65258: 65010
                    }
                }
            },
            1617: {
                1612: 64606,
                1613: 64607,
                1614: 64608,
                1615: 64609,
                1616: 64610
            }
        }
          , a = {
            1612: 64606,
            1613: 64607,
            1614: 64608,
            1615: 64609,
            1616: 64610
        }
          , n = [1570, 1571, 1573, 1575];
        e.__arabicParser__ = {};
        var o = e.__arabicParser__.isInArabicSubstitutionA = function(e) {
            return void 0 !== t[e.charCodeAt(0)]
        }
          , l = e.__arabicParser__.isArabicLetter = function(e) {
            return "string" == typeof e && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(e)
        }
          , i = e.__arabicParser__.isArabicEndLetter = function(e) {
            return l(e) && o(e) && t[e.charCodeAt(0)].length <= 2
        }
          , s = e.__arabicParser__.isArabicAlfLetter = function(e) {
            return l(e) && n.indexOf(e.charCodeAt(0)) >= 0
        }
        ;
        e.__arabicParser__.arabicLetterHasIsolatedForm = function(e) {
            return l(e) && o(e) && t[e.charCodeAt(0)].length >= 1
        }
        ;
        var c = e.__arabicParser__.arabicLetterHasFinalForm = function(e) {
            return l(e) && o(e) && t[e.charCodeAt(0)].length >= 2
        }
        ;
        e.__arabicParser__.arabicLetterHasInitialForm = function(e) {
            return l(e) && o(e) && t[e.charCodeAt(0)].length >= 3
        }
        ;
        var u = e.__arabicParser__.arabicLetterHasMedialForm = function(e) {
            return l(e) && o(e) && 4 == t[e.charCodeAt(0)].length
        }
          , h = e.__arabicParser__.resolveLigatures = function(e) {
            var t = 0
              , a = r
              , n = ""
              , o = 0;
            for (t = 0; t < e.length; t += 1)
                void 0 !== a[e.charCodeAt(t)] ? (o++,
                "number" == typeof (a = a[e.charCodeAt(t)]) && (n += String.fromCharCode(a),
                a = r,
                o = 0),
                t === e.length - 1 && (a = r,
                n += e.charAt(t - (o - 1)),
                t -= o - 1,
                o = 0)) : (a = r,
                n += e.charAt(t - o),
                t -= o,
                o = 0);
            return n
        }
        ;
        e.__arabicParser__.isArabicDiacritic = function(e) {
            return void 0 !== e && void 0 !== a[e.charCodeAt(0)]
        }
        ;
        var d = e.__arabicParser__.getCorrectForm = function(e, t, r) {
            return l(e) ? !1 === o(e) ? -1 : !c(e) || !l(t) && !l(r) || !l(r) && i(t) || i(e) && !l(t) || i(e) && s(t) || i(e) && i(t) ? 0 : u(e) && l(t) && !i(t) && l(r) && c(r) ? 3 : i(e) || !l(r) ? 1 : 2 : -1
        }
          , f = function(e) {
            var r = 0
              , a = 0
              , n = 0
              , o = ""
              , i = ""
              , s = ""
              , c = (e = e || "").split("\\s+")
              , u = [];
            for (r = 0; r < c.length; r += 1) {
                for (u.push(""),
                a = 0; a < c[r].length; a += 1)
                    o = c[r][a],
                    i = c[r][a - 1],
                    s = c[r][a + 1],
                    l(o) ? (n = d(o, i, s),
                    u[r] += -1 !== n ? String.fromCharCode(t[o.charCodeAt(0)][n]) : o) : u[r] += o;
                u[r] = h(u[r])
            }
            return u.join(" ")
        }
          , m = e.__arabicParser__.processArabic = e.processArabic = function() {
            var e, t = "string" == typeof arguments[0] ? arguments[0] : arguments[0].text, r = [];
            if (Array.isArray(t)) {
                var a = 0;
                for (r = [],
                a = 0; a < t.length; a += 1)
                    Array.isArray(t[a]) ? r.push([f(t[a][0]), t[a][1], t[a][2]]) : r.push([f(t[a])]);
                e = r
            } else
                e = f(t);
            return "string" == typeof arguments[0] ? e : (arguments[0].text = e,
            arguments[0])
        }
        ;
        e.events.push(["preProcessText", m])
    }(g.API),
    g.API.autoPrint = function(e) {
        var t;
        switch ((e = e || {}).variant = e.variant || "non-conform",
        e.variant) {
        case "javascript":
            this.addJS("print({});");
            break;
        case "non-conform":
        default:
            this.internal.events.subscribe("postPutResources", (function() {
                t = this.internal.newObject(),
                this.internal.out("<<"),
                this.internal.out("/S /Named"),
                this.internal.out("/Type /Action"),
                this.internal.out("/N /Print"),
                this.internal.out(">>"),
                this.internal.out("endobj")
            }
            )),
            this.internal.events.subscribe("putCatalog", (function() {
                this.internal.out("/OpenAction " + t + " 0 R")
            }
            ))
        }
        return this
    }
    ,
    /**
     * @license
     * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = function() {
            var e = void 0;
            Object.defineProperty(this, "pdf", {
                get: function() {
                    return e
                },
                set: function(t) {
                    e = t
                }
            });
            var t = 150;
            Object.defineProperty(this, "width", {
                get: function() {
                    return t
                },
                set: function(e) {
                    t = isNaN(e) || !1 === Number.isInteger(e) || e < 0 ? 150 : e,
                    this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = t + 1)
                }
            });
            var r = 300;
            Object.defineProperty(this, "height", {
                get: function() {
                    return r
                },
                set: function(e) {
                    r = isNaN(e) || !1 === Number.isInteger(e) || e < 0 ? 300 : e,
                    this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = r + 1)
                }
            });
            var a = [];
            Object.defineProperty(this, "childNodes", {
                get: function() {
                    return a
                },
                set: function(e) {
                    a = e
                }
            });
            var n = {};
            Object.defineProperty(this, "style", {
                get: function() {
                    return n
                },
                set: function(e) {
                    n = e
                }
            }),
            Object.defineProperty(this, "parentNode", {})
        };
        t.prototype.getContext = function(e, t) {
            var r;
            if ("2d" !== (e = e || "2d"))
                return null;
            for (r in t)
                this.pdf.context2d.hasOwnProperty(r) && (this.pdf.context2d[r] = t[r]);
            return this.pdf.context2d._canvas = this,
            this.pdf.context2d
        }
        ,
        t.prototype.toDataURL = function() {
            throw new Error("toDataURL is not implemented.")
        }
        ,
        e.events.push(["initialized", function() {
            this.canvas = new t,
            this.canvas.pdf = this
        }
        ])
    }(g.API),
    /**
     * @license
     * ====================================================================
     * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
     *               2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
     *               2013 Lee Driscoll, https://github.com/lsdriscoll
     *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
     *               2014 James Hall, james@parall.ax
     *               2014 Diego Casorran, https://github.com/diegocr
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    function(e) {
        var t = {
            left: 0,
            top: 0,
            bottom: 0,
            right: 0
        }
          , r = !1
          , a = function() {
            void 0 === this.internal.__cell__ && (this.internal.__cell__ = {},
            this.internal.__cell__.padding = 3,
            this.internal.__cell__.headerFunction = void 0,
            this.internal.__cell__.margins = Object.assign({}, t),
            this.internal.__cell__.margins.width = this.getPageWidth(),
            n.call(this))
        }
          , n = function() {
            this.internal.__cell__.lastCell = new o,
            this.internal.__cell__.pages = 1
        }
          , o = function() {
            var e = arguments[0];
            Object.defineProperty(this, "x", {
                enumerable: !0,
                get: function() {
                    return e
                },
                set: function(t) {
                    e = t
                }
            });
            var t = arguments[1];
            Object.defineProperty(this, "y", {
                enumerable: !0,
                get: function() {
                    return t
                },
                set: function(e) {
                    t = e
                }
            });
            var r = arguments[2];
            Object.defineProperty(this, "width", {
                enumerable: !0,
                get: function() {
                    return r
                },
                set: function(e) {
                    r = e
                }
            });
            var a = arguments[3];
            Object.defineProperty(this, "height", {
                enumerable: !0,
                get: function() {
                    return a
                },
                set: function(e) {
                    a = e
                }
            });
            var n = arguments[4];
            Object.defineProperty(this, "text", {
                enumerable: !0,
                get: function() {
                    return n
                },
                set: function(e) {
                    n = e
                }
            });
            var o = arguments[5];
            Object.defineProperty(this, "lineNumber", {
                enumerable: !0,
                get: function() {
                    return o
                },
                set: function(e) {
                    o = e
                }
            });
            var l = arguments[6];
            return Object.defineProperty(this, "align", {
                enumerable: !0,
                get: function() {
                    return l
                },
                set: function(e) {
                    l = e
                }
            }),
            this
        };
        o.prototype.clone = function() {
            return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)
        }
        ,
        o.prototype.toArray = function() {
            return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align]
        }
        ,
        e.setHeaderFunction = function(e) {
            return a.call(this),
            this.internal.__cell__.headerFunction = "function" == typeof e ? e : void 0,
            this
        }
        ,
        e.getTextDimensions = function(e, t) {
            a.call(this);
            var r = (t = t || {}).fontSize || this.getFontSize()
              , n = t.font || this.getFont()
              , o = t.scaleFactor || this.internal.scaleFactor
              , l = 0
              , i = 0
              , s = 0;
            if (!Array.isArray(e) && "string" != typeof e) {
                if ("number" != typeof e)
                    throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
                e = String(e)
            }
            const c = t.maxWidth;
            c > 0 ? "string" == typeof e ? e = this.splitTextToSize(e, c) : "[object Array]" === Object.prototype.toString.call(e) && (e = this.splitTextToSize(e.join(" "), c)) : e = Array.isArray(e) ? e : [e];
            for (var u = 0; u < e.length; u++)
                l < (s = this.getStringUnitWidth(e[u], {
                    font: n
                }) * r) && (l = s);
            return 0 !== l && (i = e.length),
            {
                w: l /= o,
                h: Math.max((i * r * this.getLineHeightFactor() - r * (this.getLineHeightFactor() - 1)) / o, 0)
            }
        }
        ,
        e.cellAddPage = function() {
            a.call(this),
            this.addPage();
            var e = this.internal.__cell__.margins || t;
            return this.internal.__cell__.lastCell = new o(e.left,e.top,void 0,void 0),
            this.internal.__cell__.pages += 1,
            this
        }
        ;
        var l = e.cell = function() {
            var e;
            e = arguments[0]instanceof o ? arguments[0] : new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),
            a.call(this);
            var n = this.internal.__cell__.lastCell
              , l = this.internal.__cell__.padding
              , i = this.internal.__cell__.margins || t
              , s = this.internal.__cell__.tableHeaderRow
              , c = this.internal.__cell__.printHeaders;
            return void 0 !== n.lineNumber && (n.lineNumber === e.lineNumber ? (e.x = (n.x || 0) + (n.width || 0),
            e.y = n.y || 0) : n.y + n.height + e.height + i.bottom > this.getPageHeight() ? (this.cellAddPage(),
            e.y = i.top,
            c && s && (this.printHeaderRow(e.lineNumber, !0),
            e.y += s[0].height)) : e.y = n.y + n.height || e.y),
            void 0 !== e.text[0] && (this.rect(e.x, e.y, e.width, e.height, !0 === r ? "FD" : void 0),
            "right" === e.align ? this.text(e.text, e.x + e.width - l, e.y + l, {
                align: "right",
                baseline: "top"
            }) : "center" === e.align ? this.text(e.text, e.x + e.width / 2, e.y + l, {
                align: "center",
                baseline: "top",
                maxWidth: e.width - l - l
            }) : this.text(e.text, e.x + l, e.y + l, {
                align: "left",
                baseline: "top",
                maxWidth: e.width - l - l
            })),
            this.internal.__cell__.lastCell = e,
            this
        }
        ;
        e.table = function(e, r, s, c, u) {
            if (a.call(this),
            !s)
                throw new Error("No data for PDF table.");
            var h, d, f, m, p = [], g = [], y = [], v = {}, A = {}, b = [], k = [], w = (u = u || {}).autoSize || !1, x = !1 !== u.printHeaders, S = u.css && void 0 !== u.css["font-size"] ? 16 * u.css["font-size"] : u.fontSize || 12, _ = u.margins || Object.assign({
                width: this.getPageWidth()
            }, t), C = "number" == typeof u.padding ? u.padding : 3, T = u.headerBackgroundColor || "#c8c8c8";
            if (n.call(this),
            this.internal.__cell__.printHeaders = x,
            this.internal.__cell__.margins = _,
            this.internal.__cell__.table_font_size = S,
            this.internal.__cell__.padding = C,
            this.internal.__cell__.headerBackgroundColor = T,
            this.setFontSize(S),
            null == c)
                g = p = Object.keys(s[0]),
                y = p.map((function() {
                    return "left"
                }
                ));
            else if (Array.isArray(c) && "object" == typeof c[0])
                for (p = c.map((function(e) {
                    return e.name
                }
                )),
                g = c.map((function(e) {
                    return e.prompt || e.name || ""
                }
                )),
                y = p.map((function(e) {
                    return e.align || "left"
                }
                )),
                h = 0; h < c.length; h += 1)
                    A[c[h].name] = c[h].width * (19.049976 / 25.4);
            else
                Array.isArray(c) && "string" == typeof c[0] && (g = p = c,
                y = p.map((function() {
                    return "left"
                }
                )));
            if (w)
                for (h = 0; h < p.length; h += 1) {
                    for (v[m = p[h]] = s.map((function(e) {
                        return e[m]
                    }
                    )),
                    this.setFont(void 0, "bold"),
                    b.push(this.getTextDimensions(g[h], {
                        fontSize: this.internal.__cell__.table_font_size,
                        scaleFactor: this.internal.scaleFactor
                    }).w),
                    d = v[m],
                    this.setFont(void 0, "normal"),
                    f = 0; f < d.length; f += 1)
                        b.push(this.getTextDimensions(d[f], {
                            fontSize: this.internal.__cell__.table_font_size,
                            scaleFactor: this.internal.scaleFactor
                        }).w);
                    A[m] = Math.max.apply(null, b) + C + C,
                    b = []
                }
            if (x) {
                var E = {};
                for (h = 0; h < p.length; h += 1)
                    E[p[h]] = {},
                    E[p[h]].text = g[h],
                    E[p[h]].align = y[h];
                var I = i.call(this, E, A);
                k = p.map((function(t) {
                    return new o(e,r,A[t],I,E[t].text,void 0,E[t].align)
                }
                )),
                this.setTableHeaderRow(k),
                this.printHeaderRow(1, !1)
            }
            var R = c.reduce((function(e, t) {
                return e[t.name] = t.align,
                e
            }
            ), {});
            for (h = 0; h < s.length; h += 1) {
                var B = i.call(this, s[h], A);
                for (f = 0; f < p.length; f += 1)
                    l.call(this, new o(e,r,A[p[f]],B,s[h][p[f]],h + 2,R[p[f]]))
            }
            return this.internal.__cell__.table_x = e,
            this.internal.__cell__.table_y = r,
            this
        }
        ;
        var i = function(e, t) {
            var r = this.internal.__cell__.padding
              , a = this.internal.__cell__.table_font_size
              , n = this.internal.scaleFactor;
            return Object.keys(e).map((function(t) {
                return [t, e[t]]
            }
            )).map((function(e) {
                var t = e[0]
                  , r = e[1];
                return "object" == typeof r ? [t, r.text] : [t, r]
            }
            )).map((function(e) {
                var a = e[0]
                  , n = e[1];
                return this.splitTextToSize(n, t[a] - r - r)
            }
            ), this).map((function(e) {
                return this.getLineHeightFactor() * e.length * a / n + r + r
            }
            ), this).reduce((function(e, t) {
                return Math.max(e, t)
            }
            ), 0)
        };
        e.setTableHeaderRow = function(e) {
            a.call(this),
            this.internal.__cell__.tableHeaderRow = e
        }
        ,
        e.printHeaderRow = function(e, t) {
            if (a.call(this),
            !this.internal.__cell__.tableHeaderRow)
                throw new Error("Property tableHeaderRow does not exist.");
            var n;
            if (r = !0,
            "function" == typeof this.internal.__cell__.headerFunction) {
                var i = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
                this.internal.__cell__.lastCell = new o(i[0],i[1],i[2],i[3],void 0,-1)
            }
            this.setFont(void 0, "bold");
            for (var s = [], c = 0; c < this.internal.__cell__.tableHeaderRow.length; c += 1)
                n = this.internal.__cell__.tableHeaderRow[c].clone(),
                t && (n.y = this.internal.__cell__.margins.top || 0,
                s.push(n)),
                n.lineNumber = e,
                this.setFillColor(this.internal.__cell__.headerBackgroundColor),
                l.call(this, n);
            s.length > 0 && this.setTableHeaderRow(s),
            this.setFont(void 0, "normal"),
            r = !1
        }
    }(g.API),
    function(e) {
        var t, r, a, o, l, i, s, c, u, h = function(e) {
            return e = e || {},
            this.isStrokeTransparent = e.isStrokeTransparent || !1,
            this.strokeOpacity = e.strokeOpacity || 1,
            this.strokeStyle = e.strokeStyle || "#000000",
            this.fillStyle = e.fillStyle || "#000000",
            this.isFillTransparent = e.isFillTransparent || !1,
            this.fillOpacity = e.fillOpacity || 1,
            this.font = e.font || "10px sans-serif",
            this.textBaseline = e.textBaseline || "alphabetic",
            this.textAlign = e.textAlign || "left",
            this.lineWidth = e.lineWidth || 1,
            this.lineJoin = e.lineJoin || "miter",
            this.lineCap = e.lineCap || "butt",
            this.path = e.path || [],
            this.transform = void 0 !== e.transform ? e.transform.clone() : new c,
            this.globalCompositeOperation = e.globalCompositeOperation || "normal",
            this.globalAlpha = e.globalAlpha || 1,
            this.clip_path = e.clip_path || [],
            this.currentPoint = e.currentPoint || new i,
            this.miterLimit = e.miterLimit || 10,
            this.lastPoint = e.lastPoint || new i,
            this.ignoreClearRect = "boolean" != typeof e.ignoreClearRect || e.ignoreClearRect,
            this
        };
        e.events.push(["initialized", function() {
            this.context2d = new d(this),
            t = this.internal.f2,
            r = this.internal.getCoordinateString,
            a = this.internal.getVerticalCoordinateString,
            o = this.internal.getHorizontalCoordinate,
            l = this.internal.getVerticalCoordinate,
            i = this.internal.Point,
            s = this.internal.Rectangle,
            c = this.internal.Matrix,
            u = new h
        }
        ]);
        var d = function(e) {
            Object.defineProperty(this, "canvas", {
                get: function() {
                    return {
                        parentNode: !1,
                        style: !1
                    }
                }
            });
            var t = e;
            Object.defineProperty(this, "pdf", {
                get: function() {
                    return t
                }
            });
            var r = !1;
            Object.defineProperty(this, "pageWrapXEnabled", {
                get: function() {
                    return r
                },
                set: function(e) {
                    r = Boolean(e)
                }
            });
            var a = !1;
            Object.defineProperty(this, "pageWrapYEnabled", {
                get: function() {
                    return a
                },
                set: function(e) {
                    a = Boolean(e)
                }
            });
            var n = 0;
            Object.defineProperty(this, "posX", {
                get: function() {
                    return n
                },
                set: function(e) {
                    isNaN(e) || (n = e)
                }
            });
            var o = 0;
            Object.defineProperty(this, "posY", {
                get: function() {
                    return o
                },
                set: function(e) {
                    isNaN(e) || (o = e)
                }
            });
            var l = !1;
            Object.defineProperty(this, "autoPaging", {
                get: function() {
                    return l
                },
                set: function(e) {
                    l = Boolean(e)
                }
            });
            var i = 0;
            Object.defineProperty(this, "lastBreak", {
                get: function() {
                    return i
                },
                set: function(e) {
                    i = e
                }
            });
            var s = [];
            Object.defineProperty(this, "pageBreaks", {
                get: function() {
                    return s
                },
                set: function(e) {
                    s = e
                }
            }),
            Object.defineProperty(this, "ctx", {
                get: function() {
                    return u
                },
                set: function(e) {
                    e instanceof h && (u = e)
                }
            }),
            Object.defineProperty(this, "path", {
                get: function() {
                    return u.path
                },
                set: function(e) {
                    u.path = e
                }
            });
            var c = [];
            Object.defineProperty(this, "ctxStack", {
                get: function() {
                    return c
                },
                set: function(e) {
                    c = e
                }
            }),
            Object.defineProperty(this, "fillStyle", {
                get: function() {
                    return this.ctx.fillStyle
                },
                set: function(e) {
                    var t;
                    t = f(e),
                    this.ctx.fillStyle = t.style,
                    this.ctx.isFillTransparent = 0 === t.a,
                    this.ctx.fillOpacity = t.a,
                    this.pdf.setFillColor(t.r, t.g, t.b, {
                        a: t.a
                    }),
                    this.pdf.setTextColor(t.r, t.g, t.b, {
                        a: t.a
                    })
                }
            }),
            Object.defineProperty(this, "strokeStyle", {
                get: function() {
                    return this.ctx.strokeStyle
                },
                set: function(e) {
                    var t = f(e);
                    this.ctx.strokeStyle = t.style,
                    this.ctx.isStrokeTransparent = 0 === t.a,
                    this.ctx.strokeOpacity = t.a,
                    0 === t.a ? this.pdf.setDrawColor(255, 255, 255) : (t.a,
                    this.pdf.setDrawColor(t.r, t.g, t.b))
                }
            }),
            Object.defineProperty(this, "lineCap", {
                get: function() {
                    return this.ctx.lineCap
                },
                set: function(e) {
                    -1 !== ["butt", "round", "square"].indexOf(e) && (this.ctx.lineCap = e,
                    this.pdf.setLineCap(e))
                }
            }),
            Object.defineProperty(this, "lineWidth", {
                get: function() {
                    return this.ctx.lineWidth
                },
                set: function(e) {
                    isNaN(e) || (this.ctx.lineWidth = e,
                    this.pdf.setLineWidth(e))
                }
            }),
            Object.defineProperty(this, "lineJoin", {
                get: function() {
                    return this.ctx.lineJoin
                },
                set: function(e) {
                    -1 !== ["bevel", "round", "miter"].indexOf(e) && (this.ctx.lineJoin = e,
                    this.pdf.setLineJoin(e))
                }
            }),
            Object.defineProperty(this, "miterLimit", {
                get: function() {
                    return this.ctx.miterLimit
                },
                set: function(e) {
                    isNaN(e) || (this.ctx.miterLimit = e,
                    this.pdf.setMiterLimit(e))
                }
            }),
            Object.defineProperty(this, "textBaseline", {
                get: function() {
                    return this.ctx.textBaseline
                },
                set: function(e) {
                    this.ctx.textBaseline = e
                }
            }),
            Object.defineProperty(this, "textAlign", {
                get: function() {
                    return this.ctx.textAlign
                },
                set: function(e) {
                    -1 !== ["right", "end", "center", "left", "start"].indexOf(e) && (this.ctx.textAlign = e)
                }
            }),
            Object.defineProperty(this, "font", {
                get: function() {
                    return this.ctx.font
                },
                set: function(e) {
                    var t;
                    if (this.ctx.font = e,
                    null !== (t = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(e))) {
                        var r = t[1]
                          , a = (t[2],
                        t[3])
                          , n = t[4]
                          , o = (t[5],
                        t[6])
                          , l = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(n)[2];
                        n = "px" === l ? Math.floor(parseFloat(n) * this.pdf.internal.scaleFactor) : "em" === l ? Math.floor(parseFloat(n) * this.pdf.getFontSize()) : Math.floor(parseFloat(n) * this.pdf.internal.scaleFactor),
                        this.pdf.setFontSize(n);
                        var i = "";
                        ("bold" === a || parseInt(a, 10) >= 700 || "bold" === r) && (i = "bold"),
                        "italic" === r && (i += "italic"),
                        0 === i.length && (i = "normal");
                        for (var s = "", c = o.replace(/"|'/g, "").split(/\s*,\s*/), u = {
                            arial: "Helvetica",
                            Arial: "Helvetica",
                            verdana: "Helvetica",
                            Verdana: "Helvetica",
                            helvetica: "Helvetica",
                            Helvetica: "Helvetica",
                            "sans-serif": "Helvetica",
                            fixed: "Courier",
                            monospace: "Courier",
                            terminal: "Courier",
                            cursive: "Times",
                            fantasy: "Times",
                            serif: "Times"
                        }, h = 0; h < c.length; h++) {
                            if (void 0 !== this.pdf.internal.getFont(c[h], i, {
                                noFallback: !0,
                                disableWarning: !0
                            })) {
                                s = c[h];
                                break
                            }
                            if ("bolditalic" === i && void 0 !== this.pdf.internal.getFont(c[h], "bold", {
                                noFallback: !0,
                                disableWarning: !0
                            }))
                                s = c[h],
                                i = "bold";
                            else if (void 0 !== this.pdf.internal.getFont(c[h], "normal", {
                                noFallback: !0,
                                disableWarning: !0
                            })) {
                                s = c[h],
                                i = "normal";
                                break
                            }
                        }
                        if ("" === s)
                            for (var d = 0; d < c.length; d++)
                                if (u[c[d]]) {
                                    s = u[c[d]];
                                    break
                                }
                        s = "" === s ? "Times" : s,
                        this.pdf.setFont(s, i)
                    }
                }
            }),
            Object.defineProperty(this, "globalCompositeOperation", {
                get: function() {
                    return this.ctx.globalCompositeOperation
                },
                set: function(e) {
                    this.ctx.globalCompositeOperation = e
                }
            }),
            Object.defineProperty(this, "globalAlpha", {
                get: function() {
                    return this.ctx.globalAlpha
                },
                set: function(e) {
                    this.ctx.globalAlpha = e
                }
            }),
            Object.defineProperty(this, "ignoreClearRect", {
                get: function() {
                    return this.ctx.ignoreClearRect
                },
                set: function(e) {
                    this.ctx.ignoreClearRect = Boolean(e)
                }
            })
        };
        d.prototype.fill = function() {
            b.call(this, "fill", !1)
        }
        ,
        d.prototype.stroke = function() {
            b.call(this, "stroke", !1)
        }
        ,
        d.prototype.beginPath = function() {
            this.path = [{
                type: "begin"
            }]
        }
        ,
        d.prototype.moveTo = function(e, t) {
            if (isNaN(e) || isNaN(t))
                throw n.error("jsPDF.context2d.moveTo: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
            var r = this.ctx.transform.applyToPoint(new i(e,t));
            this.path.push({
                type: "mt",
                x: r.x,
                y: r.y
            }),
            this.ctx.lastPoint = new i(e,t)
        }
        ,
        d.prototype.closePath = function() {
            var e = new i(0,0)
              , t = 0;
            for (t = this.path.length - 1; -1 !== t; t--)
                if ("begin" === this.path[t].type && "object" == typeof this.path[t + 1] && "number" == typeof this.path[t + 1].x) {
                    e = new i(this.path[t + 1].x,this.path[t + 1].y),
                    this.path.push({
                        type: "lt",
                        x: e.x,
                        y: e.y
                    });
                    break
                }
            "object" == typeof this.path[t + 2] && "number" == typeof this.path[t + 2].x && this.path.push(JSON.parse(JSON.stringify(this.path[t + 2]))),
            this.path.push({
                type: "close"
            }),
            this.ctx.lastPoint = new i(e.x,e.y)
        }
        ,
        d.prototype.lineTo = function(e, t) {
            if (isNaN(e) || isNaN(t))
                throw n.error("jsPDF.context2d.lineTo: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
            var r = this.ctx.transform.applyToPoint(new i(e,t));
            this.path.push({
                type: "lt",
                x: r.x,
                y: r.y
            }),
            this.ctx.lastPoint = new i(r.x,r.y)
        }
        ,
        d.prototype.clip = function() {
            this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)),
            b.call(this, null, !0)
        }
        ,
        d.prototype.quadraticCurveTo = function(e, t, r, a) {
            if (isNaN(r) || isNaN(a) || isNaN(e) || isNaN(t))
                throw n.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
            var o = this.ctx.transform.applyToPoint(new i(r,a))
              , l = this.ctx.transform.applyToPoint(new i(e,t));
            this.path.push({
                type: "qct",
                x1: l.x,
                y1: l.y,
                x: o.x,
                y: o.y
            }),
            this.ctx.lastPoint = new i(o.x,o.y)
        }
        ,
        d.prototype.bezierCurveTo = function(e, t, r, a, o, l) {
            if (isNaN(o) || isNaN(l) || isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a))
                throw n.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
            var s = this.ctx.transform.applyToPoint(new i(o,l))
              , c = this.ctx.transform.applyToPoint(new i(e,t))
              , u = this.ctx.transform.applyToPoint(new i(r,a));
            this.path.push({
                type: "bct",
                x1: c.x,
                y1: c.y,
                x2: u.x,
                y2: u.y,
                x: s.x,
                y: s.y
            }),
            this.ctx.lastPoint = new i(s.x,s.y)
        }
        ,
        d.prototype.arc = function(e, t, r, a, o, l) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || isNaN(o))
                throw n.error("jsPDF.context2d.arc: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.arc");
            if (l = Boolean(l),
            !this.ctx.transform.isIdentity) {
                var s = this.ctx.transform.applyToPoint(new i(e,t));
                e = s.x,
                t = s.y;
                var c = this.ctx.transform.applyToPoint(new i(0,r))
                  , u = this.ctx.transform.applyToPoint(new i(0,0));
                r = Math.sqrt(Math.pow(c.x - u.x, 2) + Math.pow(c.y - u.y, 2))
            }
            Math.abs(o - a) >= 2 * Math.PI && (a = 0,
            o = 2 * Math.PI),
            this.path.push({
                type: "arc",
                x: e,
                y: t,
                radius: r,
                startAngle: a,
                endAngle: o,
                counterclockwise: l
            })
        }
        ,
        d.prototype.arcTo = function(e, t, r, a, n) {
            throw new Error("arcTo not implemented.")
        }
        ,
        d.prototype.rect = function(e, t, r, a) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a))
                throw n.error("jsPDF.context2d.rect: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.rect");
            this.moveTo(e, t),
            this.lineTo(e + r, t),
            this.lineTo(e + r, t + a),
            this.lineTo(e, t + a),
            this.lineTo(e, t),
            this.lineTo(e + r, t),
            this.lineTo(e, t)
        }
        ,
        d.prototype.fillRect = function(e, t, r, a) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a))
                throw n.error("jsPDF.context2d.fillRect: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
            if (!m.call(this)) {
                var o = {};
                "butt" !== this.lineCap && (o.lineCap = this.lineCap,
                this.lineCap = "butt"),
                "miter" !== this.lineJoin && (o.lineJoin = this.lineJoin,
                this.lineJoin = "miter"),
                this.beginPath(),
                this.rect(e, t, r, a),
                this.fill(),
                o.hasOwnProperty("lineCap") && (this.lineCap = o.lineCap),
                o.hasOwnProperty("lineJoin") && (this.lineJoin = o.lineJoin)
            }
        }
        ,
        d.prototype.strokeRect = function(e, t, r, a) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a))
                throw n.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
            p.call(this) || (this.beginPath(),
            this.rect(e, t, r, a),
            this.stroke())
        }
        ,
        d.prototype.clearRect = function(e, t, r, a) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a))
                throw n.error("jsPDF.context2d.clearRect: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
            this.ignoreClearRect || (this.fillStyle = "#ffffff",
            this.fillRect(e, t, r, a))
        }
        ,
        d.prototype.save = function(e) {
            e = "boolean" != typeof e || e;
            for (var t = this.pdf.internal.getCurrentPageInfo().pageNumber, r = 0; r < this.pdf.internal.getNumberOfPages(); r++)
                this.pdf.setPage(r + 1),
                this.pdf.internal.out("q");
            if (this.pdf.setPage(t),
            e) {
                this.ctx.fontSize = this.pdf.internal.getFontSize();
                var a = new h(this.ctx);
                this.ctxStack.push(this.ctx),
                this.ctx = a
            }
        }
        ,
        d.prototype.restore = function(e) {
            e = "boolean" != typeof e || e;
            for (var t = this.pdf.internal.getCurrentPageInfo().pageNumber, r = 0; r < this.pdf.internal.getNumberOfPages(); r++)
                this.pdf.setPage(r + 1),
                this.pdf.internal.out("Q");
            this.pdf.setPage(t),
            e && 0 !== this.ctxStack.length && (this.ctx = this.ctxStack.pop(),
            this.fillStyle = this.ctx.fillStyle,
            this.strokeStyle = this.ctx.strokeStyle,
            this.font = this.ctx.font,
            this.lineCap = this.ctx.lineCap,
            this.lineWidth = this.ctx.lineWidth,
            this.lineJoin = this.ctx.lineJoin)
        }
        ,
        d.prototype.toDataURL = function() {
            throw new Error("toDataUrl not implemented.")
        }
        ;
        var f = function(e) {
            var t, r, a, n;
            if (!0 === e.isCanvasGradient && (e = e.getColor()),
            !e)
                return {
                    r: 0,
                    g: 0,
                    b: 0,
                    a: 0,
                    style: e
                };
            if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))
                t = 0,
                r = 0,
                a = 0,
                n = 0;
            else {
                var o = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);
                if (null !== o)
                    t = parseInt(o[1]),
                    r = parseInt(o[2]),
                    a = parseInt(o[3]),
                    n = 1;
                else if (null !== (o = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))
                    t = parseInt(o[1]),
                    r = parseInt(o[2]),
                    a = parseInt(o[3]),
                    n = parseFloat(o[4]);
                else {
                    if (n = 1,
                    "string" == typeof e && "#" !== e.charAt(0)) {
                        var l = new c$1(e);
                        e = l.ok ? l.toHex() : "#000000"
                    }
                    4 === e.length ? (t = e.substring(1, 2),
                    t += t,
                    r = e.substring(2, 3),
                    r += r,
                    a = e.substring(3, 4),
                    a += a) : (t = e.substring(1, 3),
                    r = e.substring(3, 5),
                    a = e.substring(5, 7)),
                    t = parseInt(t, 16),
                    r = parseInt(r, 16),
                    a = parseInt(a, 16)
                }
            }
            return {
                r: t,
                g: r,
                b: a,
                a: n,
                style: e
            }
        }
          , m = function() {
            return this.ctx.isFillTransparent || 0 == this.globalAlpha
        }
          , p = function() {
            return Boolean(this.ctx.isStrokeTransparent || 0 == this.globalAlpha)
        };
        d.prototype.fillText = function(e, t, r, a) {
            if (isNaN(t) || isNaN(r) || "string" != typeof e)
                throw n.error("jsPDF.context2d.fillText: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.fillText");
            if (a = isNaN(a) ? void 0 : a,
            !m.call(this)) {
                r = w.call(this, r);
                var o = F(this.ctx.transform.rotation)
                  , l = this.ctx.transform.scaleX;
                T.call(this, {
                    text: e,
                    x: t,
                    y: r,
                    scale: l,
                    angle: o,
                    align: this.textAlign,
                    maxWidth: a
                })
            }
        }
        ,
        d.prototype.strokeText = function(e, t, r, a) {
            if (isNaN(t) || isNaN(r) || "string" != typeof e)
                throw n.error("jsPDF.context2d.strokeText: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
            if (!p.call(this)) {
                a = isNaN(a) ? void 0 : a,
                r = w.call(this, r);
                var o = F(this.ctx.transform.rotation)
                  , l = this.ctx.transform.scaleX;
                T.call(this, {
                    text: e,
                    x: t,
                    y: r,
                    scale: l,
                    renderingMode: "stroke",
                    angle: o,
                    align: this.textAlign,
                    maxWidth: a
                })
            }
        }
        ,
        d.prototype.measureText = function(e) {
            if ("string" != typeof e)
                throw n.error("jsPDF.context2d.measureText: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.measureText");
            var t = this.pdf
              , r = this.pdf.internal.scaleFactor
              , a = t.internal.getFontSize()
              , o = t.getStringUnitWidth(e) * a / t.internal.scaleFactor
              , l = function(e) {
                var t = (e = e || {}).width || 0;
                return Object.defineProperty(this, "width", {
                    get: function() {
                        return t
                    }
                }),
                this
            };
            return new l({
                width: o *= Math.round(96 * r / 72 * 1e4) / 1e4
            })
        }
        ,
        d.prototype.scale = function(e, t) {
            if (isNaN(e) || isNaN(t))
                throw n.error("jsPDF.context2d.scale: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.scale");
            var r = new c(e,0,0,t,0,0);
            this.ctx.transform = this.ctx.transform.multiply(r)
        }
        ,
        d.prototype.rotate = function(e) {
            if (isNaN(e))
                throw n.error("jsPDF.context2d.rotate: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.rotate");
            var t = new c(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);
            this.ctx.transform = this.ctx.transform.multiply(t)
        }
        ,
        d.prototype.translate = function(e, t) {
            if (isNaN(e) || isNaN(t))
                throw n.error("jsPDF.context2d.translate: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.translate");
            var r = new c(1,0,0,1,e,t);
            this.ctx.transform = this.ctx.transform.multiply(r)
        }
        ,
        d.prototype.transform = function(e, t, r, a, o, l) {
            if (isNaN(e) || isNaN(t) || isNaN(r) || isNaN(a) || isNaN(o) || isNaN(l))
                throw n.error("jsPDF.context2d.transform: Invalid arguments", arguments),
                new Error("Invalid arguments passed to jsPDF.context2d.transform");
            var i = new c(e,t,r,a,o,l);
            this.ctx.transform = this.ctx.transform.multiply(i)
        }
        ,
        d.prototype.setTransform = function(e, t, r, a, n, o) {
            e = isNaN(e) ? 1 : e,
            t = isNaN(t) ? 0 : t,
            r = isNaN(r) ? 0 : r,
            a = isNaN(a) ? 1 : a,
            n = isNaN(n) ? 0 : n,
            o = isNaN(o) ? 0 : o,
            this.ctx.transform = new c(e,t,r,a,n,o)
        }
        ,
        d.prototype.drawImage = function(e, t, r, a, n, o, l, i, u) {
            var h = this.pdf.getImageProperties(e)
              , d = 1
              , f = 1
              , m = 1
              , p = 1;
            void 0 !== a && void 0 !== i && (m = i / a,
            p = u / n,
            d = h.width / a * i / a,
            f = h.height / n * u / n),
            void 0 === o && (o = t,
            l = r,
            t = 0,
            r = 0),
            void 0 !== a && void 0 === i && (i = a,
            u = n),
            void 0 === a && void 0 === i && (i = h.width,
            u = h.height);
            for (var y, b = this.ctx.transform.decompose(), w = F(b.rotate.shx), x = new c, S = (x = (x = (x = x.multiply(b.translate)).multiply(b.skew)).multiply(b.scale)).applyToRectangle(new s(o - t * m,l - r * p,a * d,n * f)), _ = g.call(this, S), C = [], T = 0; T < _.length; T += 1)
                -1 === C.indexOf(_[T]) && C.push(_[T]);
            if (A(C),
            this.autoPaging)
                for (var E = C[0], I = C[C.length - 1], R = E; R < I + 1; R++) {
                    if (this.pdf.setPage(R),
                    0 !== this.ctx.clip_path.length) {
                        var B = this.path;
                        y = JSON.parse(JSON.stringify(this.ctx.clip_path)),
                        this.path = v(y, this.posX, -1 * this.pdf.internal.pageSize.height * (R - 1) + this.posY),
                        k.call(this, "fill", !0),
                        this.path = B
                    }
                    var N = JSON.parse(JSON.stringify(S));
                    N = v([N], this.posX, -1 * this.pdf.internal.pageSize.height * (R - 1) + this.posY)[0],
                    this.pdf.addImage(e, "JPEG", N.x, N.y, N.w, N.h, null, null, w)
                }
            else
                this.pdf.addImage(e, "JPEG", S.x, S.y, S.w, S.h, null, null, w)
        }
        ;
        var g = function(e, t, r) {
            var a = [];
            switch (t = t || this.pdf.internal.pageSize.width,
            r = r || this.pdf.internal.pageSize.height,
            e.type) {
            default:
            case "mt":
            case "lt":
                a.push(Math.floor((e.y + this.posY) / r) + 1);
                break;
            case "arc":
                a.push(Math.floor((e.y + this.posY - e.radius) / r) + 1),
                a.push(Math.floor((e.y + this.posY + e.radius) / r) + 1);
                break;
            case "qct":
                var n = P(this.ctx.lastPoint.x, this.ctx.lastPoint.y, e.x1, e.y1, e.x, e.y);
                a.push(Math.floor(n.y / r) + 1),
                a.push(Math.floor((n.y + n.h) / r) + 1);
                break;
            case "bct":
                var o = $(this.ctx.lastPoint.x, this.ctx.lastPoint.y, e.x1, e.y1, e.x2, e.y2, e.x, e.y);
                a.push(Math.floor(o.y / r) + 1),
                a.push(Math.floor((o.y + o.h) / r) + 1);
                break;
            case "rect":
                a.push(Math.floor((e.y + this.posY) / r) + 1),
                a.push(Math.floor((e.y + e.h + this.posY) / r) + 1)
            }
            for (var l = 0; l < a.length; l += 1)
                for (; this.pdf.internal.getNumberOfPages() < a[l]; )
                    y.call(this);
            return a
        }
          , y = function() {
            var e = this.fillStyle
              , t = this.strokeStyle
              , r = this.font
              , a = this.lineCap
              , n = this.lineWidth
              , o = this.lineJoin;
            this.pdf.addPage(),
            this.fillStyle = e,
            this.strokeStyle = t,
            this.font = r,
            this.lineCap = a,
            this.lineWidth = n,
            this.lineJoin = o
        }
          , v = function(e, t, r) {
            for (var a = 0; a < e.length; a++)
                switch (e[a].type) {
                case "bct":
                    e[a].x2 += t,
                    e[a].y2 += r;
                case "qct":
                    e[a].x1 += t,
                    e[a].y1 += r;
                case "mt":
                case "lt":
                case "arc":
                default:
                    e[a].x += t,
                    e[a].y += r
                }
            return e
        }
          , A = function(e) {
            return e.sort((function(e, t) {
                return e - t
            }
            ))
        }
          , b = function(e, t) {
            for (var r, a, n = this.fillStyle, o = this.strokeStyle, l = this.lineCap, i = this.lineWidth, s = i * this.ctx.transform.scaleX, c = this.lineJoin, u = JSON.parse(JSON.stringify(this.path)), h = JSON.parse(JSON.stringify(this.path)), d = [], f = 0; f < h.length; f++)
                if (void 0 !== h[f].x)
                    for (var m = g.call(this, h[f]), p = 0; p < m.length; p += 1)
                        -1 === d.indexOf(m[p]) && d.push(m[p]);
            for (var b = 0; b < d.length; b++)
                for (; this.pdf.internal.getNumberOfPages() < d[b]; )
                    y.call(this);
            if (A(d),
            this.autoPaging)
                for (var w = d[0], x = d[d.length - 1], S = w; S < x + 1; S++) {
                    if (this.pdf.setPage(S),
                    this.fillStyle = n,
                    this.strokeStyle = o,
                    this.lineCap = l,
                    this.lineWidth = s,
                    this.lineJoin = c,
                    0 !== this.ctx.clip_path.length) {
                        var _ = this.path;
                        r = JSON.parse(JSON.stringify(this.ctx.clip_path)),
                        this.path = v(r, this.posX, -1 * this.pdf.internal.pageSize.height * (S - 1) + this.posY),
                        k.call(this, e, !0),
                        this.path = _
                    }
                    a = JSON.parse(JSON.stringify(u)),
                    this.path = v(a, this.posX, -1 * this.pdf.internal.pageSize.height * (S - 1) + this.posY),
                    !1 !== t && 0 !== S || k.call(this, e, t),
                    this.lineWidth = i
                }
            else
                this.lineWidth = s,
                k.call(this, e, t),
                this.lineWidth = i;
            this.path = u
        }
          , k = function(e, t) {
            if (("stroke" !== e || t || !p.call(this)) && ("stroke" === e || t || !m.call(this))) {
                for (var r, a, n = [], o = this.path, l = 0; l < o.length; l++) {
                    var i = o[l];
                    switch (i.type) {
                    case "begin":
                        n.push({
                            begin: !0
                        });
                        break;
                    case "close":
                        n.push({
                            close: !0
                        });
                        break;
                    case "mt":
                        n.push({
                            start: i,
                            deltas: [],
                            abs: []
                        });
                        break;
                    case "lt":
                        var s = n.length;
                        if (!isNaN(o[l - 1].x) && (r = [i.x - o[l - 1].x, i.y - o[l - 1].y],
                        s > 0))
                            for (; s >= 0; s--)
                                if (!0 !== n[s - 1].close && !0 !== n[s - 1].begin) {
                                    n[s - 1].deltas.push(r),
                                    n[s - 1].abs.push(i);
                                    break
                                }
                        break;
                    case "bct":
                        r = [i.x1 - o[l - 1].x, i.y1 - o[l - 1].y, i.x2 - o[l - 1].x, i.y2 - o[l - 1].y, i.x - o[l - 1].x, i.y - o[l - 1].y],
                        n[n.length - 1].deltas.push(r);
                        break;
                    case "qct":
                        var c = o[l - 1].x + 2 / 3 * (i.x1 - o[l - 1].x)
                          , u = o[l - 1].y + 2 / 3 * (i.y1 - o[l - 1].y)
                          , h = i.x + 2 / 3 * (i.x1 - i.x)
                          , d = i.y + 2 / 3 * (i.y1 - i.y)
                          , f = i.x
                          , g = i.y;
                        r = [c - o[l - 1].x, u - o[l - 1].y, h - o[l - 1].x, d - o[l - 1].y, f - o[l - 1].x, g - o[l - 1].y],
                        n[n.length - 1].deltas.push(r);
                        break;
                    case "arc":
                        n.push({
                            deltas: [],
                            abs: [],
                            arc: !0
                        }),
                        Array.isArray(n[n.length - 1].abs) && n[n.length - 1].abs.push(i)
                    }
                }
                a = t ? null : "stroke" === e ? "stroke" : "fill";
                for (var y = 0; y < n.length; y++) {
                    if (n[y].arc) {
                        for (var v = n[y].abs, A = 0; A < v.length; A++) {
                            var b = v[A];
                            "arc" === b.type ? x.call(this, b.x, b.y, b.radius, b.startAngle, b.endAngle, b.counterclockwise, void 0, t) : E.call(this, b.x, b.y)
                        }
                        S.call(this, a),
                        this.pdf.internal.out("h")
                    }
                    if (!n[y].arc && !0 !== n[y].close && !0 !== n[y].begin) {
                        var k = n[y].start.x
                          , w = n[y].start.y;
                        I.call(this, n[y].deltas, k, w)
                    }
                }
                a && S.call(this, a),
                t && _.call(this)
            }
        }
          , w = function(e) {
            var t = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor
              , r = t * (this.pdf.internal.getLineHeightFactor() - 1);
            switch (this.ctx.textBaseline) {
            case "bottom":
                return e - r;
            case "top":
                return e + t - r;
            case "hanging":
                return e + t - 2 * r;
            case "middle":
                return e + t / 2 - r;
            case "ideographic":
                return e;
            case "alphabetic":
            default:
                return e
            }
        };
        d.prototype.createLinearGradient = function() {
            var e = function() {};
            return e.colorStops = [],
            e.addColorStop = function(e, t) {
                this.colorStops.push([e, t])
            }
            ,
            e.getColor = function() {
                return 0 === this.colorStops.length ? "#000000" : this.colorStops[0][1]
            }
            ,
            e.isCanvasGradient = !0,
            e
        }
        ,
        d.prototype.createPattern = function() {
            return this.createLinearGradient()
        }
        ,
        d.prototype.createRadialGradient = function() {
            return this.createLinearGradient()
        }
        ;
        var x = function(e, t, r, a, n, o, l, i) {
            for (var s = B.call(this, r, a, n, o), c = 0; c < s.length; c++) {
                var u = s[c];
                0 === c && C.call(this, u.x1 + e, u.y1 + t),
                R.call(this, e, t, u.x2, u.y2, u.x3, u.y3, u.x4, u.y4)
            }
            i ? _.call(this) : S.call(this, l)
        }
          , S = function(e) {
            switch (e) {
            case "stroke":
                this.pdf.internal.out("S");
                break;
            case "fill":
                this.pdf.internal.out("f")
            }
        }
          , _ = function() {
            this.pdf.clip(),
            this.pdf.discardPath()
        }
          , C = function(e, t) {
            this.pdf.internal.out(r(e) + " " + a(t) + " m")
        }
          , T = function(e) {
            var t;
            switch (e.align) {
            case "right":
            case "end":
                t = "right";
                break;
            case "center":
                t = "center";
                break;
            case "left":
            case "start":
            default:
                t = "left"
            }
            var r = this.ctx.transform.applyToPoint(new i(e.x,e.y))
              , a = this.ctx.transform.decompose()
              , n = new c;
            n = (n = (n = n.multiply(a.translate)).multiply(a.skew)).multiply(a.scale);
            for (var o, l, u, h = this.pdf.getTextDimensions(e.text), d = this.ctx.transform.applyToRectangle(new s(e.x,e.y,h.w,h.h)), f = n.applyToRectangle(new s(e.x,e.y - h.h,h.w,h.h)), m = g.call(this, f), p = [], y = 0; y < m.length; y += 1)
                -1 === p.indexOf(m[y]) && p.push(m[y]);
            if (A(p),
            !0 === this.autoPaging)
                for (var b = p[0], w = p[p.length - 1], x = b; x < w + 1; x++) {
                    if (this.pdf.setPage(x),
                    0 !== this.ctx.clip_path.length) {
                        var S = this.path;
                        o = JSON.parse(JSON.stringify(this.ctx.clip_path)),
                        this.path = v(o, this.posX, -1 * this.pdf.internal.pageSize.height * (x - 1) + this.posY),
                        k.call(this, "fill", !0),
                        this.path = S
                    }
                    var _ = JSON.parse(JSON.stringify(d));
                    _ = v([_], this.posX, -1 * this.pdf.internal.pageSize.height * (x - 1) + this.posY)[0],
                    e.scale >= .01 && (l = this.pdf.internal.getFontSize(),
                    this.pdf.setFontSize(l * e.scale),
                    u = this.lineWidth,
                    this.lineWidth = u * e.scale),
                    this.pdf.text(e.text, _.x, _.y, {
                        angle: e.angle,
                        align: t,
                        renderingMode: e.renderingMode,
                        maxWidth: e.maxWidth
                    }),
                    e.scale >= .01 && (this.pdf.setFontSize(l),
                    this.lineWidth = u)
                }
            else
                e.scale >= .01 && (l = this.pdf.internal.getFontSize(),
                this.pdf.setFontSize(l * e.scale),
                u = this.lineWidth,
                this.lineWidth = u * e.scale),
                this.pdf.text(e.text, r.x + this.posX, r.y + this.posY, {
                    angle: e.angle,
                    align: t,
                    renderingMode: e.renderingMode,
                    maxWidth: e.maxWidth
                }),
                e.scale >= .01 && (this.pdf.setFontSize(l),
                this.lineWidth = u)
        }
          , E = function(e, t, n, o) {
            n = n || 0,
            o = o || 0,
            this.pdf.internal.out(r(e + n) + " " + a(t + o) + " l")
        }
          , I = function(e, t, r) {
            return this.pdf.lines(e, t, r, null, null)
        }
          , R = function(e, r, a, n, i, s, c, u) {
            this.pdf.internal.out([t(o(a + e)), t(l(n + r)), t(o(i + e)), t(l(s + r)), t(o(c + e)), t(l(u + r)), "c"].join(" "))
        }
          , B = function(e, t, r, a) {
            for (var n = 2 * Math.PI, o = Math.PI / 2; t > r; )
                t -= n;
            var l = Math.abs(r - t);
            l < n && a && (l = n - l);
            for (var i = [], s = a ? -1 : 1, c = t; l > 1e-5; ) {
                var u = c + s * Math.min(l, o);
                i.push(N.call(this, e, c, u)),
                l -= Math.abs(u - c),
                c = u
            }
            return i
        }
          , N = function(e, t, r) {
            var a = (r - t) / 2
              , n = e * Math.cos(a)
              , o = e * Math.sin(a)
              , l = n
              , i = -o
              , s = l * l + i * i
              , c = s + l * n + i * o
              , u = 4 / 3 * (Math.sqrt(2 * s * c) - c) / (l * o - i * n)
              , h = l - u * i
              , d = i + u * l
              , f = h
              , m = -d
              , p = a + t
              , g = Math.cos(p)
              , y = Math.sin(p);
            return {
                x1: e * Math.cos(t),
                y1: e * Math.sin(t),
                x2: h * g - d * y,
                y2: h * y + d * g,
                x3: f * g - m * y,
                y3: f * y + m * g,
                x4: e * Math.cos(r),
                y4: e * Math.sin(r)
            }
        }
          , F = function(e) {
            return 180 * e / Math.PI
        }
          , P = function(e, t, r, a, n, o) {
            var l = e + .5 * (r - e)
              , i = t + .5 * (a - t)
              , c = n + .5 * (r - n)
              , u = o + .5 * (a - o)
              , h = Math.min(e, n, l, c)
              , d = Math.max(e, n, l, c)
              , f = Math.min(t, o, i, u)
              , m = Math.max(t, o, i, u);
            return new s(h,f,d - h,m - f)
        }
          , $ = function(e, t, r, a, n, o, l, i) {
            var c, u, h, d, f, m, p, g, y, v, A, b, k, w, x = r - e, S = a - t, _ = n - r, C = o - a, T = l - n, E = i - o;
            for (u = 0; u < 41; u++)
                y = (p = (h = e + (c = u / 40) * x) + c * ((f = r + c * _) - h)) + c * (f + c * (n + c * T - f) - p),
                v = (g = (d = t + c * S) + c * ((m = a + c * C) - d)) + c * (m + c * (o + c * E - m) - g),
                0 == u ? (A = y,
                b = v,
                k = y,
                w = v) : (A = Math.min(A, y),
                b = Math.min(b, v),
                k = Math.max(k, y),
                w = Math.max(w, v));
            return new s(Math.round(A),Math.round(b),Math.round(k - A),Math.round(w - b))
        }
    }(g.API);
    /**
     * @license
     Copyright (c) 2013 Gildas Lormeau. All rights reserved.

     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:

     1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

     2. Redistributions in binary form must reproduce the above copyright 
     notice, this list of conditions and the following disclaimer in 
     the documentation and/or other materials provided with the distribution.

     3. The names of the authors may not be used to endorse or promote products
     derived from this software without specific prior written permission.

     THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
     FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
     INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    var lt = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29];
    function ft() {
        var e = this;
        function t(e, t) {
            var r = 0;
            do {
                r |= 1 & e,
                e >>>= 1,
                r <<= 1
            } while (--t > 0);return r >>> 1
        }
        e.build_tree = function(r) {
            var a, n, o, l = e.dyn_tree, i = e.stat_desc.static_tree, s = e.stat_desc.elems, c = -1;
            for (r.heap_len = 0,
            r.heap_max = 573,
            a = 0; a < s; a++)
                0 !== l[2 * a] ? (r.heap[++r.heap_len] = c = a,
                r.depth[a] = 0) : l[2 * a + 1] = 0;
            for (; r.heap_len < 2; )
                l[2 * (o = r.heap[++r.heap_len] = c < 2 ? ++c : 0)] = 1,
                r.depth[o] = 0,
                r.opt_len--,
                i && (r.static_len -= i[2 * o + 1]);
            for (e.max_code = c,
            a = Math.floor(r.heap_len / 2); a >= 1; a--)
                r.pqdownheap(l, a);
            o = s;
            do {
                a = r.heap[1],
                r.heap[1] = r.heap[r.heap_len--],
                r.pqdownheap(l, 1),
                n = r.heap[1],
                r.heap[--r.heap_max] = a,
                r.heap[--r.heap_max] = n,
                l[2 * o] = l[2 * a] + l[2 * n],
                r.depth[o] = Math.max(r.depth[a], r.depth[n]) + 1,
                l[2 * a + 1] = l[2 * n + 1] = o,
                r.heap[1] = o++,
                r.pqdownheap(l, 1)
            } while (r.heap_len >= 2);r.heap[--r.heap_max] = r.heap[1],
            function(t) {
                var r, a, n, o, l, i, s = e.dyn_tree, c = e.stat_desc.static_tree, u = e.stat_desc.extra_bits, h = e.stat_desc.extra_base, d = e.stat_desc.max_length, f = 0;
                for (o = 0; o <= 15; o++)
                    t.bl_count[o] = 0;
                for (s[2 * t.heap[t.heap_max] + 1] = 0,
                r = t.heap_max + 1; r < 573; r++)
                    (o = s[2 * s[2 * (a = t.heap[r]) + 1] + 1] + 1) > d && (o = d,
                    f++),
                    s[2 * a + 1] = o,
                    a > e.max_code || (t.bl_count[o]++,
                    l = 0,
                    a >= h && (l = u[a - h]),
                    i = s[2 * a],
                    t.opt_len += i * (o + l),
                    c && (t.static_len += i * (c[2 * a + 1] + l)));
                if (0 !== f) {
                    do {
                        for (o = d - 1; 0 === t.bl_count[o]; )
                            o--;
                        t.bl_count[o]--,
                        t.bl_count[o + 1] += 2,
                        t.bl_count[d]--,
                        f -= 2
                    } while (f > 0);for (o = d; 0 !== o; o--)
                        for (a = t.bl_count[o]; 0 !== a; )
                            (n = t.heap[--r]) > e.max_code || (s[2 * n + 1] !== o && (t.opt_len += (o - s[2 * n + 1]) * s[2 * n],
                            s[2 * n + 1] = o),
                            a--)
                }
            }(r),
            function(e, r, a) {
                var n, o, l, i = [], s = 0;
                for (n = 1; n <= 15; n++)
                    i[n] = s = s + a[n - 1] << 1;
                for (o = 0; o <= r; o++)
                    0 !== (l = e[2 * o + 1]) && (e[2 * o] = t(i[l]++, l))
            }(l, e.max_code, r.bl_count)
        }
    }
    function dt(e, t, r, a, n) {
        this.static_tree = e,
        this.extra_bits = t,
        this.extra_base = r,
        this.elems = a,
        this.max_length = n
    }
    function pt(e, t, r, a, n) {
        this.good_length = e,
        this.max_lazy = t,
        this.nice_length = r,
        this.max_chain = a,
        this.func = n
    }
    ft._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28],
    ft.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0],
    ft.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576],
    ft.d_code = function(e) {
        return e < 256 ? lt[e] : lt[256 + (e >>> 7)]
    }
    ,
    ft.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0],
    ft.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13],
    ft.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7],
    ft.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
    dt.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8],
    dt.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5],
    dt.static_l_desc = new dt(dt.static_ltree,ft.extra_lbits,257,286,15),
    dt.static_d_desc = new dt(dt.static_dtree,ft.extra_dbits,0,30,15),
    dt.static_bl_desc = new dt(null,ft.extra_blbits,0,19,7);
    var gt, mt, vt, bt = [new pt(0,0,0,0,0), new pt(4,4,8,4,1), new pt(4,5,16,8,1), new pt(4,6,32,32,1), new pt(4,4,16,16,2), new pt(8,16,32,32,2), new pt(8,16,128,128,2), new pt(8,32,128,256,2), new pt(32,128,258,1024,2), new pt(32,258,258,4096,2)], yt = ["need dictionary", "stream end", "", "", "stream error", "data error", "", "buffer error", "", ""];
    function wt(e, t, r, a) {
        var n = e[2 * t]
          , o = e[2 * r];
        return n < o || n === o && a[t] <= a[r]
    }
    function Nt() {
        var e, t, r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _, C, T, E, I, R, B, N, F, P, $, L, O, D, M, U, H = this, q = new ft, z = new ft, j = new ft;
        function V() {
            var e;
            for (e = 0; e < 286; e++)
                R[2 * e] = 0;
            for (e = 0; e < 30; e++)
                B[2 * e] = 0;
            for (e = 0; e < 19; e++)
                N[2 * e] = 0;
            R[512] = 1,
            H.opt_len = H.static_len = 0,
            $ = O = 0
        }
        function Q(e, t) {
            var r, a, n = -1, o = e[1], l = 0, i = 7, s = 4;
            for (0 === o && (i = 138,
            s = 3),
            e[2 * (t + 1) + 1] = 65535,
            r = 0; r <= t; r++)
                a = o,
                o = e[2 * (r + 1) + 1],
                ++l < i && a === o || (l < s ? N[2 * a] += l : 0 !== a ? (a !== n && N[2 * a]++,
                N[32]++) : l <= 10 ? N[34]++ : N[36]++,
                l = 0,
                n = a,
                0 === o ? (i = 138,
                s = 3) : a === o ? (i = 6,
                s = 3) : (i = 7,
                s = 4))
        }
        function G(e) {
            H.pending_buf[H.pending++] = e
        }
        function K(e) {
            G(255 & e),
            G(e >>> 8 & 255)
        }
        function W(e, t) {
            var r, a = t;
            U > 16 - a ? (K(M |= (r = e) << U & 65535),
            M = r >>> 16 - U,
            U += a - 16) : (M |= e << U & 65535,
            U += a)
        }
        function Y(e, t) {
            var r = 2 * e;
            W(65535 & t[r], 65535 & t[r + 1])
        }
        function X(e, t) {
            var r, a, n = -1, o = e[1], l = 0, i = 7, s = 4;
            for (0 === o && (i = 138,
            s = 3),
            r = 0; r <= t; r++)
                if (a = o,
                o = e[2 * (r + 1) + 1],
                !(++l < i && a === o)) {
                    if (l < s)
                        do {
                            Y(a, N)
                        } while (0 != --l);
                    else
                        0 !== a ? (a !== n && (Y(a, N),
                        l--),
                        Y(16, N),
                        W(l - 3, 2)) : l <= 10 ? (Y(17, N),
                        W(l - 3, 3)) : (Y(18, N),
                        W(l - 11, 7));
                    l = 0,
                    n = a,
                    0 === o ? (i = 138,
                    s = 3) : a === o ? (i = 6,
                    s = 3) : (i = 7,
                    s = 4)
                }
        }
        function J() {
            16 === U ? (K(M),
            M = 0,
            U = 0) : U >= 8 && (G(255 & M),
            M >>>= 8,
            U -= 8)
        }
        function Z(e, t) {
            var r, a, n;
            if (H.pending_buf[L + 2 * $] = e >>> 8 & 255,
            H.pending_buf[L + 2 * $ + 1] = 255 & e,
            H.pending_buf[F + $] = 255 & t,
            $++,
            0 === e ? R[2 * t]++ : (O++,
            e--,
            R[2 * (ft._length_code[t] + 256 + 1)]++,
            B[2 * ft.d_code(e)]++),
            0 == (8191 & $) && C > 2) {
                for (r = 8 * $,
                a = b - g,
                n = 0; n < 30; n++)
                    r += B[2 * n] * (5 + ft.extra_dbits[n]);
                if (r >>>= 3,
                O < Math.floor($ / 2) && r < Math.floor(a / 2))
                    return !0
            }
            return $ === P - 1
        }
        function ee(e, t) {
            var r, a, n, o, l = 0;
            if (0 !== $)
                do {
                    r = H.pending_buf[L + 2 * l] << 8 & 65280 | 255 & H.pending_buf[L + 2 * l + 1],
                    a = 255 & H.pending_buf[F + l],
                    l++,
                    0 === r ? Y(a, e) : (Y((n = ft._length_code[a]) + 256 + 1, e),
                    0 !== (o = ft.extra_lbits[n]) && W(a -= ft.base_length[n], o),
                    r--,
                    Y(n = ft.d_code(r), t),
                    0 !== (o = ft.extra_dbits[n]) && W(r -= ft.base_dist[n], o))
                } while (l < $);Y(256, e),
            D = e[513]
        }
        function te() {
            U > 8 ? K(M) : U > 0 && G(255 & M),
            M = 0,
            U = 0
        }
        function re(e, t, r) {
            W(0 + (r ? 1 : 0), 3),
            function(e, t, r) {
                te(),
                D = 8,
                K(t),
                K(~t),
                H.pending_buf.set(i.subarray(e, e + t), H.pending),
                H.pending += t
            }(e, t)
        }
        function ae(t) {
            (function(e, t, r) {
                var a, n, o = 0;
                C > 0 ? (q.build_tree(H),
                z.build_tree(H),
                o = function() {
                    var e;
                    for (Q(R, q.max_code),
                    Q(B, z.max_code),
                    j.build_tree(H),
                    e = 18; e >= 3 && 0 === N[2 * ft.bl_order[e] + 1]; e--)
                        ;
                    return H.opt_len += 3 * (e + 1) + 5 + 5 + 4,
                    e
                }(),
                a = H.opt_len + 3 + 7 >>> 3,
                (n = H.static_len + 3 + 7 >>> 3) <= a && (a = n)) : a = n = t + 5,
                t + 4 <= a && -1 !== e ? re(e, t, r) : n === a ? (W(2 + (r ? 1 : 0), 3),
                ee(dt.static_ltree, dt.static_dtree)) : (W(4 + (r ? 1 : 0), 3),
                function(e, t, r) {
                    var a;
                    for (W(e - 257, 5),
                    W(t - 1, 5),
                    W(r - 4, 4),
                    a = 0; a < r; a++)
                        W(N[2 * ft.bl_order[a] + 1], 3);
                    X(R, e - 1),
                    X(B, t - 1)
                }(q.max_code + 1, z.max_code + 1, o + 1),
                ee(R, B)),
                V(),
                r && te()
            }
            )(g >= 0 ? g : -1, b - g, t),
            g = b,
            e.flush_pending()
        }
        function ne() {
            var t, r, a, o;
            do {
                if (0 == (o = s - w - b) && 0 === b && 0 === w)
                    o = n;
                else if (-1 === o)
                    o--;
                else if (b >= n + n - 262) {
                    i.set(i.subarray(n, n + n), 0),
                    k -= n,
                    b -= n,
                    g -= n,
                    a = t = d;
                    do {
                        r = 65535 & u[--a],
                        u[a] = r >= n ? r - n : 0
                    } while (0 != --t);a = t = n;
                    do {
                        r = 65535 & c[--a],
                        c[a] = r >= n ? r - n : 0
                    } while (0 != --t);o += n
                }
                if (0 === e.avail_in)
                    return;
                t = e.read_buf(i, b + w, o),
                (w += t) >= 3 && (h = ((h = 255 & i[b]) << p ^ 255 & i[b + 1]) & m)
            } while (w < 262 && 0 !== e.avail_in)
        }
        function oe(e) {
            var t, r, a = S, o = b, s = x, u = b > n - 262 ? b - (n - 262) : 0, h = I, d = l, f = b + 258, m = i[o + s - 1], p = i[o + s];
            x >= E && (a >>= 2),
            h > w && (h = w);
            do {
                if (i[(t = e) + s] === p && i[t + s - 1] === m && i[t] === i[o] && i[++t] === i[o + 1]) {
                    o += 2,
                    t++;
                    do {} while (i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && i[++o] === i[++t] && o < f);if (r = 258 - (f - o),
                    o = f - 258,
                    r > s) {
                        if (k = e,
                        s = r,
                        r >= h)
                            break;
                        m = i[o + s - 1],
                        p = i[o + s]
                    }
                }
            } while ((e = 65535 & c[e & d]) > u && 0 != --a);return s <= w ? s : w
        }
        function le(e) {
            return e.total_in = e.total_out = 0,
            e.msg = null,
            H.pending = 0,
            H.pending_out = 0,
            t = 113,
            a = 0,
            q.dyn_tree = R,
            q.stat_desc = dt.static_l_desc,
            z.dyn_tree = B,
            z.stat_desc = dt.static_d_desc,
            j.dyn_tree = N,
            j.stat_desc = dt.static_bl_desc,
            M = 0,
            U = 0,
            D = 8,
            V(),
            function() {
                var e;
                for (s = 2 * n,
                u[d - 1] = 0,
                e = 0; e < d - 1; e++)
                    u[e] = 0;
                _ = bt[C].max_lazy,
                E = bt[C].good_length,
                I = bt[C].nice_length,
                S = bt[C].max_chain,
                b = 0,
                g = 0,
                w = 0,
                y = x = 2,
                A = 0,
                h = 0
            }(),
            0
        }
        H.depth = [],
        H.bl_count = [],
        H.heap = [],
        R = [],
        B = [],
        N = [],
        H.pqdownheap = function(e, t) {
            for (var r = H.heap, a = r[t], n = t << 1; n <= H.heap_len && (n < H.heap_len && wt(e, r[n + 1], r[n], H.depth) && n++,
            !wt(e, a, r[n], H.depth)); )
                r[t] = r[n],
                t = n,
                n <<= 1;
            r[t] = a
        }
        ,
        H.deflateInit = function(e, t, a, s, h, g) {
            return s || (s = 8),
            h || (h = 8),
            g || (g = 0),
            e.msg = null,
            -1 === t && (t = 6),
            h < 1 || h > 9 || 8 !== s || a < 9 || a > 15 || t < 0 || t > 9 || g < 0 || g > 2 ? -2 : (e.dstate = H,
            l = (n = 1 << (o = a)) - 1,
            m = (d = 1 << (f = h + 7)) - 1,
            p = Math.floor((f + 3 - 1) / 3),
            i = new Uint8Array(2 * n),
            c = [],
            u = [],
            P = 1 << h + 6,
            H.pending_buf = new Uint8Array(4 * P),
            r = 4 * P,
            L = Math.floor(P / 2),
            F = 3 * P,
            C = t,
            T = g,
            le(e))
        }
        ,
        H.deflateEnd = function() {
            return 42 !== t && 113 !== t && 666 !== t ? -2 : (H.pending_buf = null,
            u = null,
            c = null,
            i = null,
            H.dstate = null,
            113 === t ? -3 : 0)
        }
        ,
        H.deflateParams = function(e, t, r) {
            var a = 0;
            return -1 === t && (t = 6),
            t < 0 || t > 9 || r < 0 || r > 2 ? -2 : (bt[C].func !== bt[t].func && 0 !== e.total_in && (a = e.deflate(1)),
            C !== t && (_ = bt[C = t].max_lazy,
            E = bt[C].good_length,
            I = bt[C].nice_length,
            S = bt[C].max_chain),
            T = r,
            a)
        }
        ,
        H.deflateSetDictionary = function(e, r, a) {
            var o, s = a, d = 0;
            if (!r || 42 !== t)
                return -2;
            if (s < 3)
                return 0;
            for (s > n - 262 && (d = a - (s = n - 262)),
            i.set(r.subarray(d, d + s), 0),
            b = s,
            g = s,
            h = ((h = 255 & i[0]) << p ^ 255 & i[1]) & m,
            o = 0; o <= s - 3; o++)
                h = (h << p ^ 255 & i[o + 2]) & m,
                c[o & l] = u[h],
                u[h] = o;
            return 0
        }
        ,
        H.deflate = function(s, f) {
            var S, E, I, R, B, N;
            if (f > 4 || f < 0)
                return -2;
            if (!s.next_out || !s.next_in && 0 !== s.avail_in || 666 === t && 4 !== f)
                return s.msg = yt[4],
                -2;
            if (0 === s.avail_out)
                return s.msg = yt[7],
                -5;
            if (e = s,
            R = a,
            a = f,
            42 === t && (E = 8 + (o - 8 << 4) << 8,
            (I = (C - 1 & 255) >> 1) > 3 && (I = 3),
            E |= I << 6,
            0 !== b && (E |= 32),
            t = 113,
            G((N = E += 31 - E % 31) >> 8 & 255),
            G(255 & N)),
            0 !== H.pending) {
                if (e.flush_pending(),
                0 === e.avail_out)
                    return a = -1,
                    0
            } else if (0 === e.avail_in && f <= R && 4 !== f)
                return e.msg = yt[7],
                -5;
            if (666 === t && 0 !== e.avail_in)
                return s.msg = yt[7],
                -5;
            if (0 !== e.avail_in || 0 !== w || 0 !== f && 666 !== t) {
                switch (B = -1,
                bt[C].func) {
                case 0:
                    B = function(t) {
                        var a, o = 65535;
                        for (o > r - 5 && (o = r - 5); ; ) {
                            if (w <= 1) {
                                if (ne(),
                                0 === w && 0 === t)
                                    return 0;
                                if (0 === w)
                                    break
                            }
                            if (b += w,
                            w = 0,
                            a = g + o,
                            (0 === b || b >= a) && (w = b - a,
                            b = a,
                            ae(!1),
                            0 === e.avail_out))
                                return 0;
                            if (b - g >= n - 262 && (ae(!1),
                            0 === e.avail_out))
                                return 0
                        }
                        return ae(4 === t),
                        0 === e.avail_out ? 4 === t ? 2 : 0 : 4 === t ? 3 : 1
                    }(f);
                    break;
                case 1:
                    B = function(t) {
                        for (var r, a = 0; ; ) {
                            if (w < 262) {
                                if (ne(),
                                w < 262 && 0 === t)
                                    return 0;
                                if (0 === w)
                                    break
                            }
                            if (w >= 3 && (h = (h << p ^ 255 & i[b + 2]) & m,
                            a = 65535 & u[h],
                            c[b & l] = u[h],
                            u[h] = b),
                            0 !== a && (b - a & 65535) <= n - 262 && 2 !== T && (y = oe(a)),
                            y >= 3)
                                if (r = Z(b - k, y - 3),
                                w -= y,
                                y <= _ && w >= 3) {
                                    y--;
                                    do {
                                        b++,
                                        h = (h << p ^ 255 & i[b + 2]) & m,
                                        a = 65535 & u[h],
                                        c[b & l] = u[h],
                                        u[h] = b
                                    } while (0 != --y);b++
                                } else
                                    b += y,
                                    y = 0,
                                    h = ((h = 255 & i[b]) << p ^ 255 & i[b + 1]) & m;
                            else
                                r = Z(0, 255 & i[b]),
                                w--,
                                b++;
                            if (r && (ae(!1),
                            0 === e.avail_out))
                                return 0
                        }
                        return ae(4 === t),
                        0 === e.avail_out ? 4 === t ? 2 : 0 : 4 === t ? 3 : 1
                    }(f);
                    break;
                case 2:
                    B = function(t) {
                        for (var r, a, o = 0; ; ) {
                            if (w < 262) {
                                if (ne(),
                                w < 262 && 0 === t)
                                    return 0;
                                if (0 === w)
                                    break
                            }
                            if (w >= 3 && (h = (h << p ^ 255 & i[b + 2]) & m,
                            o = 65535 & u[h],
                            c[b & l] = u[h],
                            u[h] = b),
                            x = y,
                            v = k,
                            y = 2,
                            0 !== o && x < _ && (b - o & 65535) <= n - 262 && (2 !== T && (y = oe(o)),
                            y <= 5 && (1 === T || 3 === y && b - k > 4096) && (y = 2)),
                            x >= 3 && y <= x) {
                                a = b + w - 3,
                                r = Z(b - 1 - v, x - 3),
                                w -= x - 1,
                                x -= 2;
                                do {
                                    ++b <= a && (h = (h << p ^ 255 & i[b + 2]) & m,
                                    o = 65535 & u[h],
                                    c[b & l] = u[h],
                                    u[h] = b)
                                } while (0 != --x);if (A = 0,
                                y = 2,
                                b++,
                                r && (ae(!1),
                                0 === e.avail_out))
                                    return 0
                            } else if (0 !== A) {
                                if ((r = Z(0, 255 & i[b - 1])) && ae(!1),
                                b++,
                                w--,
                                0 === e.avail_out)
                                    return 0
                            } else
                                A = 1,
                                b++,
                                w--
                        }
                        return 0 !== A && (r = Z(0, 255 & i[b - 1]),
                        A = 0),
                        ae(4 === t),
                        0 === e.avail_out ? 4 === t ? 2 : 0 : 4 === t ? 3 : 1
                    }(f)
                }
                if (2 !== B && 3 !== B || (t = 666),
                0 === B || 2 === B)
                    return 0 === e.avail_out && (a = -1),
                    0;
                if (1 === B) {
                    if (1 === f)
                        W(2, 3),
                        Y(256, dt.static_ltree),
                        J(),
                        1 + D + 10 - U < 9 && (W(2, 3),
                        Y(256, dt.static_ltree),
                        J()),
                        D = 7;
                    else if (re(0, 0, !1),
                    3 === f)
                        for (S = 0; S < d; S++)
                            u[S] = 0;
                    if (e.flush_pending(),
                    0 === e.avail_out)
                        return a = -1,
                        0
                }
            }
            return 4 !== f ? 0 : 1
        }
    }
    function Lt() {
        this.next_in_index = 0,
        this.next_out_index = 0,
        this.avail_in = 0,
        this.total_in = 0,
        this.avail_out = 0,
        this.total_out = 0
    }
    function xt(e) {
        var t = new Lt
          , r = new Uint8Array(512)
          , a = e ? e.level : -1;
        void 0 === a && (a = -1),
        t.deflateInit(a),
        t.next_out = r,
        this.append = function(e, a) {
            var n, o = [], l = 0, i = 0, s = 0;
            if (e.length) {
                t.next_in_index = 0,
                t.next_in = e,
                t.avail_in = e.length;
                do {
                    if (t.next_out_index = 0,
                    t.avail_out = 512,
                    0 !== t.deflate(0))
                        throw new Error("deflating: " + t.msg);
                    t.next_out_index && (512 === t.next_out_index ? o.push(new Uint8Array(r)) : o.push(new Uint8Array(r.subarray(0, t.next_out_index)))),
                    s += t.next_out_index,
                    a && t.next_in_index > 0 && t.next_in_index !== l && (a(t.next_in_index),
                    l = t.next_in_index)
                } while (t.avail_in > 0 || 0 === t.avail_out);return n = new Uint8Array(s),
                o.forEach((function(e) {
                    n.set(e, i),
                    i += e.length
                }
                )),
                n
            }
        }
        ,
        this.flush = function() {
            var e, a, n = [], o = 0, l = 0;
            do {
                if (t.next_out_index = 0,
                t.avail_out = 512,
                1 !== (e = t.deflate(4)) && 0 !== e)
                    throw new Error("deflating: " + t.msg);
                512 - t.avail_out > 0 && n.push(new Uint8Array(r.subarray(0, t.next_out_index))),
                l += t.next_out_index
            } while (t.avail_in > 0 || 0 === t.avail_out);return t.deflateEnd(),
            a = new Uint8Array(l),
            n.forEach((function(e) {
                a.set(e, o),
                o += e.length
            }
            )),
            a
        }
    }
    /**
     * @license
     * jsPDF filters PlugIn
     * Copyright (c) 2014 Aras Abbasi
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    Lt.prototype = {
        deflateInit: function(e, t) {
            return this.dstate = new Nt,
            t || (t = 15),
            this.dstate.deflateInit(this, e, t)
        },
        deflate: function(e) {
            return this.dstate ? this.dstate.deflate(this, e) : -2
        },
        deflateEnd: function() {
            if (!this.dstate)
                return -2;
            var e = this.dstate.deflateEnd();
            return this.dstate = null,
            e
        },
        deflateParams: function(e, t) {
            return this.dstate ? this.dstate.deflateParams(this, e, t) : -2
        },
        deflateSetDictionary: function(e, t) {
            return this.dstate ? this.dstate.deflateSetDictionary(this, e, t) : -2
        },
        read_buf: function(e, t, r) {
            var a = this.avail_in;
            return a > r && (a = r),
            0 === a ? 0 : (this.avail_in -= a,
            e.set(this.next_in.subarray(this.next_in_index, this.next_in_index + a), t),
            this.next_in_index += a,
            this.total_in += a,
            a)
        },
        flush_pending: function() {
            var e = this.dstate.pending;
            e > this.avail_out && (e = this.avail_out),
            0 !== e && (this.next_out.set(this.dstate.pending_buf.subarray(this.dstate.pending_out, this.dstate.pending_out + e), this.next_out_index),
            this.next_out_index += e,
            this.dstate.pending_out += e,
            this.total_out += e,
            this.avail_out -= e,
            this.dstate.pending -= e,
            0 === this.dstate.pending && (this.dstate.pending_out = 0))
        }
    },
    function(e) {
        var t = function(e) {
            var t, r, a, n, o, l, i, s, c, u;
            for (/[^\x00-\xFF]/.test(e),
            r = [],
            a = 0,
            n = (e += t = "\0\0\0\0".slice(e.length % 4 || 4)).length; n > a; a += 4)
                0 !== (o = (e.charCodeAt(a) << 24) + (e.charCodeAt(a + 1) << 16) + (e.charCodeAt(a + 2) << 8) + e.charCodeAt(a + 3)) ? (l = (o = ((o = ((o = ((o = (o - (u = o % 85)) / 85) - (c = o % 85)) / 85) - (s = o % 85)) / 85) - (i = o % 85)) / 85) % 85,
                r.push(l + 33, i + 33, s + 33, c + 33, u + 33)) : r.push(122);
            return function(e, t) {
                for (var r = t; r > 0; r--)
                    e.pop()
            }(r, t.length),
            String.fromCharCode.apply(String, r) + "~>"
        }
          , r = function(e) {
            var t, r, a, n, o, l = String, i = "length", s = 255, c = "charCodeAt", u = "slice", h = "replace";
            for (e[u](-2),
            e = e[u](0, -2)[h](/\s/g, "")[h]("z", "!!!!!"),
            a = [],
            n = 0,
            o = (e += t = "uuuuu"[u](e[i] % 5 || 5))[i]; o > n; n += 5)
                r = 52200625 * (e[c](n) - 33) + 614125 * (e[c](n + 1) - 33) + 7225 * (e[c](n + 2) - 33) + 85 * (e[c](n + 3) - 33) + (e[c](n + 4) - 33),
                a.push(s & r >> 24, s & r >> 16, s & r >> 8, s & r);
            return function(e, t) {
                for (var r = t; r > 0; r--)
                    e.pop()
            }(a, t[i]),
            l.fromCharCode.apply(l, a)
        }
          , a = function(e) {
            var t = new RegExp(/^([0-9A-Fa-f]{2})+$/);
            if (-1 !== (e = e.replace(/\s/g, "")).indexOf(">") && (e = e.substr(0, e.indexOf(">"))),
            e.length % 2 && (e += "0"),
            !1 === t.test(e))
                return "";
            for (var r = "", a = 0; a < e.length; a += 2)
                r += String.fromCharCode("0x" + (e[a] + e[a + 1]));
            return r
        }
          , n = function(t) {
            for (var r, a, n, o, l, i = [], s = t.length; s--; )
                i[s] = t.charCodeAt(s);
            return r = e.adler32cs.from(t),
            n = t = (a = new xt(6)).append(new Uint8Array(i)),
            o = a.flush(),
            (l = new Uint8Array(n.byteLength + o.byteLength)).set(new Uint8Array(n), 0),
            l.set(new Uint8Array(o), n.byteLength),
            t = l,
            (i = new Uint8Array(t.byteLength + 6)).set(new Uint8Array([120, 156])),
            i.set(t, 2),
            i.set(new Uint8Array([255 & r, r >> 8 & 255, r >> 16 & 255, r >> 24 & 255]), t.byteLength + 2),
            i.reduce((function(e, t) {
                return e + String.fromCharCode(t)
            }
            ), "")
        };
        e.processDataByFilters = function(e, o) {
            var l = 0
              , i = e || ""
              , s = [];
            for ("string" == typeof (o = o || []) && (o = [o]),
            l = 0; l < o.length; l += 1)
                switch (o[l]) {
                case "ASCII85Decode":
                case "/ASCII85Decode":
                    i = r(i),
                    s.push("/ASCII85Encode");
                    break;
                case "ASCII85Encode":
                case "/ASCII85Encode":
                    i = t(i),
                    s.push("/ASCII85Decode");
                    break;
                case "ASCIIHexDecode":
                case "/ASCIIHexDecode":
                    i = a(i),
                    s.push("/ASCIIHexEncode");
                    break;
                case "ASCIIHexEncode":
                case "/ASCIIHexEncode":
                    i = i.split("").map((function(e) {
                        return ("0" + e.charCodeAt().toString(16)).slice(-2)
                    }
                    )).join("") + ">",
                    s.push("/ASCIIHexDecode");
                    break;
                case "FlateEncode":
                case "/FlateEncode":
                    i = n(i),
                    s.push("/FlateDecode");
                    break;
                default:
                    throw new Error('The filter: "' + o[l] + '" is not implemented')
                }
            return {
                data: i,
                reverseChain: s.reverse().join(" ")
            }
        }
    }(g.API),
    /**
     * @license
     * jsPDF fileloading PlugIn
     * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        e.loadFile = function(e, t, r) {
            return function(e, t, r) {
                t = !1 !== t,
                r = "function" == typeof r ? r : function() {}
                ;
                var a = void 0;
                try {
                    a = function(e, t, r) {
                        var a = new XMLHttpRequest
                          , n = 0
                          , o = function(e) {
                            var t = e.length
                              , r = []
                              , a = String.fromCharCode;
                            for (n = 0; n < t; n += 1)
                                r.push(a(255 & e.charCodeAt(n)));
                            return r.join("")
                        };
                        if (a.open("GET", e, !t),
                        a.overrideMimeType("text/plain; charset=x-user-defined"),
                        !1 === t && (a.onload = function() {
                            200 === a.status ? r(o(this.responseText)) : r(void 0)
                        }
                        ),
                        a.send(null),
                        t && 200 === a.status)
                            return o(a.responseText)
                    }(e, t, r)
                } catch (e) {}
                return a
            }(e, t, r)
        }
        ,
        e.loadImageFile = e.loadFile
    }(g.API),
    /**
     * @license
     * Copyright (c) 2018 Erik Koopmans
     * Released under the MIT License.
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        function r() {
            return (t.html2canvas ? Promise.resolve(t.html2canvas) : Promise.resolve().then((function() {
                return html2canvas_esm
            }
            ))).catch((function(e) {
                return Promise.reject(new Error("Could not load dompurify: " + e))
            }
            )).then((function(e) {
                return e.default ? e.default : e
            }
            ))
        }
        function a() {
            return (t.DOMPurify ? Promise.resolve(t.DOMPurify) : Promise.resolve().then((function() {
                return purify_es
            }
            ))).catch((function(e) {
                return Promise.reject(new Error("Could not load dompurify: " + e))
            }
            )).then((function(e) {
                return e.default ? e.default : e
            }
            ))
        }
        var n = function(e) {
            var t = typeof e;
            return "undefined" === t ? "undefined" : "string" === t || e instanceof String ? "string" : "number" === t || e instanceof Number ? "number" : "function" === t || e instanceof Function ? "function" : e && e.constructor === Array ? "array" : e && 1 === e.nodeType ? "element" : "object" === t ? "object" : "unknown"
        }
          , o = function(e, t) {
            var r = document.createElement(e);
            for (var a in t.className && (r.className = t.className),
            t.innerHTML && t.dompurify && (r.innerHTML = t.dompurify.sanitize(t.innerHTML)),
            t.style)
                r.style[a] = t.style[a];
            return r
        }
          , l = function(e, t) {
            for (var r = 3 === e.nodeType ? document.createTextNode(e.nodeValue) : e.cloneNode(!1), a = e.firstChild; a; a = a.nextSibling)
                !0 !== t && 1 === a.nodeType && "SCRIPT" === a.nodeName || r.appendChild(l(a, t));
            return 1 === e.nodeType && ("CANVAS" === e.nodeName ? (r.width = e.width,
            r.height = e.height,
            r.getContext("2d").drawImage(e, 0, 0)) : "TEXTAREA" !== e.nodeName && "SELECT" !== e.nodeName || (r.value = e.value),
            r.addEventListener("load", (function() {
                r.scrollTop = e.scrollTop,
                r.scrollLeft = e.scrollLeft
            }
            ), !0)),
            r
        }
          , i = function e(t) {
            var r = Object.assign(e.convert(Promise.resolve()), JSON.parse(JSON.stringify(e.template)))
              , a = e.convert(Promise.resolve(), r);
            return (a = a.setProgress(1, e, 1, [e])).set(t)
        };
        (i.prototype = Object.create(Promise.prototype)).constructor = i,
        i.convert = function(e, t) {
            return e.__proto__ = t || i.prototype,
            e
        }
        ,
        i.template = {
            prop: {
                src: null,
                container: null,
                overlay: null,
                canvas: null,
                img: null,
                pdf: null,
                pageSize: null,
                callback: function() {}
            },
            progress: {
                val: 0,
                state: null,
                n: 0,
                stack: []
            },
            opt: {
                filename: "file.pdf",
                margin: [0, 0, 0, 0],
                enableLinks: !0,
                x: 0,
                y: 0,
                html2canvas: {},
                jsPDF: {},
                backgroundColor: "transparent"
            }
        },
        i.prototype.from = function(e, t) {
            return this.then((function() {
                switch (t = t || function(e) {
                    switch (n(e)) {
                    case "string":
                        return "string";
                    case "element":
                        return "canvas" === e.nodeName.toLowerCase ? "canvas" : "element";
                    default:
                        return "unknown"
                    }
                }(e)) {
                case "string":
                    return this.then(a).then((function(t) {
                        return this.set({
                            src: o("div", {
                                innerHTML: e,
                                dompurify: t
                            })
                        })
                    }
                    ));
                case "element":
                    return this.set({
                        src: e
                    });
                case "canvas":
                    return this.set({
                        canvas: e
                    });
                case "img":
                    return this.set({
                        img: e
                    });
                default:
                    return this.error("Unknown source type.")
                }
            }
            ))
        }
        ,
        i.prototype.to = function(e) {
            switch (e) {
            case "container":
                return this.toContainer();
            case "canvas":
                return this.toCanvas();
            case "img":
                return this.toImg();
            case "pdf":
                return this.toPdf();
            default:
                return this.error("Invalid target.")
            }
        }
        ,
        i.prototype.toContainer = function() {
            return this.thenList([function() {
                return this.prop.src || this.error("Cannot duplicate - no source HTML.")
            }
            , function() {
                return this.prop.pageSize || this.setPageSize()
            }
            ]).then((function() {
                var e = {
                    position: "relative",
                    display: "inline-block",
                    width: Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) + "px",
                    left: 0,
                    right: 0,
                    top: 0,
                    margin: "auto",
                    backgroundColor: this.opt.backgroundColor
                }
                  , t = l(this.prop.src, this.opt.html2canvas.javascriptEnabled);
                "BODY" === t.tagName && (e.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"),
                this.prop.overlay = o("div", {
                    className: "html2pdf__overlay",
                    style: {
                        position: "fixed",
                        overflow: "hidden",
                        zIndex: 1e3,
                        left: "-100000px",
                        right: 0,
                        bottom: 0,
                        top: 0
                    }
                }),
                this.prop.container = o("div", {
                    className: "html2pdf__container",
                    style: e
                }),
                this.prop.container.appendChild(t),
                this.prop.container.firstChild.appendChild(o("div", {
                    style: {
                        clear: "both",
                        border: "0 none transparent",
                        margin: 0,
                        padding: 0,
                        height: 0
                    }
                })),
                this.prop.container.style.float = "none",
                this.prop.overlay.appendChild(this.prop.container),
                document.body.appendChild(this.prop.overlay),
                this.prop.container.firstChild.style.position = "relative",
                this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px"
            }
            ))
        }
        ,
        i.prototype.toCanvas = function() {
            var e = [function() {
                return document.body.contains(this.prop.container) || this.toContainer()
            }
            ];
            return this.thenList(e).then(r).then((function(e) {
                var t = Object.assign({}, this.opt.html2canvas);
                return delete t.onrendered,
                e(this.prop.container, t)
            }
            )).then((function(e) {
                (this.opt.html2canvas.onrendered || function() {}
                )(e),
                this.prop.canvas = e,
                document.body.removeChild(this.prop.overlay)
            }
            ))
        }
        ,
        i.prototype.toContext2d = function() {
            var e = [function() {
                return document.body.contains(this.prop.container) || this.toContainer()
            }
            ];
            return this.thenList(e).then(r).then((function(e) {
                var t = this.opt.jsPDF
                  , r = Object.assign({
                    async: !0,
                    allowTaint: !0,
                    scale: 1,
                    scrollX: this.opt.scrollX || 0,
                    scrollY: this.opt.scrollY || 0,
                    backgroundColor: "#ffffff",
                    imageTimeout: 15e3,
                    logging: !0,
                    proxy: null,
                    removeContainer: !0,
                    foreignObjectRendering: !1,
                    useCORS: !1
                }, this.opt.html2canvas);
                return delete r.onrendered,
                t.context2d.autoPaging = !0,
                t.context2d.posX = this.opt.x,
                t.context2d.posY = this.opt.y,
                r.windowHeight = r.windowHeight || 0,
                r.windowHeight = 0 == r.windowHeight ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : r.windowHeight,
                e(this.prop.container, r)
            }
            )).then((function(e) {
                (this.opt.html2canvas.onrendered || function() {}
                )(e),
                this.prop.canvas = e,
                document.body.removeChild(this.prop.overlay)
            }
            ))
        }
        ,
        i.prototype.toImg = function() {
            return this.thenList([function() {
                return this.prop.canvas || this.toCanvas()
            }
            ]).then((function() {
                var e = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
                this.prop.img = document.createElement("img"),
                this.prop.img.src = e
            }
            ))
        }
        ,
        i.prototype.toPdf = function() {
            return this.thenList([function() {
                return this.toContext2d()
            }
            ]).then((function() {
                this.prop.pdf = this.prop.pdf || this.opt.jsPDF
            }
            ))
        }
        ,
        i.prototype.output = function(e, t, r) {
            return "img" === (r = r || "pdf").toLowerCase() || "image" === r.toLowerCase() ? this.outputImg(e, t) : this.outputPdf(e, t)
        }
        ,
        i.prototype.outputPdf = function(e, t) {
            return this.thenList([function() {
                return this.prop.pdf || this.toPdf()
            }
            ]).then((function() {
                return this.prop.pdf.output(e, t)
            }
            ))
        }
        ,
        i.prototype.outputImg = function(e) {
            return this.thenList([function() {
                return this.prop.img || this.toImg()
            }
            ]).then((function() {
                switch (e) {
                case void 0:
                case "img":
                    return this.prop.img;
                case "datauristring":
                case "dataurlstring":
                    return this.prop.img.src;
                case "datauri":
                case "dataurl":
                    return document.location.href = this.prop.img.src;
                default:
                    throw 'Image output type "' + e + '" is not supported.'
                }
            }
            ))
        }
        ,
        i.prototype.save = function(e) {
            return this.thenList([function() {
                return this.prop.pdf || this.toPdf()
            }
            ]).set(e ? {
                filename: e
            } : null).then((function() {
                this.prop.pdf.save(this.opt.filename)
            }
            ))
        }
        ,
        i.prototype.doCallback = function() {
            return this.thenList([function() {
                return this.prop.pdf || this.toPdf()
            }
            ]).then((function() {
                this.prop.callback(this.prop.pdf)
            }
            ))
        }
        ,
        i.prototype.set = function(e) {
            if ("object" !== n(e))
                return this;
            var t = Object.keys(e || {}).map((function(t) {
                if (t in i.template.prop)
                    return function() {
                        this.prop[t] = e[t]
                    }
                    ;
                switch (t) {
                case "margin":
                    return this.setMargin.bind(this, e.margin);
                case "jsPDF":
                    return function() {
                        return this.opt.jsPDF = e.jsPDF,
                        this.setPageSize()
                    }
                    ;
                case "pageSize":
                    return this.setPageSize.bind(this, e.pageSize);
                default:
                    return function() {
                        this.opt[t] = e[t]
                    }
                }
            }
            ), this);
            return this.then((function() {
                return this.thenList(t)
            }
            ))
        }
        ,
        i.prototype.get = function(e, t) {
            return this.then((function() {
                var r = e in i.template.prop ? this.prop[e] : this.opt[e];
                return t ? t(r) : r
            }
            ))
        }
        ,
        i.prototype.setMargin = function(e) {
            return this.then((function() {
                switch (n(e)) {
                case "number":
                    e = [e, e, e, e];
                case "array":
                    if (2 === e.length && (e = [e[0], e[1], e[0], e[1]]),
                    4 === e.length)
                        break;
                default:
                    return this.error("Invalid margin array.")
                }
                this.opt.margin = e
            }
            )).then(this.setPageSize)
        }
        ,
        i.prototype.setPageSize = function(e) {
            function t(e, t) {
                return Math.floor(e * t / 72 * 96)
            }
            return this.then((function() {
                (e = e || g.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (e.inner = {
                    width: e.width - this.opt.margin[1] - this.opt.margin[3],
                    height: e.height - this.opt.margin[0] - this.opt.margin[2]
                },
                e.inner.px = {
                    width: t(e.inner.width, e.k),
                    height: t(e.inner.height, e.k)
                },
                e.inner.ratio = e.inner.height / e.inner.width),
                this.prop.pageSize = e
            }
            ))
        }
        ,
        i.prototype.setProgress = function(e, t, r, a) {
            return null != e && (this.progress.val = e),
            null != t && (this.progress.state = t),
            null != r && (this.progress.n = r),
            null != a && (this.progress.stack = a),
            this.progress.ratio = this.progress.val / this.progress.state,
            this
        }
        ,
        i.prototype.updateProgress = function(e, t, r, a) {
            return this.setProgress(e ? this.progress.val + e : null, t || null, r ? this.progress.n + r : null, a ? this.progress.stack.concat(a) : null)
        }
        ,
        i.prototype.then = function(e, t) {
            var r = this;
            return this.thenCore(e, t, (function(e, t) {
                return r.updateProgress(null, null, 1, [e]),
                Promise.prototype.then.call(this, (function(t) {
                    return r.updateProgress(null, e),
                    t
                }
                )).then(e, t).then((function(e) {
                    return r.updateProgress(1),
                    e
                }
                ))
            }
            ))
        }
        ,
        i.prototype.thenCore = function(e, t, r) {
            r = r || Promise.prototype.then,
            e && (e = e.bind(this)),
            t && (t = t.bind(this));
            var a = -1 !== Promise.toString().indexOf("[native code]") && "Promise" === Promise.name ? this : i.convert(Object.assign({}, this), Promise.prototype)
              , n = r.call(a, e, t);
            return i.convert(n, this.__proto__)
        }
        ,
        i.prototype.thenExternal = function(e, t) {
            return Promise.prototype.then.call(this, e, t)
        }
        ,
        i.prototype.thenList = function(e) {
            var t = this;
            return e.forEach((function(e) {
                t = t.thenCore(e)
            }
            )),
            t
        }
        ,
        i.prototype.catch = function(e) {
            e && (e = e.bind(this));
            var t = Promise.prototype.catch.call(this, e);
            return i.convert(t, this)
        }
        ,
        i.prototype.catchExternal = function(e) {
            return Promise.prototype.catch.call(this, e)
        }
        ,
        i.prototype.error = function(e) {
            return this.then((function() {
                throw new Error(e)
            }
            ))
        }
        ,
        i.prototype.using = i.prototype.set,
        i.prototype.saveAs = i.prototype.save,
        i.prototype.export = i.prototype.output,
        i.prototype.run = i.prototype.then,
        g.getPageSize = function(e, t, r) {
            if ("object" == typeof e) {
                var a = e;
                e = a.orientation,
                t = a.unit || t,
                r = a.format || r
            }
            t = t || "mm",
            r = r || "a4",
            e = ("" + (e || "P")).toLowerCase();
            var n, o = ("" + r).toLowerCase(), l = {
                a0: [2383.94, 3370.39],
                a1: [1683.78, 2383.94],
                a2: [1190.55, 1683.78],
                a3: [841.89, 1190.55],
                a4: [595.28, 841.89],
                a5: [419.53, 595.28],
                a6: [297.64, 419.53],
                a7: [209.76, 297.64],
                a8: [147.4, 209.76],
                a9: [104.88, 147.4],
                a10: [73.7, 104.88],
                b0: [2834.65, 4008.19],
                b1: [2004.09, 2834.65],
                b2: [1417.32, 2004.09],
                b3: [1000.63, 1417.32],
                b4: [708.66, 1000.63],
                b5: [498.9, 708.66],
                b6: [354.33, 498.9],
                b7: [249.45, 354.33],
                b8: [175.75, 249.45],
                b9: [124.72, 175.75],
                b10: [87.87, 124.72],
                c0: [2599.37, 3676.54],
                c1: [1836.85, 2599.37],
                c2: [1298.27, 1836.85],
                c3: [918.43, 1298.27],
                c4: [649.13, 918.43],
                c5: [459.21, 649.13],
                c6: [323.15, 459.21],
                c7: [229.61, 323.15],
                c8: [161.57, 229.61],
                c9: [113.39, 161.57],
                c10: [79.37, 113.39],
                dl: [311.81, 623.62],
                letter: [612, 792],
                "government-letter": [576, 756],
                legal: [612, 1008],
                "junior-legal": [576, 360],
                ledger: [1224, 792],
                tabloid: [792, 1224],
                "credit-card": [153, 243]
            };
            switch (t) {
            case "pt":
                n = 1;
                break;
            case "mm":
                n = 72 / 25.4;
                break;
            case "cm":
                n = 72 / 2.54;
                break;
            case "in":
                n = 72;
                break;
            case "px":
                n = .75;
                break;
            case "pc":
            case "em":
                n = 12;
                break;
            case "ex":
                n = 6;
                break;
            default:
                throw "Invalid unit: " + t
            }
            var i, s = 0, c = 0;
            if (l.hasOwnProperty(o))
                s = l[o][1] / n,
                c = l[o][0] / n;
            else
                try {
                    s = r[1],
                    c = r[0]
                } catch (e) {
                    throw new Error("Invalid format: " + r)
                }
            if ("p" === e || "portrait" === e)
                e = "p",
                c > s && (i = c,
                c = s,
                s = i);
            else {
                if ("l" !== e && "landscape" !== e)
                    throw "Invalid orientation: " + e;
                e = "l",
                s > c && (i = c,
                c = s,
                s = i)
            }
            return {
                width: c,
                height: s,
                unit: t,
                k: n,
                orientation: e
            }
        }
        ,
        e.html = function(e, t) {
            (t = t || {}).callback = t.callback || function() {}
            ,
            t.html2canvas = t.html2canvas || {},
            t.html2canvas.canvas = t.html2canvas.canvas || this.canvas,
            t.jsPDF = t.jsPDF || this;
            var r = new i(t);
            return t.worker ? r : r.from(e).doCallback()
        }
    }(g.API),
    g.API.addJS = function(e) {
        return vt = e,
        this.internal.events.subscribe("postPutResources", (function() {
            gt = this.internal.newObject(),
            this.internal.out("<<"),
            this.internal.out("/Names [(EmbeddedJS) " + (gt + 1) + " 0 R]"),
            this.internal.out(">>"),
            this.internal.out("endobj"),
            mt = this.internal.newObject(),
            this.internal.out("<<"),
            this.internal.out("/S /JavaScript"),
            this.internal.out("/JS (" + vt + ")"),
            this.internal.out(">>"),
            this.internal.out("endobj")
        }
        )),
        this.internal.events.subscribe("putCatalog", (function() {
            void 0 !== gt && void 0 !== mt && this.internal.out("/Names <</JavaScript " + gt + " 0 R>>")
        }
        )),
        this
        /**
     * @license
     * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    }
    ,
    function(e) {
        var t;
        e.events.push(["postPutResources", function() {
            var e = this
              , r = /^(\d+) 0 obj$/;
            if (this.outline.root.children.length > 0)
                for (var a = e.outline.render().split(/\r\n/), n = 0; n < a.length; n++) {
                    var o = a[n]
                      , l = r.exec(o);
                    if (null != l) {
                        var i = l[1];
                        e.internal.newObjectDeferredBegin(i, !1)
                    }
                    e.internal.write(o)
                }
            if (this.outline.createNamedDestinations) {
                var s = this.internal.pages.length
                  , c = [];
                for (n = 0; n < s; n++) {
                    var u = e.internal.newObject();
                    c.push(u);
                    var h = e.internal.getPageInfo(n + 1);
                    e.internal.write("<< /D[" + h.objId + " 0 R /XYZ null null null]>> endobj")
                }
                var d = e.internal.newObject();
                for (e.internal.write("<< /Names [ "),
                n = 0; n < c.length; n++)
                    e.internal.write("(page_" + (n + 1) + ")" + c[n] + " 0 R");
                e.internal.write(" ] >>", "endobj"),
                t = e.internal.newObject(),
                e.internal.write("<< /Dests " + d + " 0 R"),
                e.internal.write(">>", "endobj")
            }
        }
        ]),
        e.events.push(["putCatalog", function() {
            this.outline.root.children.length > 0 && (this.internal.write("/Outlines", this.outline.makeRef(this.outline.root)),
            this.outline.createNamedDestinations && this.internal.write("/Names " + t + " 0 R"))
        }
        ]),
        e.events.push(["initialized", function() {
            var e = this;
            e.outline = {
                createNamedDestinations: !1,
                root: {
                    children: []
                }
            },
            e.outline.add = function(e, t, r) {
                var a = {
                    title: t,
                    options: r,
                    children: []
                };
                return null == e && (e = this.root),
                e.children.push(a),
                a
            }
            ,
            e.outline.render = function() {
                return this.ctx = {},
                this.ctx.val = "",
                this.ctx.pdf = e,
                this.genIds_r(this.root),
                this.renderRoot(this.root),
                this.renderItems(this.root),
                this.ctx.val
            }
            ,
            e.outline.genIds_r = function(t) {
                t.id = e.internal.newObjectDeferred();
                for (var r = 0; r < t.children.length; r++)
                    this.genIds_r(t.children[r])
            }
            ,
            e.outline.renderRoot = function(e) {
                this.objStart(e),
                this.line("/Type /Outlines"),
                e.children.length > 0 && (this.line("/First " + this.makeRef(e.children[0])),
                this.line("/Last " + this.makeRef(e.children[e.children.length - 1]))),
                this.line("/Count " + this.count_r({
                    count: 0
                }, e)),
                this.objEnd()
            }
            ,
            e.outline.renderItems = function(t) {
                for (var r = this.ctx.pdf.internal.getVerticalCoordinateString, a = 0; a < t.children.length; a++) {
                    var n = t.children[a];
                    this.objStart(n),
                    this.line("/Title " + this.makeString(n.title)),
                    this.line("/Parent " + this.makeRef(t)),
                    a > 0 && this.line("/Prev " + this.makeRef(t.children[a - 1])),
                    a < t.children.length - 1 && this.line("/Next " + this.makeRef(t.children[a + 1])),
                    n.children.length > 0 && (this.line("/First " + this.makeRef(n.children[0])),
                    this.line("/Last " + this.makeRef(n.children[n.children.length - 1])));
                    var o = this.count = this.count_r({
                        count: 0
                    }, n);
                    if (o > 0 && this.line("/Count " + o),
                    n.options && n.options.pageNumber) {
                        var l = e.internal.getPageInfo(n.options.pageNumber);
                        this.line("/Dest [" + l.objId + " 0 R /XYZ 0 " + r(0) + " 0]")
                    }
                    this.objEnd()
                }
                for (var i = 0; i < t.children.length; i++)
                    this.renderItems(t.children[i])
            }
            ,
            e.outline.line = function(e) {
                this.ctx.val += e + "\r\n"
            }
            ,
            e.outline.makeRef = function(e) {
                return e.id + " 0 R"
            }
            ,
            e.outline.makeString = function(t) {
                return "(" + e.internal.pdfEscape(t) + ")"
            }
            ,
            e.outline.objStart = function(e) {
                this.ctx.val += "\r\n" + e.id + " 0 obj\r\n<<\r\n"
            }
            ,
            e.outline.objEnd = function() {
                this.ctx.val += ">> \r\nendobj\r\n"
            }
            ,
            e.outline.count_r = function(e, t) {
                for (var r = 0; r < t.children.length; r++)
                    e.count++,
                    this.count_r(e, t.children[r]);
                return e.count
            }
        }
        ])
    }(g.API),
    /**
     * @license
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = [192, 193, 194, 195, 196, 197, 198, 199];
        e.processJPEG = function(e, r, a, n, o, l) {
            var i, s = this.decode.DCT_DECODE, c = null;
            if ("string" == typeof e || this.__addimage__.isArrayBuffer(e) || this.__addimage__.isArrayBufferView(e)) {
                switch (e = o || e,
                e = this.__addimage__.isArrayBuffer(e) ? new Uint8Array(e) : e,
                (i = function(e) {
                    for (var r, a = 256 * e.charCodeAt(4) + e.charCodeAt(5), n = e.length, o = {
                        width: 0,
                        height: 0,
                        numcomponents: 1
                    }, l = 4; l < n; l += 2) {
                        if (l += a,
                        -1 !== t.indexOf(e.charCodeAt(l + 1))) {
                            r = 256 * e.charCodeAt(l + 5) + e.charCodeAt(l + 6),
                            o = {
                                width: 256 * e.charCodeAt(l + 7) + e.charCodeAt(l + 8),
                                height: r,
                                numcomponents: e.charCodeAt(l + 9)
                            };
                            break
                        }
                        a = 256 * e.charCodeAt(l + 2) + e.charCodeAt(l + 3)
                    }
                    return o
                }(e = this.__addimage__.isArrayBufferView(e) ? this.__addimage__.arrayBufferToBinaryString(e) : e)).numcomponents) {
                case 1:
                    l = this.color_spaces.DEVICE_GRAY;
                    break;
                case 4:
                    l = this.color_spaces.DEVICE_CMYK;
                    break;
                case 3:
                    l = this.color_spaces.DEVICE_RGB
                }
                c = {
                    data: e,
                    width: i.width,
                    height: i.height,
                    colorSpace: l,
                    bitsPerComponent: 8,
                    filter: s,
                    index: r,
                    alias: a
                }
            }
            return c
        }
    }(g.API);
    /**
     * @license
     * Extracted from pdf.js
     * https://github.com/andreasgal/pdf.js
     *
     * Copyright (c) 2011 Mozilla Foundation
     *
     * Contributors: Andreas Gal <gal@mozilla.com>
     *               Chris G Jones <cjones@mozilla.com>
     *               Shaon Barman <shaon.barman@gmail.com>
     *               Vivien Nicolas <21@vingtetun.org>
     *               Justin D'Arcangelo <justindarc@gmail.com>
     *               Yury Delendik
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
     * to deal in the Software without restriction, including without limitation
     * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     * and/or sell copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
     * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     * DEALINGS IN THE SOFTWARE.
     */
    var At, _t, St, Pt, kt, Ft = function() {
        function e() {
            this.pos = 0,
            this.bufferLength = 0,
            this.eof = !1,
            this.buffer = null
        }
        return e.prototype = {
            ensureBuffer: function(e) {
                var t = this.buffer
                  , r = t ? t.byteLength : 0;
                if (e < r)
                    return t;
                for (var a = 512; a < e; )
                    a <<= 1;
                for (var n = new Uint8Array(a), o = 0; o < r; ++o)
                    n[o] = t[o];
                return this.buffer = n
            },
            getByte: function() {
                for (var e = this.pos; this.bufferLength <= e; ) {
                    if (this.eof)
                        return null;
                    this.readBlock()
                }
                return this.buffer[this.pos++]
            },
            getBytes: function(e) {
                var t = this.pos;
                if (e) {
                    this.ensureBuffer(t + e);
                    for (var r = t + e; !this.eof && this.bufferLength < r; )
                        this.readBlock();
                    var a = this.bufferLength;
                    r > a && (r = a)
                } else {
                    for (; !this.eof; )
                        this.readBlock();
                    r = this.bufferLength
                }
                return this.pos = r,
                this.buffer.subarray(t, r)
            },
            lookChar: function() {
                for (var e = this.pos; this.bufferLength <= e; ) {
                    if (this.eof)
                        return null;
                    this.readBlock()
                }
                return String.fromCharCode(this.buffer[this.pos])
            },
            getChar: function() {
                for (var e = this.pos; this.bufferLength <= e; ) {
                    if (this.eof)
                        return null;
                    this.readBlock()
                }
                return String.fromCharCode(this.buffer[this.pos++])
            },
            makeSubStream: function(e, t, r) {
                for (var a = e + t; this.bufferLength <= a && !this.eof; )
                    this.readBlock();
                return new Stream(this.buffer,e,t,r)
            },
            skip: function(e) {
                e || (e = 1),
                this.pos += e
            },
            reset: function() {
                this.pos = 0
            }
        },
        e
    }(), It = ("undefined" != typeof self && self || "undefined" != typeof window && window || "undefined" != typeof global && global || Function('return typeof this === "object" && this.content')() || Function("return this")()).FlateStream = function() {
        if ("undefined" != typeof Uint32Array) {
            var e = new Uint32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
              , t = new Uint32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258])
              , r = new Uint32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545])
              , a = [new Uint32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9]
              , n = [new Uint32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5];
            return l.prototype = Object.create(Ft.prototype),
            l.prototype.getBits = function(e) {
                for (var t, r = this.codeSize, a = this.codeBuf, n = this.bytes, l = this.bytesPos; r < e; )
                    void 0 === (t = n[l++]) && o("Bad encoding in flate stream"),
                    a |= t << r,
                    r += 8;
                return t = a & (1 << e) - 1,
                this.codeBuf = a >> e,
                this.codeSize = r -= e,
                this.bytesPos = l,
                t
            }
            ,
            l.prototype.getCode = function(e) {
                for (var t = e[0], r = e[1], a = this.codeSize, n = this.codeBuf, l = this.bytes, i = this.bytesPos; a < r; ) {
                    var s;
                    void 0 === (s = l[i++]) && o("Bad encoding in flate stream"),
                    n |= s << a,
                    a += 8
                }
                var c = t[n & (1 << r) - 1]
                  , u = c >> 16
                  , h = 65535 & c;
                return (0 == a || a < u || 0 == u) && o("Bad encoding in flate stream"),
                this.codeBuf = n >> u,
                this.codeSize = a - u,
                this.bytesPos = i,
                h
            }
            ,
            l.prototype.generateHuffmanTable = function(e) {
                for (var t = e.length, r = 0, a = 0; a < t; ++a)
                    e[a] > r && (r = e[a]);
                for (var n = 1 << r, o = new Uint32Array(n), l = 1, i = 0, s = 2; l <= r; ++l,
                i <<= 1,
                s <<= 1)
                    for (var c = 0; c < t; ++c)
                        if (e[c] == l) {
                            var u = 0
                              , h = i;
                            for (a = 0; a < l; ++a)
                                u = u << 1 | 1 & h,
                                h >>= 1;
                            for (a = u; a < n; a += s)
                                o[a] = l << 16 | c;
                            ++i
                        }
                return [o, r]
            }
            ,
            l.prototype.readBlock = function() {
                function l(e, t, r, a, n) {
                    for (var o = e.getBits(r) + a; o-- > 0; )
                        t[m++] = n
                }
                var i = this.getBits(3);
                if (1 & i && (this.eof = !0),
                0 != (i >>= 1)) {
                    var s, c;
                    if (1 == i)
                        s = a,
                        c = n;
                    else if (2 == i) {
                        for (var u = this.getBits(5) + 257, h = this.getBits(5) + 1, d = this.getBits(4) + 4, f = Array(e.length), m = 0; m < d; )
                            f[e[m++]] = this.getBits(3);
                        for (var p = this.generateHuffmanTable(f), g = 0, y = (m = 0,
                        u + h), v = new Array(y); m < y; ) {
                            var A = this.getCode(p);
                            16 == A ? l(this, v, 2, 3, g) : 17 == A ? l(this, v, 3, 3, g = 0) : 18 == A ? l(this, v, 7, 11, g = 0) : v[m++] = g = A
                        }
                        s = this.generateHuffmanTable(v.slice(0, u)),
                        c = this.generateHuffmanTable(v.slice(u, y))
                    } else
                        o("Unknown block type in flate stream");
                    for (var b = (N = this.buffer) ? N.length : 0, k = this.bufferLength; ; ) {
                        var w = this.getCode(s);
                        if (w < 256)
                            k + 1 >= b && (b = (N = this.ensureBuffer(k + 1)).length),
                            N[k++] = w;
                        else {
                            if (256 == w)
                                return void (this.bufferLength = k);
                            var x = (w = t[w -= 257]) >> 16;
                            x > 0 && (x = this.getBits(x)),
                            g = (65535 & w) + x,
                            w = this.getCode(c),
                            (x = (w = r[w]) >> 16) > 0 && (x = this.getBits(x));
                            var S = (65535 & w) + x;
                            k + g >= b && (b = (N = this.ensureBuffer(k + g)).length);
                            for (var _ = 0; _ < g; ++_,
                            ++k)
                                N[k] = N[k - S]
                        }
                    }
                } else {
                    var C, T = this.bytes, E = this.bytesPos;
                    void 0 === (C = T[E++]) && o("Bad block header in flate stream");
                    var I = C;
                    void 0 === (C = T[E++]) && o("Bad block header in flate stream"),
                    I |= C << 8,
                    void 0 === (C = T[E++]) && o("Bad block header in flate stream");
                    var R = C;
                    void 0 === (C = T[E++]) && o("Bad block header in flate stream"),
                    (R |= C << 8) != (65535 & ~I) && o("Bad uncompressed block length in flate stream"),
                    this.codeBuf = 0,
                    this.codeSize = 0;
                    var B = this.bufferLength
                      , N = this.ensureBuffer(B + I)
                      , F = B + I;
                    this.bufferLength = F;
                    for (var P = B; P < F; ++P) {
                        if (void 0 === (C = T[E++])) {
                            this.eof = !0;
                            break
                        }
                        N[P] = C
                    }
                    this.bytesPos = E
                }
            }
            ,
            l
        }
        function o(e) {
            throw new Error(e)
        }
        function l(e) {
            var t = 0
              , r = e[t++]
              , a = e[t++];
            -1 != r && -1 != a || o("Invalid header in flate stream"),
            8 != (15 & r) && o("Unknown compression method in flate stream"),
            ((r << 8) + a) % 31 != 0 && o("Bad FCHECK in flate stream"),
            32 & a && o("FDICT bit set in flate stream"),
            this.bytes = e,
            this.bytesPos = 2,
            this.codeSize = 0,
            this.codeBuf = 0,
            Ft.call(this)
        }
    }(), Ct = function() {
        var e, r, a;
        function n(e) {
            var t, r, a, n, o, l, i, s, c, u, h, d, f, m;
            for (this.data = e,
            this.pos = 8,
            this.palette = [],
            this.imgData = [],
            this.transparency = {},
            this.animation = null,
            this.text = {},
            l = null; ; ) {
                switch (t = this.readUInt32(),
                c = function() {
                    var e, t;
                    for (t = [],
                    e = 0; e < 4; ++e)
                        t.push(String.fromCharCode(this.data[this.pos++]));
                    return t
                }
                .call(this).join("")) {
                case "IHDR":
                    this.width = this.readUInt32(),
                    this.height = this.readUInt32(),
                    this.bits = this.data[this.pos++],
                    this.colorType = this.data[this.pos++],
                    this.compressionMethod = this.data[this.pos++],
                    this.filterMethod = this.data[this.pos++],
                    this.interlaceMethod = this.data[this.pos++];
                    break;
                case "acTL":
                    this.animation = {
                        numFrames: this.readUInt32(),
                        numPlays: this.readUInt32() || 1 / 0,
                        frames: []
                    };
                    break;
                case "PLTE":
                    this.palette = this.read(t);
                    break;
                case "fcTL":
                    l && this.animation.frames.push(l),
                    this.pos += 4,
                    l = {
                        width: this.readUInt32(),
                        height: this.readUInt32(),
                        xOffset: this.readUInt32(),
                        yOffset: this.readUInt32()
                    },
                    o = this.readUInt16(),
                    n = this.readUInt16() || 100,
                    l.delay = 1e3 * o / n,
                    l.disposeOp = this.data[this.pos++],
                    l.blendOp = this.data[this.pos++],
                    l.data = [];
                    break;
                case "IDAT":
                case "fdAT":
                    for ("fdAT" === c && (this.pos += 4,
                    t -= 4),
                    e = (null != l ? l.data : void 0) || this.imgData,
                    d = 0; 0 <= t ? d < t : d > t; 0 <= t ? ++d : --d)
                        e.push(this.data[this.pos++]);
                    break;
                case "tRNS":
                    switch (this.transparency = {},
                    this.colorType) {
                    case 3:
                        if (a = this.palette.length / 3,
                        this.transparency.indexed = this.read(t),
                        this.transparency.indexed.length > a)
                            throw new Error("More transparent colors than palette size");
                        if ((u = a - this.transparency.indexed.length) > 0)
                            for (f = 0; 0 <= u ? f < u : f > u; 0 <= u ? ++f : --f)
                                this.transparency.indexed.push(255);
                        break;
                    case 0:
                        this.transparency.grayscale = this.read(t)[0];
                        break;
                    case 2:
                        this.transparency.rgb = this.read(t)
                    }
                    break;
                case "tEXt":
                    i = (h = this.read(t)).indexOf(0),
                    s = String.fromCharCode.apply(String, h.slice(0, i)),
                    this.text[s] = String.fromCharCode.apply(String, h.slice(i + 1));
                    break;
                case "IEND":
                    return l && this.animation.frames.push(l),
                    this.colors = function() {
                        switch (this.colorType) {
                        case 0:
                        case 3:
                        case 4:
                            return 1;
                        case 2:
                        case 6:
                            return 3
                        }
                    }
                    .call(this),
                    this.hasAlphaChannel = 4 === (m = this.colorType) || 6 === m,
                    r = this.colors + (this.hasAlphaChannel ? 1 : 0),
                    this.pixelBitlength = this.bits * r,
                    this.colorSpace = function() {
                        switch (this.colors) {
                        case 1:
                            return "DeviceGray";
                        case 3:
                            return "DeviceRGB"
                        }
                    }
                    .call(this),
                    void (this.imgData = new Uint8Array(this.imgData));
                default:
                    this.pos += t
                }
                if (this.pos += 4,
                this.pos > this.data.length)
                    throw new Error("Incomplete or corrupt PNG file")
            }
        }
        n.prototype.read = function(e) {
            var t, r;
            for (r = [],
            t = 0; 0 <= e ? t < e : t > e; 0 <= e ? ++t : --t)
                r.push(this.data[this.pos++]);
            return r
        }
        ,
        n.prototype.readUInt32 = function() {
            return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++]
        }
        ,
        n.prototype.readUInt16 = function() {
            return this.data[this.pos++] << 8 | this.data[this.pos++]
        }
        ,
        n.prototype.decodePixels = function(e) {
            var t = this.pixelBitlength / 8
              , r = new Uint8Array(this.width * this.height * t)
              , a = 0
              , n = this;
            if (null == e && (e = this.imgData),
            0 === e.length)
                return new Uint8Array(0);
            function o(o, l, i, s) {
                var c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _, C, T, E, I, R = Math.ceil((n.width - o) / i), B = Math.ceil((n.height - l) / s), N = n.width == R && n.height == B;
                for (w = t * R,
                b = N ? r : new Uint8Array(w * B),
                m = e.length,
                k = 0,
                u = 0; k < B && a < m; ) {
                    switch (e[a++]) {
                    case 0:
                        for (d = _ = 0; _ < w; d = _ += 1)
                            b[u++] = e[a++];
                        break;
                    case 1:
                        for (d = C = 0; C < w; d = C += 1)
                            c = e[a++],
                            f = d < t ? 0 : b[u - t],
                            b[u++] = (c + f) % 256;
                        break;
                    case 2:
                        for (d = T = 0; T < w; d = T += 1)
                            c = e[a++],
                            h = (d - d % t) / t,
                            x = k && b[(k - 1) * w + h * t + d % t],
                            b[u++] = (x + c) % 256;
                        break;
                    case 3:
                        for (d = E = 0; E < w; d = E += 1)
                            c = e[a++],
                            h = (d - d % t) / t,
                            f = d < t ? 0 : b[u - t],
                            x = k && b[(k - 1) * w + h * t + d % t],
                            b[u++] = (c + Math.floor((f + x) / 2)) % 256;
                        break;
                    case 4:
                        for (d = I = 0; I < w; d = I += 1)
                            c = e[a++],
                            h = (d - d % t) / t,
                            f = d < t ? 0 : b[u - t],
                            0 === k ? x = S = 0 : (x = b[(k - 1) * w + h * t + d % t],
                            S = h && b[(k - 1) * w + (h - 1) * t + d % t]),
                            p = f + x - S,
                            g = Math.abs(p - f),
                            v = Math.abs(p - x),
                            A = Math.abs(p - S),
                            y = g <= v && g <= A ? f : v <= A ? x : S,
                            b[u++] = (c + y) % 256;
                        break;
                    default:
                        throw new Error("Invalid filter algorithm: " + e[a - 1])
                    }
                    if (!N) {
                        var F = ((l + k * s) * n.width + o) * t
                          , P = k * w;
                        for (d = 0; d < R; d += 1) {
                            for (var $ = 0; $ < t; $ += 1)
                                r[F++] = b[P++];
                            F += (i - 1) * t
                        }
                    }
                    k++
                }
            }
            return e = (e = new It(e)).getBytes(),
            1 == n.interlaceMethod ? (o(0, 0, 8, 8),
            o(4, 0, 8, 8),
            o(0, 4, 4, 8),
            o(2, 0, 4, 4),
            o(0, 2, 2, 4),
            o(1, 0, 2, 2),
            o(0, 1, 1, 2)) : o(0, 0, 1, 1),
            r
        }
        ,
        n.prototype.decodePalette = function() {
            var e, t, r, a, n, o, l, i, s;
            for (r = this.palette,
            o = this.transparency.indexed || [],
            n = new Uint8Array((o.length || 0) + r.length),
            a = 0,
            e = 0,
            t = l = 0,
            i = r.length; l < i; t = l += 3)
                n[a++] = r[t],
                n[a++] = r[t + 1],
                n[a++] = r[t + 2],
                n[a++] = null != (s = o[e++]) ? s : 255;
            return n
        }
        ,
        n.prototype.copyToImageData = function(e, t) {
            var r, a, n, o, l, i, s, c, u, h, d;
            if (a = this.colors,
            u = null,
            r = this.hasAlphaChannel,
            this.palette.length && (u = null != (d = this._decodedPalette) ? d : this._decodedPalette = this.decodePalette(),
            a = 4,
            r = !0),
            c = (n = e.data || e).length,
            l = u || t,
            o = i = 0,
            1 === a)
                for (; o < c; )
                    s = u ? 4 * t[o / 4] : i,
                    h = l[s++],
                    n[o++] = h,
                    n[o++] = h,
                    n[o++] = h,
                    n[o++] = r ? l[s++] : 255,
                    i = s;
            else
                for (; o < c; )
                    s = u ? 4 * t[o / 4] : i,
                    n[o++] = l[s++],
                    n[o++] = l[s++],
                    n[o++] = l[s++],
                    n[o++] = r ? l[s++] : 255,
                    i = s
        }
        ,
        n.prototype.decode = function() {
            var e;
            return e = new Uint8Array(this.width * this.height * 4),
            this.copyToImageData(e, this.decodePixels()),
            e
        }
        ;
        var o = function() {
            if ("[object Window]" === Object.prototype.toString.call(t)) {
                try {
                    r = t.document.createElement("canvas"),
                    a = r.getContext("2d")
                } catch (e) {
                    return !1
                }
                return !0
            }
            return !1
        };
        return o(),
        e = function(e) {
            var t;
            if (!0 === o())
                return a.width = e.width,
                a.height = e.height,
                a.clearRect(0, 0, e.width, e.height),
                a.putImageData(e, 0, 0),
                (t = new Image).src = r.toDataURL(),
                t;
            throw new Error("This method requires a Browser with Canvas-capability.")
        }
        ,
        n.prototype.decodeFrames = function(t) {
            var r, a, n, o, l, i, s, c;
            if (this.animation) {
                for (c = [],
                a = l = 0,
                i = (s = this.animation.frames).length; l < i; a = ++l)
                    r = s[a],
                    n = t.createImageData(r.width, r.height),
                    o = this.decodePixels(new Uint8Array(r.data)),
                    this.copyToImageData(n, o),
                    r.imageData = n,
                    c.push(r.image = e(n));
                return c
            }
        }
        ,
        n.prototype.renderFrame = function(e, t) {
            var r, a, n;
            return r = (a = this.animation.frames)[t],
            n = a[t - 1],
            0 === t && e.clearRect(0, 0, this.width, this.height),
            1 === (null != n ? n.disposeOp : void 0) ? e.clearRect(n.xOffset, n.yOffset, n.width, n.height) : 2 === (null != n ? n.disposeOp : void 0) && e.putImageData(n.imageData, n.xOffset, n.yOffset),
            0 === r.blendOp && e.clearRect(r.xOffset, r.yOffset, r.width, r.height),
            e.drawImage(r.image, r.xOffset, r.yOffset)
        }
        ,
        n.prototype.animate = function(e) {
            var t, r, a, n, o, l, i = this;
            return r = 0,
            l = this.animation,
            n = l.numFrames,
            a = l.frames,
            o = l.numPlays,
            (t = function() {
                var l, s;
                if (l = r++ % n,
                s = a[l],
                i.renderFrame(e, l),
                n > 1 && r / n < o)
                    return i.animation._timeout = setTimeout(t, s.delay)
            }
            )()
        }
        ,
        n.prototype.stopAnimation = function() {
            var e;
            return clearTimeout(null != (e = this.animation) ? e._timeout : void 0)
        }
        ,
        n.prototype.render = function(e) {
            var t, r;
            return e._png && e._png.stopAnimation(),
            e._png = this,
            e.width = this.width,
            e.height = this.height,
            t = e.getContext("2d"),
            this.animation ? (this.decodeFrames(t),
            this.animate(t)) : (r = t.createImageData(this.width, this.height),
            this.copyToImageData(r, this.decodePixels()),
            t.putImageData(r, 0, 0))
        }
        ,
        n
    }();
    /**
     * @license
     * (c) Dean McNamee <dean@gmail.com>, 2013.
     *
     * https://github.com/deanm/omggif
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy
     * of this software and associated documentation files (the "Software"), to
     * deal in the Software without restriction, including without limitation the
     * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     * sell copies of the Software, and to permit persons to whom the Software is
     * furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     * IN THE SOFTWARE.
     *
     * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
     * including animation and compression.  It does not rely on any specific
     * underlying system, so should run in the browser, Node, or Plask.
     */
    function jt(e) {
        var t = 0;
        if (71 !== e[t++] || 73 !== e[t++] || 70 !== e[t++] || 56 !== e[t++] || 56 != (e[t++] + 1 & 253) || 97 !== e[t++])
            throw new Error("Invalid GIF 87a/89a header.");
        var r = e[t++] | e[t++] << 8
          , a = e[t++] | e[t++] << 8
          , n = e[t++]
          , o = n >> 7
          , l = 1 << 1 + (7 & n);
        e[t++],
        e[t++];
        var i = null
          , s = null;
        o && (i = t,
        s = l,
        t += 3 * l);
        var c = !0
          , u = []
          , h = 0
          , d = null
          , f = 0
          , m = null;
        for (this.width = r,
        this.height = a; c && t < e.length; )
            switch (e[t++]) {
            case 33:
                switch (e[t++]) {
                case 255:
                    if (11 !== e[t] || 78 == e[t + 1] && 69 == e[t + 2] && 84 == e[t + 3] && 83 == e[t + 4] && 67 == e[t + 5] && 65 == e[t + 6] && 80 == e[t + 7] && 69 == e[t + 8] && 50 == e[t + 9] && 46 == e[t + 10] && 48 == e[t + 11] && 3 == e[t + 12] && 1 == e[t + 13] && 0 == e[t + 16])
                        t += 14,
                        m = e[t++] | e[t++] << 8,
                        t++;
                    else
                        for (t += 12; ; ) {
                            if (!((T = e[t++]) >= 0))
                                throw Error("Invalid block size");
                            if (0 === T)
                                break;
                            t += T
                        }
                    break;
                case 249:
                    if (4 !== e[t++] || 0 !== e[t + 4])
                        throw new Error("Invalid graphics extension block.");
                    var p = e[t++];
                    h = e[t++] | e[t++] << 8,
                    d = e[t++],
                    0 == (1 & p) && (d = null),
                    f = p >> 2 & 7,
                    t++;
                    break;
                case 254:
                    for (; ; ) {
                        if (!((T = e[t++]) >= 0))
                            throw Error("Invalid block size");
                        if (0 === T)
                            break;
                        t += T
                    }
                    break;
                default:
                    throw new Error("Unknown graphic control label: 0x" + e[t - 1].toString(16))
                }
                break;
            case 44:
                var g = e[t++] | e[t++] << 8
                  , y = e[t++] | e[t++] << 8
                  , v = e[t++] | e[t++] << 8
                  , A = e[t++] | e[t++] << 8
                  , b = e[t++]
                  , k = b >> 6 & 1
                  , w = 1 << 1 + (7 & b)
                  , x = i
                  , S = s
                  , _ = !1;
                b >> 7 && (_ = !0,
                x = t,
                S = w,
                t += 3 * w);
                var C = t;
                for (t++; ; ) {
                    var T;
                    if (!((T = e[t++]) >= 0))
                        throw Error("Invalid block size");
                    if (0 === T)
                        break;
                    t += T
                }
                u.push({
                    x: g,
                    y: y,
                    width: v,
                    height: A,
                    has_local_palette: _,
                    palette_offset: x,
                    palette_size: S,
                    data_offset: C,
                    data_length: t - C,
                    transparent_index: d,
                    interlaced: !!k,
                    delay: h,
                    disposal: f
                });
                break;
            case 59:
                c = !1;
                break;
            default:
                throw new Error("Unknown gif block: 0x" + e[t - 1].toString(16))
            }
        this.numFrames = function() {
            return u.length
        }
        ,
        this.loopCount = function() {
            return m
        }
        ,
        this.frameInfo = function(e) {
            if (e < 0 || e >= u.length)
                throw new Error("Frame index out of range.");
            return u[e]
        }
        ,
        this.decodeAndBlitFrameBGRA = function(t, a) {
            var n = this.frameInfo(t)
              , o = n.width * n.height
              , l = new Uint8Array(o);
            Bt(e, n.data_offset, l, o);
            var i = n.palette_offset
              , s = n.transparent_index;
            null === s && (s = 256);
            var c = n.width
              , u = r - c
              , h = c
              , d = 4 * (n.y * r + n.x)
              , f = 4 * ((n.y + n.height) * r + n.x)
              , m = d
              , p = 4 * u;
            !0 === n.interlaced && (p += 4 * r * 7);
            for (var g = 8, y = 0, v = l.length; y < v; ++y) {
                var A = l[y];
                if (0 === h && (h = c,
                (m += p) >= f && (p = 4 * u + 4 * r * (g - 1),
                m = d + (c + u) * (g << 1),
                g >>= 1)),
                A === s)
                    m += 4;
                else {
                    var b = e[i + 3 * A]
                      , k = e[i + 3 * A + 1]
                      , w = e[i + 3 * A + 2];
                    a[m++] = w,
                    a[m++] = k,
                    a[m++] = b,
                    a[m++] = 255
                }
                --h
            }
        }
        ,
        this.decodeAndBlitFrameRGBA = function(t, a) {
            var n = this.frameInfo(t)
              , o = n.width * n.height
              , l = new Uint8Array(o);
            Bt(e, n.data_offset, l, o);
            var i = n.palette_offset
              , s = n.transparent_index;
            null === s && (s = 256);
            var c = n.width
              , u = r - c
              , h = c
              , d = 4 * (n.y * r + n.x)
              , f = 4 * ((n.y + n.height) * r + n.x)
              , m = d
              , p = 4 * u;
            !0 === n.interlaced && (p += 4 * r * 7);
            for (var g = 8, y = 0, v = l.length; y < v; ++y) {
                var A = l[y];
                if (0 === h && (h = c,
                (m += p) >= f && (p = 4 * u + 4 * r * (g - 1),
                m = d + (c + u) * (g << 1),
                g >>= 1)),
                A === s)
                    m += 4;
                else {
                    var b = e[i + 3 * A]
                      , k = e[i + 3 * A + 1]
                      , w = e[i + 3 * A + 2];
                    a[m++] = b,
                    a[m++] = k,
                    a[m++] = w,
                    a[m++] = 255
                }
                --h
            }
        }
    }
    function Bt(e, t, r, a) {
        for (var o = e[t++], l = 1 << o, i = l + 1, s = i + 1, c = o + 1, u = (1 << c) - 1, h = 0, d = 0, f = 0, m = e[t++], p = new Int32Array(4096), g = null; ; ) {
            for (; h < 16 && 0 !== m; )
                d |= e[t++] << h,
                h += 8,
                1 === m ? m = e[t++] : --m;
            if (h < c)
                break;
            var y = d & u;
            if (d >>= c,
            h -= c,
            y !== l) {
                if (y === i)
                    break;
                for (var v = y < s ? y : g, A = 0, b = v; b > l; )
                    b = p[b] >> 8,
                    ++A;
                var k = b;
                if (f + A + (v !== y ? 1 : 0) > a)
                    return void n.log("Warning, gif stream longer than expected.");
                r[f++] = k;
                var w = f += A;
                for (v !== y && (r[f++] = k),
                b = v; A--; )
                    b = p[b],
                    r[--w] = 255 & b,
                    b >>= 8;
                null !== g && s < 4096 && (p[s++] = g << 8 | k,
                s >= u + 1 && c < 12 && (++c,
                u = u << 1 | 1)),
                g = y
            } else
                s = i + 1,
                u = (1 << (c = o + 1)) - 1,
                g = null
        }
        return f !== a && n.log("Warning, gif stream shorter than expected."),
        r
    }
    /**
     * @license
      Copyright (c) 2008, Adobe Systems Incorporated
      All rights reserved.

      Redistribution and use in source and binary forms, with or without 
      modification, are permitted provided that the following conditions are
      met:

      * Redistributions of source code must retain the above copyright notice, 
        this list of conditions and the following disclaimer.
      
      * Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the 
        documentation and/or other materials provided with the distribution.
      
      * Neither the name of Adobe Systems Incorporated nor the names of its 
        contributors may be used to endorse or promote products derived from 
        this software without specific prior written permission.

      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
      IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
      THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
      PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
      CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
      EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
      PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
      PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
      LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
      NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
      SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    function Ot(e) {
        var t, r, a, n, o, l = Math.floor, i = new Array(64), s = new Array(64), c = new Array(64), u = new Array(64), h = new Array(65535), d = new Array(65535), f = new Array(64), m = new Array(64), p = [], g = 0, y = 7, v = new Array(64), A = new Array(64), b = new Array(64), k = new Array(256), w = new Array(2048), x = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], S = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], _ = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], C = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], T = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], E = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], I = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], R = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], B = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
        function N(e, t) {
            for (var r = 0, a = 0, n = new Array, o = 1; o <= 16; o++) {
                for (var l = 1; l <= e[o]; l++)
                    n[t[a]] = [],
                    n[t[a]][0] = r,
                    n[t[a]][1] = o,
                    a++,
                    r++;
                r *= 2
            }
            return n
        }
        function F(e) {
            for (var t = e[0], r = e[1] - 1; r >= 0; )
                t & 1 << r && (g |= 1 << y),
                r--,
                --y < 0 && (255 == g ? (P(255),
                P(0)) : P(g),
                y = 7,
                g = 0)
        }
        function P(e) {
            p.push(e)
        }
        function $(e) {
            P(e >> 8 & 255),
            P(255 & e)
        }
        function L(e, t, r, a, n) {
            for (var o, l = n[0], i = n[240], s = function(e, t) {
                var r, a, n, o, l, i, s, c, u, h, d = 0;
                for (u = 0; u < 8; ++u) {
                    r = e[d],
                    a = e[d + 1],
                    n = e[d + 2],
                    o = e[d + 3],
                    l = e[d + 4],
                    i = e[d + 5],
                    s = e[d + 6];
                    var m = r + (c = e[d + 7])
                      , p = r - c
                      , g = a + s
                      , y = a - s
                      , v = n + i
                      , A = n - i
                      , b = o + l
                      , k = o - l
                      , w = m + b
                      , x = m - b
                      , S = g + v
                      , _ = g - v;
                    e[d] = w + S,
                    e[d + 4] = w - S;
                    var C = .707106781 * (_ + x);
                    e[d + 2] = x + C,
                    e[d + 6] = x - C;
                    var T = .382683433 * ((w = k + A) - (_ = y + p))
                      , E = .5411961 * w + T
                      , I = 1.306562965 * _ + T
                      , R = .707106781 * (S = A + y)
                      , B = p + R
                      , N = p - R;
                    e[d + 5] = N + E,
                    e[d + 3] = N - E,
                    e[d + 1] = B + I,
                    e[d + 7] = B - I,
                    d += 8
                }
                for (d = 0,
                u = 0; u < 8; ++u) {
                    r = e[d],
                    a = e[d + 8],
                    n = e[d + 16],
                    o = e[d + 24],
                    l = e[d + 32],
                    i = e[d + 40],
                    s = e[d + 48];
                    var F = r + (c = e[d + 56])
                      , P = r - c
                      , $ = a + s
                      , L = a - s
                      , O = n + i
                      , D = n - i
                      , M = o + l
                      , U = o - l
                      , H = F + M
                      , q = F - M
                      , z = $ + O
                      , j = $ - O;
                    e[d] = H + z,
                    e[d + 32] = H - z;
                    var V = .707106781 * (j + q);
                    e[d + 16] = q + V,
                    e[d + 48] = q - V;
                    var Q = .382683433 * ((H = U + D) - (j = L + P))
                      , G = .5411961 * H + Q
                      , K = 1.306562965 * j + Q
                      , W = .707106781 * (z = D + L)
                      , Y = P + W
                      , X = P - W;
                    e[d + 40] = X + G,
                    e[d + 24] = X - G,
                    e[d + 8] = Y + K,
                    e[d + 56] = Y - K,
                    d++
                }
                for (u = 0; u < 64; ++u)
                    h = e[u] * t[u],
                    f[u] = h > 0 ? h + .5 | 0 : h - .5 | 0;
                return f
            }(e, t), c = 0; c < 64; ++c)
                m[x[c]] = s[c];
            var u = m[0] - r;
            r = m[0],
            0 == u ? F(a[0]) : (F(a[d[o = 32767 + u]]),
            F(h[o]));
            for (var p = 63; p > 0 && 0 == m[p]; )
                p--;
            if (0 == p)
                return F(l),
                r;
            for (var g, y = 1; y <= p; ) {
                for (var v = y; 0 == m[y] && y <= p; )
                    ++y;
                var A = y - v;
                if (A >= 16) {
                    g = A >> 4;
                    for (var b = 1; b <= g; ++b)
                        F(i);
                    A &= 15
                }
                o = 32767 + m[y],
                F(n[(A << 4) + d[o]]),
                F(h[o]),
                y++
            }
            return 63 != p && F(l),
            r
        }
        function O(e) {
            e = Math.min(Math.max(e, 1), 100),
            o != e && (function(e) {
                for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], r = 0; r < 64; r++) {
                    var a = l((t[r] * e + 50) / 100);
                    a = Math.min(Math.max(a, 1), 255),
                    i[x[r]] = a
                }
                for (var n = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
                    var h = l((n[o] * e + 50) / 100);
                    h = Math.min(Math.max(h, 1), 255),
                    s[x[o]] = h
                }
                for (var d = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], f = 0, m = 0; m < 8; m++)
                    for (var p = 0; p < 8; p++)
                        c[f] = 1 / (i[x[f]] * d[m] * d[p] * 8),
                        u[f] = 1 / (s[x[f]] * d[m] * d[p] * 8),
                        f++
            }(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
            o = e)
        }
        this.encode = function(e, o) {
            o && O(o),
            p = new Array,
            g = 0,
            y = 7,
            $(65496),
            $(65504),
            $(16),
            P(74),
            P(70),
            P(73),
            P(70),
            P(0),
            P(1),
            P(1),
            P(0),
            $(1),
            $(1),
            P(0),
            P(0),
            function() {
                $(65499),
                $(132),
                P(0);
                for (var e = 0; e < 64; e++)
                    P(i[e]);
                P(1);
                for (var t = 0; t < 64; t++)
                    P(s[t])
            }(),
            function(e, t) {
                $(65472),
                $(17),
                P(8),
                $(t),
                $(e),
                P(3),
                P(1),
                P(17),
                P(0),
                P(2),
                P(17),
                P(1),
                P(3),
                P(17),
                P(1)
            }(e.width, e.height),
            function() {
                $(65476),
                $(418),
                P(0);
                for (var e = 0; e < 16; e++)
                    P(S[e + 1]);
                for (var t = 0; t <= 11; t++)
                    P(_[t]);
                P(16);
                for (var r = 0; r < 16; r++)
                    P(C[r + 1]);
                for (var a = 0; a <= 161; a++)
                    P(T[a]);
                P(1);
                for (var n = 0; n < 16; n++)
                    P(E[n + 1]);
                for (var o = 0; o <= 11; o++)
                    P(I[o]);
                P(17);
                for (var l = 0; l < 16; l++)
                    P(R[l + 1]);
                for (var i = 0; i <= 161; i++)
                    P(B[i])
            }(),
            $(65498),
            $(12),
            P(3),
            P(1),
            P(0),
            P(2),
            P(17),
            P(3),
            P(17),
            P(0),
            P(63),
            P(0);
            var l = 0
              , h = 0
              , d = 0;
            g = 0,
            y = 7,
            this.encode.displayName = "_encode_";
            for (var f, m, k, x, N, D, M, U, H, q = e.data, z = e.width, j = e.height, V = 4 * z, Q = 0; Q < j; ) {
                for (f = 0; f < V; ) {
                    for (N = V * Q + f,
                    M = -1,
                    U = 0,
                    H = 0; H < 64; H++)
                        D = N + (U = H >> 3) * V + (M = 4 * (7 & H)),
                        Q + U >= j && (D -= V * (Q + 1 + U - j)),
                        f + M >= V && (D -= f + M - V + 4),
                        m = q[D++],
                        k = q[D++],
                        x = q[D++],
                        v[H] = (w[m] + w[k + 256 >> 0] + w[x + 512 >> 0] >> 16) - 128,
                        A[H] = (w[m + 768 >> 0] + w[k + 1024 >> 0] + w[x + 1280 >> 0] >> 16) - 128,
                        b[H] = (w[m + 1280 >> 0] + w[k + 1536 >> 0] + w[x + 1792 >> 0] >> 16) - 128;
                    l = L(v, c, l, t, a),
                    h = L(A, u, h, r, n),
                    d = L(b, u, d, r, n),
                    f += 32
                }
                Q += 8
            }
            if (y >= 0) {
                var G = [];
                G[1] = y + 1,
                G[0] = (1 << y + 1) - 1,
                F(G)
            }
            return $(65497),
            new Uint8Array(p)
        }
        ,
        e = e || 50,
        function() {
            for (var e = String.fromCharCode, t = 0; t < 256; t++)
                k[t] = e(t)
        }(),
        t = N(S, _),
        r = N(E, I),
        a = N(C, T),
        n = N(R, B),
        function() {
            for (var e = 1, t = 2, r = 1; r <= 15; r++) {
                for (var a = e; a < t; a++)
                    d[32767 + a] = r,
                    h[32767 + a] = [],
                    h[32767 + a][1] = r,
                    h[32767 + a][0] = a;
                for (var n = -(t - 1); n <= -e; n++)
                    d[32767 + n] = r,
                    h[32767 + n] = [],
                    h[32767 + n][1] = r,
                    h[32767 + n][0] = t - 1 + n;
                e <<= 1,
                t <<= 1
            }
        }(),
        function() {
            for (var e = 0; e < 256; e++)
                w[e] = 19595 * e,
                w[e + 256 >> 0] = 38470 * e,
                w[e + 512 >> 0] = 7471 * e + 32768,
                w[e + 768 >> 0] = -11059 * e,
                w[e + 1024 >> 0] = -21709 * e,
                w[e + 1280 >> 0] = 32768 * e + 8421375,
                w[e + 1536 >> 0] = -27439 * e,
                w[e + 1792 >> 0] = -5329 * e
        }(),
        O(e)
    }
    /**
     * @license
     * Copyright (c) 2017 Aras Abbasi
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function Mt(e, t) {
        if (this.pos = 0,
        this.buffer = e,
        this.datav = new DataView(e.buffer),
        this.is_with_alpha = !!t,
        this.bottom_up = !0,
        this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]),
        this.pos += 2,
        -1 === ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag))
            throw new Error("Invalid BMP File");
        this.parseHeader(),
        this.parseBGR()
    }
    function Et(e) {
        function t(e) {
            if (!e)
                throw Error("assert :P")
        }
        function r(e, t, r) {
            for (var a = 0; 4 > a; a++)
                if (e[t + a] != r.charCodeAt(a))
                    return !0;
            return !1
        }
        function a(e, t, r, a, n) {
            for (var o = 0; o < n; o++)
                e[t + o] = r[a + o]
        }
        function n(e, t, r, a) {
            for (var n = 0; n < a; n++)
                e[t + n] = r
        }
        function o(e) {
            return new Int32Array(e)
        }
        function l(e, t) {
            for (var r = [], a = 0; a < e; a++)
                r.push(new t);
            return r
        }
        function i(e, t) {
            var r = [];
            return function e(r, a, n) {
                for (var o = n[a], l = 0; l < o && (r.push(n.length > a + 1 ? [] : new t),
                !(n.length < a + 1)); l++)
                    e(r[l], a + 1, n)
            }(r, 0, e),
            r
        }
        function s(e, t) {
            for (var r = "", a = 0; a < 4; a++)
                r += String.fromCharCode(e[t++]);
            return r
        }
        function c(e, t) {
            return (e[t + 0] << 0 | e[t + 1] << 8 | e[t + 2] << 16) >>> 0
        }
        function u(e, t) {
            return (e[t + 0] << 0 | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0
        }
        new (Et = function() {
            var e = this;
            function s(e, t) {
                for (var r = 1 << t - 1 >>> 0; e & r; )
                    r >>>= 1;
                return r ? (e & r - 1) + r : e
            }
            function c(e, r, a, n, o) {
                t(!(n % a));
                do {
                    e[r + (n -= a)] = o
                } while (0 < n)
            }
            function u(e, r, a, n, l) {
                if (t(2328 >= l),
                512 >= l)
                    var i = o(512);
                else if (null == (i = o(l)))
                    return 0;
                return function(e, r, a, n, l, i) {
                    var u, d, f = r, m = 1 << a, p = o(16), g = o(16);
                    for (t(0 != l),
                    t(null != n),
                    t(null != e),
                    t(0 < a),
                    d = 0; d < l; ++d) {
                        if (15 < n[d])
                            return 0;
                        ++p[n[d]]
                    }
                    if (p[0] == l)
                        return 0;
                    for (g[1] = 0,
                    u = 1; 15 > u; ++u) {
                        if (p[u] > 1 << u)
                            return 0;
                        g[u + 1] = g[u] + p[u]
                    }
                    for (d = 0; d < l; ++d)
                        u = n[d],
                        0 < n[d] && (i[g[u]++] = d);
                    if (1 == g[15])
                        return (n = new h).g = 0,
                        n.value = i[0],
                        c(e, f, 1, m, n),
                        m;
                    var y, v = -1, A = m - 1, b = 0, k = 1, w = 1, x = 1 << a;
                    for (d = 0,
                    u = 1,
                    l = 2; u <= a; ++u,
                    l <<= 1) {
                        if (k += w <<= 1,
                        0 > (w -= p[u]))
                            return 0;
                        for (; 0 < p[u]; --p[u])
                            (n = new h).g = u,
                            n.value = i[d++],
                            c(e, f + b, l, x, n),
                            b = s(b, u)
                    }
                    for (u = a + 1,
                    l = 2; 15 >= u; ++u,
                    l <<= 1) {
                        if (k += w <<= 1,
                        0 > (w -= p[u]))
                            return 0;
                        for (; 0 < p[u]; --p[u]) {
                            if (n = new h,
                            (b & A) != v) {
                                for (f += x,
                                y = 1 << (v = u) - a; 15 > v && !(0 >= (y -= p[v])); )
                                    ++v,
                                    y <<= 1;
                                m += x = 1 << (y = v - a),
                                e[r + (v = b & A)].g = y + a,
                                e[r + v].value = f - r - v
                            }
                            n.g = u - a,
                            n.value = i[d++],
                            c(e, f + (b >> a), l, x, n),
                            b = s(b, u)
                        }
                    }
                    return k != 2 * g[15] - 1 ? 0 : m
                }(e, r, a, n, l, i)
            }
            function h() {
                this.value = this.g = 0
            }
            function d() {
                this.value = this.g = 0
            }
            function f() {
                this.G = l(5, h),
                this.H = o(5),
                this.jc = this.Qb = this.qb = this.nd = 0,
                this.pd = l(Dr, d)
            }
            function m(e, r, a, n) {
                t(null != e),
                t(null != r),
                t(2147483648 > n),
                e.Ca = 254,
                e.I = 0,
                e.b = -8,
                e.Ka = 0,
                e.oa = r,
                e.pa = a,
                e.Jd = r,
                e.Yc = a + n,
                e.Zc = 4 <= n ? a + n - 4 + 1 : a,
                C(e)
            }
            function p(e, t) {
                for (var r = 0; 0 < t--; )
                    r |= E(e, 128) << t;
                return r
            }
            function g(e, t) {
                var r = p(e, t);
                return T(e) ? -r : r
            }
            function y(e, r, a, n) {
                var o, l = 0;
                for (t(null != e),
                t(null != r),
                t(4294967288 > n),
                e.Sb = n,
                e.Ra = 0,
                e.u = 0,
                e.h = 0,
                4 < n && (n = 4),
                o = 0; o < n; ++o)
                    l += r[a + o] << 8 * o;
                e.Ra = l,
                e.bb = n,
                e.oa = r,
                e.pa = a
            }
            function v(e) {
                for (; 8 <= e.u && e.bb < e.Sb; )
                    e.Ra >>>= 8,
                    e.Ra += e.oa[e.pa + e.bb] << Hr - 8 >>> 0,
                    ++e.bb,
                    e.u -= 8;
                x(e) && (e.h = 1,
                e.u = 0)
            }
            function A(e, r) {
                if (t(0 <= r),
                !e.h && r <= Ur) {
                    var a = w(e) & Mr[r];
                    return e.u += r,
                    v(e),
                    a
                }
                return e.h = 1,
                e.u = 0
            }
            function b() {
                this.b = this.Ca = this.I = 0,
                this.oa = [],
                this.pa = 0,
                this.Jd = [],
                this.Yc = 0,
                this.Zc = [],
                this.Ka = 0
            }
            function k() {
                this.Ra = 0,
                this.oa = [],
                this.h = this.u = this.bb = this.Sb = this.pa = 0
            }
            function w(e) {
                return e.Ra >>> (e.u & Hr - 1) >>> 0
            }
            function x(e) {
                return t(e.bb <= e.Sb),
                e.h || e.bb == e.Sb && e.u > Hr
            }
            function S(e, t) {
                e.u = t,
                e.h = x(e)
            }
            function _(e) {
                e.u >= qr && (t(e.u >= qr),
                v(e))
            }
            function C(e) {
                t(null != e && null != e.oa),
                e.pa < e.Zc ? (e.I = (e.oa[e.pa++] | e.I << 8) >>> 0,
                e.b += 8) : (t(null != e && null != e.oa),
                e.pa < e.Yc ? (e.b += 8,
                e.I = e.oa[e.pa++] | e.I << 8) : e.Ka ? e.b = 0 : (e.I <<= 8,
                e.b += 8,
                e.Ka = 1))
            }
            function T(e) {
                return p(e, 1)
            }
            function E(e, t) {
                var r = e.Ca;
                0 > e.b && C(e);
                var a = e.b
                  , n = r * t >>> 8
                  , o = (e.I >>> a > n) + 0;
                for (o ? (r -= n,
                e.I -= n + 1 << a >>> 0) : r = n + 1,
                a = r,
                n = 0; 256 <= a; )
                    n += 8,
                    a >>= 8;
                return a = 7 ^ n + zr[a],
                e.b -= a,
                e.Ca = (r << a) - 1,
                o
            }
            function I(e, t, r) {
                e[t + 0] = r >> 24 & 255,
                e[t + 1] = r >> 16 & 255,
                e[t + 2] = r >> 8 & 255,
                e[t + 3] = r >> 0 & 255
            }
            function R(e, t) {
                return e[t + 0] << 0 | e[t + 1] << 8
            }
            function B(e, t) {
                return R(e, t) | e[t + 2] << 16
            }
            function N(e, t) {
                return R(e, t) | R(e, t + 2) << 16
            }
            function F(e, r) {
                var a = 1 << r;
                return t(null != e),
                t(0 < r),
                e.X = o(a),
                null == e.X ? 0 : (e.Mb = 32 - r,
                e.Xa = r,
                1)
            }
            function P(e, r) {
                t(null != e),
                t(null != r),
                t(e.Xa == r.Xa),
                a(r.X, 0, e.X, 0, 1 << r.Xa)
            }
            function $() {
                this.X = [],
                this.Xa = this.Mb = 0
            }
            function L(e, r, a, n) {
                t(null != a),
                t(null != n);
                var o = a[0]
                  , l = n[0];
                return 0 == o && (o = (e * l + r / 2) / r),
                0 == l && (l = (r * o + e / 2) / e),
                0 >= o || 0 >= l ? 0 : (a[0] = o,
                n[0] = l,
                1)
            }
            function O(e, t) {
                return e + (1 << t) - 1 >>> t
            }
            function D(e, t) {
                return ((4278255360 & e) + (4278255360 & t) >>> 0 & 4278255360) + ((16711935 & e) + (16711935 & t) >>> 0 & 16711935) >>> 0
            }
            function M(t, r) {
                e[r] = function(r, a, n, o, l, i, s) {
                    var c;
                    for (c = 0; c < l; ++c) {
                        var u = e[t](i[s + c - 1], n, o + c);
                        i[s + c] = D(r[a + c], u)
                    }
                }
            }
            function U() {
                this.ud = this.hd = this.jd = 0
            }
            function H(e, t) {
                return ((4278124286 & (e ^ t)) >>> 1) + (e & t) >>> 0
            }
            function q(e) {
                return 0 <= e && 256 > e ? e : 0 > e ? 0 : 255 < e ? 255 : void 0
            }
            function z(e, t) {
                return q(e + (e - t + .5 >> 1))
            }
            function j(e, t, r) {
                return Math.abs(t - r) - Math.abs(e - r)
            }
            function V(e, t, r, a, n, o, l) {
                for (a = o[l - 1],
                r = 0; r < n; ++r)
                    o[l + r] = a = D(e[t + r], a)
            }
            function Q(e, t, r, a, n) {
                var o;
                for (o = 0; o < r; ++o) {
                    var l = e[t + o]
                      , i = l >> 8 & 255
                      , s = 16711935 & (s = (s = 16711935 & l) + ((i << 16) + i));
                    a[n + o] = (4278255360 & l) + s >>> 0
                }
            }
            function G(e, t) {
                t.jd = e >> 0 & 255,
                t.hd = e >> 8 & 255,
                t.ud = e >> 16 & 255
            }
            function K(e, t, r, a, n, o) {
                var l;
                for (l = 0; l < a; ++l) {
                    var i = t[r + l]
                      , s = i >>> 8
                      , c = i
                      , u = 255 & (u = (u = i >>> 16) + ((e.jd << 24 >> 24) * (s << 24 >> 24) >>> 5));
                    c = 255 & (c = (c += (e.hd << 24 >> 24) * (s << 24 >> 24) >>> 5) + ((e.ud << 24 >> 24) * (u << 24 >> 24) >>> 5)),
                    n[o + l] = (4278255360 & i) + (u << 16) + c
                }
            }
            function W(t, r, a, n, o) {
                e[r] = function(e, t, r, a, l, i, s, c, u) {
                    for (a = s; a < c; ++a)
                        for (s = 0; s < u; ++s)
                            l[i++] = o(r[n(e[t++])])
                }
                ,
                e[t] = function(t, r, l, i, s, c, u) {
                    var h = 8 >> t.b
                      , d = t.Ea
                      , f = t.K[0]
                      , m = t.w;
                    if (8 > h)
                        for (t = (1 << t.b) - 1,
                        m = (1 << h) - 1; r < l; ++r) {
                            var p, g = 0;
                            for (p = 0; p < d; ++p)
                                p & t || (g = n(i[s++])),
                                c[u++] = o(f[g & m]),
                                g >>= h
                        }
                    else
                        e["VP8LMapColor" + a](i, s, f, m, c, u, r, l, d)
                }
            }
            function Y(e, t, r, a, n) {
                for (r = t + r; t < r; ) {
                    var o = e[t++];
                    a[n++] = o >> 16 & 255,
                    a[n++] = o >> 8 & 255,
                    a[n++] = o >> 0 & 255
                }
            }
            function X(e, t, r, a, n) {
                for (r = t + r; t < r; ) {
                    var o = e[t++];
                    a[n++] = o >> 16 & 255,
                    a[n++] = o >> 8 & 255,
                    a[n++] = o >> 0 & 255,
                    a[n++] = o >> 24 & 255
                }
            }
            function J(e, t, r, a, n) {
                for (r = t + r; t < r; ) {
                    var o = (l = e[t++]) >> 16 & 240 | l >> 12 & 15
                      , l = l >> 0 & 240 | l >> 28 & 15;
                    a[n++] = o,
                    a[n++] = l
                }
            }
            function Z(e, t, r, a, n) {
                for (r = t + r; t < r; ) {
                    var o = (l = e[t++]) >> 16 & 248 | l >> 13 & 7
                      , l = l >> 5 & 224 | l >> 3 & 31;
                    a[n++] = o,
                    a[n++] = l
                }
            }
            function ee(e, t, r, a, n) {
                for (r = t + r; t < r; ) {
                    var o = e[t++];
                    a[n++] = o >> 0 & 255,
                    a[n++] = o >> 8 & 255,
                    a[n++] = o >> 16 & 255
                }
            }
            function te(e, t, r, n, o, l) {
                if (0 == l)
                    for (r = t + r; t < r; )
                        I(n, ((l = e[t++])[0] >> 24 | l[1] >> 8 & 65280 | l[2] << 8 & 16711680 | l[3] << 24) >>> 0),
                        o += 32;
                else
                    a(n, o, e, t, r)
            }
            function re(t, r) {
                e[r][0] = e[t + "0"],
                e[r][1] = e[t + "1"],
                e[r][2] = e[t + "2"],
                e[r][3] = e[t + "3"],
                e[r][4] = e[t + "4"],
                e[r][5] = e[t + "5"],
                e[r][6] = e[t + "6"],
                e[r][7] = e[t + "7"],
                e[r][8] = e[t + "8"],
                e[r][9] = e[t + "9"],
                e[r][10] = e[t + "10"],
                e[r][11] = e[t + "11"],
                e[r][12] = e[t + "12"],
                e[r][13] = e[t + "13"],
                e[r][14] = e[t + "0"],
                e[r][15] = e[t + "0"]
            }
            function ae(e) {
                return e == qa || e == za || e == ja || e == Va
            }
            function ne() {
                this.eb = [],
                this.size = this.A = this.fb = 0
            }
            function oe() {
                this.y = [],
                this.f = [],
                this.ea = [],
                this.F = [],
                this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0
            }
            function le() {
                this.Rd = this.height = this.width = this.S = 0,
                this.f = {},
                this.f.RGBA = new ne,
                this.f.kb = new oe,
                this.sd = null
            }
            function ie() {
                this.width = [0],
                this.height = [0],
                this.Pd = [0],
                this.Qd = [0],
                this.format = [0]
            }
            function se() {
                this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0
            }
            function ce(e) {
                return alert("todo:WebPSamplerProcessPlane"),
                e.T
            }
            function ue(e, t) {
                var r = e.T
                  , n = t.ba.f.RGBA
                  , o = n.eb
                  , l = n.fb + e.ka * n.A
                  , i = yn[t.ba.S]
                  , s = e.y
                  , c = e.O
                  , u = e.f
                  , h = e.N
                  , d = e.ea
                  , f = e.W
                  , m = t.cc
                  , p = t.dc
                  , g = t.Mc
                  , y = t.Nc
                  , v = e.ka
                  , A = e.ka + e.T
                  , b = e.U
                  , k = b + 1 >> 1;
                for (0 == v ? i(s, c, null, null, u, h, d, f, u, h, d, f, o, l, null, null, b) : (i(t.ec, t.fc, s, c, m, p, g, y, u, h, d, f, o, l - n.A, o, l, b),
                ++r); v + 2 < A; v += 2)
                    m = u,
                    p = h,
                    g = d,
                    y = f,
                    h += e.Rc,
                    f += e.Rc,
                    l += 2 * n.A,
                    i(s, (c += 2 * e.fa) - e.fa, s, c, m, p, g, y, u, h, d, f, o, l - n.A, o, l, b);
                return c += e.fa,
                e.j + A < e.o ? (a(t.ec, t.fc, s, c, b),
                a(t.cc, t.dc, u, h, k),
                a(t.Mc, t.Nc, d, f, k),
                r--) : 1 & A || i(s, c, null, null, u, h, d, f, u, h, d, f, o, l + n.A, null, null, b),
                r
            }
            function he(e, r, a) {
                var n = e.F
                  , o = [e.J];
                if (null != n) {
                    var l = e.U
                      , i = r.ba.S
                      , s = i == Ma || i == ja;
                    r = r.ba.f.RGBA;
                    var c = [0]
                      , u = e.ka;
                    c[0] = e.T,
                    e.Kb && (0 == u ? --c[0] : (--u,
                    o[0] -= e.width),
                    e.j + e.ka + e.T == e.o && (c[0] = e.o - e.j - u));
                    var h = r.eb;
                    u = r.fb + u * r.A,
                    e = Sa(n, o[0], e.width, l, c, h, u + (s ? 0 : 3), r.A),
                    t(a == c),
                    e && ae(i) && wa(h, u, s, l, c, r.A)
                }
                return 0
            }
            function de(e) {
                var t = e.ma
                  , r = t.ba.S
                  , a = 11 > r
                  , n = r == La || r == Da || r == Ma || r == Ua || 12 == r || ae(r);
                if (t.memory = null,
                t.Ib = null,
                t.Jb = null,
                t.Nd = null,
                !$r(t.Oa, e, n ? 11 : 12))
                    return 0;
                if (n && ae(r) && vr(),
                e.da)
                    alert("todo:use_scaling");
                else {
                    if (a) {
                        if (t.Ib = ce,
                        e.Kb) {
                            if (r = e.U + 1 >> 1,
                            t.memory = o(e.U + 2 * r),
                            null == t.memory)
                                return 0;
                            t.ec = t.memory,
                            t.fc = 0,
                            t.cc = t.ec,
                            t.dc = t.fc + e.U,
                            t.Mc = t.cc,
                            t.Nc = t.dc + r,
                            t.Ib = ue,
                            vr()
                        }
                    } else
                        alert("todo:EmitYUV");
                    n && (t.Jb = he,
                    a && gr())
                }
                if (a && !Bn) {
                    for (e = 0; 256 > e; ++e)
                        Nn[e] = 89858 * (e - 128) + Cn >> _n,
                        $n[e] = -22014 * (e - 128) + Cn,
                        Pn[e] = -45773 * (e - 128),
                        Fn[e] = 113618 * (e - 128) + Cn >> _n;
                    for (e = Tn; e < En; ++e)
                        t = 76283 * (e - 16) + Cn >> _n,
                        Ln[e - Tn] = Ve(t, 255),
                        On[e - Tn] = Ve(t + 8 >> 4, 15);
                    Bn = 1
                }
                return 1
            }
            function fe(e) {
                var r = e.ma
                  , a = e.U
                  , n = e.T;
                return t(!(1 & e.ka)),
                0 >= a || 0 >= n ? 0 : (a = r.Ib(e, r),
                null != r.Jb && r.Jb(e, r, a),
                r.Dc += a,
                1)
            }
            function me(e) {
                e.ma.memory = null
            }
            function pe(e, t, r, a) {
                return 47 != A(e, 8) ? 0 : (t[0] = A(e, 14) + 1,
                r[0] = A(e, 14) + 1,
                a[0] = A(e, 1),
                0 != A(e, 3) ? 0 : !e.h)
            }
            function ge(e, t) {
                if (4 > e)
                    return e + 1;
                var r = e - 2 >> 1;
                return (2 + (1 & e) << r) + A(t, r) + 1
            }
            function ye(e, t) {
                return 120 < t ? t - 120 : 1 <= (r = ((r = Xa[t - 1]) >> 4) * e + (8 - (15 & r))) ? r : 1;
                var r
            }
            function ve(e, t, r) {
                var a = w(r)
                  , n = e[t += 255 & a].g - 8;
                return 0 < n && (S(r, r.u + 8),
                a = w(r),
                t += e[t].value,
                t += a & (1 << n) - 1),
                S(r, r.u + e[t].g),
                e[t].value
            }
            function Ae(e, r, a) {
                return a.g += e.g,
                a.value += e.value << r >>> 0,
                t(8 >= a.g),
                e.g
            }
            function be(e, r, a) {
                var n = e.xc;
                return t((r = 0 == n ? 0 : e.vc[e.md * (a >> n) + (r >> n)]) < e.Wb),
                e.Ya[r]
            }
            function ke(e, r, n, o) {
                var l = e.ab
                  , i = e.c * r
                  , s = e.C;
                r = s + r;
                var c = n
                  , u = o;
                for (o = e.Ta,
                n = e.Ua; 0 < l--; ) {
                    var h = e.gc[l]
                      , d = s
                      , f = r
                      , m = c
                      , p = u
                      , g = (u = o,
                    c = n,
                    h.Ea);
                    switch (t(d < f),
                    t(f <= h.nc),
                    h.hc) {
                    case 2:
                        Qr(m, p, (f - d) * g, u, c);
                        break;
                    case 0:
                        var y = d
                          , v = f
                          , A = u
                          , b = c
                          , k = (C = h).Ea;
                        0 == y && (jr(m, p, null, null, 1, A, b),
                        V(m, p + 1, 0, 0, k - 1, A, b + 1),
                        p += k,
                        b += k,
                        ++y);
                        for (var w = 1 << C.b, x = w - 1, S = O(k, C.b), _ = C.K, C = C.w + (y >> C.b) * S; y < v; ) {
                            var T = _
                              , E = C
                              , I = 1;
                            for (Vr(m, p, A, b - k, 1, A, b); I < k; ) {
                                var R = (I & ~x) + w;
                                R > k && (R = k),
                                (0,
                                Xr[T[E++] >> 8 & 15])(m, p + +I, A, b + I - k, R - I, A, b + I),
                                I = R
                            }
                            p += k,
                            b += k,
                            ++y & x || (C += S)
                        }
                        f != h.nc && a(u, c - g, u, c + (f - d - 1) * g, g);
                        break;
                    case 1:
                        for (g = m,
                        v = p,
                        k = (m = h.Ea) - (b = m & ~(A = (p = 1 << h.b) - 1)),
                        y = O(m, h.b),
                        w = h.K,
                        h = h.w + (d >> h.b) * y; d < f; ) {
                            for (x = w,
                            S = h,
                            _ = new U,
                            C = v + b,
                            T = v + m; v < C; )
                                G(x[S++], _),
                                Jr(_, g, v, p, u, c),
                                v += p,
                                c += p;
                            v < T && (G(x[S++], _),
                            Jr(_, g, v, k, u, c),
                            v += k,
                            c += k),
                            ++d & A || (h += y)
                        }
                        break;
                    case 3:
                        if (m == u && p == c && 0 < h.b) {
                            for (v = u,
                            m = g = c + (f - d) * g - (b = (f - d) * O(h.Ea, h.b)),
                            p = u,
                            A = c,
                            y = [],
                            b = (k = b) - 1; 0 <= b; --b)
                                y[b] = p[A + b];
                            for (b = k - 1; 0 <= b; --b)
                                v[m + b] = y[b];
                            Gr(h, d, f, u, g, u, c)
                        } else
                            Gr(h, d, f, m, p, u, c)
                    }
                    c = o,
                    u = n
                }
                u != n && a(o, n, c, u, i)
            }
            function we(e, r) {
                var a = e.V
                  , n = e.Ba + e.c * e.C
                  , o = r - e.C;
                if (t(r <= e.l.o),
                t(16 >= o),
                0 < o) {
                    var l = e.l
                      , i = e.Ta
                      , s = e.Ua
                      , c = l.width;
                    if (ke(e, o, a, n),
                    o = s = [s],
                    t((a = e.C) < (n = r)),
                    t(l.v < l.va),
                    n > l.o && (n = l.o),
                    a < l.j) {
                        var u = l.j - a;
                        a = l.j,
                        o[0] += u * c
                    }
                    if (a >= n ? a = 0 : (o[0] += 4 * l.v,
                    l.ka = a - l.j,
                    l.U = l.va - l.v,
                    l.T = n - a,
                    a = 1),
                    a) {
                        if (s = s[0],
                        11 > (a = e.ca).S) {
                            var h = a.f.RGBA
                              , d = (n = a.S,
                            o = l.U,
                            l = l.T,
                            u = h.eb,
                            h.A)
                              , f = l;
                            for (h = h.fb + e.Ma * h.A; 0 < f--; ) {
                                var m = i
                                  , p = s
                                  , g = o
                                  , y = u
                                  , v = h;
                                switch (n) {
                                case $a:
                                    Zr(m, p, g, y, v);
                                    break;
                                case La:
                                    ea(m, p, g, y, v);
                                    break;
                                case qa:
                                    ea(m, p, g, y, v),
                                    wa(y, v, 0, g, 1, 0);
                                    break;
                                case Oa:
                                    aa(m, p, g, y, v);
                                    break;
                                case Da:
                                    te(m, p, g, y, v, 1);
                                    break;
                                case za:
                                    te(m, p, g, y, v, 1),
                                    wa(y, v, 0, g, 1, 0);
                                    break;
                                case Ma:
                                    te(m, p, g, y, v, 0);
                                    break;
                                case ja:
                                    te(m, p, g, y, v, 0),
                                    wa(y, v, 1, g, 1, 0);
                                    break;
                                case Ua:
                                    ta(m, p, g, y, v);
                                    break;
                                case Va:
                                    ta(m, p, g, y, v),
                                    xa(y, v, g, 1, 0);
                                    break;
                                case Ha:
                                    ra(m, p, g, y, v);
                                    break;
                                default:
                                    t(0)
                                }
                                s += c,
                                h += d
                            }
                            e.Ma += l
                        } else
                            alert("todo:EmitRescaledRowsYUVA");
                        t(e.Ma <= a.height)
                    }
                }
                e.C = r,
                t(e.C <= e.i)
            }
            function xe(e) {
                var t;
                if (0 < e.ua)
                    return 0;
                for (t = 0; t < e.Wb; ++t) {
                    var r = e.Ya[t].G
                      , a = e.Ya[t].H;
                    if (0 < r[1][a[1] + 0].g || 0 < r[2][a[2] + 0].g || 0 < r[3][a[3] + 0].g)
                        return 0
                }
                return 1
            }
            function Se(e, r, a, n, o, l) {
                if (0 != e.Z) {
                    var i = e.qd
                      , s = e.rd;
                    for (t(null != gn[e.Z]); r < a; ++r)
                        gn[e.Z](i, s, n, o, n, o, l),
                        i = n,
                        s = o,
                        o += l;
                    e.qd = i,
                    e.rd = s
                }
            }
            function _e(e, r) {
                var a = e.l.ma
                  , n = 0 == a.Z || 1 == a.Z ? e.l.j : e.C;
                if (n = e.C < n ? n : e.C,
                t(r <= e.l.o),
                r > n) {
                    var o = e.l.width
                      , l = a.ca
                      , i = a.tb + o * n
                      , s = e.V
                      , c = e.Ba + e.c * n
                      , u = e.gc;
                    t(1 == e.ab),
                    t(3 == u[0].hc),
                    Wr(u[0], n, r, s, c, l, i),
                    Se(a, n, r, l, i, o)
                }
                e.C = e.Ma = r
            }
            function Ce(e, r, a, n, o, l, i) {
                var s = e.$ / n
                  , c = e.$ % n
                  , u = e.m
                  , h = e.s
                  , d = a + e.$
                  , f = d;
                o = a + n * o;
                var m = a + n * l
                  , p = 280 + h.ua
                  , g = e.Pb ? s : 16777216
                  , y = 0 < h.ua ? h.Wa : null
                  , v = h.wc
                  , A = d < m ? be(h, c, s) : null;
                t(e.C < l),
                t(m <= o);
                var b = !1;
                e: for (; ; ) {
                    for (; b || d < m; ) {
                        var k = 0;
                        if (s >= g) {
                            var C = d - a;
                            t((g = e).Pb),
                            g.wd = g.m,
                            g.xd = C,
                            0 < g.s.ua && P(g.s.Wa, g.s.vb),
                            g = s + Za
                        }
                        if (c & v || (A = be(h, c, s)),
                        t(null != A),
                        A.Qb && (r[d] = A.qb,
                        b = !0),
                        !b)
                            if (_(u),
                            A.jc) {
                                k = u,
                                C = r;
                                var T = d
                                  , E = A.pd[w(k) & Dr - 1];
                                t(A.jc),
                                256 > E.g ? (S(k, k.u + E.g),
                                C[T] = E.value,
                                k = 0) : (S(k, k.u + E.g - 256),
                                t(256 <= E.value),
                                k = E.value),
                                0 == k && (b = !0)
                            } else
                                k = ve(A.G[0], A.H[0], u);
                        if (u.h)
                            break;
                        if (b || 256 > k) {
                            if (!b)
                                if (A.nd)
                                    r[d] = (A.qb | k << 8) >>> 0;
                                else {
                                    if (_(u),
                                    b = ve(A.G[1], A.H[1], u),
                                    _(u),
                                    C = ve(A.G[2], A.H[2], u),
                                    T = ve(A.G[3], A.H[3], u),
                                    u.h)
                                        break;
                                    r[d] = (T << 24 | b << 16 | k << 8 | C) >>> 0
                                }
                            if (b = !1,
                            ++d,
                            ++c >= n && (c = 0,
                            ++s,
                            null != i && s <= l && !(s % 16) && i(e, s),
                            null != y))
                                for (; f < d; )
                                    k = r[f++],
                                    y.X[(506832829 * k & 4294967295) >>> y.Mb] = k
                        } else if (280 > k) {
                            if (k = ge(k - 256, u),
                            C = ve(A.G[4], A.H[4], u),
                            _(u),
                            C = ye(n, C = ge(C, u)),
                            u.h)
                                break;
                            if (d - a < C || o - d < k)
                                break e;
                            for (T = 0; T < k; ++T)
                                r[d + T] = r[d + T - C];
                            for (d += k,
                            c += k; c >= n; )
                                c -= n,
                                ++s,
                                null != i && s <= l && !(s % 16) && i(e, s);
                            if (t(d <= o),
                            c & v && (A = be(h, c, s)),
                            null != y)
                                for (; f < d; )
                                    k = r[f++],
                                    y.X[(506832829 * k & 4294967295) >>> y.Mb] = k
                        } else {
                            if (!(k < p))
                                break e;
                            for (b = k - 280,
                            t(null != y); f < d; )
                                k = r[f++],
                                y.X[(506832829 * k & 4294967295) >>> y.Mb] = k;
                            k = d,
                            t(!(b >>> (C = y).Xa)),
                            r[k] = C.X[b],
                            b = !0
                        }
                        b || t(u.h == x(u))
                    }
                    if (e.Pb && u.h && d < o)
                        t(e.m.h),
                        e.a = 5,
                        e.m = e.wd,
                        e.$ = e.xd,
                        0 < e.s.ua && P(e.s.vb, e.s.Wa);
                    else {
                        if (u.h)
                            break e;
                        null != i && i(e, s > l ? l : s),
                        e.a = 0,
                        e.$ = d - a
                    }
                    return 1
                }
                return e.a = 3,
                0
            }
            function Te(e) {
                t(null != e),
                e.vc = null,
                e.yc = null,
                e.Ya = null;
                var r = e.Wa;
                null != r && (r.X = null),
                e.vb = null,
                t(null != e)
            }
            function Ee() {
                var t = new lr;
                return null == t ? null : (t.a = 0,
                t.xb = pn,
                re("Predictor", "VP8LPredictors"),
                re("Predictor", "VP8LPredictors_C"),
                re("PredictorAdd", "VP8LPredictorsAdd"),
                re("PredictorAdd", "VP8LPredictorsAdd_C"),
                Qr = Q,
                Jr = K,
                Zr = Y,
                ea = X,
                ta = J,
                ra = Z,
                aa = ee,
                e.VP8LMapColor32b = Kr,
                e.VP8LMapColor8b = Yr,
                t)
            }
            function Ie(e, r, a, i, s) {
                var c = 1
                  , d = [e]
                  , m = [r]
                  , p = i.m
                  , g = i.s
                  , y = null
                  , v = 0;
                e: for (; ; ) {
                    if (a)
                        for (; c && A(p, 1); ) {
                            var b = d
                              , k = m
                              , x = i
                              , C = 1
                              , T = x.m
                              , E = x.gc[x.ab]
                              , I = A(T, 2);
                            if (x.Oc & 1 << I)
                                c = 0;
                            else {
                                switch (x.Oc |= 1 << I,
                                E.hc = I,
                                E.Ea = b[0],
                                E.nc = k[0],
                                E.K = [null],
                                ++x.ab,
                                t(4 >= x.ab),
                                I) {
                                case 0:
                                case 1:
                                    E.b = A(T, 3) + 2,
                                    C = Ie(O(E.Ea, E.b), O(E.nc, E.b), 0, x, E.K),
                                    E.K = E.K[0];
                                    break;
                                case 3:
                                    var R, B = A(T, 8) + 1, N = 16 < B ? 0 : 4 < B ? 1 : 2 < B ? 2 : 3;
                                    if (b[0] = O(E.Ea, N),
                                    E.b = N,
                                    R = C = Ie(B, 1, 0, x, E.K)) {
                                        var P, $ = B, L = E, M = 1 << (8 >> L.b), U = o(M);
                                        if (null == U)
                                            R = 0;
                                        else {
                                            var H = L.K[0]
                                              , q = L.w;
                                            for (U[0] = L.K[0][0],
                                            P = 1; P < 1 * $; ++P)
                                                U[P] = D(H[q + P], U[P - 1]);
                                            for (; P < 4 * M; ++P)
                                                U[P] = 0;
                                            L.K[0] = null,
                                            L.K[0] = U,
                                            R = 1
                                        }
                                    }
                                    C = R;
                                    break;
                                case 2:
                                    break;
                                default:
                                    t(0)
                                }
                                c = C
                            }
                        }
                    if (d = d[0],
                    m = m[0],
                    c && A(p, 1) && !(c = 1 <= (v = A(p, 4)) && 11 >= v)) {
                        i.a = 3;
                        break e
                    }
                    var z;
                    if (z = c)
                        t: {
                            var j, V, Q, G = i, K = d, W = m, Y = v, X = a, J = G.m, Z = G.s, ee = [null], te = 1, re = 0, ae = Ja[Y];
                            r: for (; ; ) {
                                if (X && A(J, 1)) {
                                    var ne = A(J, 3) + 2
                                      , oe = O(K, ne)
                                      , le = O(W, ne)
                                      , ie = oe * le;
                                    if (!Ie(oe, le, 0, G, ee))
                                        break r;
                                    for (ee = ee[0],
                                    Z.xc = ne,
                                    j = 0; j < ie; ++j) {
                                        var se = ee[j] >> 8 & 65535;
                                        ee[j] = se,
                                        se >= te && (te = se + 1)
                                    }
                                }
                                if (J.h)
                                    break r;
                                for (V = 0; 5 > V; ++V) {
                                    var ce = Ka[V];
                                    !V && 0 < Y && (ce += 1 << Y),
                                    re < ce && (re = ce)
                                }
                                var ue = l(te * ae, h)
                                  , he = te
                                  , de = l(he, f);
                                if (null == de)
                                    var fe = null;
                                else
                                    t(65536 >= he),
                                    fe = de;
                                var me = o(re);
                                if (null == fe || null == me || null == ue) {
                                    G.a = 1;
                                    break r
                                }
                                var pe = ue;
                                for (j = Q = 0; j < te; ++j) {
                                    var ge = fe[j]
                                      , ye = ge.G
                                      , ve = ge.H
                                      , be = 0
                                      , ke = 1
                                      , we = 0;
                                    for (V = 0; 5 > V; ++V) {
                                        ce = Ka[V],
                                        ye[V] = pe,
                                        ve[V] = Q,
                                        !V && 0 < Y && (ce += 1 << Y);
                                        a: {
                                            var xe, Se = ce, _e = G, Ee = me, Re = pe, Be = Q, Ne = 0, Fe = _e.m, Pe = A(Fe, 1);
                                            if (n(Ee, 0, 0, Se),
                                            Pe) {
                                                var $e = A(Fe, 1) + 1
                                                  , Le = A(Fe, 1)
                                                  , Oe = A(Fe, 0 == Le ? 1 : 8);
                                                Ee[Oe] = 1,
                                                2 == $e && (Ee[Oe = A(Fe, 8)] = 1);
                                                var De = 1
                                            } else {
                                                var Me = o(19)
                                                  , Ue = A(Fe, 4) + 4;
                                                if (19 < Ue) {
                                                    _e.a = 3;
                                                    var He = 0;
                                                    break a
                                                }
                                                for (xe = 0; xe < Ue; ++xe)
                                                    Me[Ya[xe]] = A(Fe, 3);
                                                var qe = void 0
                                                  , ze = void 0
                                                  , je = _e
                                                  , Ve = Me
                                                  , Qe = Se
                                                  , Ge = Ee
                                                  , Ke = 0
                                                  , We = je.m
                                                  , Ye = 8
                                                  , Xe = l(128, h);
                                                n: for (; u(Xe, 0, 7, Ve, 19); ) {
                                                    if (A(We, 1)) {
                                                        var Je = 2 + 2 * A(We, 3);
                                                        if ((qe = 2 + A(We, Je)) > Qe)
                                                            break n
                                                    } else
                                                        qe = Qe;
                                                    for (ze = 0; ze < Qe && qe--; ) {
                                                        _(We);
                                                        var Ze = Xe[0 + (127 & w(We))];
                                                        S(We, We.u + Ze.g);
                                                        var et = Ze.value;
                                                        if (16 > et)
                                                            Ge[ze++] = et,
                                                            0 != et && (Ye = et);
                                                        else {
                                                            var tt = 16 == et
                                                              , rt = et - 16
                                                              , at = Ga[rt]
                                                              , nt = A(We, Qa[rt]) + at;
                                                            if (ze + nt > Qe)
                                                                break n;
                                                            for (var ot = tt ? Ye : 0; 0 < nt--; )
                                                                Ge[ze++] = ot
                                                        }
                                                    }
                                                    Ke = 1;
                                                    break n
                                                }
                                                Ke || (je.a = 3),
                                                De = Ke
                                            }
                                            (De = De && !Fe.h) && (Ne = u(Re, Be, 8, Ee, Se)),
                                            De && 0 != Ne ? He = Ne : (_e.a = 3,
                                            He = 0)
                                        }
                                        if (0 == He)
                                            break r;
                                        if (ke && 1 == Wa[V] && (ke = 0 == pe[Q].g),
                                        be += pe[Q].g,
                                        Q += He,
                                        3 >= V) {
                                            var lt, it = me[0];
                                            for (lt = 1; lt < ce; ++lt)
                                                me[lt] > it && (it = me[lt]);
                                            we += it
                                        }
                                    }
                                    if (ge.nd = ke,
                                    ge.Qb = 0,
                                    ke && (ge.qb = (ye[3][ve[3] + 0].value << 24 | ye[1][ve[1] + 0].value << 16 | ye[2][ve[2] + 0].value) >>> 0,
                                    0 == be && 256 > ye[0][ve[0] + 0].value && (ge.Qb = 1,
                                    ge.qb += ye[0][ve[0] + 0].value << 8)),
                                    ge.jc = !ge.Qb && 6 > we,
                                    ge.jc) {
                                        var st, ct = ge;
                                        for (st = 0; st < Dr; ++st) {
                                            var ut = st
                                              , ht = ct.pd[ut]
                                              , dt = ct.G[0][ct.H[0] + ut];
                                            256 <= dt.value ? (ht.g = dt.g + 256,
                                            ht.value = dt.value) : (ht.g = 0,
                                            ht.value = 0,
                                            ut >>= Ae(dt, 8, ht),
                                            ut >>= Ae(ct.G[1][ct.H[1] + ut], 16, ht),
                                            ut >>= Ae(ct.G[2][ct.H[2] + ut], 0, ht),
                                            Ae(ct.G[3][ct.H[3] + ut], 24, ht))
                                        }
                                    }
                                }
                                Z.vc = ee,
                                Z.Wb = te,
                                Z.Ya = fe,
                                Z.yc = ue,
                                z = 1;
                                break t
                            }
                            z = 0
                        }
                    if (!(c = z)) {
                        i.a = 3;
                        break e
                    }
                    if (0 < v) {
                        if (g.ua = 1 << v,
                        !F(g.Wa, v)) {
                            i.a = 1,
                            c = 0;
                            break e
                        }
                    } else
                        g.ua = 0;
                    var ft = i
                      , mt = d
                      , pt = m
                      , gt = ft.s
                      , yt = gt.xc;
                    if (ft.c = mt,
                    ft.i = pt,
                    gt.md = O(mt, yt),
                    gt.wc = 0 == yt ? -1 : (1 << yt) - 1,
                    a) {
                        i.xb = mn;
                        break e
                    }
                    if (null == (y = o(d * m))) {
                        i.a = 1,
                        c = 0;
                        break e
                    }
                    c = (c = Ce(i, y, 0, d, m, m, null)) && !p.h;
                    break e
                }
                return c ? (null != s ? s[0] = y : (t(null == y),
                t(a)),
                i.$ = 0,
                a || Te(g)) : Te(g),
                c
            }
            function Re(e, r) {
                var a = e.c * e.i
                  , n = a + r + 16 * r;
                return t(e.c <= r),
                e.V = o(n),
                null == e.V ? (e.Ta = null,
                e.Ua = 0,
                e.a = 1,
                0) : (e.Ta = e.V,
                e.Ua = e.Ba + a + r,
                1)
            }
            function Be(e, r) {
                var a = e.C
                  , n = r - a
                  , o = e.V
                  , l = e.Ba + e.c * a;
                for (t(r <= e.l.o); 0 < n; ) {
                    var i = 16 < n ? 16 : n
                      , s = e.l.ma
                      , c = e.l.width
                      , u = c * i
                      , h = s.ca
                      , d = s.tb + c * a
                      , f = e.Ta
                      , m = e.Ua;
                    ke(e, i, o, l),
                    _a(f, m, h, d, u),
                    Se(s, a, a + i, h, d, c),
                    n -= i,
                    o += i * e.c,
                    a += i
                }
                t(a == r),
                e.C = e.Ma = r
            }
            function Ne() {
                this.ub = this.yd = this.td = this.Rb = 0
            }
            function Fe() {
                this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0
            }
            function Pe() {
                this.Fb = this.Bb = this.Cb = 0,
                this.Zb = o(4),
                this.Lb = o(4)
            }
            function $e() {
                this.Yb = function() {
                    var e = [];
                    return function e(t, r, a) {
                        for (var n = a[r], o = 0; o < n && (t.push(a.length > r + 1 ? [] : 0),
                        !(a.length < r + 1)); o++)
                            e(t[o], r + 1, a)
                    }(e, 0, [3, 11]),
                    e
                }()
            }
            function Le() {
                this.jb = o(3),
                this.Wc = i([4, 8], $e),
                this.Xc = i([4, 17], $e)
            }
            function Oe() {
                this.Pc = this.wb = this.Tb = this.zd = 0,
                this.vd = new o(4),
                this.od = new o(4)
            }
            function De() {
                this.ld = this.La = this.dd = this.tc = 0
            }
            function Me() {
                this.Na = this.la = 0
            }
            function Ue() {
                this.Sc = [0, 0],
                this.Eb = [0, 0],
                this.Qc = [0, 0],
                this.ia = this.lc = 0
            }
            function He() {
                this.ad = o(384),
                this.Za = 0,
                this.Ob = o(16),
                this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0
            }
            function qe() {
                this.uc = this.M = this.Nb = 0,
                this.wa = Array(new De),
                this.Y = 0,
                this.ya = Array(new He),
                this.aa = 0,
                this.l = new Qe
            }
            function ze() {
                this.y = o(16),
                this.f = o(8),
                this.ea = o(8)
            }
            function je() {
                this.cb = this.a = 0,
                this.sc = "",
                this.m = new b,
                this.Od = new Ne,
                this.Kc = new Fe,
                this.ed = new Oe,
                this.Qa = new Pe,
                this.Ic = this.$c = this.Aa = 0,
                this.D = new qe,
                this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0,
                this.Jc = l(8, b),
                this.ia = 0,
                this.pb = l(4, Ue),
                this.Pa = new Le,
                this.Bd = this.kc = 0,
                this.Ac = [],
                this.Bc = 0,
                this.zc = [0, 0, 0, 0],
                this.Gd = Array(new ze),
                this.Hd = 0,
                this.rb = Array(new Me),
                this.sb = 0,
                this.wa = Array(new De),
                this.Y = 0,
                this.oc = [],
                this.pc = 0,
                this.sa = [],
                this.ta = 0,
                this.qa = [],
                this.ra = 0,
                this.Ha = [],
                this.B = this.R = this.Ia = 0,
                this.Ec = [],
                this.M = this.ja = this.Vb = this.Fc = 0,
                this.ya = Array(new He),
                this.L = this.aa = 0,
                this.gd = i([4, 2], De),
                this.ga = null,
                this.Fa = [],
                this.Cc = this.qc = this.P = 0,
                this.Gb = [],
                this.Uc = 0,
                this.mb = [],
                this.nb = 0,
                this.rc = [],
                this.Ga = this.Vc = 0
            }
            function Ve(e, t) {
                return 0 > e ? 0 : e > t ? t : e
            }
            function Qe() {
                this.T = this.U = this.ka = this.height = this.width = 0,
                this.y = [],
                this.f = [],
                this.ea = [],
                this.Rc = this.fa = this.W = this.N = this.O = 0,
                this.ma = "void",
                this.put = "VP8IoPutHook",
                this.ac = "VP8IoSetupHook",
                this.bc = "VP8IoTeardownHook",
                this.ha = this.Kb = 0,
                this.data = [],
                this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0,
                this.F = [],
                this.J = 0
            }
            function Ge() {
                var e = new je;
                return null != e && (e.a = 0,
                e.sc = "OK",
                e.cb = 0,
                e.Xb = 0,
                rn || (rn = Xe)),
                e
            }
            function Ke(e, t, r) {
                return 0 == e.a && (e.a = t,
                e.sc = r,
                e.cb = 0),
                0
            }
            function We(e, t, r) {
                return 3 <= r && 157 == e[t + 0] && 1 == e[t + 1] && 42 == e[t + 2]
            }
            function Ye(e, r) {
                if (null == e)
                    return 0;
                if (e.a = 0,
                e.sc = "OK",
                null == r)
                    return Ke(e, 2, "null VP8Io passed to VP8GetHeaders()");
                var a = r.data
                  , o = r.w
                  , l = r.ha;
                if (4 > l)
                    return Ke(e, 7, "Truncated header.");
                var i = a[o + 0] | a[o + 1] << 8 | a[o + 2] << 16
                  , s = e.Od;
                if (s.Rb = !(1 & i),
                s.td = i >> 1 & 7,
                s.yd = i >> 4 & 1,
                s.ub = i >> 5,
                3 < s.td)
                    return Ke(e, 3, "Incorrect keyframe parameters.");
                if (!s.yd)
                    return Ke(e, 4, "Frame not displayable.");
                o += 3,
                l -= 3;
                var c = e.Kc;
                if (s.Rb) {
                    if (7 > l)
                        return Ke(e, 7, "cannot parse picture header");
                    if (!We(a, o, l))
                        return Ke(e, 3, "Bad code word");
                    c.c = 16383 & (a[o + 4] << 8 | a[o + 3]),
                    c.Td = a[o + 4] >> 6,
                    c.i = 16383 & (a[o + 6] << 8 | a[o + 5]),
                    c.Ud = a[o + 6] >> 6,
                    o += 7,
                    l -= 7,
                    e.za = c.c + 15 >> 4,
                    e.Ub = c.i + 15 >> 4,
                    r.width = c.c,
                    r.height = c.i,
                    r.Da = 0,
                    r.j = 0,
                    r.v = 0,
                    r.va = r.width,
                    r.o = r.height,
                    r.da = 0,
                    r.ib = r.width,
                    r.hb = r.height,
                    r.U = r.width,
                    r.T = r.height,
                    n((i = e.Pa).jb, 0, 255, i.jb.length),
                    t(null != (i = e.Qa)),
                    i.Cb = 0,
                    i.Bb = 0,
                    i.Fb = 1,
                    n(i.Zb, 0, 0, i.Zb.length),
                    n(i.Lb, 0, 0, i.Lb)
                }
                if (s.ub > l)
                    return Ke(e, 7, "bad partition length");
                m(i = e.m, a, o, s.ub),
                o += s.ub,
                l -= s.ub,
                s.Rb && (c.Ld = T(i),
                c.Kd = T(i)),
                c = e.Qa;
                var u, h = e.Pa;
                if (t(null != i),
                t(null != c),
                c.Cb = T(i),
                c.Cb) {
                    if (c.Bb = T(i),
                    T(i)) {
                        for (c.Fb = T(i),
                        u = 0; 4 > u; ++u)
                            c.Zb[u] = T(i) ? g(i, 7) : 0;
                        for (u = 0; 4 > u; ++u)
                            c.Lb[u] = T(i) ? g(i, 6) : 0
                    }
                    if (c.Bb)
                        for (u = 0; 3 > u; ++u)
                            h.jb[u] = T(i) ? p(i, 8) : 255
                } else
                    c.Bb = 0;
                if (i.Ka)
                    return Ke(e, 3, "cannot parse segment header");
                if ((c = e.ed).zd = T(i),
                c.Tb = p(i, 6),
                c.wb = p(i, 3),
                c.Pc = T(i),
                c.Pc && T(i)) {
                    for (h = 0; 4 > h; ++h)
                        T(i) && (c.vd[h] = g(i, 6));
                    for (h = 0; 4 > h; ++h)
                        T(i) && (c.od[h] = g(i, 6))
                }
                if (e.L = 0 == c.Tb ? 0 : c.zd ? 1 : 2,
                i.Ka)
                    return Ke(e, 3, "cannot parse filter header");
                var d = l;
                if (l = u = o,
                o = u + d,
                c = d,
                e.Xb = (1 << p(e.m, 2)) - 1,
                d < 3 * (h = e.Xb))
                    a = 7;
                else {
                    for (u += 3 * h,
                    c -= 3 * h,
                    d = 0; d < h; ++d) {
                        var f = a[l + 0] | a[l + 1] << 8 | a[l + 2] << 16;
                        f > c && (f = c),
                        m(e.Jc[+d], a, u, f),
                        u += f,
                        c -= f,
                        l += 3
                    }
                    m(e.Jc[+h], a, u, c),
                    a = u < o ? 0 : 5
                }
                if (0 != a)
                    return Ke(e, a, "cannot parse partitions");
                for (a = p(u = e.m, 7),
                l = T(u) ? g(u, 4) : 0,
                o = T(u) ? g(u, 4) : 0,
                c = T(u) ? g(u, 4) : 0,
                h = T(u) ? g(u, 4) : 0,
                u = T(u) ? g(u, 4) : 0,
                d = e.Qa,
                f = 0; 4 > f; ++f) {
                    if (d.Cb) {
                        var y = d.Zb[f];
                        d.Fb || (y += a)
                    } else {
                        if (0 < f) {
                            e.pb[f] = e.pb[0];
                            continue
                        }
                        y = a
                    }
                    var v = e.pb[f];
                    v.Sc[0] = en[Ve(y + l, 127)],
                    v.Sc[1] = tn[Ve(y + 0, 127)],
                    v.Eb[0] = 2 * en[Ve(y + o, 127)],
                    v.Eb[1] = 101581 * tn[Ve(y + c, 127)] >> 16,
                    8 > v.Eb[1] && (v.Eb[1] = 8),
                    v.Qc[0] = en[Ve(y + h, 117)],
                    v.Qc[1] = tn[Ve(y + u, 127)],
                    v.lc = y + u
                }
                if (!s.Rb)
                    return Ke(e, 4, "Not a key frame.");
                for (T(i),
                s = e.Pa,
                a = 0; 4 > a; ++a) {
                    for (l = 0; 8 > l; ++l)
                        for (o = 0; 3 > o; ++o)
                            for (c = 0; 11 > c; ++c)
                                h = E(i, cn[a][l][o][c]) ? p(i, 8) : ln[a][l][o][c],
                                s.Wc[a][l].Yb[o][c] = h;
                    for (l = 0; 17 > l; ++l)
                        s.Xc[a][l] = s.Wc[a][un[l]]
                }
                return e.kc = T(i),
                e.kc && (e.Bd = p(i, 8)),
                e.cb = 1
            }
            function Xe(e, t, r, a, n, o, l) {
                var i = t[n].Yb[r];
                for (r = 0; 16 > n; ++n) {
                    if (!E(e, i[r + 0]))
                        return n;
                    for (; !E(e, i[r + 1]); )
                        if (i = t[++n].Yb[0],
                        r = 0,
                        16 == n)
                            return 16;
                    var s = t[n + 1].Yb;
                    if (E(e, i[r + 2])) {
                        var c = e
                          , u = 0;
                        if (E(c, (d = i)[(h = r) + 3]))
                            if (E(c, d[h + 6])) {
                                for (i = 0,
                                h = 2 * (u = E(c, d[h + 8])) + (d = E(c, d[h + 9 + u])),
                                u = 0,
                                d = an[h]; d[i]; ++i)
                                    u += u + E(c, d[i]);
                                u += 3 + (8 << h)
                            } else
                                E(c, d[h + 7]) ? (u = 7 + 2 * E(c, 165),
                                u += E(c, 145)) : u = 5 + E(c, 159);
                        else
                            u = E(c, d[h + 4]) ? 3 + E(c, d[h + 5]) : 2;
                        i = s[2]
                    } else
                        u = 1,
                        i = s[1];
                    s = l + nn[n],
                    0 > (c = e).b && C(c);
                    var h, d = c.b, f = (h = c.Ca >> 1) - (c.I >> d) >> 31;
                    --c.b,
                    c.Ca += f,
                    c.Ca |= 1,
                    c.I -= (h + 1 & f) << d,
                    o[s] = ((u ^ f) - f) * a[(0 < n) + 0]
                }
                return 16
            }
            function Je(e) {
                var t = e.rb[e.sb - 1];
                t.la = 0,
                t.Na = 0,
                n(e.zc, 0, 0, e.zc.length),
                e.ja = 0
            }
            function Ze(e, r) {
                if (null == e)
                    return 0;
                if (null == r)
                    return Ke(e, 2, "NULL VP8Io parameter in VP8Decode().");
                if (!e.cb && !Ye(e, r))
                    return 0;
                if (t(e.cb),
                null == r.ac || r.ac(r)) {
                    r.ob && (e.L = 0);
                    var i = Mn[e.L];
                    if (2 == e.L ? (e.yb = 0,
                    e.zb = 0) : (e.yb = r.v - i >> 4,
                    e.zb = r.j - i >> 4,
                    0 > e.yb && (e.yb = 0),
                    0 > e.zb && (e.zb = 0)),
                    e.Va = r.o + 15 + i >> 4,
                    e.Hb = r.va + 15 + i >> 4,
                    e.Hb > e.za && (e.Hb = e.za),
                    e.Va > e.Ub && (e.Va = e.Ub),
                    0 < e.L) {
                        var s = e.ed;
                        for (i = 0; 4 > i; ++i) {
                            var c;
                            if (e.Qa.Cb) {
                                var u = e.Qa.Lb[i];
                                e.Qa.Fb || (u += s.Tb)
                            } else
                                u = s.Tb;
                            for (c = 0; 1 >= c; ++c) {
                                var h = e.gd[i][c]
                                  , d = u;
                                if (s.Pc && (d += s.vd[0],
                                c && (d += s.od[0])),
                                0 < (d = 0 > d ? 0 : 63 < d ? 63 : d)) {
                                    var f = d;
                                    0 < s.wb && (f = 4 < s.wb ? f >> 2 : f >> 1) > 9 - s.wb && (f = 9 - s.wb),
                                    1 > f && (f = 1),
                                    h.dd = f,
                                    h.tc = 2 * d + f,
                                    h.ld = 40 <= d ? 2 : 15 <= d ? 1 : 0
                                } else
                                    h.tc = 0;
                                h.La = c
                            }
                        }
                    }
                    i = 0
                } else
                    Ke(e, 6, "Frame setup failed"),
                    i = e.a;
                if (i = 0 == i) {
                    if (i) {
                        e.$c = 0,
                        0 < e.Aa || (e.Ic = Hn);
                        e: {
                            i = e.Ic,
                            s = 4 * (f = e.za);
                            var m = 32 * f
                              , p = f + 1
                              , g = 0 < e.L ? f * (0 < e.Aa ? 2 : 1) : 0
                              , y = (2 == e.Aa ? 2 : 1) * f;
                            if ((h = s + 832 + (c = 3 * (16 * i + Mn[e.L]) / 2 * m) + (u = null != e.Fa && 0 < e.Fa.length ? e.Kc.c * e.Kc.i : 0)) != h)
                                i = 0;
                            else {
                                if (h > e.Vb) {
                                    if (e.Vb = 0,
                                    e.Ec = o(h),
                                    e.Fc = 0,
                                    null == e.Ec) {
                                        i = Ke(e, 1, "no memory during frame initialization.");
                                        break e
                                    }
                                    e.Vb = h
                                }
                                h = e.Ec,
                                d = e.Fc,
                                e.Ac = h,
                                e.Bc = d,
                                d += s,
                                e.Gd = l(m, ze),
                                e.Hd = 0,
                                e.rb = l(p + 1, Me),
                                e.sb = 1,
                                e.wa = g ? l(g, De) : null,
                                e.Y = 0,
                                e.D.Nb = 0,
                                e.D.wa = e.wa,
                                e.D.Y = e.Y,
                                0 < e.Aa && (e.D.Y += f),
                                t(!0),
                                e.oc = h,
                                e.pc = d,
                                d += 832,
                                e.ya = l(y, He),
                                e.aa = 0,
                                e.D.ya = e.ya,
                                e.D.aa = e.aa,
                                2 == e.Aa && (e.D.aa += f),
                                e.R = 16 * f,
                                e.B = 8 * f,
                                f = (m = Mn[e.L]) * e.R,
                                m = m / 2 * e.B,
                                e.sa = h,
                                e.ta = d + f,
                                e.qa = e.sa,
                                e.ra = e.ta + 16 * i * e.R + m,
                                e.Ha = e.qa,
                                e.Ia = e.ra + 8 * i * e.B + m,
                                e.$c = 0,
                                d += c,
                                e.mb = u ? h : null,
                                e.nb = u ? d : null,
                                t(d + u <= e.Fc + e.Vb),
                                Je(e),
                                n(e.Ac, e.Bc, 0, s),
                                i = 1
                            }
                        }
                        if (i) {
                            if (r.ka = 0,
                            r.y = e.sa,
                            r.O = e.ta,
                            r.f = e.qa,
                            r.N = e.ra,
                            r.ea = e.Ha,
                            r.Vd = e.Ia,
                            r.fa = e.R,
                            r.Rc = e.B,
                            r.F = null,
                            r.J = 0,
                            !Ra) {
                                for (i = -255; 255 >= i; ++i)
                                    Ca[255 + i] = 0 > i ? -i : i;
                                for (i = -1020; 1020 >= i; ++i)
                                    Ta[1020 + i] = -128 > i ? -128 : 127 < i ? 127 : i;
                                for (i = -112; 112 >= i; ++i)
                                    Ea[112 + i] = -16 > i ? -16 : 15 < i ? 15 : i;
                                for (i = -255; 510 >= i; ++i)
                                    Ia[255 + i] = 0 > i ? 0 : 255 < i ? 255 : i;
                                Ra = 1
                            }
                            na = ct,
                            oa = ot,
                            ia = lt,
                            sa = it,
                            ca = st,
                            la = nt,
                            ua = Kt,
                            ha = Wt,
                            da = Jt,
                            fa = Zt,
                            ma = Yt,
                            pa = Xt,
                            ga = er,
                            ya = tr,
                            va = qt,
                            Aa = zt,
                            ba = jt,
                            ka = Vt,
                            dn[0] = St,
                            dn[1] = ht,
                            dn[2] = wt,
                            dn[3] = xt,
                            dn[4] = _t,
                            dn[5] = Tt,
                            dn[6] = Ct,
                            dn[7] = Et,
                            dn[8] = Rt,
                            dn[9] = It,
                            hn[0] = yt,
                            hn[1] = ft,
                            hn[2] = mt,
                            hn[3] = pt,
                            hn[4] = vt,
                            hn[5] = At,
                            hn[6] = bt,
                            fn[0] = Pt,
                            fn[1] = dt,
                            fn[2] = Bt,
                            fn[3] = Nt,
                            fn[4] = Lt,
                            fn[5] = $t,
                            fn[6] = Ot,
                            i = 1
                        } else
                            i = 0
                    }
                    i && (i = function(e, r) {
                        for (e.M = 0; e.M < e.Va; ++e.M) {
                            var l, i = e.Jc[e.M & e.Xb], s = e.m, c = e;
                            for (l = 0; l < c.za; ++l) {
                                var u = s
                                  , h = c
                                  , d = h.Ac
                                  , f = h.Bc + 4 * l
                                  , m = h.zc
                                  , p = h.ya[h.aa + l];
                                if (h.Qa.Bb ? p.$b = E(u, h.Pa.jb[0]) ? 2 + E(u, h.Pa.jb[2]) : E(u, h.Pa.jb[1]) : p.$b = 0,
                                h.kc && (p.Ad = E(u, h.Bd)),
                                p.Za = !E(u, 145) + 0,
                                p.Za) {
                                    var g = p.Ob
                                      , y = 0;
                                    for (h = 0; 4 > h; ++h) {
                                        var v, A = m[0 + h];
                                        for (v = 0; 4 > v; ++v) {
                                            A = sn[d[f + v]][A];
                                            for (var b = on[E(u, A[0])]; 0 < b; )
                                                b = on[2 * b + E(u, A[b])];
                                            A = -b,
                                            d[f + v] = A
                                        }
                                        a(g, y, d, f, 4),
                                        y += 4,
                                        m[0 + h] = A
                                    }
                                } else
                                    A = E(u, 156) ? E(u, 128) ? 1 : 3 : E(u, 163) ? 2 : 0,
                                    p.Ob[0] = A,
                                    n(d, f, A, 4),
                                    n(m, 0, A, 4);
                                p.Dd = E(u, 142) ? E(u, 114) ? E(u, 183) ? 1 : 3 : 2 : 0
                            }
                            if (c.m.Ka)
                                return Ke(e, 7, "Premature end-of-partition0 encountered.");
                            for (; e.ja < e.za; ++e.ja) {
                                if (c = i,
                                u = (s = e).rb[s.sb - 1],
                                d = s.rb[s.sb + s.ja],
                                l = s.ya[s.aa + s.ja],
                                f = s.kc ? l.Ad : 0)
                                    u.la = d.la = 0,
                                    l.Za || (u.Na = d.Na = 0),
                                    l.Hc = 0,
                                    l.Gc = 0,
                                    l.ia = 0;
                                else {
                                    var k, w;
                                    if (u = d,
                                    d = c,
                                    f = s.Pa.Xc,
                                    m = s.ya[s.aa + s.ja],
                                    p = s.pb[m.$b],
                                    h = m.ad,
                                    g = 0,
                                    y = s.rb[s.sb - 1],
                                    A = v = 0,
                                    n(h, g, 0, 384),
                                    m.Za)
                                        var x = 0
                                          , S = f[3];
                                    else {
                                        b = o(16);
                                        var _ = u.Na + y.Na;
                                        if (_ = rn(d, f[1], _, p.Eb, 0, b, 0),
                                        u.Na = y.Na = (0 < _) + 0,
                                        1 < _)
                                            na(b, 0, h, g);
                                        else {
                                            var C = b[0] + 3 >> 3;
                                            for (b = 0; 256 > b; b += 16)
                                                h[g + b] = C
                                        }
                                        x = 1,
                                        S = f[0]
                                    }
                                    var T = 15 & u.la
                                      , I = 15 & y.la;
                                    for (b = 0; 4 > b; ++b) {
                                        var R = 1 & I;
                                        for (C = w = 0; 4 > C; ++C)
                                            T = T >> 1 | (R = (_ = rn(d, S, _ = R + (1 & T), p.Sc, x, h, g)) > x) << 7,
                                            w = w << 2 | (3 < _ ? 3 : 1 < _ ? 2 : 0 != h[g + 0]),
                                            g += 16;
                                        T >>= 4,
                                        I = I >> 1 | R << 7,
                                        v = (v << 8 | w) >>> 0
                                    }
                                    for (S = T,
                                    x = I >> 4,
                                    k = 0; 4 > k; k += 2) {
                                        for (w = 0,
                                        T = u.la >> 4 + k,
                                        I = y.la >> 4 + k,
                                        b = 0; 2 > b; ++b) {
                                            for (R = 1 & I,
                                            C = 0; 2 > C; ++C)
                                                _ = R + (1 & T),
                                                T = T >> 1 | (R = 0 < (_ = rn(d, f[2], _, p.Qc, 0, h, g))) << 3,
                                                w = w << 2 | (3 < _ ? 3 : 1 < _ ? 2 : 0 != h[g + 0]),
                                                g += 16;
                                            T >>= 2,
                                            I = I >> 1 | R << 5
                                        }
                                        A |= w << 4 * k,
                                        S |= T << 4 << k,
                                        x |= (240 & I) << k
                                    }
                                    u.la = S,
                                    y.la = x,
                                    m.Hc = v,
                                    m.Gc = A,
                                    m.ia = 43690 & A ? 0 : p.ia,
                                    f = !(v | A)
                                }
                                if (0 < s.L && (s.wa[s.Y + s.ja] = s.gd[l.$b][l.Za],
                                s.wa[s.Y + s.ja].La |= !f),
                                c.Ka)
                                    return Ke(e, 7, "Premature end-of-file encountered.")
                            }
                            if (Je(e),
                            s = r,
                            c = 1,
                            l = (i = e).D,
                            u = 0 < i.L && i.M >= i.zb && i.M <= i.Va,
                            0 == i.Aa)
                                e: {
                                    if (l.M = i.M,
                                    l.uc = u,
                                    Fr(i, l),
                                    c = 1,
                                    l = (w = i.D).Nb,
                                    u = (A = Mn[i.L]) * i.R,
                                    d = A / 2 * i.B,
                                    b = 16 * l * i.R,
                                    C = 8 * l * i.B,
                                    f = i.sa,
                                    m = i.ta - u + b,
                                    p = i.qa,
                                    h = i.ra - d + C,
                                    g = i.Ha,
                                    y = i.Ia - d + C,
                                    I = 0 == (T = w.M),
                                    v = T >= i.Va - 1,
                                    2 == i.Aa && Fr(i, w),
                                    w.uc)
                                        for (R = (_ = i).D.M,
                                        t(_.D.uc),
                                        w = _.yb; w < _.Hb; ++w) {
                                            x = w,
                                            S = R;
                                            var B = (N = (H = _).D).Nb;
                                            k = H.R;
                                            var N = N.wa[N.Y + x]
                                              , F = H.sa
                                              , P = H.ta + 16 * B * k + 16 * x
                                              , $ = N.dd
                                              , L = N.tc;
                                            if (0 != L)
                                                if (t(3 <= L),
                                                1 == H.L)
                                                    0 < x && Aa(F, P, k, L + 4),
                                                    N.La && ka(F, P, k, L),
                                                    0 < S && va(F, P, k, L + 4),
                                                    N.La && ba(F, P, k, L);
                                                else {
                                                    var O = H.B
                                                      , D = H.qa
                                                      , M = H.ra + 8 * B * O + 8 * x
                                                      , U = H.Ha
                                                      , H = H.Ia + 8 * B * O + 8 * x;
                                                    B = N.ld,
                                                    0 < x && (ha(F, P, k, L + 4, $, B),
                                                    fa(D, M, U, H, O, L + 4, $, B)),
                                                    N.La && (pa(F, P, k, L, $, B),
                                                    ya(D, M, U, H, O, L, $, B)),
                                                    0 < S && (ua(F, P, k, L + 4, $, B),
                                                    da(D, M, U, H, O, L + 4, $, B)),
                                                    N.La && (ma(F, P, k, L, $, B),
                                                    ga(D, M, U, H, O, L, $, B))
                                                }
                                        }
                                    if (i.ia && alert("todo:DitherRow"),
                                    null != s.put) {
                                        if (w = 16 * T,
                                        T = 16 * (T + 1),
                                        I ? (s.y = i.sa,
                                        s.O = i.ta + b,
                                        s.f = i.qa,
                                        s.N = i.ra + C,
                                        s.ea = i.Ha,
                                        s.W = i.Ia + C) : (w -= A,
                                        s.y = f,
                                        s.O = m,
                                        s.f = p,
                                        s.N = h,
                                        s.ea = g,
                                        s.W = y),
                                        v || (T -= A),
                                        T > s.o && (T = s.o),
                                        s.F = null,
                                        s.J = null,
                                        null != i.Fa && 0 < i.Fa.length && w < T && (s.J = hr(i, s, w, T - w),
                                        s.F = i.mb,
                                        null == s.F && 0 == s.F.length)) {
                                            c = Ke(i, 3, "Could not decode alpha data.");
                                            break e
                                        }
                                        w < s.j && (A = s.j - w,
                                        w = s.j,
                                        t(!(1 & A)),
                                        s.O += i.R * A,
                                        s.N += i.B * (A >> 1),
                                        s.W += i.B * (A >> 1),
                                        null != s.F && (s.J += s.width * A)),
                                        w < T && (s.O += s.v,
                                        s.N += s.v >> 1,
                                        s.W += s.v >> 1,
                                        null != s.F && (s.J += s.v),
                                        s.ka = w - s.j,
                                        s.U = s.va - s.v,
                                        s.T = T - w,
                                        c = s.put(s))
                                    }
                                    l + 1 != i.Ic || v || (a(i.sa, i.ta - u, f, m + 16 * i.R, u),
                                    a(i.qa, i.ra - d, p, h + 8 * i.B, d),
                                    a(i.Ha, i.Ia - d, g, y + 8 * i.B, d))
                                }
                            if (!c)
                                return Ke(e, 6, "Output aborted.")
                        }
                        return 1
                    }(e, r)),
                    null != r.bc && r.bc(r),
                    i &= 1
                }
                return i ? (e.cb = 0,
                i) : 0
            }
            function et(e, t, r, a, n) {
                n = e[t + r + 32 * a] + (n >> 3),
                e[t + r + 32 * a] = -256 & n ? 0 > n ? 0 : 255 : n
            }
            function tt(e, t, r, a, n, o) {
                et(e, t, 0, r, a + n),
                et(e, t, 1, r, a + o),
                et(e, t, 2, r, a - o),
                et(e, t, 3, r, a - n)
            }
            function rt(e) {
                return (20091 * e >> 16) + e
            }
            function at(e, t, r, a) {
                var n, l = 0, i = o(16);
                for (n = 0; 4 > n; ++n) {
                    var s = e[t + 0] + e[t + 8]
                      , c = e[t + 0] - e[t + 8]
                      , u = (35468 * e[t + 4] >> 16) - rt(e[t + 12])
                      , h = rt(e[t + 4]) + (35468 * e[t + 12] >> 16);
                    i[l + 0] = s + h,
                    i[l + 1] = c + u,
                    i[l + 2] = c - u,
                    i[l + 3] = s - h,
                    l += 4,
                    t++
                }
                for (n = l = 0; 4 > n; ++n)
                    s = (e = i[l + 0] + 4) + i[l + 8],
                    c = e - i[l + 8],
                    u = (35468 * i[l + 4] >> 16) - rt(i[l + 12]),
                    et(r, a, 0, 0, s + (h = rt(i[l + 4]) + (35468 * i[l + 12] >> 16))),
                    et(r, a, 1, 0, c + u),
                    et(r, a, 2, 0, c - u),
                    et(r, a, 3, 0, s - h),
                    l++,
                    a += 32
            }
            function nt(e, t, r, a) {
                var n = e[t + 0] + 4
                  , o = 35468 * e[t + 4] >> 16
                  , l = rt(e[t + 4])
                  , i = 35468 * e[t + 1] >> 16;
                tt(r, a, 0, n + l, e = rt(e[t + 1]), i),
                tt(r, a, 1, n + o, e, i),
                tt(r, a, 2, n - o, e, i),
                tt(r, a, 3, n - l, e, i)
            }
            function ot(e, t, r, a, n) {
                at(e, t, r, a),
                n && at(e, t + 16, r, a + 4)
            }
            function lt(e, t, r, a) {
                oa(e, t + 0, r, a, 1),
                oa(e, t + 32, r, a + 128, 1)
            }
            function it(e, t, r, a) {
                var n;
                for (e = e[t + 0] + 4,
                n = 0; 4 > n; ++n)
                    for (t = 0; 4 > t; ++t)
                        et(r, a, t, n, e)
            }
            function st(e, t, r, a) {
                e[t + 0] && sa(e, t + 0, r, a),
                e[t + 16] && sa(e, t + 16, r, a + 4),
                e[t + 32] && sa(e, t + 32, r, a + 128),
                e[t + 48] && sa(e, t + 48, r, a + 128 + 4)
            }
            function ct(e, t, r, a) {
                var n, l = o(16);
                for (n = 0; 4 > n; ++n) {
                    var i = e[t + 0 + n] + e[t + 12 + n]
                      , s = e[t + 4 + n] + e[t + 8 + n]
                      , c = e[t + 4 + n] - e[t + 8 + n]
                      , u = e[t + 0 + n] - e[t + 12 + n];
                    l[0 + n] = i + s,
                    l[8 + n] = i - s,
                    l[4 + n] = u + c,
                    l[12 + n] = u - c
                }
                for (n = 0; 4 > n; ++n)
                    i = (e = l[0 + 4 * n] + 3) + l[3 + 4 * n],
                    s = l[1 + 4 * n] + l[2 + 4 * n],
                    c = l[1 + 4 * n] - l[2 + 4 * n],
                    u = e - l[3 + 4 * n],
                    r[a + 0] = i + s >> 3,
                    r[a + 16] = u + c >> 3,
                    r[a + 32] = i - s >> 3,
                    r[a + 48] = u - c >> 3,
                    a += 64
            }
            function ut(e, t, r) {
                var a, n = t - 32, o = Fa, l = 255 - e[n - 1];
                for (a = 0; a < r; ++a) {
                    var i, s = o, c = l + e[t - 1];
                    for (i = 0; i < r; ++i)
                        e[t + i] = s[c + e[n + i]];
                    t += 32
                }
            }
            function ht(e, t) {
                ut(e, t, 4)
            }
            function dt(e, t) {
                ut(e, t, 8)
            }
            function ft(e, t) {
                ut(e, t, 16)
            }
            function mt(e, t) {
                var r;
                for (r = 0; 16 > r; ++r)
                    a(e, t + 32 * r, e, t - 32, 16)
            }
            function pt(e, t) {
                var r;
                for (r = 16; 0 < r; --r)
                    n(e, t, e[t - 1], 16),
                    t += 32
            }
            function gt(e, t, r) {
                var a;
                for (a = 0; 16 > a; ++a)
                    n(t, r + 32 * a, e, 16)
            }
            function yt(e, t) {
                var r, a = 16;
                for (r = 0; 16 > r; ++r)
                    a += e[t - 1 + 32 * r] + e[t + r - 32];
                gt(a >> 5, e, t)
            }
            function vt(e, t) {
                var r, a = 8;
                for (r = 0; 16 > r; ++r)
                    a += e[t - 1 + 32 * r];
                gt(a >> 4, e, t)
            }
            function At(e, t) {
                var r, a = 8;
                for (r = 0; 16 > r; ++r)
                    a += e[t + r - 32];
                gt(a >> 4, e, t)
            }
            function bt(e, t) {
                gt(128, e, t)
            }
            function kt(e, t, r) {
                return e + 2 * t + r + 2 >> 2
            }
            function wt(e, t) {
                var r, n = t - 32;
                for (n = new Uint8Array([kt(e[n - 1], e[n + 0], e[n + 1]), kt(e[n + 0], e[n + 1], e[n + 2]), kt(e[n + 1], e[n + 2], e[n + 3]), kt(e[n + 2], e[n + 3], e[n + 4])]),
                r = 0; 4 > r; ++r)
                    a(e, t + 32 * r, n, 0, n.length)
            }
            function xt(e, t) {
                var r = e[t - 1]
                  , a = e[t - 1 + 32]
                  , n = e[t - 1 + 64]
                  , o = e[t - 1 + 96];
                I(e, t + 0, 16843009 * kt(e[t - 1 - 32], r, a)),
                I(e, t + 32, 16843009 * kt(r, a, n)),
                I(e, t + 64, 16843009 * kt(a, n, o)),
                I(e, t + 96, 16843009 * kt(n, o, o))
            }
            function St(e, t) {
                var r, a = 4;
                for (r = 0; 4 > r; ++r)
                    a += e[t + r - 32] + e[t - 1 + 32 * r];
                for (a >>= 3,
                r = 0; 4 > r; ++r)
                    n(e, t + 32 * r, a, 4)
            }
            function _t(e, t) {
                var r = e[t - 1 + 0]
                  , a = e[t - 1 + 32]
                  , n = e[t - 1 + 64]
                  , o = e[t - 1 - 32]
                  , l = e[t + 0 - 32]
                  , i = e[t + 1 - 32]
                  , s = e[t + 2 - 32]
                  , c = e[t + 3 - 32];
                e[t + 0 + 96] = kt(a, n, e[t - 1 + 96]),
                e[t + 1 + 96] = e[t + 0 + 64] = kt(r, a, n),
                e[t + 2 + 96] = e[t + 1 + 64] = e[t + 0 + 32] = kt(o, r, a),
                e[t + 3 + 96] = e[t + 2 + 64] = e[t + 1 + 32] = e[t + 0 + 0] = kt(l, o, r),
                e[t + 3 + 64] = e[t + 2 + 32] = e[t + 1 + 0] = kt(i, l, o),
                e[t + 3 + 32] = e[t + 2 + 0] = kt(s, i, l),
                e[t + 3 + 0] = kt(c, s, i)
            }
            function Ct(e, t) {
                var r = e[t + 1 - 32]
                  , a = e[t + 2 - 32]
                  , n = e[t + 3 - 32]
                  , o = e[t + 4 - 32]
                  , l = e[t + 5 - 32]
                  , i = e[t + 6 - 32]
                  , s = e[t + 7 - 32];
                e[t + 0 + 0] = kt(e[t + 0 - 32], r, a),
                e[t + 1 + 0] = e[t + 0 + 32] = kt(r, a, n),
                e[t + 2 + 0] = e[t + 1 + 32] = e[t + 0 + 64] = kt(a, n, o),
                e[t + 3 + 0] = e[t + 2 + 32] = e[t + 1 + 64] = e[t + 0 + 96] = kt(n, o, l),
                e[t + 3 + 32] = e[t + 2 + 64] = e[t + 1 + 96] = kt(o, l, i),
                e[t + 3 + 64] = e[t + 2 + 96] = kt(l, i, s),
                e[t + 3 + 96] = kt(i, s, s)
            }
            function Tt(e, t) {
                var r = e[t - 1 + 0]
                  , a = e[t - 1 + 32]
                  , n = e[t - 1 + 64]
                  , o = e[t - 1 - 32]
                  , l = e[t + 0 - 32]
                  , i = e[t + 1 - 32]
                  , s = e[t + 2 - 32]
                  , c = e[t + 3 - 32];
                e[t + 0 + 0] = e[t + 1 + 64] = o + l + 1 >> 1,
                e[t + 1 + 0] = e[t + 2 + 64] = l + i + 1 >> 1,
                e[t + 2 + 0] = e[t + 3 + 64] = i + s + 1 >> 1,
                e[t + 3 + 0] = s + c + 1 >> 1,
                e[t + 0 + 96] = kt(n, a, r),
                e[t + 0 + 64] = kt(a, r, o),
                e[t + 0 + 32] = e[t + 1 + 96] = kt(r, o, l),
                e[t + 1 + 32] = e[t + 2 + 96] = kt(o, l, i),
                e[t + 2 + 32] = e[t + 3 + 96] = kt(l, i, s),
                e[t + 3 + 32] = kt(i, s, c)
            }
            function Et(e, t) {
                var r = e[t + 0 - 32]
                  , a = e[t + 1 - 32]
                  , n = e[t + 2 - 32]
                  , o = e[t + 3 - 32]
                  , l = e[t + 4 - 32]
                  , i = e[t + 5 - 32]
                  , s = e[t + 6 - 32]
                  , c = e[t + 7 - 32];
                e[t + 0 + 0] = r + a + 1 >> 1,
                e[t + 1 + 0] = e[t + 0 + 64] = a + n + 1 >> 1,
                e[t + 2 + 0] = e[t + 1 + 64] = n + o + 1 >> 1,
                e[t + 3 + 0] = e[t + 2 + 64] = o + l + 1 >> 1,
                e[t + 0 + 32] = kt(r, a, n),
                e[t + 1 + 32] = e[t + 0 + 96] = kt(a, n, o),
                e[t + 2 + 32] = e[t + 1 + 96] = kt(n, o, l),
                e[t + 3 + 32] = e[t + 2 + 96] = kt(o, l, i),
                e[t + 3 + 64] = kt(l, i, s),
                e[t + 3 + 96] = kt(i, s, c)
            }
            function It(e, t) {
                var r = e[t - 1 + 0]
                  , a = e[t - 1 + 32]
                  , n = e[t - 1 + 64]
                  , o = e[t - 1 + 96];
                e[t + 0 + 0] = r + a + 1 >> 1,
                e[t + 2 + 0] = e[t + 0 + 32] = a + n + 1 >> 1,
                e[t + 2 + 32] = e[t + 0 + 64] = n + o + 1 >> 1,
                e[t + 1 + 0] = kt(r, a, n),
                e[t + 3 + 0] = e[t + 1 + 32] = kt(a, n, o),
                e[t + 3 + 32] = e[t + 1 + 64] = kt(n, o, o),
                e[t + 3 + 64] = e[t + 2 + 64] = e[t + 0 + 96] = e[t + 1 + 96] = e[t + 2 + 96] = e[t + 3 + 96] = o
            }
            function Rt(e, t) {
                var r = e[t - 1 + 0]
                  , a = e[t - 1 + 32]
                  , n = e[t - 1 + 64]
                  , o = e[t - 1 + 96]
                  , l = e[t - 1 - 32]
                  , i = e[t + 0 - 32]
                  , s = e[t + 1 - 32]
                  , c = e[t + 2 - 32];
                e[t + 0 + 0] = e[t + 2 + 32] = r + l + 1 >> 1,
                e[t + 0 + 32] = e[t + 2 + 64] = a + r + 1 >> 1,
                e[t + 0 + 64] = e[t + 2 + 96] = n + a + 1 >> 1,
                e[t + 0 + 96] = o + n + 1 >> 1,
                e[t + 3 + 0] = kt(i, s, c),
                e[t + 2 + 0] = kt(l, i, s),
                e[t + 1 + 0] = e[t + 3 + 32] = kt(r, l, i),
                e[t + 1 + 32] = e[t + 3 + 64] = kt(a, r, l),
                e[t + 1 + 64] = e[t + 3 + 96] = kt(n, a, r),
                e[t + 1 + 96] = kt(o, n, a)
            }
            function Bt(e, t) {
                var r;
                for (r = 0; 8 > r; ++r)
                    a(e, t + 32 * r, e, t - 32, 8)
            }
            function Nt(e, t) {
                var r;
                for (r = 0; 8 > r; ++r)
                    n(e, t, e[t - 1], 8),
                    t += 32
            }
            function Ft(e, t, r) {
                var a;
                for (a = 0; 8 > a; ++a)
                    n(t, r + 32 * a, e, 8)
            }
            function Pt(e, t) {
                var r, a = 8;
                for (r = 0; 8 > r; ++r)
                    a += e[t + r - 32] + e[t - 1 + 32 * r];
                Ft(a >> 4, e, t)
            }
            function $t(e, t) {
                var r, a = 4;
                for (r = 0; 8 > r; ++r)
                    a += e[t + r - 32];
                Ft(a >> 3, e, t)
            }
            function Lt(e, t) {
                var r, a = 4;
                for (r = 0; 8 > r; ++r)
                    a += e[t - 1 + 32 * r];
                Ft(a >> 3, e, t)
            }
            function Ot(e, t) {
                Ft(128, e, t)
            }
            function Dt(e, t, r) {
                var a = e[t - r]
                  , n = e[t + 0]
                  , o = 3 * (n - a) + Ba[1020 + e[t - 2 * r] - e[t + r]]
                  , l = Na[112 + (o + 4 >> 3)];
                e[t - r] = Fa[255 + a + Na[112 + (o + 3 >> 3)]],
                e[t + 0] = Fa[255 + n - l]
            }
            function Mt(e, t, r, a) {
                var n = e[t + 0]
                  , o = e[t + r];
                return Pa[255 + e[t - 2 * r] - e[t - r]] > a || Pa[255 + o - n] > a
            }
            function Ut(e, t, r, a) {
                return 4 * Pa[255 + e[t - r] - e[t + 0]] + Pa[255 + e[t - 2 * r] - e[t + r]] <= a
            }
            function Ht(e, t, r, a, n) {
                var o = e[t - 3 * r]
                  , l = e[t - 2 * r]
                  , i = e[t - r]
                  , s = e[t + 0]
                  , c = e[t + r]
                  , u = e[t + 2 * r]
                  , h = e[t + 3 * r];
                return 4 * Pa[255 + i - s] + Pa[255 + l - c] > a ? 0 : Pa[255 + e[t - 4 * r] - o] <= n && Pa[255 + o - l] <= n && Pa[255 + l - i] <= n && Pa[255 + h - u] <= n && Pa[255 + u - c] <= n && Pa[255 + c - s] <= n
            }
            function qt(e, t, r, a) {
                var n = 2 * a + 1;
                for (a = 0; 16 > a; ++a)
                    Ut(e, t + a, r, n) && Dt(e, t + a, r)
            }
            function zt(e, t, r, a) {
                var n = 2 * a + 1;
                for (a = 0; 16 > a; ++a)
                    Ut(e, t + a * r, 1, n) && Dt(e, t + a * r, 1)
            }
            function jt(e, t, r, a) {
                var n;
                for (n = 3; 0 < n; --n)
                    qt(e, t += 4 * r, r, a)
            }
            function Vt(e, t, r, a) {
                var n;
                for (n = 3; 0 < n; --n)
                    zt(e, t += 4, r, a)
            }
            function Qt(e, t, r, a, n, o, l, i) {
                for (o = 2 * o + 1; 0 < n--; ) {
                    if (Ht(e, t, r, o, l))
                        if (Mt(e, t, r, i))
                            Dt(e, t, r);
                        else {
                            var s = e
                              , c = t
                              , u = r
                              , h = s[c - 2 * u]
                              , d = s[c - u]
                              , f = s[c + 0]
                              , m = s[c + u]
                              , p = s[c + 2 * u]
                              , g = 27 * (v = Ba[1020 + 3 * (f - d) + Ba[1020 + h - m]]) + 63 >> 7
                              , y = 18 * v + 63 >> 7
                              , v = 9 * v + 63 >> 7;
                            s[c - 3 * u] = Fa[255 + s[c - 3 * u] + v],
                            s[c - 2 * u] = Fa[255 + h + y],
                            s[c - u] = Fa[255 + d + g],
                            s[c + 0] = Fa[255 + f - g],
                            s[c + u] = Fa[255 + m - y],
                            s[c + 2 * u] = Fa[255 + p - v]
                        }
                    t += a
                }
            }
            function Gt(e, t, r, a, n, o, l, i) {
                for (o = 2 * o + 1; 0 < n--; ) {
                    if (Ht(e, t, r, o, l))
                        if (Mt(e, t, r, i))
                            Dt(e, t, r);
                        else {
                            var s = e
                              , c = t
                              , u = r
                              , h = s[c - u]
                              , d = s[c + 0]
                              , f = s[c + u]
                              , m = Na[112 + (4 + (p = 3 * (d - h)) >> 3)]
                              , p = Na[112 + (p + 3 >> 3)]
                              , g = m + 1 >> 1;
                            s[c - 2 * u] = Fa[255 + s[c - 2 * u] + g],
                            s[c - u] = Fa[255 + h + p],
                            s[c + 0] = Fa[255 + d - m],
                            s[c + u] = Fa[255 + f - g]
                        }
                    t += a
                }
            }
            function Kt(e, t, r, a, n, o) {
                Qt(e, t, r, 1, 16, a, n, o)
            }
            function Wt(e, t, r, a, n, o) {
                Qt(e, t, 1, r, 16, a, n, o)
            }
            function Yt(e, t, r, a, n, o) {
                var l;
                for (l = 3; 0 < l; --l)
                    Gt(e, t += 4 * r, r, 1, 16, a, n, o)
            }
            function Xt(e, t, r, a, n, o) {
                var l;
                for (l = 3; 0 < l; --l)
                    Gt(e, t += 4, 1, r, 16, a, n, o)
            }
            function Jt(e, t, r, a, n, o, l, i) {
                Qt(e, t, n, 1, 8, o, l, i),
                Qt(r, a, n, 1, 8, o, l, i)
            }
            function Zt(e, t, r, a, n, o, l, i) {
                Qt(e, t, 1, n, 8, o, l, i),
                Qt(r, a, 1, n, 8, o, l, i)
            }
            function er(e, t, r, a, n, o, l, i) {
                Gt(e, t + 4 * n, n, 1, 8, o, l, i),
                Gt(r, a + 4 * n, n, 1, 8, o, l, i)
            }
            function tr(e, t, r, a, n, o, l, i) {
                Gt(e, t + 4, 1, n, 8, o, l, i),
                Gt(r, a + 4, 1, n, 8, o, l, i)
            }
            function rr() {
                this.ba = new le,
                this.ec = [],
                this.cc = [],
                this.Mc = [],
                this.Dc = this.Nc = this.dc = this.fc = 0,
                this.Oa = new se,
                this.memory = 0,
                this.Ib = "OutputFunc",
                this.Jb = "OutputAlphaFunc",
                this.Nd = "OutputRowFunc"
            }
            function ar() {
                this.data = [],
                this.offset = this.kd = this.ha = this.w = 0,
                this.na = [],
                this.xa = this.gb = this.Ja = this.Sa = this.P = 0
            }
            function nr() {
                this.nc = this.Ea = this.b = this.hc = 0,
                this.K = [],
                this.w = 0
            }
            function or() {
                this.ua = 0,
                this.Wa = new $,
                this.vb = new $,
                this.md = this.xc = this.wc = 0,
                this.vc = [],
                this.Wb = 0,
                this.Ya = new f,
                this.yc = new h
            }
            function lr() {
                this.xb = this.a = 0,
                this.l = new Qe,
                this.ca = new le,
                this.V = [],
                this.Ba = 0,
                this.Ta = [],
                this.Ua = 0,
                this.m = new k,
                this.Pb = 0,
                this.wd = new k,
                this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0,
                this.s = new or,
                this.ab = 0,
                this.gc = l(4, nr),
                this.Oc = 0
            }
            function ir() {
                this.Lc = this.Z = this.$a = this.i = this.c = 0,
                this.l = new Qe,
                this.ic = 0,
                this.ca = [],
                this.tb = 0,
                this.qd = null,
                this.rd = 0
            }
            function sr(e, t, r, a, n, o, l) {
                for (e = null == e ? 0 : e[t + 0],
                t = 0; t < l; ++t)
                    n[o + t] = e + r[a + t] & 255,
                    e = n[o + t]
            }
            function cr(e, t, r, a, n, o, l) {
                var i;
                if (null == e)
                    sr(null, null, r, a, n, o, l);
                else
                    for (i = 0; i < l; ++i)
                        n[o + i] = e[t + i] + r[a + i] & 255
            }
            function ur(e, t, r, a, n, o, l) {
                if (null == e)
                    sr(null, null, r, a, n, o, l);
                else {
                    var i, s = e[t + 0], c = s, u = s;
                    for (i = 0; i < l; ++i)
                        c = u + (s = e[t + i]) - c,
                        u = r[a + i] + (-256 & c ? 0 > c ? 0 : 255 : c) & 255,
                        c = s,
                        n[o + i] = u
                }
            }
            function hr(e, r, n, l) {
                var i = r.width
                  , s = r.o;
                if (t(null != e && null != r),
                0 > n || 0 >= l || n + l > s)
                    return null;
                if (!e.Cc) {
                    if (null == e.ga) {
                        var c;
                        if (e.ga = new ir,
                        (c = null == e.ga) || (c = r.width * r.o,
                        t(0 == e.Gb.length),
                        e.Gb = o(c),
                        e.Uc = 0,
                        null == e.Gb ? c = 0 : (e.mb = e.Gb,
                        e.nb = e.Uc,
                        e.rc = null,
                        c = 1),
                        c = !c),
                        !c) {
                            c = e.ga;
                            var u = e.Fa
                              , h = e.P
                              , d = e.qc
                              , f = e.mb
                              , m = e.nb
                              , p = h + 1
                              , g = d - 1
                              , v = c.l;
                            if (t(null != u && null != f && null != r),
                            gn[0] = null,
                            gn[1] = sr,
                            gn[2] = cr,
                            gn[3] = ur,
                            c.ca = f,
                            c.tb = m,
                            c.c = r.width,
                            c.i = r.height,
                            t(0 < c.c && 0 < c.i),
                            1 >= d)
                                r = 0;
                            else if (c.$a = u[h + 0] >> 0 & 3,
                            c.Z = u[h + 0] >> 2 & 3,
                            c.Lc = u[h + 0] >> 4 & 3,
                            h = u[h + 0] >> 6 & 3,
                            0 > c.$a || 1 < c.$a || 4 <= c.Z || 1 < c.Lc || h)
                                r = 0;
                            else if (v.put = fe,
                            v.ac = de,
                            v.bc = me,
                            v.ma = c,
                            v.width = r.width,
                            v.height = r.height,
                            v.Da = r.Da,
                            v.v = r.v,
                            v.va = r.va,
                            v.j = r.j,
                            v.o = r.o,
                            c.$a)
                                e: {
                                    t(1 == c.$a),
                                    r = Ee();
                                    t: for (; ; ) {
                                        if (null == r) {
                                            r = 0;
                                            break e
                                        }
                                        if (t(null != c),
                                        c.mc = r,
                                        r.c = c.c,
                                        r.i = c.i,
                                        r.l = c.l,
                                        r.l.ma = c,
                                        r.l.width = c.c,
                                        r.l.height = c.i,
                                        r.a = 0,
                                        y(r.m, u, p, g),
                                        !Ie(c.c, c.i, 1, r, null))
                                            break t;
                                        if (1 == r.ab && 3 == r.gc[0].hc && xe(r.s) ? (c.ic = 1,
                                        u = r.c * r.i,
                                        r.Ta = null,
                                        r.Ua = 0,
                                        r.V = o(u),
                                        r.Ba = 0,
                                        null == r.V ? (r.a = 1,
                                        r = 0) : r = 1) : (c.ic = 0,
                                        r = Re(r, c.c)),
                                        !r)
                                            break t;
                                        r = 1;
                                        break e
                                    }
                                    c.mc = null,
                                    r = 0
                                }
                            else
                                r = g >= c.c * c.i;
                            c = !r
                        }
                        if (c)
                            return null;
                        1 != e.ga.Lc ? e.Ga = 0 : l = s - n
                    }
                    t(null != e.ga),
                    t(n + l <= s);
                    e: {
                        if (r = (u = e.ga).c,
                        s = u.l.o,
                        0 == u.$a) {
                            if (p = e.rc,
                            g = e.Vc,
                            v = e.Fa,
                            h = e.P + 1 + n * r,
                            d = e.mb,
                            f = e.nb + n * r,
                            t(h <= e.P + e.qc),
                            0 != u.Z)
                                for (t(null != gn[u.Z]),
                                c = 0; c < l; ++c)
                                    gn[u.Z](p, g, v, h, d, f, r),
                                    p = d,
                                    g = f,
                                    f += r,
                                    h += r;
                            else
                                for (c = 0; c < l; ++c)
                                    a(d, f, v, h, r),
                                    p = d,
                                    g = f,
                                    f += r,
                                    h += r;
                            e.rc = p,
                            e.Vc = g
                        } else {
                            if (t(null != u.mc),
                            r = n + l,
                            t(null != (c = u.mc)),
                            t(r <= c.i),
                            c.C >= r)
                                r = 1;
                            else if (u.ic || gr(),
                            u.ic) {
                                u = c.V,
                                p = c.Ba,
                                g = c.c;
                                var A = c.i
                                  , b = (v = 1,
                                h = c.$ / g,
                                d = c.$ % g,
                                f = c.m,
                                m = c.s,
                                c.$)
                                  , k = g * A
                                  , w = g * r
                                  , S = m.wc
                                  , C = b < w ? be(m, d, h) : null;
                                t(b <= k),
                                t(r <= A),
                                t(xe(m));
                                t: for (; ; ) {
                                    for (; !f.h && b < w; ) {
                                        if (d & S || (C = be(m, d, h)),
                                        t(null != C),
                                        _(f),
                                        256 > (A = ve(C.G[0], C.H[0], f)))
                                            u[p + b] = A,
                                            ++b,
                                            ++d >= g && (d = 0,
                                            ++h <= r && !(h % 16) && _e(c, h));
                                        else {
                                            if (!(280 > A)) {
                                                v = 0;
                                                break t
                                            }
                                            A = ge(A - 256, f);
                                            var T, E = ve(C.G[4], C.H[4], f);
                                            if (_(f),
                                            !(b >= (E = ye(g, E = ge(E, f))) && k - b >= A)) {
                                                v = 0;
                                                break t
                                            }
                                            for (T = 0; T < A; ++T)
                                                u[p + b + T] = u[p + b + T - E];
                                            for (b += A,
                                            d += A; d >= g; )
                                                d -= g,
                                                ++h <= r && !(h % 16) && _e(c, h);
                                            b < w && d & S && (C = be(m, d, h))
                                        }
                                        t(f.h == x(f))
                                    }
                                    _e(c, h > r ? r : h);
                                    break t
                                }
                                !v || f.h && b < k ? (v = 0,
                                c.a = f.h ? 5 : 3) : c.$ = b,
                                r = v
                            } else
                                r = Ce(c, c.V, c.Ba, c.c, c.i, r, Be);
                            if (!r) {
                                l = 0;
                                break e
                            }
                        }
                        n + l >= s && (e.Cc = 1),
                        l = 1
                    }
                    if (!l)
                        return null;
                    if (e.Cc && (null != (l = e.ga) && (l.mc = null),
                    e.ga = null,
                    0 < e.Ga))
                        return alert("todo:WebPDequantizeLevels"),
                        null
                }
                return e.nb + n * i
            }
            function dr(e, t, r, a, n, o) {
                for (; 0 < n--; ) {
                    var l, i = e, s = t + (r ? 1 : 0), c = e, u = t + (r ? 0 : 3);
                    for (l = 0; l < a; ++l) {
                        var h = c[u + 4 * l];
                        255 != h && (h *= 32897,
                        i[s + 4 * l + 0] = i[s + 4 * l + 0] * h >> 23,
                        i[s + 4 * l + 1] = i[s + 4 * l + 1] * h >> 23,
                        i[s + 4 * l + 2] = i[s + 4 * l + 2] * h >> 23)
                    }
                    t += o
                }
            }
            function fr(e, t, r, a, n) {
                for (; 0 < a--; ) {
                    var o;
                    for (o = 0; o < r; ++o) {
                        var l = e[t + 2 * o + 0]
                          , i = 15 & (c = e[t + 2 * o + 1])
                          , s = 4369 * i
                          , c = (240 & c | c >> 4) * s >> 16;
                        e[t + 2 * o + 0] = (240 & l | l >> 4) * s >> 16 & 240 | (15 & l | l << 4) * s >> 16 >> 4 & 15,
                        e[t + 2 * o + 1] = 240 & c | i
                    }
                    t += n
                }
            }
            function mr(e, t, r, a, n, o, l, i) {
                var s, c, u = 255;
                for (c = 0; c < n; ++c) {
                    for (s = 0; s < a; ++s) {
                        var h = e[t + s];
                        o[l + 4 * s] = h,
                        u &= h
                    }
                    t += r,
                    l += i
                }
                return 255 != u
            }
            function pr(e, t, r, a, n) {
                var o;
                for (o = 0; o < n; ++o)
                    r[a + o] = e[t + o] >> 8
            }
            function gr() {
                wa = dr,
                xa = fr,
                Sa = mr,
                _a = pr
            }
            function yr(r, a, n) {
                e[r] = function(e, r, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A) {
                    var b, k = A - 1 >> 1, w = i[s + 0] | c[u + 0] << 16, x = h[d + 0] | f[m + 0] << 16;
                    t(null != e);
                    var S = 3 * w + x + 131074 >> 2;
                    for (a(e[r + 0], 255 & S, S >> 16, p, g),
                    null != o && (S = 3 * x + w + 131074 >> 2,
                    a(o[l + 0], 255 & S, S >> 16, y, v)),
                    b = 1; b <= k; ++b) {
                        var _ = i[s + b] | c[u + b] << 16
                          , C = h[d + b] | f[m + b] << 16
                          , T = w + _ + x + C + 524296
                          , E = T + 2 * (_ + x) >> 3;
                        S = E + w >> 1,
                        w = (T = T + 2 * (w + C) >> 3) + _ >> 1,
                        a(e[r + 2 * b - 1], 255 & S, S >> 16, p, g + (2 * b - 1) * n),
                        a(e[r + 2 * b - 0], 255 & w, w >> 16, p, g + (2 * b - 0) * n),
                        null != o && (S = T + x >> 1,
                        w = E + C >> 1,
                        a(o[l + 2 * b - 1], 255 & S, S >> 16, y, v + (2 * b - 1) * n),
                        a(o[l + 2 * b + 0], 255 & w, w >> 16, y, v + (2 * b + 0) * n)),
                        w = _,
                        x = C
                    }
                    1 & A || (S = 3 * w + x + 131074 >> 2,
                    a(e[r + A - 1], 255 & S, S >> 16, p, g + (A - 1) * n),
                    null != o && (S = 3 * x + w + 131074 >> 2,
                    a(o[l + A - 1], 255 & S, S >> 16, y, v + (A - 1) * n)))
                }
            }
            function vr() {
                yn[$a] = vn,
                yn[La] = bn,
                yn[Oa] = An,
                yn[Da] = kn,
                yn[Ma] = wn,
                yn[Ua] = xn,
                yn[Ha] = Sn,
                yn[qa] = bn,
                yn[za] = kn,
                yn[ja] = wn,
                yn[Va] = xn
            }
            function Ar(e) {
                return e & ~Rn ? 0 > e ? 0 : 255 : e >> In
            }
            function br(e, t) {
                return Ar((19077 * e >> 8) + (26149 * t >> 8) - 14234)
            }
            function kr(e, t, r) {
                return Ar((19077 * e >> 8) - (6419 * t >> 8) - (13320 * r >> 8) + 8708)
            }
            function wr(e, t) {
                return Ar((19077 * e >> 8) + (33050 * t >> 8) - 17685)
            }
            function xr(e, t, r, a, n) {
                a[n + 0] = br(e, r),
                a[n + 1] = kr(e, t, r),
                a[n + 2] = wr(e, t)
            }
            function Sr(e, t, r, a, n) {
                a[n + 0] = wr(e, t),
                a[n + 1] = kr(e, t, r),
                a[n + 2] = br(e, r)
            }
            function _r(e, t, r, a, n) {
                var o = kr(e, t, r);
                t = o << 3 & 224 | wr(e, t) >> 3,
                a[n + 0] = 248 & br(e, r) | o >> 5,
                a[n + 1] = t
            }
            function Cr(e, t, r, a, n) {
                var o = 240 & wr(e, t) | 15;
                a[n + 0] = 240 & br(e, r) | kr(e, t, r) >> 4,
                a[n + 1] = o
            }
            function Tr(e, t, r, a, n) {
                a[n + 0] = 255,
                xr(e, t, r, a, n + 1)
            }
            function Er(e, t, r, a, n) {
                Sr(e, t, r, a, n),
                a[n + 3] = 255
            }
            function Ir(e, t, r, a, n) {
                xr(e, t, r, a, n),
                a[n + 3] = 255
            }
            function Ve(e, t) {
                return 0 > e ? 0 : e > t ? t : e
            }
            function Rr(t, r, a) {
                e[t] = function(e, t, n, o, l, i, s, c, u) {
                    for (var h = c + (-2 & u) * a; c != h; )
                        r(e[t + 0], n[o + 0], l[i + 0], s, c),
                        r(e[t + 1], n[o + 0], l[i + 0], s, c + a),
                        t += 2,
                        ++o,
                        ++i,
                        c += 2 * a;
                    1 & u && r(e[t + 0], n[o + 0], l[i + 0], s, c)
                }
            }
            function Br(e, t, r) {
                return 0 == r ? 0 == e ? 0 == t ? 6 : 5 : 0 == t ? 4 : 0 : r
            }
            function Nr(e, t, r, a, n) {
                switch (e >>> 30) {
                case 3:
                    oa(t, r, a, n, 0);
                    break;
                case 2:
                    la(t, r, a, n);
                    break;
                case 1:
                    sa(t, r, a, n)
                }
            }
            function Fr(e, t) {
                var r, o, l = t.M, i = t.Nb, s = e.oc, c = e.pc + 40, u = e.oc, h = e.pc + 584, d = e.oc, f = e.pc + 600;
                for (r = 0; 16 > r; ++r)
                    s[c + 32 * r - 1] = 129;
                for (r = 0; 8 > r; ++r)
                    u[h + 32 * r - 1] = 129,
                    d[f + 32 * r - 1] = 129;
                for (0 < l ? s[c - 1 - 32] = u[h - 1 - 32] = d[f - 1 - 32] = 129 : (n(s, c - 32 - 1, 127, 21),
                n(u, h - 32 - 1, 127, 9),
                n(d, f - 32 - 1, 127, 9)),
                o = 0; o < e.za; ++o) {
                    var m = t.ya[t.aa + o];
                    if (0 < o) {
                        for (r = -1; 16 > r; ++r)
                            a(s, c + 32 * r - 4, s, c + 32 * r + 12, 4);
                        for (r = -1; 8 > r; ++r)
                            a(u, h + 32 * r - 4, u, h + 32 * r + 4, 4),
                            a(d, f + 32 * r - 4, d, f + 32 * r + 4, 4)
                    }
                    var p = e.Gd
                      , g = e.Hd + o
                      , y = m.ad
                      , v = m.Hc;
                    if (0 < l && (a(s, c - 32, p[g].y, 0, 16),
                    a(u, h - 32, p[g].f, 0, 8),
                    a(d, f - 32, p[g].ea, 0, 8)),
                    m.Za) {
                        var A = s
                          , b = c - 32 + 16;
                        for (0 < l && (o >= e.za - 1 ? n(A, b, p[g].y[15], 4) : a(A, b, p[g + 1].y, 0, 4)),
                        r = 0; 4 > r; r++)
                            A[b + 128 + r] = A[b + 256 + r] = A[b + 384 + r] = A[b + 0 + r];
                        for (r = 0; 16 > r; ++r,
                        v <<= 2)
                            A = s,
                            b = c + Dn[r],
                            dn[m.Ob[r]](A, b),
                            Nr(v, y, 16 * +r, A, b)
                    } else if (A = Br(o, l, m.Ob[0]),
                    hn[A](s, c),
                    0 != v)
                        for (r = 0; 16 > r; ++r,
                        v <<= 2)
                            Nr(v, y, 16 * +r, s, c + Dn[r]);
                    for (r = m.Gc,
                    A = Br(o, l, m.Dd),
                    fn[A](u, h),
                    fn[A](d, f),
                    v = y,
                    A = u,
                    b = h,
                    255 & (m = r >> 0) && (170 & m ? ia(v, 256, A, b) : ca(v, 256, A, b)),
                    m = d,
                    v = f,
                    255 & (r >>= 8) && (170 & r ? ia(y, 320, m, v) : ca(y, 320, m, v)),
                    l < e.Ub - 1 && (a(p[g].y, 0, s, c + 480, 16),
                    a(p[g].f, 0, u, h + 224, 8),
                    a(p[g].ea, 0, d, f + 224, 8)),
                    r = 8 * i * e.B,
                    p = e.sa,
                    g = e.ta + 16 * o + 16 * i * e.R,
                    y = e.qa,
                    m = e.ra + 8 * o + r,
                    v = e.Ha,
                    A = e.Ia + 8 * o + r,
                    r = 0; 16 > r; ++r)
                        a(p, g + r * e.R, s, c + 32 * r, 16);
                    for (r = 0; 8 > r; ++r)
                        a(y, m + r * e.B, u, h + 32 * r, 8),
                        a(v, A + r * e.B, d, f + 32 * r, 8)
                }
            }
            function Pr(e, a, n, o, l, i, s, c, u) {
                var h = [0]
                  , d = [0]
                  , f = 0
                  , m = null != u ? u.kd : 0
                  , p = null != u ? u : new ar;
                if (null == e || 12 > n)
                    return 7;
                p.data = e,
                p.w = a,
                p.ha = n,
                a = [a],
                n = [n],
                p.gb = [p.gb];
                e: {
                    var g = a
                      , v = n
                      , A = p.gb;
                    if (t(null != e),
                    t(null != v),
                    t(null != A),
                    A[0] = 0,
                    12 <= v[0] && !r(e, g[0], "RIFF")) {
                        if (r(e, g[0] + 8, "WEBP")) {
                            A = 3;
                            break e
                        }
                        var b = N(e, g[0] + 4);
                        if (12 > b || 4294967286 < b) {
                            A = 3;
                            break e
                        }
                        if (m && b > v[0] - 8) {
                            A = 7;
                            break e
                        }
                        A[0] = b,
                        g[0] += 12,
                        v[0] -= 12
                    }
                    A = 0
                }
                if (0 != A)
                    return A;
                for (b = 0 < p.gb[0],
                n = n[0]; ; ) {
                    e: {
                        var w = e;
                        v = a,
                        A = n;
                        var x = h
                          , S = d
                          , _ = g = [0];
                        if ((E = f = [f])[0] = 0,
                        8 > A[0])
                            A = 7;
                        else {
                            if (!r(w, v[0], "VP8X")) {
                                if (10 != N(w, v[0] + 4)) {
                                    A = 3;
                                    break e
                                }
                                if (18 > A[0]) {
                                    A = 7;
                                    break e
                                }
                                var C = N(w, v[0] + 8)
                                  , T = 1 + B(w, v[0] + 12);
                                if (2147483648 <= T * (w = 1 + B(w, v[0] + 15))) {
                                    A = 3;
                                    break e
                                }
                                null != _ && (_[0] = C),
                                null != x && (x[0] = T),
                                null != S && (S[0] = w),
                                v[0] += 18,
                                A[0] -= 18,
                                E[0] = 1
                            }
                            A = 0
                        }
                    }
                    if (f = f[0],
                    g = g[0],
                    0 != A)
                        return A;
                    if (v = !!(2 & g),
                    !b && f)
                        return 3;
                    if (null != i && (i[0] = !!(16 & g)),
                    null != s && (s[0] = v),
                    null != c && (c[0] = 0),
                    s = h[0],
                    g = d[0],
                    f && v && null == u) {
                        A = 0;
                        break
                    }
                    if (4 > n) {
                        A = 7;
                        break
                    }
                    if (b && f || !b && !f && !r(e, a[0], "ALPH")) {
                        n = [n],
                        p.na = [p.na],
                        p.P = [p.P],
                        p.Sa = [p.Sa];
                        e: {
                            C = e,
                            A = a,
                            b = n;
                            var E = p.gb;
                            x = p.na,
                            S = p.P,
                            _ = p.Sa,
                            T = 22,
                            t(null != C),
                            t(null != b),
                            w = A[0];
                            var I = b[0];
                            for (t(null != x),
                            t(null != _),
                            x[0] = null,
                            S[0] = null,
                            _[0] = 0; ; ) {
                                if (A[0] = w,
                                b[0] = I,
                                8 > I) {
                                    A = 7;
                                    break e
                                }
                                var R = N(C, w + 4);
                                if (4294967286 < R) {
                                    A = 3;
                                    break e
                                }
                                var F = 8 + R + 1 & -2;
                                if (T += F,
                                0 < E && T > E) {
                                    A = 3;
                                    break e
                                }
                                if (!r(C, w, "VP8 ") || !r(C, w, "VP8L")) {
                                    A = 0;
                                    break e
                                }
                                if (I[0] < F) {
                                    A = 7;
                                    break e
                                }
                                r(C, w, "ALPH") || (x[0] = C,
                                S[0] = w + 8,
                                _[0] = R),
                                w += F,
                                I -= F
                            }
                        }
                        if (n = n[0],
                        p.na = p.na[0],
                        p.P = p.P[0],
                        p.Sa = p.Sa[0],
                        0 != A)
                            break
                    }
                    n = [n],
                    p.Ja = [p.Ja],
                    p.xa = [p.xa];
                    e: if (E = e,
                    A = a,
                    b = n,
                    x = p.gb[0],
                    S = p.Ja,
                    _ = p.xa,
                    C = A[0],
                    w = !r(E, C, "VP8 "),
                    T = !r(E, C, "VP8L"),
                    t(null != E),
                    t(null != b),
                    t(null != S),
                    t(null != _),
                    8 > b[0])
                        A = 7;
                    else {
                        if (w || T) {
                            if (E = N(E, C + 4),
                            12 <= x && E > x - 12) {
                                A = 3;
                                break e
                            }
                            if (m && E > b[0] - 8) {
                                A = 7;
                                break e
                            }
                            S[0] = E,
                            A[0] += 8,
                            b[0] -= 8,
                            _[0] = T
                        } else
                            _[0] = 5 <= b[0] && 47 == E[C + 0] && !(E[C + 4] >> 5),
                            S[0] = b[0];
                        A = 0
                    }
                    if (n = n[0],
                    p.Ja = p.Ja[0],
                    p.xa = p.xa[0],
                    a = a[0],
                    0 != A)
                        break;
                    if (4294967286 < p.Ja)
                        return 3;
                    if (null == c || v || (c[0] = p.xa ? 2 : 1),
                    s = [s],
                    g = [g],
                    p.xa) {
                        if (5 > n) {
                            A = 7;
                            break
                        }
                        c = s,
                        m = g,
                        v = i,
                        null == e || 5 > n ? e = 0 : 5 <= n && 47 == e[a + 0] && !(e[a + 4] >> 5) ? (b = [0],
                        E = [0],
                        x = [0],
                        y(S = new k, e, a, n),
                        pe(S, b, E, x) ? (null != c && (c[0] = b[0]),
                        null != m && (m[0] = E[0]),
                        null != v && (v[0] = x[0]),
                        e = 1) : e = 0) : e = 0
                    } else {
                        if (10 > n) {
                            A = 7;
                            break
                        }
                        c = g,
                        null == e || 10 > n || !We(e, a + 3, n - 3) ? e = 0 : (m = e[a + 0] | e[a + 1] << 8 | e[a + 2] << 16,
                        v = 16383 & (e[a + 7] << 8 | e[a + 6]),
                        e = 16383 & (e[a + 9] << 8 | e[a + 8]),
                        1 & m || 3 < (m >> 1 & 7) || !(m >> 4 & 1) || m >> 5 >= p.Ja || !v || !e ? e = 0 : (s && (s[0] = v),
                        c && (c[0] = e),
                        e = 1))
                    }
                    if (!e)
                        return 3;
                    if (s = s[0],
                    g = g[0],
                    f && (h[0] != s || d[0] != g))
                        return 3;
                    null != u && (u[0] = p,
                    u.offset = a - u.w,
                    t(4294967286 > a - u.w),
                    t(u.offset == u.ha - n));
                    break
                }
                return 0 == A || 7 == A && f && null == u ? (null != i && (i[0] |= null != p.na && 0 < p.na.length),
                null != o && (o[0] = s),
                null != l && (l[0] = g),
                0) : A
            }
            function $r(e, t, r) {
                var a = t.width
                  , n = t.height
                  , o = 0
                  , l = 0
                  , i = a
                  , s = n;
                if (t.Da = null != e && 0 < e.Da,
                t.Da && (i = e.cd,
                s = e.bd,
                o = e.v,
                l = e.j,
                11 > r || (o &= -2,
                l &= -2),
                0 > o || 0 > l || 0 >= i || 0 >= s || o + i > a || l + s > n))
                    return 0;
                if (t.v = o,
                t.j = l,
                t.va = o + i,
                t.o = l + s,
                t.U = i,
                t.T = s,
                t.da = null != e && 0 < e.da,
                t.da) {
                    if (!L(i, s, r = [e.ib], o = [e.hb]))
                        return 0;
                    t.ib = r[0],
                    t.hb = o[0]
                }
                return t.ob = null != e && e.ob,
                t.Kb = null == e || !e.Sd,
                t.da && (t.ob = t.ib < 3 * a / 4 && t.hb < 3 * n / 4,
                t.Kb = 0),
                1
            }
            function Lr(e) {
                if (null == e)
                    return 2;
                if (11 > e.S) {
                    var t = e.f.RGBA;
                    t.fb += (e.height - 1) * t.A,
                    t.A = -t.A
                } else
                    t = e.f.kb,
                    e = e.height,
                    t.O += (e - 1) * t.fa,
                    t.fa = -t.fa,
                    t.N += (e - 1 >> 1) * t.Ab,
                    t.Ab = -t.Ab,
                    t.W += (e - 1 >> 1) * t.Db,
                    t.Db = -t.Db,
                    null != t.F && (t.J += (e - 1) * t.lb,
                    t.lb = -t.lb);
                return 0
            }
            function Or(e, t, r, a) {
                if (null == a || 0 >= e || 0 >= t)
                    return 2;
                if (null != r) {
                    if (r.Da) {
                        var n = r.cd
                          , l = r.bd
                          , i = -2 & r.v
                          , s = -2 & r.j;
                        if (0 > i || 0 > s || 0 >= n || 0 >= l || i + n > e || s + l > t)
                            return 2;
                        e = n,
                        t = l
                    }
                    if (r.da) {
                        if (!L(e, t, n = [r.ib], l = [r.hb]))
                            return 2;
                        e = n[0],
                        t = l[0]
                    }
                }
                a.width = e,
                a.height = t;
                e: {
                    var c = a.width
                      , u = a.height;
                    if (e = a.S,
                    0 >= c || 0 >= u || !(e >= $a && 13 > e))
                        e = 2;
                    else {
                        if (0 >= a.Rd && null == a.sd) {
                            i = l = n = t = 0;
                            var h = (s = c * qn[e]) * u;
                            if (11 > e || (l = (u + 1) / 2 * (t = (c + 1) / 2),
                            12 == e && (i = (n = c) * u)),
                            null == (u = o(h + 2 * l + i))) {
                                e = 1;
                                break e
                            }
                            a.sd = u,
                            11 > e ? ((c = a.f.RGBA).eb = u,
                            c.fb = 0,
                            c.A = s,
                            c.size = h) : ((c = a.f.kb).y = u,
                            c.O = 0,
                            c.fa = s,
                            c.Fd = h,
                            c.f = u,
                            c.N = 0 + h,
                            c.Ab = t,
                            c.Cd = l,
                            c.ea = u,
                            c.W = 0 + h + l,
                            c.Db = t,
                            c.Ed = l,
                            12 == e && (c.F = u,
                            c.J = 0 + h + 2 * l),
                            c.Tc = i,
                            c.lb = n)
                        }
                        if (t = 1,
                        n = a.S,
                        l = a.width,
                        i = a.height,
                        n >= $a && 13 > n)
                            if (11 > n)
                                e = a.f.RGBA,
                                t &= (s = Math.abs(e.A)) * (i - 1) + l <= e.size,
                                t &= s >= l * qn[n],
                                t &= null != e.eb;
                            else {
                                e = a.f.kb,
                                s = (l + 1) / 2,
                                h = (i + 1) / 2,
                                c = Math.abs(e.fa),
                                u = Math.abs(e.Ab);
                                var d = Math.abs(e.Db)
                                  , f = Math.abs(e.lb)
                                  , m = f * (i - 1) + l;
                                t &= c * (i - 1) + l <= e.Fd,
                                t &= u * (h - 1) + s <= e.Cd,
                                t = (t &= d * (h - 1) + s <= e.Ed) & c >= l & u >= s & d >= s,
                                t &= null != e.y,
                                t &= null != e.f,
                                t &= null != e.ea,
                                12 == n && (t &= f >= l,
                                t &= m <= e.Tc,
                                t &= null != e.F)
                            }
                        else
                            t = 0;
                        e = t ? 0 : 2
                    }
                }
                return 0 != e || null != r && r.fd && (e = Lr(a)),
                e
            }
            var Dr = 64
              , Mr = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215]
              , Ur = 24
              , Hr = 32
              , qr = 8
              , zr = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
            M("Predictor0", "PredictorAdd0"),
            e.Predictor0 = function() {
                return 4278190080
            }
            ,
            e.Predictor1 = function(e) {
                return e
            }
            ,
            e.Predictor2 = function(e, t, r) {
                return t[r + 0]
            }
            ,
            e.Predictor3 = function(e, t, r) {
                return t[r + 1]
            }
            ,
            e.Predictor4 = function(e, t, r) {
                return t[r - 1]
            }
            ,
            e.Predictor5 = function(e, t, r) {
                return H(H(e, t[r + 1]), t[r + 0])
            }
            ,
            e.Predictor6 = function(e, t, r) {
                return H(e, t[r - 1])
            }
            ,
            e.Predictor7 = function(e, t, r) {
                return H(e, t[r + 0])
            }
            ,
            e.Predictor8 = function(e, t, r) {
                return H(t[r - 1], t[r + 0])
            }
            ,
            e.Predictor9 = function(e, t, r) {
                return H(t[r + 0], t[r + 1])
            }
            ,
            e.Predictor10 = function(e, t, r) {
                return H(H(e, t[r - 1]), H(t[r + 0], t[r + 1]))
            }
            ,
            e.Predictor11 = function(e, t, r) {
                var a = t[r + 0];
                return 0 >= j(a >> 24 & 255, e >> 24 & 255, (t = t[r - 1]) >> 24 & 255) + j(a >> 16 & 255, e >> 16 & 255, t >> 16 & 255) + j(a >> 8 & 255, e >> 8 & 255, t >> 8 & 255) + j(255 & a, 255 & e, 255 & t) ? a : e
            }
            ,
            e.Predictor12 = function(e, t, r) {
                var a = t[r + 0];
                return (q((e >> 24 & 255) + (a >> 24 & 255) - ((t = t[r - 1]) >> 24 & 255)) << 24 | q((e >> 16 & 255) + (a >> 16 & 255) - (t >> 16 & 255)) << 16 | q((e >> 8 & 255) + (a >> 8 & 255) - (t >> 8 & 255)) << 8 | q((255 & e) + (255 & a) - (255 & t))) >>> 0
            }
            ,
            e.Predictor13 = function(e, t, r) {
                var a = t[r - 1];
                return (z((e = H(e, t[r + 0])) >> 24 & 255, a >> 24 & 255) << 24 | z(e >> 16 & 255, a >> 16 & 255) << 16 | z(e >> 8 & 255, a >> 8 & 255) << 8 | z(e >> 0 & 255, a >> 0 & 255)) >>> 0
            }
            ;
            var jr = e.PredictorAdd0;
            e.PredictorAdd1 = V,
            M("Predictor2", "PredictorAdd2"),
            M("Predictor3", "PredictorAdd3"),
            M("Predictor4", "PredictorAdd4"),
            M("Predictor5", "PredictorAdd5"),
            M("Predictor6", "PredictorAdd6"),
            M("Predictor7", "PredictorAdd7"),
            M("Predictor8", "PredictorAdd8"),
            M("Predictor9", "PredictorAdd9"),
            M("Predictor10", "PredictorAdd10"),
            M("Predictor11", "PredictorAdd11"),
            M("Predictor12", "PredictorAdd12"),
            M("Predictor13", "PredictorAdd13");
            var Vr = e.PredictorAdd2;
            W("ColorIndexInverseTransform", "MapARGB", "32b", (function(e) {
                return e >> 8 & 255
            }
            ), (function(e) {
                return e
            }
            )),
            W("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", (function(e) {
                return e
            }
            ), (function(e) {
                return e >> 8 & 255
            }
            ));
            var Qr, Gr = e.ColorIndexInverseTransform, Kr = e.MapARGB, Wr = e.VP8LColorIndexInverseTransformAlpha, Yr = e.MapAlpha, Xr = e.VP8LPredictorsAdd = [];
            Xr.length = 16,
            (e.VP8LPredictors = []).length = 16,
            (e.VP8LPredictorsAdd_C = []).length = 16,
            (e.VP8LPredictors_C = []).length = 16;
            var Jr, Zr, ea, ta, ra, aa, na, oa, la, ia, sa, ca, ua, ha, da, fa, ma, pa, ga, ya, va, Aa, ba, ka, wa, xa, Sa, _a, Ca = o(511), Ta = o(2041), Ea = o(225), Ia = o(767), Ra = 0, Ba = Ta, Na = Ea, Fa = Ia, Pa = Ca, $a = 0, La = 1, Oa = 2, Da = 3, Ma = 4, Ua = 5, Ha = 6, qa = 7, za = 8, ja = 9, Va = 10, Qa = [2, 3, 7], Ga = [3, 3, 11], Ka = [280, 256, 256, 256, 40], Wa = [0, 1, 1, 1, 0], Ya = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Xa = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Ja = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], Za = 8, en = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], tn = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], rn = null, an = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], nn = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], on = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], ln = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], sn = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], cn = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], un = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], hn = [], dn = [], fn = [], mn = 1, pn = 2, gn = [], yn = [];
            yr("UpsampleRgbLinePair", xr, 3),
            yr("UpsampleBgrLinePair", Sr, 3),
            yr("UpsampleRgbaLinePair", Ir, 4),
            yr("UpsampleBgraLinePair", Er, 4),
            yr("UpsampleArgbLinePair", Tr, 4),
            yr("UpsampleRgba4444LinePair", Cr, 2),
            yr("UpsampleRgb565LinePair", _r, 2);
            var vn = e.UpsampleRgbLinePair
              , An = e.UpsampleBgrLinePair
              , bn = e.UpsampleRgbaLinePair
              , kn = e.UpsampleBgraLinePair
              , wn = e.UpsampleArgbLinePair
              , xn = e.UpsampleRgba4444LinePair
              , Sn = e.UpsampleRgb565LinePair
              , _n = 16
              , Cn = 1 << _n - 1
              , Tn = -227
              , En = 482
              , In = 6
              , Rn = (256 << In) - 1
              , Bn = 0
              , Nn = o(256)
              , Fn = o(256)
              , Pn = o(256)
              , $n = o(256)
              , Ln = o(En - Tn)
              , On = o(En - Tn);
            Rr("YuvToRgbRow", xr, 3),
            Rr("YuvToBgrRow", Sr, 3),
            Rr("YuvToRgbaRow", Ir, 4),
            Rr("YuvToBgraRow", Er, 4),
            Rr("YuvToArgbRow", Tr, 4),
            Rr("YuvToRgba4444Row", Cr, 2),
            Rr("YuvToRgb565Row", _r, 2);
            var Dn = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396]
              , Mn = [0, 2, 8]
              , Un = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1]
              , Hn = 1;
            this.WebPDecodeRGBA = function(e, r, a, n, o) {
                var l = La
                  , i = new rr
                  , s = new le;
                i.ba = s,
                s.S = l,
                s.width = [s.width],
                s.height = [s.height];
                var c = s.width
                  , u = s.height
                  , h = new ie;
                if (null == h || null == e)
                    var d = 2;
                else
                    t(null != h),
                    d = Pr(e, r, a, h.width, h.height, h.Pd, h.Qd, h.format, null);
                if (0 != d ? c = 0 : (null != c && (c[0] = h.width[0]),
                null != u && (u[0] = h.height[0]),
                c = 1),
                c) {
                    s.width = s.width[0],
                    s.height = s.height[0],
                    null != n && (n[0] = s.width),
                    null != o && (o[0] = s.height);
                    e: {
                        if (n = new Qe,
                        (o = new ar).data = e,
                        o.w = r,
                        o.ha = a,
                        o.kd = 1,
                        r = [0],
                        t(null != o),
                        (0 == (e = Pr(o.data, o.w, o.ha, null, null, null, r, null, o)) || 7 == e) && r[0] && (e = 4),
                        0 == (r = e)) {
                            if (t(null != i),
                            n.data = o.data,
                            n.w = o.w + o.offset,
                            n.ha = o.ha - o.offset,
                            n.put = fe,
                            n.ac = de,
                            n.bc = me,
                            n.ma = i,
                            o.xa) {
                                if (null == (e = Ee())) {
                                    i = 1;
                                    break e
                                }
                                if (function(e, r) {
                                    var a = [0]
                                      , n = [0]
                                      , o = [0];
                                    t: for (; ; ) {
                                        if (null == e)
                                            return 0;
                                        if (null == r)
                                            return e.a = 2,
                                            0;
                                        if (e.l = r,
                                        e.a = 0,
                                        y(e.m, r.data, r.w, r.ha),
                                        !pe(e.m, a, n, o)) {
                                            e.a = 3;
                                            break t
                                        }
                                        if (e.xb = pn,
                                        r.width = a[0],
                                        r.height = n[0],
                                        !Ie(a[0], n[0], 1, e, null))
                                            break t;
                                        return 1
                                    }
                                    return t(0 != e.a),
                                    0
                                }(e, n)) {
                                    if (n = 0 == (r = Or(n.width, n.height, i.Oa, i.ba))) {
                                        t: {
                                            n = e;
                                            r: for (; ; ) {
                                                if (null == n) {
                                                    n = 0;
                                                    break t
                                                }
                                                if (t(null != n.s.yc),
                                                t(null != n.s.Ya),
                                                t(0 < n.s.Wb),
                                                t(null != (a = n.l)),
                                                t(null != (o = a.ma)),
                                                0 != n.xb) {
                                                    if (n.ca = o.ba,
                                                    n.tb = o.tb,
                                                    t(null != n.ca),
                                                    !$r(o.Oa, a, Da)) {
                                                        n.a = 2;
                                                        break r
                                                    }
                                                    if (!Re(n, a.width))
                                                        break r;
                                                    if (a.da)
                                                        break r;
                                                    if ((a.da || ae(n.ca.S)) && gr(),
                                                    11 > n.ca.S || (alert("todo:WebPInitConvertARGBToYUV"),
                                                    null != n.ca.f.kb.F && gr()),
                                                    n.Pb && 0 < n.s.ua && null == n.s.vb.X && !F(n.s.vb, n.s.Wa.Xa)) {
                                                        n.a = 1;
                                                        break r
                                                    }
                                                    n.xb = 0
                                                }
                                                if (!Ce(n, n.V, n.Ba, n.c, n.i, a.o, we))
                                                    break r;
                                                o.Dc = n.Ma,
                                                n = 1;
                                                break t
                                            }
                                            t(0 != n.a),
                                            n = 0
                                        }
                                        n = !n
                                    }
                                    n && (r = e.a)
                                } else
                                    r = e.a
                            } else {
                                if (null == (e = new Ge)) {
                                    i = 1;
                                    break e
                                }
                                if (e.Fa = o.na,
                                e.P = o.P,
                                e.qc = o.Sa,
                                Ye(e, n)) {
                                    if (0 == (r = Or(n.width, n.height, i.Oa, i.ba))) {
                                        if (e.Aa = 0,
                                        a = i.Oa,
                                        t(null != (o = e)),
                                        null != a) {
                                            if (0 < (c = 0 > (c = a.Md) ? 0 : 100 < c ? 255 : 255 * c / 100)) {
                                                for (u = h = 0; 4 > u; ++u)
                                                    12 > (d = o.pb[u]).lc && (d.ia = c * Un[0 > d.lc ? 0 : d.lc] >> 3),
                                                    h |= d.ia;
                                                h && (alert("todo:VP8InitRandom"),
                                                o.ia = 1)
                                            }
                                            o.Ga = a.Id,
                                            100 < o.Ga ? o.Ga = 100 : 0 > o.Ga && (o.Ga = 0)
                                        }
                                        Ze(e, n) || (r = e.a)
                                    }
                                } else
                                    r = e.a
                            }
                            0 == r && null != i.Oa && i.Oa.fd && (r = Lr(i.ba))
                        }
                        i = r
                    }
                    l = 0 != i ? null : 11 > l ? s.f.RGBA.eb : s.f.kb.y
                } else
                    l = null;
                return l
            }
            ;
            var qn = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1]
        }
        );
        var h = [0]
          , d = [0]
          , f = []
          , m = new Et
          , p = e
          , g = function(e, t) {
            var r = {}
              , a = 0
              , n = !1
              , o = 0
              , l = 0;
            if (r.frames = [],
            !/** @license
       * Copyright (c) 2017 Dominik Homberger

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    https://webpjs.appspot.com
    WebPRiffParser dominikhlbg@gmail.com
    */
            function(e, t, r, a) {
                for (var n = 0; n < 4; n++)
                    if (e[t + n] != "RIFF".charCodeAt(n))
                        return !0;
                return !1
            }(e, t)) {
                var i, h;
                for (u(e, t += 4),
                t += 8; t < e.length; ) {
                    var d = s(e, t)
                      , f = u(e, t += 4);
                    t += 4;
                    var m = f + (1 & f);
                    switch (d) {
                    case "VP8 ":
                    case "VP8L":
                        void 0 === r.frames[a] && (r.frames[a] = {}),
                        (y = r.frames[a]).src_off = n ? l : t - 8,
                        y.src_size = o + f + 8,
                        a++,
                        n && (n = !1,
                        o = 0,
                        l = 0);
                        break;
                    case "VP8X":
                        (y = r.header = {}).feature_flags = e[t];
                        var p = t + 4;
                        y.canvas_width = 1 + c(e, p),
                        p += 3,
                        y.canvas_height = 1 + c(e, p),
                        p += 3;
                        break;
                    case "ALPH":
                        n = !0,
                        o = m + 8,
                        l = t - 8;
                        break;
                    case "ANIM":
                        (y = r.header).bgcolor = u(e, t),
                        p = t + 4,
                        y.loop_count = (i = e)[(h = p) + 0] << 0 | i[h + 1] << 8,
                        p += 2;
                        break;
                    case "ANMF":
                        var g, y;
                        (y = r.frames[a] = {}).offset_x = 2 * c(e, t),
                        t += 3,
                        y.offset_y = 2 * c(e, t),
                        t += 3,
                        y.width = 1 + c(e, t),
                        t += 3,
                        y.height = 1 + c(e, t),
                        t += 3,
                        y.duration = c(e, t),
                        t += 3,
                        g = e[t++],
                        y.dispose = 1 & g,
                        y.blend = g >> 1 & 1
                    }
                    "ANMF" != d && (t += m)
                }
                return r
            }
        }(p, 0);
        g.response = p,
        g.rgbaoutput = !0,
        g.dataurl = !1;
        var y = g.header ? g.header : null
          , v = g.frames ? g.frames : null;
        if (y) {
            y.loop_counter = y.loop_count,
            h = [y.canvas_height],
            d = [y.canvas_width];
            for (var A = 0; A < v.length && 0 != v[A].blend; A++)
                ;
        }
        var b = v[0]
          , k = m.WebPDecodeRGBA(p, b.src_off, b.src_size, d, h);
        b.rgba = k,
        b.imgwidth = d[0],
        b.imgheight = h[0];
        for (var w = 0; w < d[0] * h[0] * 4; w++)
            f[w] = k[w];
        return this.width = d,
        this.height = h,
        this.data = f,
        this
    }
    /**
     * @license
     *
     * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    !function(e) {
        var t = function(t, n, c, u) {
            var h = 5
              , d = l;
            switch (u) {
            case e.image_compression.FAST:
                h = 3,
                d = o;
                break;
            case e.image_compression.MEDIUM:
                h = 6,
                d = i;
                break;
            case e.image_compression.SLOW:
                h = 9,
                d = s
            }
            t = a(t, n, c, d);
            var f = new Uint8Array(r(h))
              , m = g.API.adler32cs.fromBuffer(t.buffer)
              , p = new xt(h)
              , y = p.append(t)
              , v = p.flush()
              , A = f.length + y.length + v.length
              , b = new Uint8Array(A + 4);
            return b.set(f),
            b.set(y, f.length),
            b.set(v, f.length + y.length),
            b[A++] = m >>> 24 & 255,
            b[A++] = m >>> 16 & 255,
            b[A++] = m >>> 8 & 255,
            b[A++] = 255 & m,
            e.__addimage__.arrayBufferToBinaryString(b)
        }
          , r = function(e) {
            var t = 30720;
            return t |= Math.min(3, (e - 1 & 255) >> 1) << 6,
            t |= 0,
            [120, 255 & (t += 31 - t % 31)]
        }
          , a = function(e, t, r, a) {
            for (var n, o, l, i = e.length / t, s = new Uint8Array(e.length + i), c = u(), d = 0; d < i; d += 1) {
                if (l = d * t,
                n = e.subarray(l, l + t),
                a)
                    s.set(a(n, r, o), l + d);
                else {
                    for (var f, m = c.length, p = []; f < m; f += 1)
                        p[f] = c[f](n, r, o);
                    var g = h(p.concat());
                    s.set(p[g], l + d)
                }
                o = n
            }
            return s
        }
          , n = function(e) {
            var t = Array.apply([], e);
            return t.unshift(0),
            t
        }
          , o = function(e, t) {
            var r, a = [], n = e.length;
            a[0] = 1;
            for (var o = 0; o < n; o += 1)
                r = e[o - t] || 0,
                a[o + 1] = e[o] - r + 256 & 255;
            return a
        }
          , l = function(e, t, r) {
            var a, n = [], o = e.length;
            n[0] = 2;
            for (var l = 0; l < o; l += 1)
                a = r && r[l] || 0,
                n[l + 1] = e[l] - a + 256 & 255;
            return n
        }
          , i = function(e, t, r) {
            var a, n, o = [], l = e.length;
            o[0] = 3;
            for (var i = 0; i < l; i += 1)
                a = e[i - t] || 0,
                n = r && r[i] || 0,
                o[i + 1] = e[i] + 256 - (a + n >>> 1) & 255;
            return o
        }
          , s = function(e, t, r) {
            var a, n, o, l, i = [], s = e.length;
            i[0] = 4;
            for (var u = 0; u < s; u += 1)
                a = e[u - t] || 0,
                n = r && r[u] || 0,
                o = r && r[u - t] || 0,
                l = c(a, n, o),
                i[u + 1] = e[u] - l + 256 & 255;
            return i
        }
          , c = function(e, t, r) {
            if (e === t && t === r)
                return e;
            var a = Math.abs(t - r)
              , n = Math.abs(e - r)
              , o = Math.abs(e + t - r - r);
            return a <= n && a <= o ? e : n <= o ? t : r
        }
          , u = function() {
            return [n, o, l, i, s]
        }
          , h = function(e) {
            var t = e.map((function(e) {
                return e.reduce((function(e, t) {
                    return e + Math.abs(t)
                }
                ), 0)
            }
            ));
            return t.indexOf(Math.min.apply(null, t))
        };
        e.processPNG = function(r, a, n, o) {
            var l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k = this.decode.FLATE_DECODE, w = "";
            if (this.__addimage__.isArrayBuffer(r) && (r = new Uint8Array(r)),
            this.__addimage__.isArrayBufferView(r)) {
                if (r = (s = new Ct(r)).imgData,
                i = s.bits,
                l = s.colorSpace,
                u = s.colors,
                -1 !== [4, 6].indexOf(s.colorType)) {
                    if (8 === s.bits) {
                        m = (f = 32 == s.pixelBitlength ? new Uint32Array(s.decodePixels().buffer) : 16 == s.pixelBitlength ? new Uint16Array(s.decodePixels().buffer) : new Uint8Array(s.decodePixels().buffer)).length,
                        g = new Uint8Array(m * s.colors),
                        p = new Uint8Array(m);
                        var x, S = s.pixelBitlength - s.bits;
                        for (A = 0,
                        b = 0; A < m; A++) {
                            for (v = f[A],
                            x = 0; x < S; )
                                g[b++] = v >>> x & 255,
                                x += s.bits;
                            p[A] = v >>> x & 255
                        }
                    }
                    if (16 === s.bits) {
                        m = (f = new Uint32Array(s.decodePixels().buffer)).length,
                        g = new Uint8Array(m * (32 / s.pixelBitlength) * s.colors),
                        p = new Uint8Array(m * (32 / s.pixelBitlength)),
                        y = s.colors > 1,
                        A = 0,
                        b = 0;
                        for (var _ = 0; A < m; )
                            v = f[A++],
                            g[b++] = v >>> 0 & 255,
                            y && (g[b++] = v >>> 16 & 255,
                            v = f[A++],
                            g[b++] = v >>> 0 & 255),
                            p[_++] = v >>> 16 & 255;
                        i = 8
                    }
                    o !== e.image_compression.NONE ? (r = t(g, s.width * s.colors, s.colors, o),
                    d = t(p, s.width, 1, o)) : (r = g,
                    d = p,
                    k = void 0)
                }
                if (3 === s.colorType && (l = this.color_spaces.INDEXED,
                h = s.palette,
                s.transparency.indexed)) {
                    var C = s.transparency.indexed
                      , T = 0;
                    for (A = 0,
                    m = C.length; A < m; ++A)
                        T += C[A];
                    if ((T /= 255) == m - 1 && -1 !== C.indexOf(0))
                        c = [C.indexOf(0)];
                    else if (T !== m) {
                        for (f = s.decodePixels(),
                        p = new Uint8Array(f.length),
                        A = 0,
                        m = f.length; A < m; A++)
                            p[A] = C[f[A]];
                        d = t(p, s.width, 1)
                    }
                }
                var E = function(t) {
                    var r;
                    switch (t) {
                    case e.image_compression.FAST:
                        r = 11;
                        break;
                    case e.image_compression.MEDIUM:
                        r = 13;
                        break;
                    case e.image_compression.SLOW:
                        r = 14;
                        break;
                    default:
                        r = 12
                    }
                    return r
                }(o);
                return k === this.decode.FLATE_DECODE && (w = "/Predictor " + E + " "),
                w += "/Colors " + u + " /BitsPerComponent " + i + " /Columns " + s.width,
                (this.__addimage__.isArrayBuffer(r) || this.__addimage__.isArrayBufferView(r)) && (r = this.__addimage__.arrayBufferToBinaryString(r)),
                (d && this.__addimage__.isArrayBuffer(d) || this.__addimage__.isArrayBufferView(d)) && (d = this.__addimage__.arrayBufferToBinaryString(d)),
                {
                    alias: n,
                    data: r,
                    index: a,
                    filter: k,
                    decodeParameters: w,
                    transparency: c,
                    palette: h,
                    sMask: d,
                    predictor: E,
                    width: s.width,
                    height: s.height,
                    bitsPerComponent: i,
                    colorSpace: l
                }
            }
        }
    }(g.API),
    function(e) {
        e.processGIF89A = function(t, r, a, n) {
            var o = new jt(t)
              , l = o.width
              , i = o.height
              , s = [];
            o.decodeAndBlitFrameRGBA(0, s);
            var c = {
                data: s,
                width: l,
                height: i
            }
              , u = new Ot(100).encode(c, 100);
            return e.processJPEG.call(this, u, r, a, n)
        }
        ,
        e.processGIF87A = e.processGIF89A
    }(g.API),
    Mt.prototype.parseHeader = function() {
        if (this.fileSize = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.reserved = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.offset = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.headerSize = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.width = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.height = this.datav.getInt32(this.pos, !0),
        this.pos += 4,
        this.planes = this.datav.getUint16(this.pos, !0),
        this.pos += 2,
        this.bitPP = this.datav.getUint16(this.pos, !0),
        this.pos += 2,
        this.compress = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.rawSize = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.hr = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.vr = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.colors = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        this.importantColors = this.datav.getUint32(this.pos, !0),
        this.pos += 4,
        16 === this.bitPP && this.is_with_alpha && (this.bitPP = 15),
        this.bitPP < 15) {
            var e = 0 === this.colors ? 1 << this.bitPP : this.colors;
            this.palette = new Array(e);
            for (var t = 0; t < e; t++) {
                var r = this.datav.getUint8(this.pos++, !0)
                  , a = this.datav.getUint8(this.pos++, !0)
                  , n = this.datav.getUint8(this.pos++, !0)
                  , o = this.datav.getUint8(this.pos++, !0);
                this.palette[t] = {
                    red: n,
                    green: a,
                    blue: r,
                    quad: o
                }
            }
        }
        this.height < 0 && (this.height *= -1,
        this.bottom_up = !1)
    }
    ,
    Mt.prototype.parseBGR = function() {
        this.pos = this.offset;
        try {
            var e = "bit" + this.bitPP
              , t = this.width * this.height * 4;
            this.data = new Uint8Array(t),
            this[e]()
        } catch (e) {
            n.log("bit decode error:" + e)
        }
    }
    ,
    Mt.prototype.bit1 = function() {
        var e, t = Math.ceil(this.width / 8), r = t % 4;
        for (e = this.height - 1; e >= 0; e--) {
            for (var a = this.bottom_up ? e : this.height - 1 - e, n = 0; n < t; n++)
                for (var o = this.datav.getUint8(this.pos++, !0), l = a * this.width * 4 + 8 * n * 4, i = 0; i < 8 && 8 * n + i < this.width; i++) {
                    var s = this.palette[o >> 7 - i & 1];
                    this.data[l + 4 * i] = s.blue,
                    this.data[l + 4 * i + 1] = s.green,
                    this.data[l + 4 * i + 2] = s.red,
                    this.data[l + 4 * i + 3] = 255
                }
            0 !== r && (this.pos += 4 - r)
        }
    }
    ,
    Mt.prototype.bit4 = function() {
        for (var e = Math.ceil(this.width / 2), t = e % 4, r = this.height - 1; r >= 0; r--) {
            for (var a = this.bottom_up ? r : this.height - 1 - r, n = 0; n < e; n++) {
                var o = this.datav.getUint8(this.pos++, !0)
                  , l = a * this.width * 4 + 2 * n * 4
                  , i = o >> 4
                  , s = 15 & o
                  , c = this.palette[i];
                if (this.data[l] = c.blue,
                this.data[l + 1] = c.green,
                this.data[l + 2] = c.red,
                this.data[l + 3] = 255,
                2 * n + 1 >= this.width)
                    break;
                c = this.palette[s],
                this.data[l + 4] = c.blue,
                this.data[l + 4 + 1] = c.green,
                this.data[l + 4 + 2] = c.red,
                this.data[l + 4 + 3] = 255
            }
            0 !== t && (this.pos += 4 - t)
        }
    }
    ,
    Mt.prototype.bit8 = function() {
        for (var e = this.width % 4, t = this.height - 1; t >= 0; t--) {
            for (var r = this.bottom_up ? t : this.height - 1 - t, a = 0; a < this.width; a++) {
                var n = this.datav.getUint8(this.pos++, !0)
                  , o = r * this.width * 4 + 4 * a;
                if (n < this.palette.length) {
                    var l = this.palette[n];
                    this.data[o] = l.red,
                    this.data[o + 1] = l.green,
                    this.data[o + 2] = l.blue,
                    this.data[o + 3] = 255
                } else
                    this.data[o] = 255,
                    this.data[o + 1] = 255,
                    this.data[o + 2] = 255,
                    this.data[o + 3] = 255
            }
            0 !== e && (this.pos += 4 - e)
        }
    }
    ,
    Mt.prototype.bit15 = function() {
        for (var e = this.width % 3, t = parseInt("11111", 2), r = this.height - 1; r >= 0; r--) {
            for (var a = this.bottom_up ? r : this.height - 1 - r, n = 0; n < this.width; n++) {
                var o = this.datav.getUint16(this.pos, !0);
                this.pos += 2;
                var l = (o & t) / t * 255 | 0
                  , i = (o >> 5 & t) / t * 255 | 0
                  , s = (o >> 10 & t) / t * 255 | 0
                  , c = o >> 15 ? 255 : 0
                  , u = a * this.width * 4 + 4 * n;
                this.data[u] = s,
                this.data[u + 1] = i,
                this.data[u + 2] = l,
                this.data[u + 3] = c
            }
            this.pos += e
        }
    }
    ,
    Mt.prototype.bit16 = function() {
        for (var e = this.width % 3, t = parseInt("11111", 2), r = parseInt("111111", 2), a = this.height - 1; a >= 0; a--) {
            for (var n = this.bottom_up ? a : this.height - 1 - a, o = 0; o < this.width; o++) {
                var l = this.datav.getUint16(this.pos, !0);
                this.pos += 2;
                var i = (l & t) / t * 255 | 0
                  , s = (l >> 5 & r) / r * 255 | 0
                  , c = (l >> 11) / t * 255 | 0
                  , u = n * this.width * 4 + 4 * o;
                this.data[u] = c,
                this.data[u + 1] = s,
                this.data[u + 2] = i,
                this.data[u + 3] = 255
            }
            this.pos += e
        }
    }
    ,
    Mt.prototype.bit24 = function() {
        for (var e = this.height - 1; e >= 0; e--) {
            for (var t = this.bottom_up ? e : this.height - 1 - e, r = 0; r < this.width; r++) {
                var a = this.datav.getUint8(this.pos++, !0)
                  , n = this.datav.getUint8(this.pos++, !0)
                  , o = this.datav.getUint8(this.pos++, !0)
                  , l = t * this.width * 4 + 4 * r;
                this.data[l] = o,
                this.data[l + 1] = n,
                this.data[l + 2] = a,
                this.data[l + 3] = 255
            }
            this.pos += this.width % 4
        }
    }
    ,
    Mt.prototype.bit32 = function() {
        for (var e = this.height - 1; e >= 0; e--)
            for (var t = this.bottom_up ? e : this.height - 1 - e, r = 0; r < this.width; r++) {
                var a = this.datav.getUint8(this.pos++, !0)
                  , n = this.datav.getUint8(this.pos++, !0)
                  , o = this.datav.getUint8(this.pos++, !0)
                  , l = this.datav.getUint8(this.pos++, !0)
                  , i = t * this.width * 4 + 4 * r;
                this.data[i] = o,
                this.data[i + 1] = n,
                this.data[i + 2] = a,
                this.data[i + 3] = l
            }
    }
    ,
    Mt.prototype.getData = function() {
        return this.data
    }
    ,
    /**
     * @license
     * Copyright (c) 2018 Aras Abbasi
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        e.processBMP = function(t, r, a, n) {
            var o = new Mt(t,!1)
              , l = o.width
              , i = o.height
              , s = {
                data: o.getData(),
                width: l,
                height: i
            }
              , c = new Ot(100).encode(s, 100);
            return e.processJPEG.call(this, c, r, a, n)
        }
    }(g.API),
    Et.prototype.getData = function() {
        return this.data
    }
    ,
    /**
     * @license
     * Copyright (c) 2019 Aras Abbasi
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        e.processWEBP = function(t, r, a, n) {
            var o = new Et(t,!1)
              , l = o.width
              , i = o.height
              , s = {
                data: o.getData(),
                width: l,
                height: i
            }
              , c = new Ot(100).encode(s, 100);
            return e.processJPEG.call(this, c, r, a, n)
        }
    }(g.API),
    g.API.setLanguage = function(e) {
        return void 0 === this.internal.languageSettings && (this.internal.languageSettings = {},
        this.internal.languageSettings.isSubscribed = !1),
        void 0 !== {
            af: "Afrikaans",
            sq: "Albanian",
            ar: "Arabic (Standard)",
            "ar-DZ": "Arabic (Algeria)",
            "ar-BH": "Arabic (Bahrain)",
            "ar-EG": "Arabic (Egypt)",
            "ar-IQ": "Arabic (Iraq)",
            "ar-JO": "Arabic (Jordan)",
            "ar-KW": "Arabic (Kuwait)",
            "ar-LB": "Arabic (Lebanon)",
            "ar-LY": "Arabic (Libya)",
            "ar-MA": "Arabic (Morocco)",
            "ar-OM": "Arabic (Oman)",
            "ar-QA": "Arabic (Qatar)",
            "ar-SA": "Arabic (Saudi Arabia)",
            "ar-SY": "Arabic (Syria)",
            "ar-TN": "Arabic (Tunisia)",
            "ar-AE": "Arabic (U.A.E.)",
            "ar-YE": "Arabic (Yemen)",
            an: "Aragonese",
            hy: "Armenian",
            as: "Assamese",
            ast: "Asturian",
            az: "Azerbaijani",
            eu: "Basque",
            be: "Belarusian",
            bn: "Bengali",
            bs: "Bosnian",
            br: "Breton",
            bg: "Bulgarian",
            my: "Burmese",
            ca: "Catalan",
            ch: "Chamorro",
            ce: "Chechen",
            zh: "Chinese",
            "zh-HK": "Chinese (Hong Kong)",
            "zh-CN": "Chinese (PRC)",
            "zh-SG": "Chinese (Singapore)",
            "zh-TW": "Chinese (Taiwan)",
            cv: "Chuvash",
            co: "Corsican",
            cr: "Cree",
            hr: "Croatian",
            cs: "Czech",
            da: "Danish",
            nl: "Dutch (Standard)",
            "nl-BE": "Dutch (Belgian)",
            en: "English",
            "en-AU": "English (Australia)",
            "en-BZ": "English (Belize)",
            "en-CA": "English (Canada)",
            "en-IE": "English (Ireland)",
            "en-JM": "English (Jamaica)",
            "en-NZ": "English (New Zealand)",
            "en-PH": "English (Philippines)",
            "en-ZA": "English (South Africa)",
            "en-TT": "English (Trinidad & Tobago)",
            "en-GB": "English (United Kingdom)",
            "en-US": "English (United States)",
            "en-ZW": "English (Zimbabwe)",
            eo: "Esperanto",
            et: "Estonian",
            fo: "Faeroese",
            fj: "Fijian",
            fi: "Finnish",
            fr: "French (Standard)",
            "fr-BE": "French (Belgium)",
            "fr-CA": "French (Canada)",
            "fr-FR": "French (France)",
            "fr-LU": "French (Luxembourg)",
            "fr-MC": "French (Monaco)",
            "fr-CH": "French (Switzerland)",
            fy: "Frisian",
            fur: "Friulian",
            gd: "Gaelic (Scots)",
            "gd-IE": "Gaelic (Irish)",
            gl: "Galacian",
            ka: "Georgian",
            de: "German (Standard)",
            "de-AT": "German (Austria)",
            "de-DE": "German (Germany)",
            "de-LI": "German (Liechtenstein)",
            "de-LU": "German (Luxembourg)",
            "de-CH": "German (Switzerland)",
            el: "Greek",
            gu: "Gujurati",
            ht: "Haitian",
            he: "Hebrew",
            hi: "Hindi",
            hu: "Hungarian",
            is: "Icelandic",
            id: "Indonesian",
            iu: "Inuktitut",
            ga: "Irish",
            it: "Italian (Standard)",
            "it-CH": "Italian (Switzerland)",
            ja: "Japanese",
            kn: "Kannada",
            ks: "Kashmiri",
            kk: "Kazakh",
            km: "Khmer",
            ky: "Kirghiz",
            tlh: "Klingon",
            ko: "Korean",
            "ko-KP": "Korean (North Korea)",
            "ko-KR": "Korean (South Korea)",
            la: "Latin",
            lv: "Latvian",
            lt: "Lithuanian",
            lb: "Luxembourgish",
            mk: "FYRO Macedonian",
            ms: "Malay",
            ml: "Malayalam",
            mt: "Maltese",
            mi: "Maori",
            mr: "Marathi",
            mo: "Moldavian",
            nv: "Navajo",
            ng: "Ndonga",
            ne: "Nepali",
            no: "Norwegian",
            nb: "Norwegian (Bokmal)",
            nn: "Norwegian (Nynorsk)",
            oc: "Occitan",
            or: "Oriya",
            om: "Oromo",
            fa: "Persian",
            "fa-IR": "Persian/Iran",
            pl: "Polish",
            pt: "Portuguese",
            "pt-BR": "Portuguese (Brazil)",
            pa: "Punjabi",
            "pa-IN": "Punjabi (India)",
            "pa-PK": "Punjabi (Pakistan)",
            qu: "Quechua",
            rm: "Rhaeto-Romanic",
            ro: "Romanian",
            "ro-MO": "Romanian (Moldavia)",
            ru: "Russian",
            "ru-MO": "Russian (Moldavia)",
            sz: "Sami (Lappish)",
            sg: "Sango",
            sa: "Sanskrit",
            sc: "Sardinian",
            sd: "Sindhi",
            si: "Singhalese",
            sr: "Serbian",
            sk: "Slovak",
            sl: "Slovenian",
            so: "Somani",
            sb: "Sorbian",
            es: "Spanish",
            "es-AR": "Spanish (Argentina)",
            "es-BO": "Spanish (Bolivia)",
            "es-CL": "Spanish (Chile)",
            "es-CO": "Spanish (Colombia)",
            "es-CR": "Spanish (Costa Rica)",
            "es-DO": "Spanish (Dominican Republic)",
            "es-EC": "Spanish (Ecuador)",
            "es-SV": "Spanish (El Salvador)",
            "es-GT": "Spanish (Guatemala)",
            "es-HN": "Spanish (Honduras)",
            "es-MX": "Spanish (Mexico)",
            "es-NI": "Spanish (Nicaragua)",
            "es-PA": "Spanish (Panama)",
            "es-PY": "Spanish (Paraguay)",
            "es-PE": "Spanish (Peru)",
            "es-PR": "Spanish (Puerto Rico)",
            "es-ES": "Spanish (Spain)",
            "es-UY": "Spanish (Uruguay)",
            "es-VE": "Spanish (Venezuela)",
            sx: "Sutu",
            sw: "Swahili",
            sv: "Swedish",
            "sv-FI": "Swedish (Finland)",
            "sv-SV": "Swedish (Sweden)",
            ta: "Tamil",
            tt: "Tatar",
            te: "Teluga",
            th: "Thai",
            tig: "Tigre",
            ts: "Tsonga",
            tn: "Tswana",
            tr: "Turkish",
            tk: "Turkmen",
            uk: "Ukrainian",
            hsb: "Upper Sorbian",
            ur: "Urdu",
            ve: "Venda",
            vi: "Vietnamese",
            vo: "Volapuk",
            wa: "Walloon",
            cy: "Welsh",
            xh: "Xhosa",
            ji: "Yiddish",
            zu: "Zulu"
        }[e] && (this.internal.languageSettings.languageCode = e,
        !1 === this.internal.languageSettings.isSubscribed && (this.internal.events.subscribe("putCatalog", (function() {
            this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")")
        }
        )),
        this.internal.languageSettings.isSubscribed = !0)),
        this
        /** @license
     * MIT license.
     * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
     *               2014 Diego Casorran, https://github.com/diegocr
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    }
    ,
    At = g.API,
    _t = At.getCharWidthsArray = function(e, t) {
        var r, a, n = (t = t || {}).font || this.internal.getFont(), o = t.fontSize || this.internal.getFontSize(), l = t.charSpace || this.internal.getCharSpace(), i = t.widths ? t.widths : n.metadata.Unicode.widths, s = i.fof ? i.fof : 1, c = t.kerning ? t.kerning : n.metadata.Unicode.kerning, u = c.fof ? c.fof : 1, h = !1 !== t.doKerning, d = 0, f = e.length, m = 0, p = i[0] || s, g = [];
        for (r = 0; r < f; r++)
            a = e.charCodeAt(r),
            "function" == typeof n.metadata.widthOfString ? g.push((n.metadata.widthOfGlyph(n.metadata.characterToGlyph(a)) + l * (1e3 / o) || 0) / 1e3) : (d = h && "object" == typeof c[a] && !isNaN(parseInt(c[a][m], 10)) ? c[a][m] / u : 0,
            g.push((i[a] || p) / s + d)),
            m = a;
        return g
    }
    ,
    St = At.getStringUnitWidth = function(e, t) {
        var r = (t = t || {}).fontSize || this.internal.getFontSize()
          , a = t.font || this.internal.getFont()
          , n = t.charSpace || this.internal.getCharSpace();
        return At.processArabic && (e = At.processArabic(e)),
        "function" == typeof a.metadata.widthOfString ? a.metadata.widthOfString(e, r, n) / r : _t.apply(this, arguments).reduce((function(e, t) {
            return e + t
        }
        ), 0)
    }
    ,
    Pt = function(e, t, r, a) {
        for (var n = [], o = 0, l = e.length, i = 0; o !== l && i + t[o] < r; )
            i += t[o],
            o++;
        n.push(e.slice(0, o));
        var s = o;
        for (i = 0; o !== l; )
            i + t[o] > a && (n.push(e.slice(s, o)),
            i = 0,
            s = o),
            i += t[o],
            o++;
        return s !== o && n.push(e.slice(s, o)),
        n
    }
    ,
    kt = function(e, t, r) {
        r || (r = {});
        var a, n, o, l, i, s, c, u = [], h = [u], d = r.textIndent || 0, f = 0, m = 0, p = e.split(" "), g = _t.apply(this, [" ", r])[0];
        if (s = -1 === r.lineIndent ? p[0].length + 2 : r.lineIndent || 0) {
            var y = Array(s).join(" ")
              , v = [];
            p.map((function(e) {
                (e = e.split(/\s*\n/)).length > 1 ? v = v.concat(e.map((function(e, t) {
                    return (t && e.length ? "\n" : "") + e
                }
                ))) : v.push(e[0])
            }
            )),
            p = v,
            s = St.apply(this, [y, r])
        }
        for (o = 0,
        l = p.length; o < l; o++) {
            var A = 0;
            if (a = p[o],
            s && "\n" == a[0] && (a = a.substr(1),
            A = 1),
            d + f + (m = (n = _t.apply(this, [a, r])).reduce((function(e, t) {
                return e + t
            }
            ), 0)) > t || A) {
                if (m > t) {
                    for (i = Pt.apply(this, [a, n, t - (d + f), t]),
                    u.push(i.shift()),
                    u = [i.pop()]; i.length; )
                        h.push([i.shift()]);
                    m = n.slice(a.length - (u[0] ? u[0].length : 0)).reduce((function(e, t) {
                        return e + t
                    }
                    ), 0)
                } else
                    u = [a];
                h.push(u),
                d = m + s,
                f = g
            } else
                u.push(a),
                d += f + m,
                f = g
        }
        return c = s ? function(e, t) {
            return (t ? y : "") + e.join(" ")
        }
        : function(e) {
            return e.join(" ")
        }
        ,
        h.map(c)
    }
    ,
    At.splitTextToSize = function(e, t, r) {
        var a, n = (r = r || {}).fontSize || this.internal.getFontSize(), o = function(e) {
            if (e.widths && e.kerning)
                return {
                    widths: e.widths,
                    kerning: e.kerning
                };
            var t = this.internal.getFont(e.fontName, e.fontStyle);
            return t.metadata.Unicode ? {
                widths: t.metadata.Unicode.widths || {
                    0: 1
                },
                kerning: t.metadata.Unicode.kerning || {}
            } : {
                font: t.metadata,
                fontSize: this.internal.getFontSize(),
                charSpace: this.internal.getCharSpace()
            }
        }
        .call(this, r);
        a = Array.isArray(e) ? e : String(e).split(/\r?\n/);
        var l = 1 * this.internal.scaleFactor * t / n;
        o.textIndent = r.textIndent ? 1 * r.textIndent * this.internal.scaleFactor / n : 0,
        o.lineIndent = r.lineIndent;
        var i, s, c = [];
        for (i = 0,
        s = a.length; i < s; i++)
            c = c.concat(kt.apply(this, [a[i], l, o]));
        return c
    }
    ,
    /** @license
     jsPDF standard_fonts_metrics plugin
     * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
     * MIT license.
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     * 
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     * 
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    function(e) {
        e.__fontmetrics__ = e.__fontmetrics__ || {};
        for (var t = "klmnopqrstuvwxyz", r = {}, a = {}, n = 0; n < t.length; n++)
            r[t[n]] = "0123456789abcdef"[n],
            a["0123456789abcdef"[n]] = t[n];
        var o = function(e) {
            return "0x" + parseInt(e, 10).toString(16)
        }
          , l = e.__fontmetrics__.compress = function(e) {
            var t, r, n, i, s = ["{"];
            for (var c in e) {
                if (t = e[c],
                isNaN(parseInt(c, 10)) ? r = "'" + c + "'" : (c = parseInt(c, 10),
                r = (r = o(c).slice(2)).slice(0, -1) + a[r.slice(-1)]),
                "number" == typeof t)
                    t < 0 ? (n = o(t).slice(3),
                    i = "-") : (n = o(t).slice(2),
                    i = ""),
                    n = i + n.slice(0, -1) + a[n.slice(-1)];
                else {
                    if ("object" != typeof t)
                        throw new Error("Don't know what to do with value type " + typeof t + ".");
                    n = l(t)
                }
                s.push(r + n)
            }
            return s.push("}"),
            s.join("")
        }
          , i = e.__fontmetrics__.uncompress = function(e) {
            if ("string" != typeof e)
                throw new Error("Invalid argument passed to uncompress.");
            for (var t, a, n, o, l = {}, i = 1, s = l, c = [], u = "", h = "", d = e.length - 1, f = 1; f < d; f += 1)
                "'" == (o = e[f]) ? t ? (n = t.join(""),
                t = void 0) : t = [] : t ? t.push(o) : "{" == o ? (c.push([s, n]),
                s = {},
                n = void 0) : "}" == o ? ((a = c.pop())[0][a[1]] = s,
                n = void 0,
                s = a[0]) : "-" == o ? i = -1 : void 0 === n ? r.hasOwnProperty(o) ? (u += r[o],
                n = parseInt(u, 16) * i,
                i = 1,
                u = "") : u += o : r.hasOwnProperty(o) ? (h += r[o],
                s[n] = parseInt(h, 16) * i,
                i = 1,
                n = void 0,
                h = "") : h += o;
            return l
        }
          , s = {
            codePages: ["WinAnsiEncoding"],
            WinAnsiEncoding: i("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")
        }
          , c = {
            Unicode: {
                Courier: s,
                "Courier-Bold": s,
                "Courier-BoldOblique": s,
                "Courier-Oblique": s,
                Helvetica: s,
                "Helvetica-Bold": s,
                "Helvetica-BoldOblique": s,
                "Helvetica-Oblique": s,
                "Times-Roman": s,
                "Times-Bold": s,
                "Times-BoldItalic": s,
                "Times-Italic": s
            }
        }
          , u = {
            Unicode: {
                "Courier-Oblique": i("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
                "Times-BoldItalic": i("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),
                "Helvetica-Bold": i("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
                Courier: i("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
                "Courier-BoldOblique": i("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
                "Times-Bold": i("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),
                Symbol: i("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),
                Helvetica: i("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),
                "Helvetica-BoldOblique": i("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
                ZapfDingbats: i("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),
                "Courier-Bold": i("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
                "Times-Italic": i("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),
                "Times-Roman": i("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),
                "Helvetica-Oblique": i("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")
            }
        };
        e.events.push(["addFont", function(e) {
            var t = e.font
              , r = u.Unicode[t.postScriptName];
            r && (t.metadata.Unicode = {},
            t.metadata.Unicode.widths = r.widths,
            t.metadata.Unicode.kerning = r.kerning);
            var a = c.Unicode[t.postScriptName];
            a && (t.metadata.Unicode.encoding = a,
            t.encoding = a.codePages[0])
        }
        ])
    }(g.API),
    /**
     * @license
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = function(e) {
            for (var t = e.length, r = new Uint8Array(t), a = 0; a < t; a++)
                r[a] = e.charCodeAt(a);
            return r
        };
        e.API.events.push(["addFont", function(r) {
            var a = void 0
              , n = r.font
              , l = r.instance;
            if (!n.isStandardFont) {
                if (void 0 === l)
                    throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + n.postScriptName + "').");
                if ("string" != typeof (a = !1 === l.existsFileInVFS(n.postScriptName) ? l.loadFile(n.postScriptName) : l.getFileFromVFS(n.postScriptName)))
                    throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + n.postScriptName + "').");
                !function(r, a) {
                    a = /^\x00\x01\x00\x00/.test(a) ? t(a) : t(o(a)),
                    r.metadata = e.API.TTFFont.open(a),
                    r.metadata.Unicode = r.metadata.Unicode || {
                        encoding: {},
                        kerning: {},
                        widths: []
                    },
                    r.metadata.glyIdsUsed = [0]
                }(n, a)
            }
        }
        ])
    }(g),
    /** @license
     * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    function(e) {
        function r() {
            return (t.canvg ? Promise.resolve(t.canvg) : Promise.resolve().then((function() {
                return index_es
            }
            ))).catch((function(e) {
                return Promise.reject(new Error("Could not load dompurify: " + e))
            }
            )).then((function(e) {
                return e.default ? e.default : e
            }
            ))
        }
        g.API.addSvgAsImage = function(e, t, a, o, l, i, s, c) {
            if (isNaN(t) || isNaN(a))
                throw n.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments),
                new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
            if (isNaN(o) || isNaN(l))
                throw n.error("jsPDF.addSvgAsImage: Invalid measurements", arguments),
                new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
            var u = document.createElement("canvas");
            u.width = o,
            u.height = l;
            var h = u.getContext("2d");
            h.fillStyle = "#fff",
            h.fillRect(0, 0, u.width, u.height);
            var d = {
                ignoreMouse: !0,
                ignoreAnimation: !0,
                ignoreDimensions: !0
            }
              , f = this;
            return r().then((function(t) {
                return t.Canvg.fromString(h, e, d)
            }
            ), (function() {
                return Promise.reject(new Error("Could not load canvg."))
            }
            )).then((function(e) {
                return e.render(d)
            }
            )).then((function() {
                f.addImage(u.toDataURL("image/jpeg", 1), t, a, o, l, s, c)
            }
            ))
        }
    }(),
    g.API.putTotalPages = function(e) {
        var t, r = 0;
        parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (t = new RegExp(e,"g"),
        r = this.internal.getNumberOfPages()) : (t = new RegExp(this.pdfEscape16(e, this.internal.getFont()),"g"),
        r = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
        for (var a = 1; a <= this.internal.getNumberOfPages(); a++)
            for (var n = 0; n < this.internal.pages[a].length; n++)
                this.internal.pages[a][n] = this.internal.pages[a][n].replace(t, r);
        return this
    }
    ,
    g.API.viewerPreferences = function(e, t) {
        var r;
        e = e || {},
        t = t || !1;
        var a, n, o, l = {
            HideToolbar: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.3
            },
            HideMenubar: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.3
            },
            HideWindowUI: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.3
            },
            FitWindow: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.3
            },
            CenterWindow: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.3
            },
            DisplayDocTitle: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.4
            },
            NonFullScreenPageMode: {
                defaultValue: "UseNone",
                value: "UseNone",
                type: "name",
                explicitSet: !1,
                valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"],
                pdfVersion: 1.3
            },
            Direction: {
                defaultValue: "L2R",
                value: "L2R",
                type: "name",
                explicitSet: !1,
                valueSet: ["L2R", "R2L"],
                pdfVersion: 1.3
            },
            ViewArea: {
                defaultValue: "CropBox",
                value: "CropBox",
                type: "name",
                explicitSet: !1,
                valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
                pdfVersion: 1.4
            },
            ViewClip: {
                defaultValue: "CropBox",
                value: "CropBox",
                type: "name",
                explicitSet: !1,
                valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
                pdfVersion: 1.4
            },
            PrintArea: {
                defaultValue: "CropBox",
                value: "CropBox",
                type: "name",
                explicitSet: !1,
                valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
                pdfVersion: 1.4
            },
            PrintClip: {
                defaultValue: "CropBox",
                value: "CropBox",
                type: "name",
                explicitSet: !1,
                valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"],
                pdfVersion: 1.4
            },
            PrintScaling: {
                defaultValue: "AppDefault",
                value: "AppDefault",
                type: "name",
                explicitSet: !1,
                valueSet: ["AppDefault", "None"],
                pdfVersion: 1.6
            },
            Duplex: {
                defaultValue: "",
                value: "none",
                type: "name",
                explicitSet: !1,
                valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"],
                pdfVersion: 1.7
            },
            PickTrayByPDFSize: {
                defaultValue: !1,
                value: !1,
                type: "boolean",
                explicitSet: !1,
                valueSet: [!0, !1],
                pdfVersion: 1.7
            },
            PrintPageRange: {
                defaultValue: "",
                value: "",
                type: "array",
                explicitSet: !1,
                valueSet: null,
                pdfVersion: 1.7
            },
            NumCopies: {
                defaultValue: 1,
                value: 1,
                type: "integer",
                explicitSet: !1,
                valueSet: null,
                pdfVersion: 1.7
            }
        }, i = Object.keys(l), s = [], c = 0, u = 0, h = 0;
        function d(e, t) {
            var r, a = !1;
            for (r = 0; r < e.length; r += 1)
                e[r] === t && (a = !0);
            return a
        }
        if (void 0 === this.internal.viewerpreferences && (this.internal.viewerpreferences = {},
        this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(l)),
        this.internal.viewerpreferences.isSubscribed = !1),
        r = this.internal.viewerpreferences.configuration,
        "reset" === e || !0 === t) {
            var f = i.length;
            for (h = 0; h < f; h += 1)
                r[i[h]].value = r[i[h]].defaultValue,
                r[i[h]].explicitSet = !1
        }
        if ("object" == typeof e)
            for (n in e)
                if (o = e[n],
                d(i, n) && void 0 !== o) {
                    if ("boolean" === r[n].type && "boolean" == typeof o)
                        r[n].value = o;
                    else if ("name" === r[n].type && d(r[n].valueSet, o))
                        r[n].value = o;
                    else if ("integer" === r[n].type && Number.isInteger(o))
                        r[n].value = o;
                    else if ("array" === r[n].type) {
                        for (c = 0; c < o.length; c += 1)
                            if (a = !0,
                            1 === o[c].length && "number" == typeof o[c][0])
                                s.push(String(o[c] - 1));
                            else if (o[c].length > 1) {
                                for (u = 0; u < o[c].length; u += 1)
                                    "number" != typeof o[c][u] && (a = !1);
                                !0 === a && s.push([o[c][0] - 1, o[c][1] - 1].join(" "))
                            }
                        r[n].value = "[" + s.join(" ") + "]"
                    } else
                        r[n].value = r[n].defaultValue;
                    r[n].explicitSet = !0
                }
        return !1 === this.internal.viewerpreferences.isSubscribed && (this.internal.events.subscribe("putCatalog", (function() {
            var e, t = [];
            for (e in r)
                !0 === r[e].explicitSet && ("name" === r[e].type ? t.push("/" + e + " /" + r[e].value) : t.push("/" + e + " " + r[e].value));
            0 !== t.length && this.internal.write("/ViewerPreferences\n<<\n" + t.join("\n") + "\n>>")
        }
        )),
        this.internal.viewerpreferences.isSubscribed = !0),
        this.internal.viewerpreferences.configuration = r,
        this
        /** ====================================================================
     * @license
     * jsPDF XMP metadata plugin
     * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
     * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * ====================================================================
     */
    }
    ,
    function(e) {
        var t = function() {
            var e = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceuri + '"><jspdf:metadata>'
              , t = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">'))
              , r = unescape(encodeURIComponent(e))
              , a = unescape(encodeURIComponent(this.internal.__metadata__.metadata))
              , n = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>"))
              , o = unescape(encodeURIComponent("</x:xmpmeta>"))
              , l = r.length + a.length + n.length + t.length + o.length;
            this.internal.__metadata__.metadata_object_number = this.internal.newObject(),
            this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + l + " >>"),
            this.internal.write("stream"),
            this.internal.write(t + r + a + n + o),
            this.internal.write("endstream"),
            this.internal.write("endobj")
        }
          , r = function() {
            this.internal.__metadata__.metadata_object_number && this.internal.write("/Metadata " + this.internal.__metadata__.metadata_object_number + " 0 R")
        };
        e.addMetadata = function(e, a) {
            return void 0 === this.internal.__metadata__ && (this.internal.__metadata__ = {
                metadata: e,
                namespaceuri: a || "http://jspdf.default.namespaceuri/"
            },
            this.internal.events.subscribe("putCatalog", r),
            this.internal.events.subscribe("postPutResources", t)),
            this
        }
    }(g.API),
    function(e) {
        var t = e.API
          , r = t.pdfEscape16 = function(e, t) {
            for (var r, a = t.metadata.Unicode.widths, n = ["", "0", "00", "000", "0000"], o = [""], l = 0, i = e.length; l < i; ++l) {
                if (r = t.metadata.characterToGlyph(e.charCodeAt(l)),
                t.metadata.glyIdsUsed.push(r),
                t.metadata.toUnicode[r] = e.charCodeAt(l),
                -1 == a.indexOf(r) && (a.push(r),
                a.push([parseInt(t.metadata.widthOfGlyph(r), 10)])),
                "0" == r)
                    return o.join("");
                r = r.toString(16),
                o.push(n[4 - r.length], r)
            }
            return o.join("")
        }
          , a = function(e) {
            var t, r, a, n, o, l, i;
            for (o = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",
            a = [],
            l = 0,
            i = (r = Object.keys(e).sort((function(e, t) {
                return e - t
            }
            ))).length; l < i; l++)
                t = r[l],
                a.length >= 100 && (o += "\n" + a.length + " beginbfchar\n" + a.join("\n") + "\nendbfchar",
                a = []),
                void 0 !== e[t] && null !== e[t] && "function" == typeof e[t].toString && (n = ("0000" + e[t].toString(16)).slice(-4),
                t = ("0000" + (+t).toString(16)).slice(-4),
                a.push("<" + t + "><" + n + ">"));
            return a.length && (o += "\n" + a.length + " beginbfchar\n" + a.join("\n") + "\nendbfchar\n"),
            o + "endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"
        };
        t.events.push(["putFont", function(t) {
            !function(t) {
                var r = t.font
                  , n = t.out
                  , o = t.newObject
                  , l = t.putStream
                  , i = t.pdfEscapeWithNeededParanthesis;
                if (r.metadata instanceof e.API.TTFFont && "Identity-H" === r.encoding) {
                    for (var s = r.metadata.Unicode.widths, c = r.metadata.subset.encode(r.metadata.glyIdsUsed, 1), u = "", h = 0; h < c.length; h++)
                        u += String.fromCharCode(c[h]);
                    var d = o();
                    l({
                        data: u,
                        addLength1: !0
                    }),
                    n("endobj");
                    var f = o();
                    l({
                        data: a(r.metadata.toUnicode),
                        addLength1: !0
                    }),
                    n("endobj");
                    var m = o();
                    n("<<"),
                    n("/Type /FontDescriptor"),
                    n("/FontName /" + i(r.fontName)),
                    n("/FontFile2 " + d + " 0 R"),
                    n("/FontBBox " + e.API.PDFObject.convert(r.metadata.bbox)),
                    n("/Flags " + r.metadata.flags),
                    n("/StemV " + r.metadata.stemV),
                    n("/ItalicAngle " + r.metadata.italicAngle),
                    n("/Ascent " + r.metadata.ascender),
                    n("/Descent " + r.metadata.decender),
                    n("/CapHeight " + r.metadata.capHeight),
                    n(">>"),
                    n("endobj");
                    var p = o();
                    n("<<"),
                    n("/Type /Font"),
                    n("/BaseFont /" + i(r.fontName)),
                    n("/FontDescriptor " + m + " 0 R"),
                    n("/W " + e.API.PDFObject.convert(s)),
                    n("/CIDToGIDMap /Identity"),
                    n("/DW 1000"),
                    n("/Subtype /CIDFontType2"),
                    n("/CIDSystemInfo"),
                    n("<<"),
                    n("/Supplement 0"),
                    n("/Registry (Adobe)"),
                    n("/Ordering (" + r.encoding + ")"),
                    n(">>"),
                    n(">>"),
                    n("endobj"),
                    r.objectNumber = o(),
                    n("<<"),
                    n("/Type /Font"),
                    n("/Subtype /Type0"),
                    n("/ToUnicode " + f + " 0 R"),
                    n("/BaseFont /" + i(r.fontName)),
                    n("/Encoding /" + r.encoding),
                    n("/DescendantFonts [" + p + " 0 R]"),
                    n(">>"),
                    n("endobj"),
                    r.isAlreadyPutted = !0
                }
            }(t)
        }
        ]),
        t.events.push(["putFont", function(t) {
            !function(t) {
                var r = t.font
                  , n = t.out
                  , o = t.newObject
                  , l = t.putStream
                  , i = t.pdfEscapeWithNeededParanthesis;
                if (r.metadata instanceof e.API.TTFFont && "WinAnsiEncoding" === r.encoding) {
                    for (var s = r.metadata.rawData, c = "", u = 0; u < s.length; u++)
                        c += String.fromCharCode(s[u]);
                    var h = o();
                    l({
                        data: c,
                        addLength1: !0
                    }),
                    n("endobj");
                    var d = o();
                    l({
                        data: a(r.metadata.toUnicode),
                        addLength1: !0
                    }),
                    n("endobj");
                    var f = o();
                    n("<<"),
                    n("/Descent " + r.metadata.decender),
                    n("/CapHeight " + r.metadata.capHeight),
                    n("/StemV " + r.metadata.stemV),
                    n("/Type /FontDescriptor"),
                    n("/FontFile2 " + h + " 0 R"),
                    n("/Flags 96"),
                    n("/FontBBox " + e.API.PDFObject.convert(r.metadata.bbox)),
                    n("/FontName /" + i(r.fontName)),
                    n("/ItalicAngle " + r.metadata.italicAngle),
                    n("/Ascent " + r.metadata.ascender),
                    n(">>"),
                    n("endobj"),
                    r.objectNumber = o();
                    for (var m = 0; m < r.metadata.hmtx.widths.length; m++)
                        r.metadata.hmtx.widths[m] = parseInt(r.metadata.hmtx.widths[m] * (1e3 / r.metadata.head.unitsPerEm));
                    n("<</Subtype/TrueType/Type/Font/ToUnicode " + d + " 0 R/BaseFont/" + r.fontName + "/FontDescriptor " + f + " 0 R/Encoding/" + r.encoding + " /FirstChar 29 /LastChar 255 /Widths " + e.API.PDFObject.convert(r.metadata.hmtx.widths) + ">>"),
                    n("endobj"),
                    r.isAlreadyPutted = !0
                }
            }(t)
        }
        ]);
        var n = function(e) {
            var t, a = e.text || "", n = e.x, o = e.y, l = e.options || {}, i = e.mutex || {}, s = i.pdfEscape, c = i.activeFontKey, u = i.fonts, h = c, d = "", f = 0, m = "", p = u[h].encoding;
            if ("Identity-H" !== u[h].encoding)
                return {
                    text: a,
                    x: n,
                    y: o,
                    options: l,
                    mutex: i
                };
            for (m = a,
            h = c,
            Array.isArray(a) && (m = a[0]),
            f = 0; f < m.length; f += 1)
                u[h].metadata.hasOwnProperty("cmap") && (t = u[h].metadata.cmap.unicode.codeMap[m[f].charCodeAt(0)]),
                t || m[f].charCodeAt(0) < 256 && u[h].metadata.hasOwnProperty("Unicode") ? d += m[f] : d += "";
            var g = "";
            return parseInt(h.slice(1)) < 14 || "WinAnsiEncoding" === p ? g = s(d, h).split("").map((function(e) {
                return e.charCodeAt(0).toString(16)
            }
            )).join("") : "Identity-H" === p && (g = r(d, u[h])),
            i.isHex = !0,
            {
                text: g,
                x: n,
                y: o,
                options: l,
                mutex: i
            }
        };
        t.events.push(["postProcessText", function(e) {
            var t = e.text || ""
              , r = []
              , a = {
                text: t,
                x: e.x,
                y: e.y,
                options: e.options,
                mutex: e.mutex
            };
            if (Array.isArray(t)) {
                var o = 0;
                for (o = 0; o < t.length; o += 1)
                    Array.isArray(t[o]) && 3 === t[o].length ? r.push([n(Object.assign({}, a, {
                        text: t[o][0]
                    })).text, t[o][1], t[o][2]]) : r.push(n(Object.assign({}, a, {
                        text: t[o]
                    })).text);
                e.text = r
            } else
                e.text = n(Object.assign({}, a, {
                    text: t
                })).text
        }
        ])
    }(g),
    /**
     * @license
     * jsPDF virtual FileSystem functionality
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e) {
        var t = function() {
            return void 0 === this.internal.vFS && (this.internal.vFS = {}),
            !0
        };
        e.existsFileInVFS = function(e) {
            return t.call(this),
            void 0 !== this.internal.vFS[e]
        }
        ,
        e.addFileToVFS = function(e, r) {
            return t.call(this),
            this.internal.vFS[e] = r,
            this
        }
        ,
        e.getFileFromVFS = function(e) {
            return t.call(this),
            void 0 !== this.internal.vFS[e] ? this.internal.vFS[e] : null
        }
    }(g.API),
    /**
     * @license
     * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
     * MIT License
     */
    function(e) {
        e.__bidiEngine__ = e.prototype.__bidiEngine__ = function(e) {
            var r, a, n, o, l, i, s, c = t, u = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], h = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], d = {
                L: 0,
                R: 1,
                EN: 2,
                AN: 3,
                N: 4,
                B: 5,
                S: 6
            }, f = {
                0: 0,
                5: 1,
                6: 2,
                7: 3,
                32: 4,
                251: 5,
                254: 6,
                255: 7
            }, m = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], p = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), g = !1, y = 0;
            this.__bidiEngine__ = {};
            var v = function(e) {
                var t = e.charCodeAt()
                  , r = t >> 8
                  , a = f[r];
                return void 0 !== a ? c[256 * a + (255 & t)] : 252 === r || 253 === r ? "AL" : p.test(r) ? "L" : 8 === r ? "R" : "N"
            }
              , A = function(e) {
                for (var t, r = 0; r < e.length; r++) {
                    if ("L" === (t = v(e.charAt(r))))
                        return !1;
                    if ("R" === t)
                        return !0
                }
                return !1
            }
              , b = function(e, t, l, i) {
                var s, c, u, h, d = t[i];
                switch (d) {
                case "L":
                case "R":
                    g = !1;
                    break;
                case "N":
                case "AN":
                    break;
                case "EN":
                    g && (d = "AN");
                    break;
                case "AL":
                    g = !0,
                    d = "R";
                    break;
                case "WS":
                    d = "N";
                    break;
                case "CS":
                    i < 1 || i + 1 >= t.length || "EN" !== (s = l[i - 1]) && "AN" !== s || "EN" !== (c = t[i + 1]) && "AN" !== c ? d = "N" : g && (c = "AN"),
                    d = c === s ? c : "N";
                    break;
                case "ES":
                    d = "EN" === (s = i > 0 ? l[i - 1] : "B") && i + 1 < t.length && "EN" === t[i + 1] ? "EN" : "N";
                    break;
                case "ET":
                    if (i > 0 && "EN" === l[i - 1]) {
                        d = "EN";
                        break
                    }
                    if (g) {
                        d = "N";
                        break
                    }
                    for (u = i + 1,
                    h = t.length; u < h && "ET" === t[u]; )
                        u++;
                    d = u < h && "EN" === t[u] ? "EN" : "N";
                    break;
                case "NSM":
                    if (n && !o) {
                        for (h = t.length,
                        u = i + 1; u < h && "NSM" === t[u]; )
                            u++;
                        if (u < h) {
                            var f = e[i]
                              , m = f >= 1425 && f <= 2303 || 64286 === f;
                            if (s = t[u],
                            m && ("R" === s || "AL" === s)) {
                                d = "R";
                                break
                            }
                        }
                    }
                    d = i < 1 || "B" === (s = t[i - 1]) ? "N" : l[i - 1];
                    break;
                case "B":
                    g = !1,
                    r = !0,
                    d = y;
                    break;
                case "S":
                    a = !0,
                    d = "N";
                    break;
                case "LRE":
                case "RLE":
                case "LRO":
                case "RLO":
                case "PDF":
                    g = !1;
                    break;
                case "BN":
                    d = "N"
                }
                return d
            }
              , k = function(e, t, r) {
                var a = e.split("");
                return r && w(a, r, {
                    hiLevel: y
                }),
                a.reverse(),
                t && t.reverse(),
                a.join("")
            }
              , w = function(e, t, n) {
                var o, l, i, s, c, f = -1, m = e.length, p = 0, A = [], k = y ? h : u, w = [];
                for (g = !1,
                r = !1,
                a = !1,
                l = 0; l < m; l++)
                    w[l] = v(e[l]);
                for (i = 0; i < m; i++) {
                    if (c = p,
                    A[i] = b(e, w, A, i),
                    o = 240 & (p = k[c][d[A[i]]]),
                    p &= 15,
                    t[i] = s = k[p][5],
                    o > 0)
                        if (16 === o) {
                            for (l = f; l < i; l++)
                                t[l] = 1;
                            f = -1
                        } else
                            f = -1;
                    if (k[p][6])
                        -1 === f && (f = i);
                    else if (f > -1) {
                        for (l = f; l < i; l++)
                            t[l] = s;
                        f = -1
                    }
                    "B" === w[i] && (t[i] = 0),
                    n.hiLevel |= s
                }
                a && function(e, t, r) {
                    for (var a = 0; a < r; a++)
                        if ("S" === e[a]) {
                            t[a] = y;
                            for (var n = a - 1; n >= 0 && "WS" === e[n]; n--)
                                t[n] = y
                        }
                }(w, t, m)
            }
              , x = function(e, t, a, n, o) {
                if (!(o.hiLevel < e)) {
                    if (1 === e && 1 === y && !r)
                        return t.reverse(),
                        void (a && a.reverse());
                    for (var l, i, s, c, u = t.length, h = 0; h < u; ) {
                        if (n[h] >= e) {
                            for (s = h + 1; s < u && n[s] >= e; )
                                s++;
                            for (c = h,
                            i = s - 1; c < i; c++,
                            i--)
                                l = t[c],
                                t[c] = t[i],
                                t[i] = l,
                                a && (l = a[c],
                                a[c] = a[i],
                                a[i] = l);
                            h = s
                        }
                        h++
                    }
                }
            }
              , S = function(e, t, r) {
                var a = e.split("")
                  , n = {
                    hiLevel: y
                };
                return r || (r = []),
                w(a, r, n),
                function(e, t, r) {
                    if (0 !== r.hiLevel && s)
                        for (var a, n = 0; n < e.length; n++)
                            1 === t[n] && (a = m.indexOf(e[n])) >= 0 && (e[n] = m[a + 1])
                }(a, r, n),
                x(2, a, t, r, n),
                x(1, a, t, r, n),
                a.join("")
            };
            return this.__bidiEngine__.doBidiReorder = function(e, t, r) {
                if (function(e, t) {
                    if (t)
                        for (var r = 0; r < e.length; r++)
                            t[r] = r;
                    void 0 === o && (o = A(e)),
                    void 0 === i && (i = A(e))
                }(e, t),
                n || !l || i)
                    if (n && l && o ^ i)
                        y = o ? 1 : 0,
                        e = k(e, t, r);
                    else if (!n && l && i)
                        y = o ? 1 : 0,
                        e = S(e, t, r),
                        e = k(e, t);
                    else if (!n || o || l || i) {
                        if (n && !l && o ^ i)
                            e = k(e, t),
                            o ? (y = 0,
                            e = S(e, t, r)) : (y = 1,
                            e = S(e, t, r),
                            e = k(e, t));
                        else if (n && o && !l && i)
                            y = 1,
                            e = S(e, t, r),
                            e = k(e, t);
                        else if (!n && !l && o ^ i) {
                            var a = s;
                            o ? (y = 1,
                            e = S(e, t, r),
                            y = 0,
                            s = !1,
                            e = S(e, t, r),
                            s = a) : (y = 0,
                            e = S(e, t, r),
                            e = k(e, t),
                            y = 1,
                            s = !1,
                            e = S(e, t, r),
                            s = a,
                            e = k(e, t))
                        }
                    } else
                        y = 0,
                        e = S(e, t, r);
                else
                    y = o ? 1 : 0,
                    e = S(e, t, r);
                return e
            }
            ,
            this.__bidiEngine__.setOptions = function(e) {
                e && (n = e.isInputVisual,
                l = e.isOutputVisual,
                o = e.isInputRtl,
                i = e.isOutputRtl,
                s = e.isSymmetricSwapping)
            }
            ,
            this.__bidiEngine__.setOptions(e),
            this.__bidiEngine__
        }
        ;
        var t = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"]
          , r = new e.__bidiEngine__({
            isInputVisual: !0
        });
        e.API.events.push(["postProcessText", function(e) {
            var t = e.text
              , a = (e.x,
            e.y,
            e.options || {})
              , n = (e.mutex,
            a.lang,
            []);
            if (a.isInputVisual = "boolean" != typeof a.isInputVisual || a.isInputVisual,
            r.setOptions(a),
            "[object Array]" === Object.prototype.toString.call(t)) {
                var o = 0;
                for (n = [],
                o = 0; o < t.length; o += 1)
                    "[object Array]" === Object.prototype.toString.call(t[o]) ? n.push([r.doBidiReorder(t[o][0]), t[o][1], t[o][2]]) : n.push([r.doBidiReorder(t[o])]);
                e.text = n
            } else
                e.text = r.doBidiReorder(t);
            r.setOptions({
                isInputVisual: !0
            })
        }
        ])
    }(g),
    g.API.TTFFont = function() {
        function e(e) {
            var t;
            if (this.rawData = e,
            t = this.contents = new Rt(e),
            this.contents.pos = 4,
            "ttcf" === t.readString(4))
                throw new Error("TTCF not supported.");
            t.pos = 0,
            this.parse(),
            this.subset = new re(this),
            this.registerTTF()
        }
        return e.open = function(t) {
            return new e(t)
        }
        ,
        e.prototype.parse = function() {
            return this.directory = new Tt(this.contents),
            this.head = new zt(this),
            this.name = new Xt(this),
            this.cmap = new Wt(this),
            this.toUnicode = {},
            this.hhea = new Vt(this),
            this.maxp = new Kt(this),
            this.hmtx = new Zt(this),
            this.post = new Yt(this),
            this.os2 = new Gt(this),
            this.loca = new ne(this),
            this.glyf = new Qt(this),
            this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender,
            this.decender = this.os2.exists && this.os2.decender || this.hhea.decender,
            this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap,
            this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax]
        }
        ,
        e.prototype.registerTTF = function() {
            var e, t, r, a, n;
            if (this.scaleFactor = 1e3 / this.head.unitsPerEm,
            this.bbox = function() {
                var t, r, a, n;
                for (n = [],
                t = 0,
                r = (a = this.bbox).length; t < r; t++)
                    e = a[t],
                    n.push(Math.round(e * this.scaleFactor));
                return n
            }
            .call(this),
            this.stemV = 0,
            this.post.exists ? (r = 255 & (a = this.post.italic_angle),
            0 != (32768 & (t = a >> 16)) && (t = -(1 + (65535 ^ t))),
            this.italicAngle = +(t + "." + r)) : this.italicAngle = 0,
            this.ascender = Math.round(this.ascender * this.scaleFactor),
            this.decender = Math.round(this.decender * this.scaleFactor),
            this.lineGap = Math.round(this.lineGap * this.scaleFactor),
            this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender,
            this.xHeight = this.os2.exists && this.os2.xHeight || 0,
            this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8,
            this.isSerif = 1 === (n = this.familyClass) || 2 === n || 3 === n || 4 === n || 5 === n || 7 === n,
            this.isScript = 10 === this.familyClass,
            this.flags = 0,
            this.post.isFixedPitch && (this.flags |= 1),
            this.isSerif && (this.flags |= 2),
            this.isScript && (this.flags |= 8),
            0 !== this.italicAngle && (this.flags |= 64),
            this.flags |= 32,
            !this.cmap.unicode)
                throw new Error("No unicode cmap for font")
        }
        ,
        e.prototype.characterToGlyph = function(e) {
            var t;
            return (null != (t = this.cmap.unicode) ? t.codeMap[e] : void 0) || 0
        }
        ,
        e.prototype.widthOfGlyph = function(e) {
            var t;
            return t = 1e3 / this.head.unitsPerEm,
            this.hmtx.forGlyph(e).advance * t
        }
        ,
        e.prototype.widthOfString = function(e, t, r) {
            var a, n, o, l;
            for (o = 0,
            n = 0,
            l = (e = "" + e).length; 0 <= l ? n < l : n > l; n = 0 <= l ? ++n : --n)
                a = e.charCodeAt(n),
                o += this.widthOfGlyph(this.characterToGlyph(a)) + r * (1e3 / t) || 0;
            return o * (t / 1e3)
        }
        ,
        e.prototype.lineHeight = function(e, t) {
            var r;
            return null == t && (t = !1),
            r = t ? this.lineGap : 0,
            (this.ascender + r - this.decender) / 1e3 * e
        }
        ,
        e
    }();
    var qt, Rt = function() {
        function e(e) {
            this.data = null != e ? e : [],
            this.pos = 0,
            this.length = this.data.length
        }
        return e.prototype.readByte = function() {
            return this.data[this.pos++]
        }
        ,
        e.prototype.writeByte = function(e) {
            return this.data[this.pos++] = e
        }
        ,
        e.prototype.readUInt32 = function() {
            return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte()
        }
        ,
        e.prototype.writeUInt32 = function(e) {
            return this.writeByte(e >>> 24 & 255),
            this.writeByte(e >> 16 & 255),
            this.writeByte(e >> 8 & 255),
            this.writeByte(255 & e)
        }
        ,
        e.prototype.readInt32 = function() {
            var e;
            return (e = this.readUInt32()) >= 2147483648 ? e - 4294967296 : e
        }
        ,
        e.prototype.writeInt32 = function(e) {
            return e < 0 && (e += 4294967296),
            this.writeUInt32(e)
        }
        ,
        e.prototype.readUInt16 = function() {
            return this.readByte() << 8 | this.readByte()
        }
        ,
        e.prototype.writeUInt16 = function(e) {
            return this.writeByte(e >> 8 & 255),
            this.writeByte(255 & e)
        }
        ,
        e.prototype.readInt16 = function() {
            var e;
            return (e = this.readUInt16()) >= 32768 ? e - 65536 : e
        }
        ,
        e.prototype.writeInt16 = function(e) {
            return e < 0 && (e += 65536),
            this.writeUInt16(e)
        }
        ,
        e.prototype.readString = function(e) {
            var t, r;
            for (r = [],
            t = 0; 0 <= e ? t < e : t > e; t = 0 <= e ? ++t : --t)
                r[t] = String.fromCharCode(this.readByte());
            return r.join("")
        }
        ,
        e.prototype.writeString = function(e) {
            var t, r, a;
            for (a = [],
            t = 0,
            r = e.length; 0 <= r ? t < r : t > r; t = 0 <= r ? ++t : --t)
                a.push(this.writeByte(e.charCodeAt(t)));
            return a
        }
        ,
        e.prototype.readShort = function() {
            return this.readInt16()
        }
        ,
        e.prototype.writeShort = function(e) {
            return this.writeInt16(e)
        }
        ,
        e.prototype.readLongLong = function() {
            var e, t, r, a, n, o, l, i;
            return e = this.readByte(),
            t = this.readByte(),
            r = this.readByte(),
            a = this.readByte(),
            n = this.readByte(),
            o = this.readByte(),
            l = this.readByte(),
            i = this.readByte(),
            128 & e ? -1 * (72057594037927940 * (255 ^ e) + 281474976710656 * (255 ^ t) + 1099511627776 * (255 ^ r) + 4294967296 * (255 ^ a) + 16777216 * (255 ^ n) + 65536 * (255 ^ o) + 256 * (255 ^ l) + (255 ^ i) + 1) : 72057594037927940 * e + 281474976710656 * t + 1099511627776 * r + 4294967296 * a + 16777216 * n + 65536 * o + 256 * l + i
        }
        ,
        e.prototype.writeLongLong = function(e) {
            var t, r;
            return t = Math.floor(e / 4294967296),
            r = 4294967295 & e,
            this.writeByte(t >> 24 & 255),
            this.writeByte(t >> 16 & 255),
            this.writeByte(t >> 8 & 255),
            this.writeByte(255 & t),
            this.writeByte(r >> 24 & 255),
            this.writeByte(r >> 16 & 255),
            this.writeByte(r >> 8 & 255),
            this.writeByte(255 & r)
        }
        ,
        e.prototype.readInt = function() {
            return this.readInt32()
        }
        ,
        e.prototype.writeInt = function(e) {
            return this.writeInt32(e)
        }
        ,
        e.prototype.read = function(e) {
            var t, r;
            for (t = [],
            r = 0; 0 <= e ? r < e : r > e; r = 0 <= e ? ++r : --r)
                t.push(this.readByte());
            return t
        }
        ,
        e.prototype.write = function(e) {
            var t, r, a, n;
            for (n = [],
            r = 0,
            a = e.length; r < a; r++)
                t = e[r],
                n.push(this.writeByte(t));
            return n
        }
        ,
        e
    }(), Tt = function() {
        var e;
        function t(e) {
            var t, r, a;
            for (this.scalarType = e.readInt(),
            this.tableCount = e.readShort(),
            this.searchRange = e.readShort(),
            this.entrySelector = e.readShort(),
            this.rangeShift = e.readShort(),
            this.tables = {},
            r = 0,
            a = this.tableCount; 0 <= a ? r < a : r > a; r = 0 <= a ? ++r : --r)
                t = {
                    tag: e.readString(4),
                    checksum: e.readInt(),
                    offset: e.readInt(),
                    length: e.readInt()
                },
                this.tables[t.tag] = t
        }
        return t.prototype.encode = function(t) {
            var r, a, n, o, l, i, s, c, u, h, d, f, m;
            for (m in d = Object.keys(t).length,
            i = Math.log(2),
            u = 16 * Math.floor(Math.log(d) / i),
            o = Math.floor(u / i),
            c = 16 * d - u,
            (a = new Rt).writeInt(this.scalarType),
            a.writeShort(d),
            a.writeShort(u),
            a.writeShort(o),
            a.writeShort(c),
            n = 16 * d,
            s = a.pos + n,
            l = null,
            f = [],
            t)
                for (h = t[m],
                a.writeString(m),
                a.writeInt(e(h)),
                a.writeInt(s),
                a.writeInt(h.length),
                f = f.concat(h),
                "head" === m && (l = s),
                s += h.length; s % 4; )
                    f.push(0),
                    s++;
            return a.write(f),
            r = 2981146554 - e(a.data),
            a.pos = l + 8,
            a.writeUInt32(r),
            a.data
        }
        ,
        e = function(e) {
            var t, r, a, n;
            for (e = $t.call(e); e.length % 4; )
                e.push(0);
            for (a = new Rt(e),
            r = 0,
            t = 0,
            n = e.length; t < n; t = t += 4)
                r += a.readUInt32();
            return 4294967295 & r
        }
        ,
        t
    }(), Dt = {}.hasOwnProperty, Ut = function(e, t) {
        for (var r in t)
            Dt.call(t, r) && (e[r] = t[r]);
        function a() {
            this.constructor = e
        }
        return a.prototype = t.prototype,
        e.prototype = new a,
        e.__super__ = t.prototype,
        e
    };
    qt = function() {
        function e(e) {
            var t;
            this.file = e,
            t = this.file.directory.tables[this.tag],
            this.exists = !!t,
            t && (this.offset = t.offset,
            this.length = t.length,
            this.parse(this.file.contents))
        }
        return e.prototype.parse = function() {}
        ,
        e.prototype.encode = function() {}
        ,
        e.prototype.raw = function() {
            return this.exists ? (this.file.contents.pos = this.offset,
            this.file.contents.read(this.length)) : null
        }
        ,
        e
    }();
    var zt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "head",
        t.prototype.parse = function(e) {
            return e.pos = this.offset,
            this.version = e.readInt(),
            this.revision = e.readInt(),
            this.checkSumAdjustment = e.readInt(),
            this.magicNumber = e.readInt(),
            this.flags = e.readShort(),
            this.unitsPerEm = e.readShort(),
            this.created = e.readLongLong(),
            this.modified = e.readLongLong(),
            this.xMin = e.readShort(),
            this.yMin = e.readShort(),
            this.xMax = e.readShort(),
            this.yMax = e.readShort(),
            this.macStyle = e.readShort(),
            this.lowestRecPPEM = e.readShort(),
            this.fontDirectionHint = e.readShort(),
            this.indexToLocFormat = e.readShort(),
            this.glyphDataFormat = e.readShort()
        }
        ,
        t.prototype.encode = function(e) {
            var t;
            return (t = new Rt).writeInt(this.version),
            t.writeInt(this.revision),
            t.writeInt(this.checkSumAdjustment),
            t.writeInt(this.magicNumber),
            t.writeShort(this.flags),
            t.writeShort(this.unitsPerEm),
            t.writeLongLong(this.created),
            t.writeLongLong(this.modified),
            t.writeShort(this.xMin),
            t.writeShort(this.yMin),
            t.writeShort(this.xMax),
            t.writeShort(this.yMax),
            t.writeShort(this.macStyle),
            t.writeShort(this.lowestRecPPEM),
            t.writeShort(this.fontDirectionHint),
            t.writeShort(e),
            t.writeShort(this.glyphDataFormat),
            t.data
        }
        ,
        t
    }()
      , Ht = function() {
        function e(e, t) {
            var r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v;
            switch (this.platformID = e.readUInt16(),
            this.encodingID = e.readShort(),
            this.offset = t + e.readInt(),
            u = e.pos,
            e.pos = this.offset,
            this.format = e.readUInt16(),
            this.length = e.readUInt16(),
            this.language = e.readUInt16(),
            this.isUnicode = 3 === this.platformID && 1 === this.encodingID && 4 === this.format || 0 === this.platformID && 4 === this.format,
            this.codeMap = {},
            this.format) {
            case 0:
                for (i = 0; i < 256; ++i)
                    this.codeMap[i] = e.readByte();
                break;
            case 4:
                for (d = e.readUInt16(),
                h = d / 2,
                e.pos += 6,
                n = function() {
                    var t, r;
                    for (r = [],
                    i = t = 0; 0 <= h ? t < h : t > h; i = 0 <= h ? ++t : --t)
                        r.push(e.readUInt16());
                    return r
                }(),
                e.pos += 2,
                m = function() {
                    var t, r;
                    for (r = [],
                    i = t = 0; 0 <= h ? t < h : t > h; i = 0 <= h ? ++t : --t)
                        r.push(e.readUInt16());
                    return r
                }(),
                s = function() {
                    var t, r;
                    for (r = [],
                    i = t = 0; 0 <= h ? t < h : t > h; i = 0 <= h ? ++t : --t)
                        r.push(e.readUInt16());
                    return r
                }(),
                c = function() {
                    var t, r;
                    for (r = [],
                    i = t = 0; 0 <= h ? t < h : t > h; i = 0 <= h ? ++t : --t)
                        r.push(e.readUInt16());
                    return r
                }(),
                a = (this.length - e.pos + this.offset) / 2,
                l = function() {
                    var t, r;
                    for (r = [],
                    i = t = 0; 0 <= a ? t < a : t > a; i = 0 <= a ? ++t : --t)
                        r.push(e.readUInt16());
                    return r
                }(),
                i = g = 0,
                v = n.length; g < v; i = ++g)
                    for (p = n[i],
                    r = y = f = m[i]; f <= p ? y <= p : y >= p; r = f <= p ? ++y : --y)
                        0 === c[i] ? o = r + s[i] : 0 !== (o = l[c[i] / 2 + (r - f) - (h - i)] || 0) && (o += s[i]),
                        this.codeMap[r] = 65535 & o
            }
            e.pos = u
        }
        return e.encode = function(e, t) {
            var r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _, C, T, E, I, R, B, N, F, P, $, L, O, D, M, U, H, q, z, j, V, Q, G;
            switch (I = new Rt,
            o = Object.keys(e).sort((function(e, t) {
                return e - t
            }
            )),
            t) {
            case "macroman":
                for (m = 0,
                p = function() {
                    var e = [];
                    for (f = 0; f < 256; ++f)
                        e.push(0);
                    return e
                }(),
                y = {
                    0: 0
                },
                n = {},
                R = 0,
                P = o.length; R < P; R++)
                    null == y[j = e[a = o[R]]] && (y[j] = ++m),
                    n[a] = {
                        old: e[a],
                        new: y[e[a]]
                    },
                    p[a] = y[e[a]];
                return I.writeUInt16(1),
                I.writeUInt16(0),
                I.writeUInt32(12),
                I.writeUInt16(0),
                I.writeUInt16(262),
                I.writeUInt16(0),
                I.write(p),
                {
                    charMap: n,
                    subtable: I.data,
                    maxGlyphID: m + 1
                };
            case "unicode":
                for (T = [],
                u = [],
                v = 0,
                y = {},
                r = {},
                g = s = null,
                B = 0,
                $ = o.length; B < $; B++)
                    null == y[b = e[a = o[B]]] && (y[b] = ++v),
                    r[a] = {
                        old: b,
                        new: y[b]
                    },
                    l = y[b] - a,
                    null != g && l === s || (g && u.push(g),
                    T.push(a),
                    s = l),
                    g = a;
                for (g && u.push(g),
                u.push(65535),
                T.push(65535),
                _ = 2 * (S = T.length),
                x = 2 * Math.pow(Math.log(S) / Math.LN2, 2),
                h = Math.log(x / 2) / Math.LN2,
                w = 2 * S - x,
                i = [],
                k = [],
                d = [],
                f = N = 0,
                L = T.length; N < L; f = ++N) {
                    if (C = T[f],
                    c = u[f],
                    65535 === C) {
                        i.push(0),
                        k.push(0);
                        break
                    }
                    if (C - (E = r[C].new) >= 32768)
                        for (i.push(0),
                        k.push(2 * (d.length + S - f)),
                        a = F = C; C <= c ? F <= c : F >= c; a = C <= c ? ++F : --F)
                            d.push(r[a].new);
                    else
                        i.push(E - C),
                        k.push(0)
                }
                for (I.writeUInt16(3),
                I.writeUInt16(1),
                I.writeUInt32(12),
                I.writeUInt16(4),
                I.writeUInt16(16 + 8 * S + 2 * d.length),
                I.writeUInt16(0),
                I.writeUInt16(_),
                I.writeUInt16(x),
                I.writeUInt16(h),
                I.writeUInt16(w),
                q = 0,
                O = u.length; q < O; q++)
                    a = u[q],
                    I.writeUInt16(a);
                for (I.writeUInt16(0),
                z = 0,
                D = T.length; z < D; z++)
                    a = T[z],
                    I.writeUInt16(a);
                for (V = 0,
                M = i.length; V < M; V++)
                    l = i[V],
                    I.writeUInt16(l);
                for (Q = 0,
                U = k.length; Q < U; Q++)
                    A = k[Q],
                    I.writeUInt16(A);
                for (G = 0,
                H = d.length; G < H; G++)
                    m = d[G],
                    I.writeUInt16(m);
                return {
                    charMap: r,
                    subtable: I.data,
                    maxGlyphID: v + 1
                }
            }
        }
        ,
        e
    }()
      , Wt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "cmap",
        t.prototype.parse = function(e) {
            var t, r, a;
            for (e.pos = this.offset,
            this.version = e.readUInt16(),
            a = e.readUInt16(),
            this.tables = [],
            this.unicode = null,
            r = 0; 0 <= a ? r < a : r > a; r = 0 <= a ? ++r : --r)
                t = new Ht(e,this.offset),
                this.tables.push(t),
                t.isUnicode && null == this.unicode && (this.unicode = t);
            return !0
        }
        ,
        t.encode = function(e, t) {
            var r, a;
            return null == t && (t = "macroman"),
            r = Ht.encode(e, t),
            (a = new Rt).writeUInt16(0),
            a.writeUInt16(1),
            r.table = a.data.concat(r.subtable),
            r
        }
        ,
        t
    }()
      , Vt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "hhea",
        t.prototype.parse = function(e) {
            return e.pos = this.offset,
            this.version = e.readInt(),
            this.ascender = e.readShort(),
            this.decender = e.readShort(),
            this.lineGap = e.readShort(),
            this.advanceWidthMax = e.readShort(),
            this.minLeftSideBearing = e.readShort(),
            this.minRightSideBearing = e.readShort(),
            this.xMaxExtent = e.readShort(),
            this.caretSlopeRise = e.readShort(),
            this.caretSlopeRun = e.readShort(),
            this.caretOffset = e.readShort(),
            e.pos += 8,
            this.metricDataFormat = e.readShort(),
            this.numberOfMetrics = e.readUInt16()
        }
        ,
        t
    }()
      , Gt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "OS/2",
        t.prototype.parse = function(e) {
            if (e.pos = this.offset,
            this.version = e.readUInt16(),
            this.averageCharWidth = e.readShort(),
            this.weightClass = e.readUInt16(),
            this.widthClass = e.readUInt16(),
            this.type = e.readShort(),
            this.ySubscriptXSize = e.readShort(),
            this.ySubscriptYSize = e.readShort(),
            this.ySubscriptXOffset = e.readShort(),
            this.ySubscriptYOffset = e.readShort(),
            this.ySuperscriptXSize = e.readShort(),
            this.ySuperscriptYSize = e.readShort(),
            this.ySuperscriptXOffset = e.readShort(),
            this.ySuperscriptYOffset = e.readShort(),
            this.yStrikeoutSize = e.readShort(),
            this.yStrikeoutPosition = e.readShort(),
            this.familyClass = e.readShort(),
            this.panose = function() {
                var t, r;
                for (r = [],
                t = 0; t < 10; ++t)
                    r.push(e.readByte());
                return r
            }(),
            this.charRange = function() {
                var t, r;
                for (r = [],
                t = 0; t < 4; ++t)
                    r.push(e.readInt());
                return r
            }(),
            this.vendorID = e.readString(4),
            this.selection = e.readShort(),
            this.firstCharIndex = e.readShort(),
            this.lastCharIndex = e.readShort(),
            this.version > 0 && (this.ascent = e.readShort(),
            this.descent = e.readShort(),
            this.lineGap = e.readShort(),
            this.winAscent = e.readShort(),
            this.winDescent = e.readShort(),
            this.codePageRange = function() {
                var t, r;
                for (r = [],
                t = 0; t < 2; t = ++t)
                    r.push(e.readInt());
                return r
            }(),
            this.version > 1))
                return this.xHeight = e.readShort(),
                this.capHeight = e.readShort(),
                this.defaultChar = e.readShort(),
                this.breakChar = e.readShort(),
                this.maxContext = e.readShort()
        }
        ,
        t
    }()
      , Yt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "post",
        t.prototype.parse = function(e) {
            var t, r, a;
            switch (e.pos = this.offset,
            this.format = e.readInt(),
            this.italicAngle = e.readInt(),
            this.underlinePosition = e.readShort(),
            this.underlineThickness = e.readShort(),
            this.isFixedPitch = e.readInt(),
            this.minMemType42 = e.readInt(),
            this.maxMemType42 = e.readInt(),
            this.minMemType1 = e.readInt(),
            this.maxMemType1 = e.readInt(),
            this.format) {
            case 65536:
                break;
            case 131072:
                var n;
                for (r = e.readUInt16(),
                this.glyphNameIndex = [],
                n = 0; 0 <= r ? n < r : n > r; n = 0 <= r ? ++n : --n)
                    this.glyphNameIndex.push(e.readUInt16());
                for (this.names = [],
                a = []; e.pos < this.offset + this.length; )
                    t = e.readByte(),
                    a.push(this.names.push(e.readString(t)));
                return a;
            case 151552:
                return r = e.readUInt16(),
                this.offsets = e.read(r);
            case 196608:
                break;
            case 262144:
                return this.map = function() {
                    var t, r, a;
                    for (a = [],
                    n = t = 0,
                    r = this.file.maxp.numGlyphs; 0 <= r ? t < r : t > r; n = 0 <= r ? ++t : --t)
                        a.push(e.readUInt32());
                    return a
                }
                .call(this)
            }
        }
        ,
        t
    }()
      , Jt = function(e, t) {
        this.raw = e,
        this.length = e.length,
        this.platformID = t.platformID,
        this.encodingID = t.encodingID,
        this.languageID = t.languageID
    }
      , Xt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "name",
        t.prototype.parse = function(e) {
            var t, r, a, n, o, l, i, s, c, u, h;
            for (e.pos = this.offset,
            e.readShort(),
            t = e.readShort(),
            l = e.readShort(),
            r = [],
            n = 0; 0 <= t ? n < t : n > t; n = 0 <= t ? ++n : --n)
                r.push({
                    platformID: e.readShort(),
                    encodingID: e.readShort(),
                    languageID: e.readShort(),
                    nameID: e.readShort(),
                    length: e.readShort(),
                    offset: this.offset + l + e.readShort()
                });
            for (i = {},
            n = c = 0,
            u = r.length; c < u; n = ++c)
                a = r[n],
                e.pos = a.offset,
                s = e.readString(a.length),
                o = new Jt(s,a),
                null == i[h = a.nameID] && (i[h] = []),
                i[a.nameID].push(o);
            this.strings = i,
            this.copyright = i[0],
            this.fontFamily = i[1],
            this.fontSubfamily = i[2],
            this.uniqueSubfamily = i[3],
            this.fontName = i[4],
            this.version = i[5];
            try {
                this.postscriptName = i[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "")
            } catch (e) {
                this.postscriptName = i[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "")
            }
            return this.trademark = i[7],
            this.manufacturer = i[8],
            this.designer = i[9],
            this.description = i[10],
            this.vendorUrl = i[11],
            this.designerUrl = i[12],
            this.license = i[13],
            this.licenseUrl = i[14],
            this.preferredFamily = i[15],
            this.preferredSubfamily = i[17],
            this.compatibleFull = i[18],
            this.sampleText = i[19]
        }
        ,
        t
    }()
      , Kt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "maxp",
        t.prototype.parse = function(e) {
            return e.pos = this.offset,
            this.version = e.readInt(),
            this.numGlyphs = e.readUInt16(),
            this.maxPoints = e.readUInt16(),
            this.maxContours = e.readUInt16(),
            this.maxCompositePoints = e.readUInt16(),
            this.maxComponentContours = e.readUInt16(),
            this.maxZones = e.readUInt16(),
            this.maxTwilightPoints = e.readUInt16(),
            this.maxStorage = e.readUInt16(),
            this.maxFunctionDefs = e.readUInt16(),
            this.maxInstructionDefs = e.readUInt16(),
            this.maxStackElements = e.readUInt16(),
            this.maxSizeOfInstructions = e.readUInt16(),
            this.maxComponentElements = e.readUInt16(),
            this.maxComponentDepth = e.readUInt16()
        }
        ,
        t
    }()
      , Zt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "hmtx",
        t.prototype.parse = function(e) {
            var t, r, a, n, o, l, i;
            for (e.pos = this.offset,
            this.metrics = [],
            t = 0,
            l = this.file.hhea.numberOfMetrics; 0 <= l ? t < l : t > l; t = 0 <= l ? ++t : --t)
                this.metrics.push({
                    advance: e.readUInt16(),
                    lsb: e.readInt16()
                });
            for (a = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics,
            this.leftSideBearings = function() {
                var r, n;
                for (n = [],
                t = r = 0; 0 <= a ? r < a : r > a; t = 0 <= a ? ++r : --r)
                    n.push(e.readInt16());
                return n
            }(),
            this.widths = function() {
                var e, t, r, a;
                for (a = [],
                e = 0,
                t = (r = this.metrics).length; e < t; e++)
                    n = r[e],
                    a.push(n.advance);
                return a
            }
            .call(this),
            r = this.widths[this.widths.length - 1],
            i = [],
            t = o = 0; 0 <= a ? o < a : o > a; t = 0 <= a ? ++o : --o)
                i.push(this.widths.push(r));
            return i
        }
        ,
        t.prototype.forGlyph = function(e) {
            return e in this.metrics ? this.metrics[e] : {
                advance: this.metrics[this.metrics.length - 1].advance,
                lsb: this.leftSideBearings[e - this.metrics.length]
            }
        }
        ,
        t
    }()
      , $t = [].slice
      , Qt = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "glyf",
        t.prototype.parse = function() {
            return this.cache = {}
        }
        ,
        t.prototype.glyphFor = function(e) {
            var t, r, a, n, o, l, i, s, c, u;
            return e in this.cache ? this.cache[e] : (n = this.file.loca,
            t = this.file.contents,
            r = n.indexOf(e),
            0 === (a = n.lengthOf(e)) ? this.cache[e] = null : (t.pos = this.offset + r,
            o = (l = new Rt(t.read(a))).readShort(),
            s = l.readShort(),
            u = l.readShort(),
            i = l.readShort(),
            c = l.readShort(),
            this.cache[e] = -1 === o ? new ee(l,s,u,i,c) : new te(l,o,s,u,i,c),
            this.cache[e]))
        }
        ,
        t.prototype.encode = function(e, t, r) {
            var a, n, o, l, i;
            for (o = [],
            n = [],
            l = 0,
            i = t.length; l < i; l++)
                a = e[t[l]],
                n.push(o.length),
                a && (o = o.concat(a.encode(r)));
            return n.push(o.length),
            {
                table: o,
                offsets: n
            }
        }
        ,
        t
    }()
      , te = function() {
        function e(e, t, r, a, n, o) {
            this.raw = e,
            this.numberOfContours = t,
            this.xMin = r,
            this.yMin = a,
            this.xMax = n,
            this.yMax = o,
            this.compound = !1
        }
        return e.prototype.encode = function() {
            return this.raw.data
        }
        ,
        e
    }()
      , ee = function() {
        function e(e, t, r, a, n) {
            var o, l;
            for (this.raw = e,
            this.xMin = t,
            this.yMin = r,
            this.xMax = a,
            this.yMax = n,
            this.compound = !0,
            this.glyphIDs = [],
            this.glyphOffsets = [],
            o = this.raw; l = o.readShort(),
            this.glyphOffsets.push(o.pos),
            this.glyphIDs.push(o.readUInt16()),
            32 & l; )
                o.pos += 1 & l ? 4 : 2,
                128 & l ? o.pos += 8 : 64 & l ? o.pos += 4 : 8 & l && (o.pos += 2)
        }
        return e.prototype.encode = function() {
            var e, t, r;
            for (t = new Rt($t.call(this.raw.data)),
            e = 0,
            r = this.glyphIDs.length; e < r; ++e)
                t.pos = this.glyphOffsets[e];
            return t.data
        }
        ,
        e
    }()
      , ne = function(e) {
        function t() {
            return t.__super__.constructor.apply(this, arguments)
        }
        return Ut(t, qt),
        t.prototype.tag = "loca",
        t.prototype.parse = function(e) {
            var t, r;
            return e.pos = this.offset,
            t = this.file.head.indexToLocFormat,
            this.offsets = 0 === t ? function() {
                var t, a;
                for (a = [],
                r = 0,
                t = this.length; r < t; r += 2)
                    a.push(2 * e.readUInt16());
                return a
            }
            .call(this) : function() {
                var t, a;
                for (a = [],
                r = 0,
                t = this.length; r < t; r += 4)
                    a.push(e.readUInt32());
                return a
            }
            .call(this)
        }
        ,
        t.prototype.indexOf = function(e) {
            return this.offsets[e]
        }
        ,
        t.prototype.lengthOf = function(e) {
            return this.offsets[e + 1] - this.offsets[e]
        }
        ,
        t.prototype.encode = function(e, t) {
            for (var r = new Uint32Array(this.offsets.length), a = 0, n = 0, o = 0; o < r.length; ++o)
                if (r[o] = a,
                n < t.length && t[n] == o) {
                    ++n,
                    r[o] = a;
                    var l = this.offsets[o]
                      , i = this.offsets[o + 1] - l;
                    i > 0 && (a += i)
                }
            for (var s = new Array(4 * r.length), c = 0; c < r.length; ++c)
                s[4 * c + 3] = 255 & r[c],
                s[4 * c + 2] = (65280 & r[c]) >> 8,
                s[4 * c + 1] = (16711680 & r[c]) >> 16,
                s[4 * c] = (4278190080 & r[c]) >> 24;
            return s
        }
        ,
        t
    }()
      , re = function() {
        function e(e) {
            this.font = e,
            this.subset = {},
            this.unicodes = {},
            this.next = 33
        }
        return e.prototype.generateCmap = function() {
            var e, t, r, a, n;
            for (t in a = this.font.cmap.tables[0].codeMap,
            e = {},
            n = this.subset)
                r = n[t],
                e[t] = a[r];
            return e
        }
        ,
        e.prototype.glyphsFor = function(e) {
            var t, r, a, n, o, l, i;
            for (a = {},
            o = 0,
            l = e.length; o < l; o++)
                a[n = e[o]] = this.font.glyf.glyphFor(n);
            for (n in t = [],
            a)
                (null != (r = a[n]) ? r.compound : void 0) && t.push.apply(t, r.glyphIDs);
            if (t.length > 0)
                for (n in i = this.glyphsFor(t))
                    r = i[n],
                    a[n] = r;
            return a
        }
        ,
        e.prototype.encode = function(e, t) {
            var r, a, n, o, l, i, s, c, u, h, d, f, m, p, g;
            for (a in r = Wt.encode(this.generateCmap(), "unicode"),
            o = this.glyphsFor(e),
            d = {
                0: 0
            },
            g = r.charMap)
                d[(i = g[a]).old] = i.new;
            for (f in h = r.maxGlyphID,
            o)
                f in d || (d[f] = h++);
            return c = function(e) {
                var t, r;
                for (t in r = {},
                e)
                    r[e[t]] = t;
                return r
            }(d),
            u = Object.keys(c).sort((function(e, t) {
                return e - t
            }
            )),
            m = function() {
                var e, t, r;
                for (r = [],
                e = 0,
                t = u.length; e < t; e++)
                    l = u[e],
                    r.push(c[l]);
                return r
            }(),
            n = this.font.glyf.encode(o, m, d),
            s = this.font.loca.encode(n.offsets, m),
            p = {
                cmap: this.font.cmap.raw(),
                glyf: n.table,
                loca: s,
                hmtx: this.font.hmtx.raw(),
                hhea: this.font.hhea.raw(),
                maxp: this.font.maxp.raw(),
                post: this.font.post.raw(),
                name: this.font.name.raw(),
                head: this.font.head.encode(t)
            },
            this.font.os2.exists && (p["OS/2"] = this.font.os2.raw()),
            this.font.directory.encode(p)
        }
        ,
        e
    }();
    function viewChange(e, t) {
        var r = sheetmanage.getSheetByIndex();
        null == r.config && (r.config = {}),
        null == r.config.sheetViewZoom && (r.config.sheetViewZoom = {});
        var a = 1
          , n = "zoomScaleNormal";
        "viewNormal" == e ? n = "viewNormalZoomScale" : "viewLayout" == e ? n = "viewLayoutZoomScale" : "viewPage" == e && (n = "viewPageZoomScale",
        a = .6);
        var o = r.config.sheetViewZoom[n];
        null == o && (o = a),
        r.config.curentsheetView = e,
        Store.clearjfundo && Store.jfredo.push({
            type: "viewChange",
            curType: e,
            preType: t,
            sheetIndex: Store.currentSheetIndex
        }),
        server.saveParam("cg", Store.currentSheetIndex, e, {
            k: "curentsheetView"
        }),
        Store.currentSheetView = e,
        zoomChange(o)
    }
    function switchViewBtn(e) {
        var t = e.parent().find("luckysheet-print-viewBtn-active").attr("type");
        if (e.attr("type") != t) {
            var r = e.attr("type");
            null != r && (viewChange(r, t),
            e.parent().find(".luckysheet-print-viewBtn").removeClass("luckysheet-print-viewBtn-active"),
            e.addClass("luckysheet-print-viewBtn-active"))
        }
    }
    function printInitial() {
        var e = luckysheetConfigsetting.container;
        $("#" + e).find(".luckysheet-print-viewBtn").click((function() {
            switchViewBtn($(this))
        }
        ))
    }
    g.API.PDFObject = function() {
        var e;
        function t() {}
        return e = function(e, t) {
            return (Array(t + 1).join("0") + e).slice(-t)
        }
        ,
        t.convert = function(r) {
            var a, n, o, l;
            if (Array.isArray(r))
                return "[" + function() {
                    var e, n, o;
                    for (o = [],
                    e = 0,
                    n = r.length; e < n; e++)
                        a = r[e],
                        o.push(t.convert(a));
                    return o
                }().join(" ") + "]";
            if ("string" == typeof r)
                return "/" + r;
            if (null != r ? r.isString : void 0)
                return "(" + r + ")";
            if (r instanceof Date)
                return "(D:" + e(r.getUTCFullYear(), 4) + e(r.getUTCMonth(), 2) + e(r.getUTCDate(), 2) + e(r.getUTCHours(), 2) + e(r.getUTCMinutes(), 2) + e(r.getUTCSeconds(), 2) + "Z)";
            if ("[object Object]" === {}.toString.call(r)) {
                for (n in o = ["<<"],
                r)
                    l = r[n],
                    o.push("/" + n + " " + t.convert(l));
                return o.push(">>"),
                o.join("\n")
            }
            return "" + r
        }
        ,
        t
    }(),
    /**
     * @license
     * Copyright (c) 2012 chick307 <chick307@gmail.com>
     *
     * Licensed under the MIT License.
     * http://opensource.org/licenses/mit-license
     */
    function(e, t) {
        e.API.adler32cs = function() {
            var e, t, r, a, n, o = "function" == typeof ArrayBuffer && "function" == typeof Uint8Array, l = null, i = function() {
                if (!o)
                    return function() {
                        return !1
                    }
                    ;
                try {
                    var e = {};
                    "function" == typeof e.Buffer && (l = e.Buffer)
                } catch (e) {}
                return function(e) {
                    return e instanceof ArrayBuffer || null !== l && e instanceof l
                }
            }(), s = null !== l ? function(e) {
                return new l(e,"utf8").toString("binary")
            }
            : function(e) {
                return unescape(encodeURIComponent(e))
            }
            , c = function(e, t) {
                for (var r = 65535 & e, a = e >>> 16, n = 0, o = t.length; n < o; n++)
                    a = (a + (r = (r + (255 & t.charCodeAt(n))) % 65521)) % 65521;
                return (a << 16 | r) >>> 0
            }, u = function(e, t) {
                for (var r = 65535 & e, a = e >>> 16, n = 0, o = t.length; n < o; n++)
                    a = (a + (r = (r + t[n]) % 65521)) % 65521;
                return (a << 16 | r) >>> 0
            }, h = {}, d = h.Adler32 = ((n = (a = function(e) {
                if (!(this instanceof a))
                    throw new TypeError("Constructor cannot called be as a function.");
                if (!isFinite(e = null === e ? 1 : +e))
                    throw new Error("First arguments needs to be a finite number.");
                this.checksum = e >>> 0
            }
            ).prototype = {}).constructor = a,
            a.from = ((e = function(e) {
                if (!(this instanceof a))
                    throw new TypeError("Constructor cannot called be as a function.");
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                this.checksum = c(1, e.toString())
            }
            ).prototype = n,
            e),
            a.fromUtf8 = ((t = function(e) {
                if (!(this instanceof a))
                    throw new TypeError("Constructor cannot called be as a function.");
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                var t = s(e.toString());
                this.checksum = c(1, t)
            }
            ).prototype = n,
            t),
            o && (a.fromBuffer = ((r = function(e) {
                if (!(this instanceof a))
                    throw new TypeError("Constructor cannot called be as a function.");
                if (!i(e))
                    throw new Error("First argument needs to be ArrayBuffer.");
                var t = new Uint8Array(e);
                return this.checksum = u(1, t)
            }
            ).prototype = n,
            r)),
            n.update = function(e) {
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                return e = e.toString(),
                this.checksum = c(this.checksum, e)
            }
            ,
            n.updateUtf8 = function(e) {
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                var t = s(e.toString());
                return this.checksum = c(this.checksum, t)
            }
            ,
            o && (n.updateBuffer = function(e) {
                if (!i(e))
                    throw new Error("First argument needs to be ArrayBuffer.");
                var t = new Uint8Array(e);
                return this.checksum = u(this.checksum, t)
            }
            ),
            n.clone = function() {
                return new d(this.checksum)
            }
            ,
            a);
            return h.from = function(e) {
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                return c(1, e.toString())
            }
            ,
            h.fromUtf8 = function(e) {
                if (null === e)
                    throw new Error("First argument needs to be a string.");
                var t = s(e.toString());
                return c(1, t)
            }
            ,
            o && (h.fromBuffer = function(e) {
                if (!i(e))
                    throw new Error("First argument need to be ArrayBuffer.");
                var t = new Uint8Array(e);
                return u(1, t)
            }
            ),
            h
        }()
    }(g);
    var notARegexp = function(e) {
        if (isRegexp(e))
            throw TypeError("The method doesn't accept regular expressions");
        return e
    }
      , MATCH$2 = wellKnownSymbol("match")
      , correctIsRegexpLogic = function(e) {
        var t = /./;
        try {
            "/./"[e](t)
        } catch (r) {
            try {
                return t[MATCH$2] = !1,
                "/./"[e](t)
            } catch (e) {}
        }
        return !1
    };
    function getCellValue(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        if (!isRealNum(e) || !isRealNum(t))
            return tooltip.info("Arguments row or column cannot be null or undefined.", "");
        var a, n = getSheetIndex(Store.currentSheetIndex), o = _objectSpread2({}, r), l = o.type, i = void 0 === l ? "v" : l, s = o.order, c = void 0 === s ? n : s, u = Store.luckysheetfile[c].data, h = u[e][t];
        return "object" == getObjType(h) && (a = h[i],
        "f" == i && null != a ? a = luckysheetformula.functionHTMLGenerate(a) : "f" == i ? a = h.v : h && h.ct && "yyyy-MM-dd" == h.ct.fa && (a = h.m)),
        null == a && (a = null),
        a
    }
    function setCellValue(e, t, r) {
        var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
        if (!isRealNum(e) || !isRealNum(t))
            return tooltip.info("The row or column parameter is invalid.", "");
        var n = _objectSpread2({}, a)
          , o = n.order
          , l = void 0 === o ? getSheetIndex(Store.currentSheetIndex) : o
          , i = n.isRefresh
          , s = void 0 === i || i
          , c = n.success
          , u = Store.luckysheetfile[l];
        if (null == u)
            return tooltip.info("The order parameter is invalid.", "");
        var h = $.extend(!0, [], u.data);
        0 == h.length && (h = sheetmanage.buildGridData(u));
        var d = {
            bg: 1,
            ff: 1,
            fc: 1,
            bl: 1,
            it: 1,
            fs: 1,
            cl: 1,
            un: 1,
            vt: 1,
            ht: 1,
            mc: 1,
            tr: 1,
            tb: 1,
            rt: 1,
            qp: 1
        };
        
        if (null == r || 0 == r.toString().length)
            luckysheetformula.delFunctionGroup(e, t),
            setcellvalue(e, t, h, r);
        else if (r instanceof Object) {
            var f = {};
            for (var m in null != r.f && null == r.v ? (f.f = r.f,
            null != r.ct && (f.ct = r.ct),
            h = luckysheetformula.updatecell(e, t, f, !1).data) : (null != r.ct && (f.ct = r.ct),
            null != r.f && (f.f = r.f),
            null != r.v && (f.v = r.v),
            null != r.m && (f.m = r.m),
            luckysheetformula.delFunctionGroup(e, t),
            setcellvalue(e, t, h, f)),
            r) {
                var p = r[m];
                m in d && menuButton.updateFormatCell(h, m, p, e, e, t, t)
            }
        } else
            "=" == r.toString().substr(0, 1) || "<span" == r.toString().substr(0, 5) ? h = luckysheetformula.updatecell(e, t, r, !1).data : (luckysheetformula.delFunctionGroup(e, t),
            setcellvalue(e, t, h, r));
        u.index == Store.currentSheetIndex && s ? jfrefreshgrid(h, [{
            row: [e, e],
            column: [t, t]
        }]) : u.data = h,
        c && "function" == typeof c && c(h)
    }
    function clearCell(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        if (!isRealNum(e) || !isRealNum(t))
            return tooltip.info("Arguments row and column cannot be null or undefined.", "");
        var a = getSheetIndex(Store.currentSheetIndex)
          , n = _objectSpread2({}, r)
          , o = n.order
          , l = void 0 === o ? a : o
          , i = n.success
          , s = $.extend(!0, [], Store.luckysheetfile[l].data)
          , c = s[e][t];
        "object" == getObjType(c) ? (delete c.m,
        delete c.v,
        null != c.f && (delete c.f,
        luckysheetformula.delFunctionGroup(e, t, l),
        delete c.spl)) : c = null,
        l === a ? jfrefreshgrid(s, [{
            row: [e, e],
            column: [t, t]
        }]) : Store.luckysheetfile[l].data = s,
        i && "function" == typeof i && i(c)
    }
    function deleteCell(e, t, r) {
        var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}
          , n = ["left", "up"];
        if (!e || n.indexOf(e) < 0)
            return tooltip.info("Arguments move cannot be null or undefined and its value must be 'left' or 'up'", "");
        if (!isRealNum(t) || !isRealNum(r))
            return tooltip.info("Arguments row and column cannot be null or undefined.", "");
        var o, l = getSheetIndex(Store.currentSheetIndex), i = _objectSpread2({}, a), s = i.order, c = void 0 === s ? l : s, u = i.success, h = "move" + e.replace(e[0], e[0].toUpperCase());
        c && Store.luckysheetfile[c] && (o = Store.luckysheetfile[c].index),
        luckysheetDeleteCell(h, t, t, r, r, o),
        u && "function" == typeof u && u()
    }
    function setCellFormat(e, t, r, a) {
        var n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {};
        if (!isRealNum(e) || !isRealNum(t))
            return tooltip.info("Arguments row or column cannot be null or undefined.", "");
        if (!r)
            return tooltip.info("Arguments attr cannot be null or undefined.", "");
        var o = getSheetIndex(Store.currentSheetIndex)
          , l = _objectSpread2({}, n)
          , i = l.order
          , s = void 0 === i ? o : i
          , c = l.success
          , u = $.extend(!0, [], Store.luckysheetfile[s].data)
          , h = u[e][t];
        if (!("ct" != r || a && a.hasOwnProperty("fa") && a.hasOwnProperty("t")))
            return new TypeError("While set attribute 'ct' to cell, the value must have property 'fa' and 't'");
        h[r] = a,
        jfrefreshgrid(u, {
            row: [e],
            column: [t]
        }),
        c && "function" == typeof c && c(h)
    }
    function find$1(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (!e && 0 != e)
            return tooltip.info("Search content cannot be null or empty", "");
        for (var r = getSheetIndex(Store.currentSheetIndex), a = _objectSpread2({}, t), n = a.isRegularExpression, o = void 0 !== n && n, l = a.isWholeWord, i = void 0 !== l && l, s = a.isCaseSensitive, c = void 0 !== s && s, u = a.order, h = void 0 === u ? r : u, d = Store.luckysheetfile[h].data, f = [], m = 0; m < d.length; m++)
            for (var p = d[m], g = 0; g < p.length; g++) {
                var y = p[g];
                if (y)
                    if (y.row = m,
                    y.column = g,
                    i)
                        c ? e.toString() == y.m && f.push(y) : y.m && e.toString().toLowerCase() == y.m.toLowerCase() && f.push(y);
                    else if (o) {
                        (c ? new RegExp(func_methods.getRegExpStr(e),"g") : new RegExp(func_methods.getRegExpStr(e),"ig")).test(y.m) && f.push(y)
                    } else if (c) {
                        var v = new RegExp(func_methods.getRegExpStr(e),"g");
                        v.test(y.m) && f.push(y)
                    } else {
                        var A = new RegExp(func_methods.getRegExpStr(e),"ig");
                        A.test(y.m) && f.push(y)
                    }
            }
        return f
    }
    function replace$1(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
          , a = find$1(e, r);
        return a.forEach((function(e) {
            e.m = t,
            setCellValue(e.row, e.column, t, r)
        }
        )),
        r.success && "function" == typeof r.success && r.success(a),
        a
    }
    function exitEditMode() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
        luckysheetformula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]),
        e.success && "function" == typeof e.success && e.success()
    }
    function frozenFirstRow(e) {
        if (luckysheetFreezen.saveFrozen("freezenRow", e),
        !e || e == getSheetIndex(Store.currentSheetIndex)) {
            var t = $("#luckysheet-cell-main").scrollTop()
              , r = luckysheet_searcharray(Store.visibledatarow, t);
            -1 == r && (r = 0);
            var a = Store.visibledatarow[r] - 2 - t + Store.columnHeaderHeight
              , n = [Store.visibledatarow[r], r + 1, t, luckysheetFreezen.cutVolumn(Store.visibledatarow, r + 1), a];
            luckysheetFreezen.saveFreezen(n, a, null, null),
            null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            luckysheetFreezen.createFreezenHorizontal(n, a),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()
        }
    }
    function frozenFirstColumn(e) {
        if (luckysheetFreezen.saveFrozen("freezenColumn", e),
        !e || e == getSheetIndex(Store.currentSheetIndex)) {
            var t = $("#luckysheet-cell-main").scrollLeft()
              , r = luckysheet_searcharray(Store.visibledatacolumn, t);
            -1 == r && (r = 0);
            var a = Store.visibledatacolumn[r] - 2 - t + Store.rowHeaderWidth
              , n = [Store.visibledatacolumn[r], r + 1, t, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, r + 1), a];
            luckysheetFreezen.saveFreezen(null, null, n, a),
            null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()),
            luckysheetFreezen.createFreezenVertical(n, a),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()
        }
    }
    function frozenRowRange(e, t) {
        var r = locale().freezen;
        if (e && (e.hasOwnProperty("row_focus") || luckysheetformula.iscelldata(e))) {
            if ("string" == typeof e && luckysheetformula.iscelldata(e) && (e = {
                row_focus: (e = luckysheetformula.getcellrange(e)).row[0],
                column_focus: e.column[0]
            }),
            luckysheetFreezen.saveFrozen("freezenRowRange", t, e),
            !t || t == getSheetIndex(Store.currentSheetIndex)) {
                var a = $("#luckysheet-cell-main").scrollTop()
                  , n = luckysheet_searcharray(Store.visibledatarow, a)
                  , o = e.row_focus;
                o > n && (n = o),
                -1 == n && (n = 0);
                var l = Store.visibledatarow[n] - 2 - a + Store.columnHeaderHeight
                  , i = [Store.visibledatarow[n], n + 1, a, luckysheetFreezen.cutVolumn(Store.visibledatarow, n + 1), l];
                luckysheetFreezen.saveFreezen(i, l, null, null),
                null != luckysheetFreezen.freezenverticaldata && (luckysheetFreezen.cancelFreezenVertical(),
                luckysheetFreezen.createAssistCanvas(),
                luckysheetrefreshgrid()),
                luckysheetFreezen.createFreezenHorizontal(i, l),
                luckysheetFreezen.createAssistCanvas(),
                luckysheetrefreshgrid()
            }
        } else
            isEditMode() ? alert(r.noSeletionError) : tooltip.info(r.noSeletionError, "")
    }
    function frozenColumnRange(e, t) {
        var r = locale().freezen
          , a = "string" == typeof e && luckysheetformula.iscelldata(e);
        if (e && (e.hasOwnProperty("column_focus") || a)) {
            if (a && (e = {
                row_focus: (e = luckysheetformula.getcellrange(e)).row[0],
                column_focus: e.column[0]
            }),
            luckysheetFreezen.saveFrozen("freezenColumnRange", t, e),
            !t || t == getSheetIndex(Store.currentSheetIndex)) {
                var n = $("#luckysheet-cell-main").scrollLeft()
                  , o = luckysheet_searcharray(Store.visibledatacolumn, n)
                  , l = e.column_focus;
                l > o && (o = l),
                -1 == o && (o = 0);
                var i = Store.visibledatacolumn[o] - 2 - n + Store.rowHeaderWidth
                  , s = [Store.visibledatacolumn[o], o + 1, n, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, o + 1), i];
                luckysheetFreezen.saveFreezen(null, null, s, i),
                null != luckysheetFreezen.freezenhorizontaldata && (luckysheetFreezen.cancelFreezenHorizontal(),
                luckysheetFreezen.createAssistCanvas(),
                luckysheetrefreshgrid()),
                luckysheetFreezen.createFreezenVertical(s, i),
                luckysheetFreezen.createAssistCanvas(),
                luckysheetrefreshgrid()
            }
        } else
            isEditMode() ? alert(r.noSeletionError) : tooltip.info(r.noSeletionError, "")
    }
    function cancelFrozen(e) {
        luckysheetFreezen.saveFrozen("freezenCancel", e),
        e && e != getSheetIndex(Store.currentSheetIndex) || (null != luckysheetFreezen.freezenverticaldata && luckysheetFreezen.cancelFreezenVertical(),
        null != luckysheetFreezen.freezenhorizontaldata && luckysheetFreezen.cancelFreezenHorizontal(),
        luckysheetFreezen.createAssistCanvas(),
        luckysheetrefreshgrid())
    }
    function setHorizontalFrozen(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = getSheetIndex(Store.currentSheetIndex)
          , a = _objectSpread2({}, t)
          , n = a.range
          , o = a.order
          , l = void 0 === o ? r : o
          , i = a.success;
        cancelFrozen(l),
        e ? frozenRowRange(n, l) : frozenFirstRow(l),
        i && "function" == typeof i && i()
    }
    function setVerticalFrozen(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = getSheetIndex(Store.currentSheetIndex)
          , a = _objectSpread2({}, t)
          , n = a.range
          , o = a.order
          , l = void 0 === o ? r : o
          , i = a.success;
        cancelFrozen(l),
        e ? frozenColumnRange(n, l) : frozenFirstColumn(l),
        i && "function" == typeof i && i()
    }
    function setBothFrozen(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = getSheetIndex(Store.currentSheetIndex)
          , a = _objectSpread2({}, t)
          , n = a.range
          , o = a.order
          , l = void 0 === o ? r : o
          , i = (a.success,
        !l || l == getSheetIndex(Store.currentSheetIndex))
          , s = locale().freezen;
        if (cancelFrozen(l),
        e) {
            luckysheetFreezen.saveFrozen("freezenRCRange", l, n);
            var c = "string" == typeof n && luckysheetformula.iscelldata(n);
            if (i) {
                if (!(n && n.hasOwnProperty("column_focus") && n.hasOwnProperty("row_focus") || c))
                    return void (isEditMode() ? alert(s.noSeletionError) : tooltip.info(s.noSeletionError, ""));
                c && (n = {
                    row_focus: (n = luckysheetformula.getcellrange(n)).row[0],
                    column_focus: n.column[0]
                });
                var u = $("#luckysheet-cell-main").scrollTop()
                  , h = luckysheet_searcharray(Store.visibledatarow, u)
                  , d = n.row_focus;
                d > h && (h = d),
                -1 == h && (h = 0);
                var f = Store.visibledatarow[h] - 2 - u + Store.columnHeaderHeight
                  , m = [Store.visibledatarow[h], h + 1, u, luckysheetFreezen.cutVolumn(Store.visibledatarow, h + 1), f];
                luckysheetFreezen.saveFreezen(m, f, null, null),
                luckysheetFreezen.createFreezenHorizontal(m, f);
                var p = $("#luckysheet-cell-main").scrollLeft()
                  , g = luckysheet_searcharray(Store.visibledatacolumn, p)
                  , y = n.column_focus;
                y > g && (g = y),
                -1 == g && (g = 0);
                var v = Store.visibledatacolumn[g] - 2 - p + Store.rowHeaderWidth
                  , A = [Store.visibledatacolumn[g], g + 1, p, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, g + 1), v];
                luckysheetFreezen.saveFreezen(null, null, A, v),
                luckysheetFreezen.createFreezenVertical(A, v),
                luckysheetFreezen.createAssistCanvas(),
                luckysheetrefreshgrid()
            }
        } else if (luckysheetFreezen.saveFrozen("freezenRC", l),
        i) {
            var b = $("#luckysheet-cell-main").scrollTop()
              , k = luckysheet_searcharray(Store.visibledatarow, b);
            -1 == k && (k = 0);
            var w = Store.visibledatarow[k] - 2 - b + Store.columnHeaderHeight
              , x = [Store.visibledatarow[k], k + 1, b, luckysheetFreezen.cutVolumn(Store.visibledatarow, k + 1), w];
            luckysheetFreezen.saveFreezen(x, w, null, null),
            luckysheetFreezen.createFreezenHorizontal(x, w);
            var S = $("#luckysheet-cell-main").scrollLeft()
              , _ = luckysheet_searcharray(Store.visibledatacolumn, S);
            -1 == _ && (_ = 0);
            var C = Store.visibledatacolumn[_] - 2 - S + Store.rowHeaderWidth
              , T = [Store.visibledatacolumn[_], _ + 1, S, luckysheetFreezen.cutVolumn(Store.visibledatacolumn, _ + 1), C];
            luckysheetFreezen.saveFreezen(null, null, T, C),
            luckysheetFreezen.createFreezenVertical(T, C),
            luckysheetFreezen.createAssistCanvas(),
            luckysheetrefreshgrid()
        }
    }
    function insertRowOrColumn(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
          , r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        if (!isRealNum(t))
            return tooltip.info("The index parameter is invalid.", "");
        var a, n = getSheetIndex(Store.currentSheetIndex), o = _objectSpread2({}, r), l = o.number, i = void 0 === l ? 1 : l, s = o.order, c = void 0 === s ? n : s, u = o.success;
        isRealNum(i) ? (i = parseInt(i)) < 1 || i > 100 ? isEditMode() ? alert(locale_info.tipInputNumberLimit) : tooltip.info(locale_info.tipInputNumberLimit, "") : (c && Store.luckysheetfile[c] && (a = Store.luckysheetfile[c].index),
        luckysheetextendtable(e, t, i, "lefttop", a),
        u && "function" == typeof u && u()) : isEditMode() ? alert(locale_info.tipInputNumber) : tooltip.info(locale_info.tipInputNumber, "")
    }
    function insertRow() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0
          , t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        insertRowOrColumn("row", e, t)
    }
    function insertColumn() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0
          , t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        insertRowOrColumn("column", e, t)
    }
    function deleteRowOrColumn(e, t, r) {
        var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
        if (!isRealNum(t) || !isRealNum(r))
            return tooltip.info("Please enter the index for deleting rows or columns correctly.", "");
        var n, o = getSheetIndex(Store.currentSheetIndex), l = _objectSpread2({}, a), i = l.order, s = void 0 === i ? o : i, c = l.success;
        s && Store.luckysheetfile[s] && (n = Store.luckysheetfile[s].index),
        luckysheetdeletetable(e, t, r, n),
        c && "function" == typeof c && c()
    }
    function deleteRow(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        deleteRowOrColumn("row", e, t, r)
    }
    function deleteColumn(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        deleteRowOrColumn("column", e, t, r)
    }
    function hideRowOrColumn(e, t, r) {
        var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
        if (!isRealNum(t) || !isRealNum(r))
            return tooltip.info("Please enter the index for deleting rows or columns correctly.", "");
        var n = getSheetIndex(Store.currentSheetIndex)
          , o = _objectSpread2({}, a)
          , l = o.order
          , i = void 0 === l ? n : l
          , s = o.success
          , c = Store.luckysheetfile[i]
          , u = "row" === e ? "rowhidden" : "colhidden"
          , h = $.extend(!0, {}, c.config);
        null == h[u] && (h[u] = {});
        for (var d = t; d <= r; d++)
            h[u][d] = 0;
        if (Store.clearjfundo) {
            var f = {};
            f.type = "row" === e ? "showHidRows" : "showHidCols",
            f.sheetIndex = c.index,
            f.config = $.extend(!0, {}, c.config),
            f.curconfig = h,
            Store.jfundo = [],
            Store.jfredo.push(f)
        }
        Store.luckysheetfile[i].config = h,
        server.saveParam("cg", c.index, h[u], {
            k: u
        }),
        i == n && (Store.config = h,
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)),
        s && "function" == typeof s && s()
    }
    function showRowOrColumn(e, t, r) {
        var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
        if (!isRealNum(t) || !isRealNum(r))
            return tooltip.info("Please enter the index for deleting rows or columns correctly.", "");
        var n = getSheetIndex(Store.currentSheetIndex)
          , o = _objectSpread2({}, a)
          , l = o.order
          , i = void 0 === l ? n : l
          , s = o.success
          , c = Store.luckysheetfile[i]
          , u = "row" === e ? "rowhidden" : "colhidden"
          , h = $.extend(!0, {}, c.config);
        if (null != h[u]) {
            for (var d = t; d <= r; d++)
                delete h[u][d];
            if (Store.clearjfundo) {
                var f = {};
                f.type = "row" === e ? "showHidRows" : "showHidCols",
                f.sheetIndex = c.index,
                f.config = $.extend(!0, {}, c.config),
                f.curconfig = h,
                Store.jfundo = [],
                Store.jfredo.push(f)
            }
            Store.luckysheetfile[i].config = Store.config,
            server.saveParam("cg", c.index, h[u], {
                k: u
            }),
            i === n && (Store.config = h,
            jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)),
            s && "function" == typeof s && s()
        }
    }
    function hideRow(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        hideRowOrColumn("row", e, t, r)
    }
    function showRow(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        showRowOrColumn("row", e, t, r)
    }
    function hideColumn(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        hideRowOrColumn("column", e, t, r)
    }
    function showColumn(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        showRowOrColumn("column", e, t, r)
    }
    function setRowHeight(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("object" != getObjType(e))
            return tooltip.info("The rowInfo parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = $.extend(!0, {}, l.config);
        for (var s in null == i.rowlen && (i.rowlen = {}),
        e)
            if (parseInt(s) >= 0) {
                var c = e[s];
                Number(c) >= 0 && (i.rowlen[parseInt(s)] = Number(c))
            }
        l.config = i,
        server.saveParam("cg", l.index, i.rowlen, {
            k: "rowlen"
        }),
        l.index == Store.currentSheetIndex && (Store.config = i,
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)),
        o && "function" == typeof o && o()
    }
    function setColumnWidth(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("object" != getObjType(e))
            return tooltip.info("The columnInfo parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = $.extend(!0, {}, l.config);
        for (var s in null == i.columnlen && (i.columnlen = {}),
        e)
            if (parseInt(s) >= 0) {
                var c = e[s];
                Number(c) >= 0 && (i.columnlen[parseInt(s)] = Number(c))
            }
        l.config = i,
        server.saveParam("cg", l.index, i.columnlen, {
            k: "columnlen"
        }),
        l.index == Store.currentSheetIndex && (Store.config = i,
        jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length)),
        o && "function" == typeof o && o()
    }
    function getRowHeight(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("array" != getObjType(e) || 0 == e.length)
            return tooltip.info("The rowInfo parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = $.extend(!0, {}, l.config)
          , s = i.rowlen || {}
          , c = {};
        return e.forEach((function(e) {
            if (parseInt(e) >= 0) {
                var t = s[parseInt(e)] || Store.defaultrowlen;
                c[parseInt(e)] = t
            }
        }
        )),
        setTimeout((function() {
            o && "function" == typeof o && o()
        }
        ), 1),
        c
    }
    function getColumnWidth(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("array" != getObjType(e) || 0 == e.length)
            return tooltip.info("The columnInfo parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = $.extend(!0, {}, l.config)
          , s = i.columnlen || {}
          , c = {};
        return e.forEach((function(e) {
            if (parseInt(e) >= 0) {
                var t = s[parseInt(e)] || Store.defaultcollen;
                c[parseInt(e)] = t
            }
        }
        )),
        setTimeout((function() {
            o && "function" == typeof o && o()
        }
        ), 1),
        c
    }
    function getDefaultRowHeight() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success;
        return setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        Store.luckysheetfile[a].defaultRowHeight
    }
    function getDefaultColWidth() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success;
        return setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        Store.luckysheetfile[a].defaultColWidth
    }
    function getRange() {
        for (var e = Store.luckysheet_select_save, t = [], r = 0; r < e.length; r++) {
            var a = e[r]
              , n = {
                row: a.row,
                column: a.column
            };
            t.push(n)
        }
        return t
    }
    function getRangeValue() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = getSheetIndex(Store.currentSheetIndex)
          , r = _objectSpread2({}, e)
          , a = r.range
          , n = r.order
          , o = void 0 === n ? t : n
          , l = Store.luckysheetfile[o];
        if (!a || "object" === _typeof(a))
            return getdatabyselection(a, l.index);
        if ("string" == typeof a) {
            if (luckysheetformula.iscelldata(a))
                return getdatabyselection(luckysheetformula.getcellrange(a), l.index);
            tooltip.info("The range is invalid, please check range parameter.", "")
        }
    }
    function getRangeHtml() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.range
          , a = void 0 === r ? Store.luckysheet_select_save : r
          , n = t.order
          , o = void 0 === n ? getSheetIndex(Store.currentSheetIndex) : n;
        t.success;
        if ("string" == getObjType(a)) {
            if (!luckysheetformula.iscelldata(a))
                return tooltip.info("The range parameter is invalid.", "");
            var l = luckysheetformula.getcellrange(a);
            a = [{
                row: l.row,
                column: l.column
            }]
        } else if ("object" == getObjType(a)) {
            if (null == a.row || null == a.column)
                return tooltip.info("The range parameter is invalid.", "");
            a = [{
                row: a.row,
                column: a.column
            }]
        }
        if ("array" != getObjType(a))
            return tooltip.info("The range parameter is invalid.", "");
        var i = Store.luckysheetfile[o];
        if (null == i)
            return tooltip.info("The order parameter is invalid.", "");
        var s = $.extend(!0, {}, i.config);
        if (null != s.merge) {
            for (var c = !1, u = 0; u < a.length; u++) {
                var h = a[u].row[0]
                  , d = a[u].row[1]
                  , f = a[u].column[0]
                  , m = a[u].column[1];
                if (c = hasPartMC(s, h, d, f, m))
                    break
            }
            if (c)
                return tooltip.info("Cannot perform this operation on partially merged cells", "")
        }
        var p = $.extend(!0, [], i.luckysheet_conditionformat_save);
        if (a.length > 1 && p.length > 0) {
            for (var g = !1, y = conditionformat.getComputeMap(i.index), v = 0; v < a.length; v++) {
                for (var A = a[v].row[0], b = a[v].row[1], k = a[v].column[0], w = a[v].column[1], x = A; x <= b; x++) {
                    for (var S = k; S <= w; S++)
                        if (null != conditionformat.checksCF(x, S, y)) {
                            g = !0;
                            break
                        }
                    if (g)
                        break
                }
                if (g)
                    break
            }
            if (g)
                return tooltip.info("Cannot perform this operation on multiple selection areas, please select a single area", "")
        }
        if (a.length > 1) {
            for (var _ = !0, C = a[0].row[0], T = a[0].row[1], E = !0, I = a[0].column[0], R = a[0].column[1], B = 1; B < a.length; B++)
                a[B].row[0] == C && a[B].row[1] == T || (_ = !1),
                a[B].column[0] == I && a[B].column[1] == R || (E = !1);
            if (!_ && !E || selectIsOverlap(a))
                return tooltip.info("Cannot perform this operation on multiple selection areas, please select a single area", "")
        }
        for (var N, F = [], P = [], L = 0; L < a.length; L++)
            for (var O = a[L].row[0], D = a[L].row[1], M = a[L].column[0], U = a[L].column[1], H = O; H <= D; H++)
                if (null == s.rowhidden || null == s.rowhidden[H]) {
                    F.includes(H) || F.push(H);
                    for (var q = M; q <= U; q++)
                        null != s.colhidden && null != s.colhidden[q] || P.includes(q) || P.push(q)
                }
        s.borderInfo && s.borderInfo.length > 0 && (N = getBorderInfoCompute(i.index));
        var z = i.data;
        null != z && 0 != z.length || (z = sheetmanage.buildGridData(i));
        var j = ""
          , V = "";
        F = F.sort(),
        P = P.sort();
        for (var Q = 0; Q < F.length; Q++) {
            var G = F[Q];
            if (null == s.rowhidden || null == s.rowhidden[G]) {
                j += "<tr>";
                for (var K = 0; K < P.length; K++) {
                    var W = P[K];
                    if (null == s.colhidden || null == s.colhidden[W]) {
                        var Y = '<td ${span} style="${style}">';
                        if (null != z[G] && null != z[G][W]) {
                            var X = ""
                              , J = "";
                            G == F[0] && (null == s.columnlen || null == s.columnlen[W.toString()] ? V += '<colgroup width="72px"></colgroup>' : V += '<colgroup width="' + s.columnlen[W.toString()] + 'px"></colgroup>'),
                            W == P[0] && (null == s.rowlen || null == s.rowlen[G.toString()] ? X += "height:19px;" : X += "height:" + s.rowlen[G.toString()] + "px;");
                            var Z = /^(w|W)((0?)|(0\.0+))$/
                              , ee = void 0;
                            if (ee = null != z[G][W].ct && null != z[G][W].ct.fa && z[G][W].ct.fa.match(Z) ? getcellvalue(G, W, z) : getcellvalue(G, W, z, "m"),
                            X += menuButton.getStyleByCell(z, G, W),
                            "object" == getObjType(z[G][W]) && "mc"in z[G][W]) {
                                if (!("rs"in z[G][W].mc))
                                    continue;
                                if (J = 'rowspan="' + z[G][W].mc.rs + '" colspan="' + z[G][W].mc.cs + '"',
                                N && N[G + "_" + W]) {
                                    for (var te = {
                                        color: {},
                                        style: {}
                                    }, re = {
                                        color: {},
                                        style: {}
                                    }, ae = {
                                        color: {},
                                        style: {}
                                    }, ne = {
                                        color: {},
                                        style: {}
                                    }, oe = G; oe < G + z[G][W].mc.rs; oe++)
                                        for (var le = W; le < W + z[G][W].mc.cs; le++) {
                                            if (oe == G && N[oe + "_" + le] && N[oe + "_" + le].t) {
                                                var ie = N[oe + "_" + le].t.style
                                                  , se = N[oe + "_" + le].t.color;
                                                null == ae.style[ie] ? ae.style[ie] = 1 : ae.style[ie] = ae.style[ie] + 1,
                                                null == ae.color[se] ? ae.color[se] = 1 : ae.color[se] = ae.color[se] + 1
                                            }
                                            if (oe == G + z[G][W].mc.rs - 1 && N[oe + "_" + le] && N[oe + "_" + le].b) {
                                                var ce = N[oe + "_" + le].b.style
                                                  , ue = N[oe + "_" + le].b.color;
                                                null == ne.style[ce] ? ne.style[ce] = 1 : ne.style[ce] = ne.style[ce] + 1,
                                                null == ne.color[ue] ? ne.color[ue] = 1 : ne.color[ue] = ne.color[ue] + 1
                                            }
                                            if (le == W && N[oe + "_" + le] && N[oe + "_" + le].l) {
                                                var he = N[G + "_" + W].l.style
                                                  , de = N[oe + "_" + le].l.color;
                                                null == te.style[he] ? te.style[he] = 1 : te.style[he] = te.style[he] + 1,
                                                null == te.color[de] ? te.color[de] = 1 : te.color[de] = te.color[de] + 1
                                            }
                                            if (le == W + z[G][W].mc.cs - 1 && N[oe + "_" + le] && N[oe + "_" + le].r) {
                                                var fe = N[oe + "_" + le].r.style
                                                  , me = N[oe + "_" + le].r.color;
                                                null == re.style[fe] ? re.style[fe] = 1 : re.style[fe] = re.style[fe] + 1,
                                                null == re.color[me] ? re.color[me] = 1 : re.color[me] = re.color[me] + 1
                                            }
                                        }
                                    var pe = z[G][W].mc.rs
                                      , ge = z[G][W].mc.cs;
                                    if (JSON.stringify(te).length > 23) {
                                        var ye = null
                                          , ve = null;
                                        for (var Ae in te.color)
                                            te.color[Ae] >= pe / 2 && (ye = Ae);
                                        for (var be in te.style)
                                            te.style[be] >= pe / 2 && (ve = be);
                                        null != ye && null != ve && (X += "border-left:" + selection.getHtmlBorderStyle(ve, ye))
                                    }
                                    if (JSON.stringify(re).length > 23) {
                                        var ke = null
                                          , we = null;
                                        for (var xe in re.color)
                                            re.color[xe] >= pe / 2 && (ke = xe);
                                        for (var Se in re.style)
                                            re.style[Se] >= pe / 2 && (we = Se);
                                        null != ke && null != we && (X += "border-right:" + selection.getHtmlBorderStyle(we, ke))
                                    }
                                    if (JSON.stringify(ae).length > 23) {
                                        var _e = null
                                          , Ce = null;
                                        for (var Te in ae.color)
                                            ae.color[Te] >= ge / 2 && (_e = Te);
                                        for (var Ee in ae.style)
                                            ae.style[Ee] >= ge / 2 && (Ce = Ee);
                                        null != _e && null != Ce && (X += "border-top:" + selection.getHtmlBorderStyle(Ce, _e))
                                    }
                                    if (JSON.stringify(ne).length > 23) {
                                        var Ie = null
                                          , Re = null;
                                        for (var Be in ne.color)
                                            ne.color[Be] >= ge / 2 && (Ie = Be);
                                        for (var Ne in ne.style)
                                            ne.style[Ne] >= ge / 2 && (Re = Ne);
                                        null != Ie && null != Re && (X += "border-bottom:" + selection.getHtmlBorderStyle(Re, Ie))
                                    }
                                }
                            } else if (N && N[G + "_" + W]) {
                                if (N[G + "_" + W].l) {
                                    var Fe = N[G + "_" + W].l.style
                                      , Pe = N[G + "_" + W].l.color;
                                    X += "border-left:" + selection.getHtmlBorderStyle(Fe, Pe)
                                }
                                if (N[G + "_" + W].r) {
                                    var $e = N[G + "_" + W].r.style
                                      , Le = N[G + "_" + W].r.color;
                                    X += "border-right:" + selection.getHtmlBorderStyle($e, Le)
                                }
                                if (N[G + "_" + W].b) {
                                    var Oe = N[G + "_" + W].b.style
                                      , De = N[G + "_" + W].b.color;
                                    X += "border-bottom:" + selection.getHtmlBorderStyle(Oe, De)
                                }
                                if (N[G + "_" + W].t) {
                                    var Me = N[G + "_" + W].t.style
                                      , Ue = N[G + "_" + W].t.color;
                                    X += "border-top:" + selection.getHtmlBorderStyle(Me, Ue)
                                }
                            }
                            Y = replaceHtml$1(Y, {
                                style: X,
                                span: J
                            }),
                            null == ee && (ee = getcellvalue(G, W, z)),
                            null == ee && (ee = " "),
                            Y += ee
                        } else {
                            var He = "";
                            if (N && N[G + "_" + W]) {
                                if (N[G + "_" + W].l) {
                                    var qe = N[G + "_" + W].l.style
                                      , ze = N[G + "_" + W].l.color;
                                    He += "border-left:" + selection.getHtmlBorderStyle(qe, ze)
                                }
                                if (N[G + "_" + W].r) {
                                    var je = N[G + "_" + W].r.style
                                      , Ve = N[G + "_" + W].r.color;
                                    He += "border-right:" + selection.getHtmlBorderStyle(je, Ve)
                                }
                                if (N[G + "_" + W].b) {
                                    var Qe = N[G + "_" + W].b.style
                                      , Ge = N[G + "_" + W].b.color;
                                    He += "border-bottom:" + selection.getHtmlBorderStyle(Qe, Ge)
                                }
                                if (N[G + "_" + W].t) {
                                    var Ke = N[G + "_" + W].t.style
                                      , We = N[G + "_" + W].t.color;
                                    He += "border-top:" + selection.getHtmlBorderStyle(Ke, We)
                                }
                            }
                            Y += "",
                            G == F[0] && (null == s.columnlen || null == s.columnlen[W.toString()] ? V += '<colgroup width="72px"></colgroup>' : V += '<colgroup width="' + s.columnlen[W.toString()] + 'px"></colgroup>'),
                            W == P[0] && (null == s.rowlen || null == s.rowlen[G.toString()] ? He += "height:19px;" : He += "height:" + s.rowlen[G.toString()] + "px;"),
                            Y = replaceHtml$1(Y, {
                                style: He,
                                span: ""
                            }),
                            Y += " "
                        }
                        j += Y += "</td>"
                    }
                }
                j += "</tr>"
            }
        }
        return j = '<table data-type="luckysheet_copy_action_table">' + V + j + "</table>"
    }
    function getRangeArray(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["oneDimensional", "twoDimensional"];
        if (!r.includes(e))
            return tooltip.info("The dimensional parameter is invalid.", "");
        var a = _objectSpread2({}, t)
          , n = a.range
          , o = void 0 === n ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : n
          , l = a.order
          , i = void 0 === l ? getSheetIndex(Store.currentSheetIndex) : l
          , s = Store.luckysheetfile[i];
        if (null == s)
            return tooltip.info("The order parameter is invalid.", "");
        if ("string" == getObjType(o)) {
            if (!luckysheetformula.iscelldata(o))
                return tooltip.info("The range parameter is invalid.", "");
            o = luckysheetformula.getcellrange(o)
        }
        if ("object" != getObjType(o) || null == o.row || null == o.column)
            return tooltip.info("The range parameter is invalid.", "");
        var c = o.row[0]
          , u = o.row[1]
          , h = o.column[0]
          , d = o.column[1]
          , f = $.extend(!0, {}, s.config);
        if (null != f.merge) {
            var m = hasPartMC(f, c, u, h, d);
            if (m)
                return tooltip.info("Cannot perform this operation on partially merged cells", "")
        }
        var p = s.data;
        null != p && 0 != p.length || (p = sheetmanage.buildGridData(s));
        var g = [];
        if ("oneDimensional" == e)
            for (var y = c; y <= u; y++)
                for (var v = h; v <= d; v++) {
                    var A = p[y][v];
                    g.push(A)
                }
        else if ("twoDimensional" == e)
            for (var b = c; b <= u; b++) {
                for (var k = [], w = h; w <= d; w++) {
                    var x = p[b][w];
                    k.push(x)
                }
                g.push(k)
            }
        return g
    }
    function getRangeJson(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = Store.luckysheet_select_save
          , a = getSheetIndex(Store.currentSheetIndex)
          , n = _objectSpread2({}, t)
          , o = n.range
          , l = void 0 === o ? r : o
          , i = n.order
          , s = void 0 === i ? a : i
          , c = Store.luckysheetfile[s]
          , u = c.config;
        if (l && "string" == typeof l && luckysheetformula.iscelldata(l) && (l = luckysheetformula.getcellrange(l)),
        !l || l.length > 1)
            isEditMode() ? alert(locale_drag.noMulti) : tooltip.info(locale_drag.noMulti, "");
        else {
            if (null != u.merge) {
                var h = l[0].row[0]
                  , d = l[0].row[1]
                  , f = l[0].column[0]
                  , m = l[0].column[1];
                if (hasPartMC(u, h, d, f, m))
                    return void (isEditMode() ? alert(locale().drag.noPartMerge) : tooltip.info(locale().drag.noPartMerge, ""))
            }
            var p = getdatabyselection(l, s)
              , g = [];
            if (0 !== p.length) {
                if (e)
                    if (1 === p.length) {
                        for (var y = {}, v = 0; v < p[0].length; v++)
                            y[getcellvalue(0, v, p)] = "";
                        g.push(y)
                    } else
                        for (var A = 1; A < p.length; A++) {
                            for (var b = {}, k = 0; k < p[0].length; k++)
                                null == getcellvalue(0, k, p) ? b[""] = getcellvalue(A, k, p) : b[getcellvalue(0, k, p)] = getcellvalue(A, k, p);
                            g.push(b)
                        }
                else
                    for (var w = l[0].column[0], x = 0; x < p.length; x++) {
                        for (var S = {}, _ = 0; _ < p[0].length; _++)
                            S[chatatABC(_ + w)] = getcellvalue(x, _, p);
                        g.push(S)
                    }
                selection.copybyformat(new Event, JSON.stringify(g))
            }
        }
    }
    function getRangeDiagonal(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["normal", "anti", "offset"];
        if (r.indexOf(e) < 0)
            return tooltip.info("The type parameter must be included in ['normal', 'anti', 'offset']", "");
        var a = getSheetIndex(Store.currentSheetIndex)
          , n = Store.luckysheet_select_save
          , o = _objectSpread2({}, t)
          , l = o.column
          , i = void 0 === l ? 1 : l
          , s = o.range
          , c = void 0 === s ? n : s
          , u = o.order
          , h = void 0 === u ? a : u
          , d = Store.luckysheetfile[h]
          , f = d.config;
        if (c && "string" == typeof c && luckysheetformula.iscelldata(c) && (c = luckysheetformula.getcellrange(c)),
        !c || c.length > 1)
            isEditMode() ? alert(locale().drag.noMulti) : tooltip.info(locale().drag.noMulti, "");
        else {
            if (null != f.merge) {
                var m = c[0].row[0]
                  , p = c[0].row[1]
                  , g = c[0].column[0]
                  , y = c[0].column[1];
                if (hasPartMC(f, m, p, g, y))
                    return void (isEditMode() ? alert(locale().drag.noPartMerge) : tooltip.info(locale().drag.noPartMerge, ""))
            }
            var v = getdatabyselection(c, h)
              , A = [];
            if (0 !== v.length) {
                var b = v[0].length;
                switch (e) {
                case "normal":
                    for (var k = 0; k < v.length && !(k >= b); k++)
                        A.push(v[k][k]);
                    break;
                case "anti":
                    for (var w = 0; w < v.length && !(w >= b); w++)
                        A.push(v[w][b - w - 1]);
                    break;
                case "offset":
                    if ("NaN" == i.toString())
                        return void (isEditMode() ? alert(locale().drag.inputCorrect) : tooltip.info(locale().drag.inputCorrect, ""));
                    if (i < 0)
                        return void (isEditMode() ? alert(locale().drag.offsetColumnLessZero) : tooltip.info(locale().drag.offsetColumnLessZero, ""));
                    for (var x = 0; x < v.length && !(x + i >= b); x++)
                        A.push(v[x][x + i])
                }
                selection.copybyformat(new Event, JSON.stringify(A))
            }
        }
    }
    function getRangeBoolean() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = getSheetIndex(Store.currentSheetIndex)
          , r = Store.luckysheet_select_save
          , a = _objectSpread2({}, e)
          , n = a.range
          , o = void 0 === n ? r : n
          , l = a.order
          , i = void 0 === l ? t : l
          , s = Store.luckysheetfile[i]
          , c = s.config;
        if (o && "string" == typeof o && luckysheetformula.iscelldata(o) && (o = luckysheetformula.getcellrange(o)),
        !o || o.length > 1)
            isEditMode() ? alert(locale().drag.noMulti) : tooltip.info(locale().drag.noMulti, "");
        else {
            if (null != c.merge) {
                var u = o[0].row[0]
                  , h = o[0].row[1]
                  , d = o[0].column[0]
                  , f = o[0].column[1];
                if (hasPartMC(c, u, h, d, f))
                    return void (isEditMode() ? alert(locale().drag.noPartMerge) : tooltip.info(locale().drag.noPartMerge, ""))
            }
            var m = getdatabyselection(o, i)
              , p = [];
            if (0 !== m.length) {
                for (var g = 0; g < m.length; g++) {
                    for (var y = [], v = 0; v < m[0].length; v++) {
                        var A = !1
                          , b = void 0;
                        A = null != (b = "object" == getObjType(m[g][v]) ? m[g][v].v : m[g][v]) && "" != b && (null == (b = parseInt(b)) || b > 0),
                        y.push(A)
                    }
                    p.push(y)
                }
                selection.copybyformat(event, JSON.stringify(p))
            }
        }
    }
    function setRangeShow(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("string" == getObjType(e)) {
            if (!luckysheetformula.iscelldata(e))
                return tooltip.info("The range parameter is invalid.", "");
            var r = luckysheetformula.getcellrange(e);
            e = [{
                row: r.row,
                column: r.column
            }]
        } else if ("object" == getObjType(e)) {
            if (null == e.row || null == e.column)
                return tooltip.info("The range parameter is invalid.", "");
            e = [{
                row: e.row,
                column: e.column
            }]
        }
        if ("array" != getObjType(e))
            return tooltip.info("The range parameter is invalid.", "");
        var a = _objectSpread2({}, t)
          , n = a.show
          , o = void 0 === n || n
          , l = a.order
          , i = void 0 === l ? getSheetIndex(Store.currentSheetIndex) : l
          , s = a.success
          , c = Store.luckysheetfile[i];
        if (null == c)
            return tooltip.info("The order parameter is invalid.", "");
        c.luckysheet_select_save = e,
        c.index == Store.currentSheetIndex && (Store.luckysheet_select_save = e,
        selectHightlightShow(),
        o || ($("#luckysheet-cell-selected-boxs").hide(),
        $("#luckysheet-cell-selected-focus").hide(),
        $("#luckysheet-row-count-show").hide(),
        $("#luckysheet-column-count-show").hide(),
        $("#luckysheet-rows-h-selected").empty(),
        $("#luckysheet-cols-h-selected").empty())),
        s && "function" == typeof s && s()
    }
    function setRangeValue(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = getSheetIndex(Store.currentSheetIndex)
          , a = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
          , n = _objectSpread2({}, t)
          , o = n.range
          , l = void 0 === o ? a : o
          , i = n.order
          , s = void 0 === i ? r : i
          , c = n.success;
        if (null == e)
            return tooltip.info("The data which will be set to range cannot be null.", "");
        if (l instanceof Array)
            return tooltip.info("setRangeValue only supports a single selection.", "");
        "string" == typeof l && luckysheetformula.iscelldata(l) && (l = luckysheetformula.getcellrange(l));
        var u = l.row[1] - l.row[0] + 1
          , h = l.column[1] - l.column[0] + 1;
        if (e.length !== u || e[0].length !== h)
            return tooltip.info("The data to be set does not match the selection.", "");
        for (var d = 0; d < u; d++)
            for (var f = 0; f < h; f++) {
                var m = l.row[0] + d
                  , p = l.column[0] + f;
                setCellValue(m, p, e[d][f], {
                    order: s
                })
            }
        c && "function" == typeof c && c()
    }
    function setSingleRangeFormat(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
          , a = getSheetIndex(Store.currentSheetIndex)
          , n = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]
          , o = _objectSpread2({}, r)
          , l = o.range
          , i = void 0 === l ? n : l
          , s = o.order
          , c = void 0 === s ? a : s;
        if (null == e)
            return tooltip.info("Arguments attr cannot be null or undefined.", "");
        if (i instanceof Array)
            return tooltip.info("setRangeValue only supports a single selection.", "");
        "string" == typeof i && luckysheetformula.iscelldata(i) && (i = luckysheetformula.getcellrange(i));
        var u = i.row[1] - i.row[0] + 1
          , h = i.column[1] - i.column[0] + 1;
        if (data.length !== u || data[0].length !== h)
            return tooltip.info("The data to be set does not match the selection", "");
        for (var d = 0; d < u; d++)
            for (var f = 0; f < h; f++) {
                var m = i.row[0] + d
                  , p = i.column[0] + f;
                setCellFormat(m, p, e, t, {
                    order: c
                })
            }
    }
    function setRangeFormat(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
          , a = (getSheetIndex(Store.currentSheetIndex),
        Store.luckysheet_select_save)
          , n = _objectSpread2({}, r)
          , o = n.range
          , l = void 0 === o ? a : o
          , i = (n.order,
        n.success);
        if (l instanceof Array)
            for (var s = 0; s < l.length; s++)
                setSingleRangeFormat(l[s]);
        i && "function" == typeof i && i()
    }
    function setRangeFilter(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["open", "close"];
        if (!r.includes(e))
            return tooltip.info("The type parameter is invalid.", "");
        var a = _objectSpread2({}, t)
          , n = a.range
          , o = void 0 === n ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : n
          , l = a.order
          , i = void 0 === l ? getSheetIndex(Store.currentSheetIndex) : l
          , s = a.success
          , c = Store.luckysheetfile[i];
        if (null == c)
            return tooltip.info("The order parameter is invalid.", "");
        if ("string" == getObjType(o)) {
            if (!luckysheetformula.iscelldata(o))
                return tooltip.info("The range parameter is invalid.", "");
            o = luckysheetformula.getcellrange(o)
        }
        if ("object" != getObjType(o) || null == o.row || null == o.column)
            return tooltip.info("The range parameter is invalid.", "");
        if (setTimeout((function() {
            s && "function" == typeof s && s()
        }
        ), 1),
        "open" == e)
            return c.filter_select = o,
            c.index == Store.currentSheetIndex && createFilterOptions(o, c.filter),
            {
                row: o.row,
                column: o.column
            };
        if ("close" == e) {
            var u = $.extend(!0, {}, c.filter_select);
            return c.filter_select = null,
            $("#luckysheet-filter-selected-sheet" + c.index).remove(),
            $("#luckysheet-filter-options-sheet" + c.index).remove(),
            {
                row: u.row,
                column: u.column
            }
        }
    }
    function setRangeMerge(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["all", "horizontal", "vertical"];
        if (r.indexOf(e) < 0)
            return tooltip.info("The type parameter must be included in ['all', 'horizontal', 'vertical']", "");
        var a = getSheetIndex(Store.currentSheetIndex)
          , n = Store.luckysheet_select_save
          , o = _objectSpread2({}, t)
          , l = o.range
          , i = void 0 === l ? n : l
          , s = o.order
          , c = void 0 === s ? a : s
          , u = o.success
          , h = Store.luckysheetfile[c]
          , d = $.extend(!0, {}, h.config)
          , f = $.extend(!0, [], h.data);
        if (0 == f.length && (f = $.extend(!0, [], sheetmanage.buildGridData(h))),
        "string" == getObjType(i)) {
            if (!luckysheetformula.iscelldata(i))
                return tooltip.info("Incorrect selection format", "");
            var m = luckysheetformula.getcellrange(i);
            i = [{
                row: m.row,
                column: m.column
            }]
        } else if ("object" == getObjType(i)) {
            if (!i.hasOwnProperty("row") || !i.hasOwnProperty("column"))
                return tooltip.info("Incorrect selection format", "");
            i = [{
                row: i.row,
                column: i.column
            }]
        }
        if (selectIsOverlap(i))
            return tooltip.info("Cannot merge overlapping range", "");
        if (null != d.merge) {
            for (var p = !1, g = 0; g < i.length; g++) {
                var y = i[g].row[0]
                  , v = i[g].row[1]
                  , A = i[g].column[0]
                  , b = i[g].column[1];
                if (p = hasPartMC(d, y, v, A, b))
                    break
            }
            if (p)
                return tooltip.info("Cannot perform this operation on partially merged cells", "")
        }
        for (var k = !1, w = 0; w < i.length; w++)
            for (var x = i[w].row[0], S = i[w].row[1], _ = i[w].column[0], C = i[w].column[1], T = x; T <= S; T++) {
                for (var E = _; E <= C; E++) {
                    var I = f[T][E];
                    if ("object" == getObjType(I) && "mc"in I) {
                        k = !0;
                        break
                    }
                }
                if (k)
                    break
            }
        if (k)
            cancelRangeMerge({
                range: i,
                order: c
            });
        else {
            for (var R = 0; R < i.length; R++) {
                var B = i[R].row[0]
                  , N = i[R].row[1]
                  , F = i[R].column[0]
                  , P = i[R].column[1];
                if (B != N || F != P)
                    if ("all" == e) {
                        for (var L = {}, O = !1, D = B; D <= N; D++)
                            for (var M = F; M <= P; M++) {
                                var U = f[D][M];
                                null == U || isRealNull(U.v) && null == U.f || O || (L = $.extend(!0, {}, U),
                                O = !0),
                                f[D][M] = {
                                    mc: {
                                        r: B,
                                        c: F
                                    }
                                }
                            }
                        f[B][F] = L,
                        f[B][F].mc = {
                            r: B,
                            c: F,
                            rs: N - B + 1,
                            cs: P - F + 1
                        },
                        d.merge[B + "_" + F] = {
                            r: B,
                            c: F,
                            rs: N - B + 1,
                            cs: P - F + 1
                        }
                    } else if ("vertical" == e)
                        for (var H = F; H <= P; H++) {
                            for (var q = {}, z = !1, j = B; j <= N; j++) {
                                var V = f[j][H];
                                null == V || isRealNull(V.v) && null == V.f || z || (q = $.extend(!0, {}, V),
                                z = !0),
                                f[j][H] = {
                                    mc: {
                                        r: B,
                                        c: H
                                    }
                                }
                            }
                            f[B][H] = q,
                            f[B][H].mc = {
                                r: B,
                                c: H,
                                rs: N - B + 1,
                                cs: 1
                            },
                            d.merge[B + "_" + H] = {
                                r: B,
                                c: H,
                                rs: N - B + 1,
                                cs: 1
                            }
                        }
                    else if ("horizontal" == e)
                        for (var Q = B; Q <= N; Q++) {
                            for (var G = {}, K = !1, W = F; W <= P; W++) {
                                var Y = f[Q][W];
                                null == Y || isRealNull(Y.v) && null == Y.f || K || (G = $.extend(!0, {}, Y),
                                K = !0),
                                f[Q][W] = {
                                    mc: {
                                        r: Q,
                                        c: F
                                    }
                                }
                            }
                            f[Q][F] = G,
                            f[Q][F].mc = {
                                r: Q,
                                c: F,
                                rs: 1,
                                cs: P - F + 1
                            },
                            d.merge[Q + "_" + F] = {
                                r: Q,
                                c: F,
                                rs: 1,
                                cs: P - F + 1
                            }
                        }
            }
            c == a ? (Store.clearjfundo && (Store.jfundo = [],
            Store.jfredo.push({
                type: "mergeChange",
                sheetIndex: h.index,
                data: $.extend(!0, [], h.data),
                curData: f,
                range: i,
                config: $.extend(!0, {}, h.config),
                curConfig: d
            })),
            Store.clearjfundo = !1,
            jfrefreshgrid(f, i, {
                cfg: d
            }),
            Store.clearjfundo = !0) : (h.data = f,
            h.config = d)
        }
        u && "function" == typeof u && u()
    }
    function cancelRangeMerge() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = Store.luckysheet_select_save
          , r = getSheetIndex(Store.currentSheetIndex)
          , a = _objectSpread2({}, e)
          , n = a.range
          , o = void 0 === n ? t : n
          , l = a.order
          , i = void 0 === l ? r : l
          , s = (a.success,
        Store.luckysheetfile[i])
          , c = $.extend(!0, {}, s.config)
          , u = $.extend(!0, [], s.data);
        if (0 == u.length && (u = $.extend(!0, [], sheetmanage.buildGridData(s))),
        "string" == getObjType(o)) {
            if (!luckysheetformula.iscelldata(o))
                return tooltip.info("Incorrect selection format", "");
            var h = luckysheetformula.getcellrange(o);
            o = [{
                row: h.row,
                column: h.column
            }]
        } else if ("object" == getObjType(o)) {
            if (!o.hasOwnProperty("row") || !o.hasOwnProperty("column"))
                return tooltip.info("Incorrect selection format", "");
            o = [{
                row: o.row,
                column: o.column
            }]
        }
        if (selectIsOverlap(o))
            return tooltip.info("Cannot merge overlapping range", "");
        if (null != c.merge) {
            for (var d = !1, f = 0; f < o.length; f++) {
                var m = o[f].row[0]
                  , p = o[f].row[1]
                  , g = o[f].column[0]
                  , y = o[f].column[1];
                if (d = hasPartMC(c, m, p, g, y))
                    break
            }
            if (d)
                return tooltip.info("Cannot perform this operation on partially merged cells", "")
        }
        for (var v = 0; v < o.length; v++) {
            var A = o[v].row[0]
              , b = o[v].row[1]
              , k = o[v].column[0]
              , w = o[v].column[1];
            if (A != b || k != w)
                for (var x = {}, S = A; S <= b; S++)
                    for (var _ = k; _ <= w; _++) {
                        var C = u[S][_];
                        if (null != C && null != C.mc) {
                            var T = C.mc.r
                              , E = C.mc.c;
                            if ("rs"in C.mc)
                                delete C.mc,
                                delete c.merge[T + "_" + E],
                                x[T + "_" + E] = $.extend(!0, {}, C);
                            else {
                                var I = x[T + "_" + E];
                                delete I.v,
                                delete I.m,
                                delete I.ct,
                                delete I.f,
                                delete I.spl,
                                u[S][_] = I
                            }
                        }
                    }
        }
        i == r ? (Store.clearjfundo && (Store.jfundo = [],
        Store.jfredo.push({
            type: "mergeChange",
            sheetIndex: s.index,
            data: $.extend(!0, [], s.data),
            curData: u,
            range: o,
            config: $.extend(!0, {}, s.config),
            curConfig: c
        })),
        Store.clearjfundo = !1,
        jfrefreshgrid(u, o, {
            cfg: c
        }),
        Store.clearjfundo = !0) : (s.data = u,
        s.config = c)
    }
    function setRangeSort(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["asc", "desc"];
        if (r.indexOf(e) < 0)
            return tooltip.info("The type parameter must be included in ['asc', 'desc'", "");
        var a = getSheetIndex(Store.currentSheetIndex)
          , n = Store.luckysheet_select_save[0]
          , o = _objectSpread2({}, t)
          , l = o.range
          , i = void 0 === l ? n : l
          , s = o.order
          , c = void 0 === s ? a : s
          , u = o.success
          , h = Store.luckysheetfile[c]
          , d = $.extend(!0, {}, h.config)
          , f = $.extend(!0, [], h.data);
        if (0 == f.length && (f = $.extend(!0, [], sheetmanage.buildGridData(h))),
        i instanceof Array && i.length > 1)
            tooltip.info(locale().sort.noRangeError, "");
        else {
            i && "string" == typeof i && luckysheetformula.iscelldata(i) && (i = luckysheetformula.getcellrange(i));
            for (var m = i.row[0], p = i.row[1], g = i.column[0], y = i.column[1], v = !1, A = [], b = m; b <= p; b++) {
                for (var k = [], w = g; w <= y; w++) {
                    if (null != f[b][w] && null != f[b][w].mc) {
                        v = !0;
                        break
                    }
                    k.push(f[b][w])
                }
                A.push(k)
            }
            if (v)
                tooltip.info(locale().sort.mergeError, "");
            else {
                A = orderbydata([].concat(A), 0, "asc" === e);
                for (var x = m; x <= p; x++)
                    for (var S = g; S <= y; S++)
                        f[x][S] = A[x - m][S - g];
                var _ = {};
                null != d.rowlen && (_ = {
                    cfg: d = rowlenByRange(f, m, p, d),
                    RowlChange: !0
                }),
                h.index == Store.currentSheetIndex ? jfrefreshgrid(f, [{
                    row: [m, p],
                    column: [g, y]
                }], _) : (h.data = f,
                h.config = d),
                u && "function" == typeof u && u()
            }
        }
    }
    function setRangeSortMulti(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        if (!(t && t instanceof Array))
            return tooltip.info("The sort parameter is invalid.", "");
        var a = getSheetIndex(Store.currentSheetIndex)
          , n = Store.luckysheet_select_save[0]
          , o = _objectSpread2({}, r)
          , l = o.range
          , i = void 0 === l ? n : l
          , s = o.order
          , c = void 0 === s ? a : s
          , u = o.success
          , h = Store.luckysheetfile[c]
          , d = $.extend(!0, {}, h.config)
          , f = $.extend(!0, [], h.data);
        if (0 == f.length && (f = $.extend(!0, [], sheetmanage.buildGridData(h))),
        i instanceof Array && i.length > 1)
            tooltip.info(locale().sort.noRangeError, "");
        else {
            i && "string" == typeof i && luckysheetformula.iscelldata(i) && (i = luckysheetformula.getcellrange(i));
            for (var m, p = i.row[0], g = i.row[1], y = i.column[0], v = i.column[1], A = !1, b = [], k = m = e ? p + 1 : p; k <= g; k++) {
                for (var w = [], x = y; x <= v; x++) {
                    if (null != f[k][x] && null != f[k][x].mc) {
                        A = !0;
                        break
                    }
                    w.push(f[k][x])
                }
                b.push(w)
            }
            if (A)
                tooltip.info(locale().sort.mergeError, "");
            else {
                t.forEach((function(e) {
                    var t = e.i;
                    t -= y,
                    b = orderbydata([].concat(b), t, "asc" === e.sort)
                }
                ));
                for (var S = m; S <= g; S++)
                    for (var _ = y; _ <= v; _++)
                        f[S][_] = b[S - m][_ - y];
                var C = {};
                null != d.rowlen && (C = {
                    cfg: d = rowlenByRange(f, m, g, d),
                    RowlChange: !0
                }),
                h.index === Store.currentSheetIndex ? jfrefreshgrid(f, [{
                    row: [m, g],
                    column: [y, v]
                }], C) : (h.data = f,
                h.config = d),
                u && "function" == typeof u && u()
            }
        }
    }
    function setRangeConditionalFormatDefault(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
          , a = ["greaterThan", "lessThan", "betweenness", "equal", "textContains", "occurrenceDate", "duplicateValue", "top10", "top10%", "last10", "last10%", "AboveAverage", "SubAverage"];
        if (!e || !a.includes(e))
            return tooltip.info("The conditionName parameter is invalid.", "");
        if ("array" != getObjType(t) || 0 == t.length)
            return tooltip.info("The conditionValue parameter is invalid.", "");
        var n = _objectSpread2({}, r)
          , o = n.format
          , l = void 0 === o ? {
            textColor: "#000000",
            cellColor: "#ff0000"
        } : o
          , i = n.cellrange
          , s = void 0 === i ? Store.luckysheet_select_save : i
          , c = n.order
          , u = void 0 === c ? getSheetIndex(Store.currentSheetIndex) : c
          , h = n.success
          , d = Store.luckysheetfile[u]
          , f = d.data;
        if (null != f && 0 != f.length || (f = sheetmanage.buildGridData(d)),
        null == d)
            return tooltip.info("Incorrect worksheet index", "");
        var m = locale().conditionformat
          , p = []
          , g = [];
        if ("betweenness" == e) {
            var y = t[0]
              , v = t[1]
              , A = conditionformat.getRangeByTxt(y);
            if (A.length > 1)
                return void conditionformat.infoDialog(m.onlySingleCell, "");
            if (1 == A.length) {
                var b = A[0].row[0]
                  , k = A[0].row[1]
                  , w = A[0].column[0]
                  , x = A[0].column[1];
                if (b != k || w != x)
                    return void conditionformat.infoDialog(m.onlySingleCell, "");
                y = getcellvalue(b, w, f),
                p.push({
                    row: A[0].row,
                    column: A[0].column
                }),
                g.push(y)
            } else if (0 == A.length) {
                if (isNaN(y) || "" == y)
                    return void conditionformat.infoDialog(m.conditionValueCanOnly, "");
                g.push(y)
            }
            var S = conditionformat.getRangeByTxt(v);
            if (S.length > 1)
                return void conditionformat.infoDialog(m.onlySingleCell, "");
            if (1 == S.length) {
                var _ = S[0].row[0]
                  , C = S[0].row[1]
                  , T = S[0].column[0]
                  , E = S[0].column[1];
                if (_ != C || T != E)
                    return void conditionformat.infoDialog(m.onlySingleCell, "");
                v = getcellvalue(_, T, f),
                p.push({
                    row: S[0].row,
                    column: S[0].column
                }),
                g.push(v)
            } else if (0 == S.length) {
                if (isNaN(v) || "" == v)
                    return void conditionformat.infoDialog(m.conditionValueCanOnly, "");
                g.push(v)
            }
        } else if ("greaterThan" == e || "lessThan" == e || "equal" == e) {
            var I = t[0]
              , R = conditionformat.getRangeByTxt(I);
            if (R.length > 1)
                return void conditionformat.infoDialog(m.onlySingleCell, "");
            if (1 == R.length) {
                var B = R[0].row[0]
                  , N = R[0].row[1]
                  , F = R[0].column[0]
                  , P = R[0].column[1];
                if (B != N || F != P)
                    return void conditionformat.infoDialog(m.onlySingleCell, "");
                I = getcellvalue(B, F, f),
                p.push({
                    row: R[0].row,
                    column: R[0].column
                }),
                g.push(I)
            } else if (0 == R.length) {
                if (isNaN(I) || "" == I)
                    return void conditionformat.infoDialog(m.conditionValueCanOnly, "");
                g.push(I)
            }
        } else if ("textContains" == e) {
            var L = t[0]
              , O = conditionformat.getRangeByTxt(L);
            if (O.length > 1)
                return void conditionformat.infoDialog(m.onlySingleCell, "");
            if (1 == O.length) {
                var D = O[0].row[0]
                  , M = O[0].row[1]
                  , U = O[0].column[0]
                  , H = O[0].column[1];
                if (D != M || U != H)
                    return void conditionformat.infoDialog(m.onlySingleCell, "");
                L = getcellvalue(D, U, f),
                p.push({
                    row: O[0].row,
                    column: O[0].column
                }),
                g.push(L)
            } else if (0 == O.length) {
                if ("" == L)
                    return void conditionformat.infoDialog(m.conditionValueCanOnly, "");
                g.push(L)
            }
        } else if ("occurrenceDate" == e) {
            var q, z = t[0], j = t[1];
            if (!isdatetime(z) || !isdatetime(j))
                return tooltip.info("The conditionValue parameter is invalid.", "");
            q = diff(z, j) > 0 ? moment(j).format("YYYY/MM/DD") + "-" + moment(z).format("YYYY/MM/DD") : moment(z).format("YYYY/MM/DD") + "-" + moment(j).format("YYYY/MM/DD"),
            g.push(q)
        } else if ("duplicateValue" == e) {
            var V = t[0];
            if ("0" != V || "1" != V)
                return tooltip.info("The conditionValue parameter is invalid.", "");
            g.push(V)
        } else if ("top10" == e || "top10%" == e || "last10" == e || "last10%" == e) {
            var Q = t[0];
            if (parseInt(Q) != Q || parseInt(Q) < 1 || parseInt(Q) > 1e3)
                return void conditionformat.infoDialog(m.pleaseEnterInteger, "");
            g.push(parseInt(Q))
        } else
            "AboveAverage" != e && "SubAverage" != e || g.push(e);
        if (!l.hasOwnProperty("textColor") || !l.hasOwnProperty("cellColor"))
            return tooltip.info("The format parameter is invalid.", "");
        if ("string" == getObjType(s) ? s = conditionformat.getRangeByTxt(s) : "object" == getObjType(s) && (s = [s]),
        "array" != getObjType(s))
            return tooltip.info("The cellrange parameter is invalid.", "");
        var G = {
            type: "default",
            cellrange: s,
            format: l,
            conditionName: e,
            conditionRange: p,
            conditionValue: g
        }
          , K = $.extend(!0, [], Store.luckysheetfile)
          , W = conditionformat.getHistoryRules(K)
          , Y = d.luckysheet_conditionformat_save || [];
        Y.push(G),
        d.luckysheet_conditionformat_save = Y;
        var X = $.extend(!0, [], Store.luckysheetfile)
          , J = conditionformat.getCurrentRules(X);
        conditionformat.ref(W, J),
        server.allowUpdate && server.saveParam("all", d.index, Y, {
            k: "luckysheet_conditionformat_save"
        }),
        h && "function" == typeof h && h()
    }
    function setRangeConditionalFormat(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["dataBar", "colorGradation", "icons"];
        if (!e || !r.includes(e))
            return tooltip.info("The type parameter is invalid.", "");
        var a = _objectSpread2({}, t)
          , n = a.format
          , o = a.cellrange
          , l = void 0 === o ? Store.luckysheet_select_save : o
          , i = a.order
          , s = void 0 === i ? getSheetIndex(Store.currentSheetIndex) : i
          , c = a.success
          , u = Store.luckysheetfile[s];
        if (null == u)
            return tooltip.info("Incorrect worksheet index", "");
        if ("dataBar" == e) {
            if (null == n && (n = ["#638ec6", "#ffffff"]),
            "array" != getObjType(n) || n.length < 1 || n.length > 2)
                return tooltip.info("The format parameter is invalid.", "")
        } else if ("colorGradation" == e) {
            if (null == n && (n = ["rgb(99, 190, 123)", "rgb(255, 235, 132)", "rgb(248, 105, 107)"]),
            "array" != getObjType(n) || n.length < 2 || n.length > 3)
                return tooltip.info("The format parameter is invalid.", "")
        } else if ("icons" == e) {
            null == n && (n = "threeWayArrowMultiColor");
            var h = ["threeWayArrowMultiColor", "threeTriangles", "fourWayArrowMultiColor", "fiveWayArrowMultiColor", "threeWayArrowGrayColor", "fourWayArrowGrayColor", "fiveWayArrowGrayColor", "threeColorTrafficLightRimless", "threeSigns", "greenRedBlackGradient", "threeColorTrafficLightBordered", "fourColorTrafficLight", "threeSymbolsCircled", "tricolorFlag", "threeSymbolsnoCircle", "threeStars", "fiveQuadrantDiagram", "fiveBoxes", "grade4", "grade5"];
            if ("string" != getObjType(n) || !h.includes(n))
                return tooltip.info("The format parameter is invalid.", "");
            switch (n) {
            case "threeWayArrowMultiColor":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 0
                };
                break;
            case "threeTriangles":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 1
                };
                break;
            case "fourWayArrowMultiColor":
                n = {
                    len: 4,
                    leftMin: 0,
                    top: 2
                };
                break;
            case "fiveWayArrowMultiColor":
                n = {
                    len: 5,
                    leftMin: 0,
                    top: 3
                };
                break;
            case "threeWayArrowGrayColor":
                n = {
                    len: 3,
                    leftMin: 5,
                    top: 0
                };
                break;
            case "fourWayArrowGrayColor":
                n = {
                    len: 4,
                    leftMin: 5,
                    top: 1
                };
                break;
            case "fiveWayArrowGrayColor":
                n = {
                    len: 5,
                    leftMin: 5,
                    top: 2
                };
                break;
            case "threeColorTrafficLightRimless":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 4
                };
                break;
            case "threeSigns":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 5
                };
                break;
            case "greenRedBlackGradient":
                n = {
                    len: 4,
                    leftMin: 0,
                    top: 6
                };
                break;
            case "threeColorTrafficLightBordered":
                n = {
                    len: 3,
                    leftMin: 5,
                    top: 4
                };
                break;
            case "fourColorTrafficLight":
                n = {
                    len: 4,
                    leftMin: 5,
                    top: 5
                };
                break;
            case "threeSymbolsCircled":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 7
                };
                break;
            case "tricolorFlag":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 8
                };
                break;
            case "threeSymbolsnoCircle":
                n = {
                    len: 3,
                    leftMin: 5,
                    top: 7
                };
                break;
            case "threeStars":
                n = {
                    len: 3,
                    leftMin: 0,
                    top: 9
                };
                break;
            case "fiveQuadrantDiagram":
                n = {
                    len: 5,
                    leftMin: 0,
                    top: 10
                };
                break;
            case "fiveBoxes":
                n = {
                    len: 5,
                    leftMin: 0,
                    top: 11
                };
                break;
            case "grade4":
                n = {
                    len: 4,
                    leftMin: 5,
                    top: 9
                };
                break;
            case "grade5":
                n = {
                    len: 5,
                    leftMin: 5,
                    top: 10
                }
            }
        }
        if ("string" == getObjType(l) ? l = conditionformat.getRangeByTxt(l) : "object" == getObjType(l) && (l = [l]),
        "array" != getObjType(l))
            return tooltip.info("The cellrange parameter is invalid.", "");
        var d = {
            type: e,
            cellrange: l,
            format: n
        }
          , f = $.extend(!0, [], Store.luckysheetfile)
          , m = conditionformat.getHistoryRules(f)
          , p = u.luckysheet_conditionformat_save || [];
        p.push(d),
        u.luckysheet_conditionformat_save = p;
        var g = $.extend(!0, [], Store.luckysheetfile)
          , y = conditionformat.getCurrentRules(g);
        conditionformat.ref(m, y),
        server.allowUpdate && server.saveParam("all", u.index, p, {
            k: "luckysheet_conditionformat_save"
        }),
        c && "function" == typeof c && c()
    }
    function deleteRangeConditionalFormat(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (!isRealNum(e))
            return tooltip.info("The itemIndex parameter is invalid.", "");
        e = Number(e);
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = $.extend(!0, [], l.luckysheet_conditionformat_save);
        if (0 == i.length)
            return tooltip.info("This worksheet has no conditional format to delete", "");
        if (null == i[e])
            return tooltip.info("The conditional format of the index cannot be found", "");
        var s = i.splice(e, 1)
          , c = $.extend(!0, [], Store.luckysheetfile)
          , u = conditionformat.getHistoryRules(c);
        l.luckysheet_conditionformat_save = i;
        var h = $.extend(!0, [], Store.luckysheetfile)
          , d = conditionformat.getCurrentRules(h);
        return conditionformat.ref(u, d),
        server.allowUpdate && server.saveParam("all", l.index, ruleArr, {
            k: "luckysheet_conditionformat_save"
        }),
        setTimeout((function() {
            o && "function" == typeof o && o()
        }
        ), 1),
        s
    }
    function clearRange() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.range
          , a = void 0 === r ? Store.luckysheet_select_save : r
          , n = t.order
          , o = void 0 === n ? getSheetIndex(Store.currentSheetIndex) : n
          , l = t.success;
        if ("string" == getObjType(a)) {
            if (!luckysheetformula.iscelldata(a))
                return tooltip.info("The range parameter is invalid.", "");
            var i = luckysheetformula.getcellrange(a);
            a = [{
                row: i.row,
                column: i.column
            }]
        } else if ("object" == getObjType(a)) {
            if (null == a.row || null == a.column)
                return tooltip.info("The range parameter is invalid.", "");
            a = [{
                row: a.row,
                column: a.column
            }]
        }
        if ("array" != getObjType(a))
            return tooltip.info("The range parameter is invalid.", "");
        var s = Store.luckysheetfile[o];
        if (null == s)
            return tooltip.info("The order parameter is invalid.", "");
        for (var c = $.extend(!0, {}, s.config), u = !1, h = 0; h < a.length; h++) {
            var d = a[h].row[0]
              , f = a[h].row[1]
              , m = a[h].column[0]
              , p = a[h].column[1];
            if (u = hasPartMC(c, d, f, m, p))
                break
        }
        if (u)
            return tooltip.info("Cannot perform this operation on partially merged cells", "");
        var g = $.extend(!0, [], s.data);
        0 == g.length && (g = $.extend(!0, [], sheetmanage.buildGridData(s)));
        for (var y = 0; y < a.length; y++)
            for (var v = a[y].row[0], A = a[y].row[1], b = a[y].column[0], k = a[y].column[1], w = v; w <= A; w++)
                for (var x = b; x <= k; x++) {
                    var S = g[w][x];
                    "object" == getObjType(S) ? (delete S.m,
                    delete S.v,
                    null != S.f && (delete S.f,
                    luckysheetformula.delFunctionGroup(w, x, s.index),
                    delete S.spl),
                    null != S.ct && "inlineStr" == S.ct.t && delete S.ct) : g[w][x] = null
                }
        s.index == Store.currentSheetIndex ? jfrefreshgrid(g, a) : s.data = g,
        l && "function" == typeof l && l()
    }
    function deleteRange(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["left", "up"];
        if (!r.includes(e))
            return tooltip.info("The move parameter is invalid.", "");
        var a = _objectSpread2({}, t)
          , n = a.range
          , o = void 0 === n ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : n
          , l = a.order
          , i = void 0 === l ? getSheetIndex(Store.currentSheetIndex) : l
          , s = a.success;
        if ("string" == getObjType(o)) {
            if (!luckysheetformula.iscelldata(o))
                return tooltip.info("The range parameter is invalid.", "");
            var c = luckysheetformula.getcellrange(o);
            o = {
                row: c.row,
                column: c.column
            }
        }
        if ("object" != getObjType(o) || null == o.row || null == o.column)
            return tooltip.info("The range parameter is invalid.", "");
        var u = Store.luckysheetfile[i];
        if (null == u)
            return tooltip.info("The order parameter is invalid.", "");
        var h = o.row[0]
          , d = o.row[1]
          , f = o.column[0]
          , m = o.column[1];
        "left" == e ? luckysheetDeleteCell("moveLeft", h, d, f, m, i) : "up" == e && luckysheetDeleteCell("moveUp", h, d, f, m, i),
        s && "function" == typeof s && s()
    }
    function matrixOperation(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = ["flipUpDown", "flipLeftRight", "flipClockwise", "flipCounterClockwise", "transpose", "deleteZeroByRow", "deleteZeroByColumn", "removeDuplicateByRow", "removeDuplicateByColumn", "newMatrix"];
        if (!e || r.indexOf(e) < 0)
            return tooltip.info("The type parameter is invalid.", "");
        var a = Store.luckysheet_select_save[0]
          , n = _objectSpread2({}, t)
          , o = n.range
          , l = void 0 === o ? a : o
          , i = n.success;
        if (l instanceof Array && l.length > 1)
            tooltip.info(locale().drag.noMulti, "");
        else {
            l && "string" == typeof l && luckysheetformula.iscelldata(l) && (l = luckysheetformula.getcellrange(l));
            var s = getdatabyselection(l)
              , c = [];
            if (0 !== s.length) {
                var u, h, d;
                switch (e) {
                case "flipUpDown":
                    for (var f = s.length - 1; f >= 0; f--) {
                        for (var m = [], p = 0; p < s[0].length; p++) {
                            var g = "";
                            null != s[f] && null != s[f][p] && (g = s[f][p]),
                            m.push(g)
                        }
                        c.push(m)
                    }
                    break;
                case "flipLeftRight":
                    for (var y = 0; y < s.length; y++) {
                        for (var v = [], A = s[0].length - 1; A >= 0; A--) {
                            var b = "";
                            null != s[y] && null != s[y][A] && (b = s[y][A]),
                            v.push(b)
                        }
                        c.push(v)
                    }
                    break;
                case "flipClockwise":
                    for (var k = 0; k < s[0].length; k++) {
                        for (var w = [], x = s.length - 1; x >= 0; x--) {
                            var S = "";
                            null != s[x] && null != s[x][k] && (S = s[x][k]),
                            w.push(S)
                        }
                        c.push(w)
                    }
                    break;
                case "flipCounterClockwise":
                    for (var _ = s[0].length - 1; _ >= 0; _--) {
                        for (var C = [], T = 0; T < s.length; T++) {
                            var E = "";
                            null != s[T] && null != s[T][_] && (E = s[T][_]),
                            C.push(E)
                        }
                        c.push(C)
                    }
                    break;
                case "transpose":
                    for (var I = 0; I < s[0].length; I++) {
                        for (var R = [], B = 0; B < s.length; B++) {
                            var N = "";
                            null != s[B] && null != s[B][I] && (N = s[B][I]),
                            R.push(N)
                        }
                        c.push(R)
                    }
                    break;
                case "deleteZeroByRow":
                    u = s[0].length;
                    for (var F = 0; F < s.length; F++) {
                        for (var P = [], $ = !0, L = !0, O = 0; O < u; O++) {
                            var D = "";
                            if (null != s[F] && null != s[F][O]) {
                                if (("0" == (D = s[F][O]).v || 0 == D.v) && $)
                                    continue;
                                $ = !1
                            }
                            P.push(D)
                        }
                        var M = [];
                        if (P.length == u)
                            M = P;
                        else {
                            for (var U = P.length - 1; U >= 0; U--) {
                                var H = "";
                                if (null != P[U]) {
                                    if (("0" == (H = P[U]).v || 0 == H.v) && L)
                                        continue;
                                    L = !1
                                }
                                M.unshift(H)
                            }
                            for (var q = u - M.length, z = 0; z < q; z++)
                                M.push("")
                        }
                        c.push(M)
                    }
                    break;
                case "deleteZeroByColumn":
                    u = s.length,
                    h = s[0].length;
                    for (var j = 0; j < h; j++) {
                        for (var V = [], Q = !0, G = !0, K = 0; K < u; K++) {
                            var W = "";
                            if (null != s[K] && null != s[K][j]) {
                                if (("0" == (W = s[K][j]).v || 0 == W.v) && Q)
                                    continue;
                                Q = !1
                            }
                            V.push(W)
                        }
                        var Y = [];
                        if (V.length == u)
                            Y = V;
                        else {
                            for (var X = V.length - 1; X >= 0; X--) {
                                var J = "";
                                if (null != V[X]) {
                                    if (("0" == (J = V[X]).v || 0 == J.v) && G)
                                        continue;
                                    G = !1
                                }
                                Y.unshift(J)
                            }
                            for (var Z = u - Y.length, ee = 0; ee < Z; ee++)
                                Y.push("")
                        }
                        c.push(Y)
                    }
                    d = [];
                    for (var te = 0; te < c[0].length; te++) {
                        for (var re = [], ae = 0; ae < c.length; ae++) {
                            var ne = "";
                            null != c[ae] && null != c[ae][te] && (ne = c[ae][te]),
                            re.push(ne)
                        }
                        d.push(re)
                    }
                    break;
                case "removeDuplicateByRow":
                    u = s[0].length;
                    for (var oe = 0; oe < s.length; oe++) {
                        for (var le = [], ie = {}, se = 0; se < u; se++) {
                            var ce = null;
                            null != s[oe] && null != s[oe][se] && ((ce = s[oe][se]).v in ie || (ie[ce.v] = []),
                            ie[ce.v].push(ce))
                        }
                        for (var ue = 0; ue < u; ue++) {
                            var he = null;
                            null != s[oe] && null != s[oe][ue] && 1 == ie[(he = s[oe][ue]).v].length && le.push(he)
                        }
                        for (var de = u - le.length, fe = 0; fe < de; fe++)
                            le.push(null);
                        c.push(le)
                    }
                    break;
                case "removeDuplicateByColumn":
                    h = s[0].length,
                    u = s.length;
                    for (var me = 0; me < h; me++) {
                        for (var pe = [], ge = {}, ye = 0; ye < u; ye++) {
                            var ve = null;
                            null != s[ye] && null != s[ye][me] && ((ve = s[ye][me]).v in ge || (ge[ve.v] = []),
                            ge[ve.v].push(ve))
                        }
                        for (var Ae = 0; Ae < u; Ae++) {
                            var be = null;
                            null != s[Ae] && null != s[Ae][me] && 1 == ge[(be = s[Ae][me]).v].length && pe.push(be)
                        }
                        a1 = pe;
                        for (var ke = u - a1.length, we = 0; we < ke; we++)
                            a1.push(null);
                        c.push(a1)
                    }
                    d = [];
                    for (var xe = 0; xe < c[0].length; xe++) {
                        for (var Se = [], _e = 0; _e < c.length; _e++) {
                            var Ce = null;
                            null != c[_e] && null != c[_e][xe] && (Ce = c[_e][xe]),
                            Se.push(Ce)
                        }
                        d.push(Se)
                    }
                    break;
                case "newMatrix":
                    console.log("TODO")
                }
                editor.controlHandler(c, l),
                i && "function" == typeof i && i()
            }
        }
    }
    function matrixCalculation(e, t) {
        var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
          , a = ["plus", "minus", "multiply", "divided", "power", "root", "log"];
        if (!e || a.indexOf(e) < 0)
            return tooltip.info("The type parameter is invalid.", "");
        if (!isRealNum(t))
            return tooltip.info("The number parameter is invalid.", "");
        var n = Store.luckysheet_select_save[0]
          , o = _objectSpread2({}, r)
          , l = o.range
          , i = void 0 === l ? n : l
          , s = o.success;
        if (i instanceof Array && i.length > 1)
            tooltip.info(locale().drag.noMulti, "");
        else {
            i && "string" == typeof i && luckysheetformula.iscelldata(i) && (i = luckysheetformula.getcellrange(i));
            var c = getdatabyselection(i);
            if (0 != c.length) {
                for (var u = [], h = 0; h < c.length; h++) {
                    for (var d = [], f = 0; f < c[0].length; f++) {
                        var m = "";
                        null != c[h] && null != c[h][f] && (m = c[h][f],
                        null != parseInt(m) && null != c[h][f].ct && "n" == c[h][f].ct.t && ("minus" == e ? m.v = m.v - t : "multiply" == e ? m.v = m.v * t : "divided" == e ? m.v = numFormat(m.v / t, 4) : "power" == e ? m.v = Math.pow(m.v, t) : "root" == e ? 2 == t ? m.v = numFormat(Math.sqrt(m.v), 4) : 3 == t && Math.cbrt ? m.v = numFormat(Math.cbrt(m.v), 4) : m.v = numFormat(jfnqrt(m.v, t), 4) : m.v = "log" == e ? numFormat(1e4 * Math.log(m.v) / Math.log(Math.abs(t)), 4) : m.v + t,
                        null == m.v ? m.m = "" : m.m = m.v.toString())),
                        d.push(m)
                    }
                    u.push(d)
                }
                editor.controlHandler(u, i),
                s && "function" == typeof s && s()
            }
        }
    }
    function setSheetAdd() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = Store.luckysheetfile.length - 1
          , r = _objectSpread2({}, e)
          , a = r.sheetObject
          , n = void 0 === a ? {} : a
          , o = r.order
          , l = void 0 === o ? t : o
          , i = r.success;
        if (!isRealNum(l))
            return tooltip.info("Parameter is not a table index", "");
        l = Number(l);
        var s = sheetmanage.generateRandomSheetIndex()
          , c = sheetmanage.generateRandomSheetName(Store.luckysheetfile, !1);
        if (n.name) {
            for (var u = !1, h = 0; h < Store.luckysheetfile.length; h++)
                if (Store.luckysheetfile[h].name == n.name) {
                    u = !0;
                    break
                }
            u || (c = n.name)
        }
        $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
            index: s,
            active: "",
            name: c,
            style: "",
            colorset: ""
        }));
        var d = {
            name: "",
            color: "",
            status: "0",
            order: "",
            index: "",
            celldata: [],
            row: Store.defaultrowNum,
            column: Store.defaultcolumnNum,
            config: {},
            pivotTable: null,
            isPivotTable: !1
        };
        if ((d = $.extend(!0, d, n)).index = s,
        d.name = c,
        d.order = l,
        l <= 0) {
            var f = Store.luckysheetfile[0].index
              , m = $("#luckysheet-sheets-item" + f);
            $("#luckysheet-sheets-item" + s).insertBefore(m),
            Store.luckysheetfile.splice(0, 0, d)
        } else {
            l > Store.luckysheetfile.length && (l = Store.luckysheetfile.length);
            var p = Store.luckysheetfile[l - 1].index
              , g = $("#luckysheet-sheets-item" + p);
            $("#luckysheet-sheets-item" + s).insertAfter(g),
            Store.luckysheetfile.splice(l, 0, d)
        }
        var y = {};
        if (Store.luckysheetfile.forEach((function(e, t, r) {
            r[t].order = t,
            y[e.index.toString()] = t
        }
        )),
        $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
        $("#luckysheet-sheets-item" + s).addClass("luckysheet-sheets-item-active"),
        $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + s + '" class="luckysheet-datavisual-selection-set"></div>'),
        cleargridelement(!0),
        server.saveParam("sha", null, $.extend(!0, {}, d)),
        server.saveParam("shr", null, y),
        Store.clearjfundo) {
            Store.jfundo = [];
            var v = {
                type: "addSheet"
            };
            v.sheetconfig = $.extend(!0, {}, d),
            v.index = s,
            v.currentSheetIndex = Store.currentSheetIndex,
            Store.jfredo.push(v)
        }
        sheetmanage.changeSheetExec(s, !1, !0),
        i && "function" == typeof i && i()
    }
    function setSheetDelete() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success
          , o = Store.luckysheetfile[a];
        return null == o ? tooltip.info("The order parameter is invalid.", "") : (sheetmanage.deleteSheet(o.index),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        o)
    }
    function setSheetCopy() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.targetOrder
          , a = t.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = t.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        if (null == r && (r = n + 1),
        !isRealNum(r))
            return tooltip.info("The targetOrder parameter is invalid.", "");
        var i = l.index
          , s = sheetmanage.generateRandomSheetIndex()
          , c = $.extend(!0, {}, l);
        c.order = Store.luckysheetfile.length,
        c.index = s,
        c.name = sheetmanage.generateCopySheetName(Store.luckysheetfile, c.name);
        var u = "";
        null != c.color && (u = '<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + c.color + ';"></div>');
        var h = $("#luckysheet-sheets-item" + i);
        if (isRealNum(r) && (h = $("#luckysheet-sheets-item" + Store.luckysheetfile[r - 1].index)),
        $("#luckysheet-sheet-container-c").append(replaceHtml$1(sheetHTML, {
            index: c.index,
            active: "",
            name: c.name,
            order: c.order,
            style: "",
            colorset: u
        })),
        $("#luckysheet-sheets-item" + c.index).insertAfter(h),
        Store.luckysheetfile.splice(r, 0, c),
        $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
        $("#luckysheet-sheets-item" + s).addClass("luckysheet-sheets-item-active"),
        $("#luckysheet-cell-main").append('<div id="luckysheet-datavisual-selection-set-' + s + '" class="luckysheet-datavisual-selection-set"></div>'),
        cleargridelement(!0),
        server.saveParam("shc", s, {
            copyindex: i,
            name: c.name
        }),
        sheetmanage.changeSheetExec(s),
        sheetmanage.reOrderAllSheet(),
        Store.clearjfundo)
            Store.jfredo.push({
                type: "copySheet",
                copyindex: i,
                index: c.index,
                sheetIndex: c.index
            });
        else if (Store.jfredo.length > 0) {
            var d = Store.jfredo[Store.jfredo.length - 1];
            "copySheet" == d.type && (d.index = c.index,
            d.sheetIndex = c.index)
        }
        return setTimeout((function() {
            o && "function" == typeof o && o()
        }
        ), 1),
        c
    }
    function setSheetHide() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success
          , o = Store.luckysheetfile[a];
        return null == o ? tooltip.info("The order parameter is invalid.", "") : (sheetmanage.setSheetHide(o.index),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        o)
    }
    function setSheetShow() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success
          , o = Store.luckysheetfile[a];
        return null == o ? tooltip.info("The order parameter is invalid.", "") : (sheetmanage.setSheetShow(o.index),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        o)
    }
    function setSheetActive(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (null == e || !isRealNum(e) || null == Store.luckysheetfile[e])
            return tooltip.info("The order parameter is invalid.", "");
        var r = Store.luckysheetfile[e]
          , a = _objectSpread2({}, t)
          , n = a.success;
        return $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"),
        $("#luckysheet-sheets-item" + r.index).addClass("luckysheet-sheets-item-active"),
        sheetmanage.changeSheet(r.index),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        r
    }
    function setSheetName(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("string" != getObjType(e) || 0 == e.toString().length)
            return tooltip.info("The name parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = l.name;
        if (l.name = e,
        $("#luckysheet-sheets-item" + l.index + " .luckysheet-sheets-item-name").text(e),
        server.saveParam("all", l.index, e, {
            k: "name"
        }),
        Store.clearjfundo) {
            var s = {
                type: "sheetName"
            };
            s.sheetIndex = l.index,
            s.oldtxt = i,
            s.txt = e,
            Store.jfundo = [],
            Store.jfredo.push(s)
        }
        o && "function" == typeof o && o()
    }
    function setSheetColor(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("string" != getObjType(e) || 0 == e.toString().length)
            return tooltip.info("The color parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        var i = l.color;
        if (l.color = e,
        $("#luckysheet-sheets-item" + l.index).find(".luckysheet-sheets-item-color").remove(),
        $("#luckysheet-sheets-item" + l.index).append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + e + ';"></div>'),
        server.saveParam("all", l.index, e, {
            k: "color"
        }),
        Store.clearjfundo) {
            var s = {
                type: "sheetColor"
            };
            s.sheetIndex = l.index,
            s.oldcolor = i,
            s.color = e,
            Store.jfundo = [],
            Store.jfredo.push(s)
        }
        o && "function" == typeof o && o()
    }
    function setSheetMove(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("left" != e && "right" != e && !isRealNum(e))
            return tooltip.info("Type parameter not available", "");
        isRealNum(e) && (e = parseInt(e));
        var r = getSheetIndex(Store.currentSheetIndex)
          , a = _objectSpread2({}, t)
          , n = a.order
          , o = void 0 === n ? r : n
          , l = a.success
          , i = Store.luckysheetfile[o];
        if (null == i)
            return tooltip.info("ncorrect worksheet index", "");
        var s = i.index;
        if ("left" == e) {
            if (0 == o)
                return;
            var c = Store.luckysheetfile[o - 1].index;
            $("#luckysheet-sheets-item" + s).insertBefore($("#luckysheet-sheets-item" + c)),
            Store.luckysheetfile.splice(o, 1),
            Store.luckysheetfile.splice(o - 1, 0, i)
        } else if ("right" == e) {
            if (o == Store.luckysheetfile.length - 1)
                return;
            var u = Store.luckysheetfile[o + 1].index;
            $("#luckysheet-sheets-item" + s).insertAfter($("#luckysheet-sheets-item" + u)),
            Store.luckysheetfile.splice(o, 1),
            Store.luckysheetfile.splice(o + 1, 0, i)
        } else {
            if (e < 0 && (e = 0),
            e > Store.luckysheetfile.length - 1 && (e = Store.luckysheetfile.length - 1),
            e == o)
                return;
            if (e < o) {
                var h = Store.luckysheetfile[e].index;
                $("#luckysheet-sheets-item" + s).insertBefore($("#luckysheet-sheets-item" + h))
            } else {
                var d = Store.luckysheetfile[e].index;
                $("#luckysheet-sheets-item" + s).insertAfter($("#luckysheet-sheets-item" + d))
            }
            Store.luckysheetfile.splice(o, 1),
            Store.luckysheetfile.splice(e, 0, i)
        }
        var f = {};
        Store.luckysheetfile.forEach((function(e, t, r) {
            r[t].order = t,
            f[e.index.toString()] = t
        }
        )),
        server.saveParam("shr", null, f),
        l && "function" == typeof l && l()
    }
    function setSheetOrder(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (null == e || 0 == e.length)
            return tooltip.info("Type orderList not available", "");
        var r = {};
        e.forEach((function(e) {
            r[e.index.toString()] = e.order
        }
        )),
        Store.luckysheetfile.sort((function(e, t) {
            var a = r[e.index.toString()]
              , n = r[t.index.toString()];
            return null != a && null != n ? a - n : null != a ? -1 : 1
        }
        ));
        var a = {};
        Store.luckysheetfile.forEach((function(e, t, r) {
            if (r[t].order = t,
            a[e.index.toString()] = t,
            t > 0) {
                var n = r[t - 1].index;
                $("#luckysheet-sheets-item" + e.index).insertAfter($("#luckysheet-sheets-item" + n))
            }
        }
        )),
        server.saveParam("shr", null, a);
        var n = _objectSpread2({}, t)
          , o = n.success;
        o && "function" == typeof o && o()
    }
    function setSheetZoom(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (!isRealNum(e) || e < .1 || e > 4)
            return tooltip.info("The zoom parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        l.zoomRatio = e,
        server.saveParam("all", l.index, e, {
            k: "zoomRatio"
        }),
        l.index == Store.currentSheetIndex && (Store.zoomRatio = e,
        zoomNumberDomBind(),
        zoomRefreshView()),
        o && "function" == typeof o && o()
    }
    function showGridLines() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success
          , o = Store.luckysheetfile[a];
        return null == o ? tooltip.info("The order parameter is invalid.", "") : (o.showGridLines = !0,
        o.index == Store.currentSheetIndex && (Store.showGridLines = !0,
        setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        o)
    }
    function hideGridLines() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = t.success
          , o = Store.luckysheetfile[a];
        return null == o ? tooltip.info("The order parameter is invalid.", "") : (o.showGridLines = !1,
        o.index == Store.currentSheetIndex && (Store.showGridLines = !1,
        setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)),
        setTimeout((function() {
            n && "function" == typeof n && n()
        }
        ), 1),
        o)
    }
    function refresh() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
        luckysheetrefreshgrid();
        var t = _objectSpread2({}, e)
          , r = t.success;
        r && "function" == typeof r && r()
    }
    function scroll() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.scrollLeft
          , a = t.scrollTop
          , n = t.targetRow
          , o = t.targetColumn
          , l = t.success;
        if (null != r) {
            if (!isRealNum(r))
                return tooltip.info("The scrollLeft parameter is invalid.", "");
            $("#luckysheet-scrollbar-x").scrollLeft(r)
        } else if (null != o) {
            if (!isRealNum(o))
                return tooltip.info("The targetColumn parameter is invalid.", "");
            Store.visibledatacolumn[o];
            var i = o <= 0 ? 0 : Store.visibledatacolumn[o - 1];
            $("#luckysheet-scrollbar-x").scrollLeft(i)
        }
        if (null != a) {
            if (!isRealNum(a))
                return tooltip.info("The scrollTop parameter is invalid.", "");
            $("#luckysheet-scrollbar-y").scrollTop(a)
        } else if (null != n) {
            if (!isRealNum(n))
                return tooltip.info("The targetRow parameter is invalid.", "");
            Store.visibledatarow[n];
            var s = n <= 0 ? 0 : Store.visibledatarow[n - 1];
            $("#luckysheet-scrollbar-y").scrollTop(s)
        }
        l && "function" == typeof l && l()
    }
    function resize() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
        luckysheetsizeauto();
        var t = _objectSpread2({}, e)
          , r = t.success;
        r && "function" == typeof r && r()
    }
    function getScreenshot() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.range
          , a = void 0 === r ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : r;
        if ("string" == getObjType(a)) {
            if (!luckysheetformula.iscelldata(a))
                return tooltip.info("The range parameter is invalid.", "");
            var n = luckysheetformula.getcellrange(a);
            a = {
                row: n.row,
                column: n.column
            }
        }
        if ("object" != getObjType(a) || null == a.row || null == a.column)
            return tooltip.info("The range parameter is invalid.", "");
        var o = a.row[0]
          , l = a.row[1]
          , i = a.column[0]
          , s = a.column[1]
          , c = hasPartMC(Store.config, o, l, i, s);
        if (c)
            return tooltip.info("Cannot perform this operation on partially merged cells", "");
        var u, h, d, f, m = Store.visibledatarow, p = Store.visibledatacolumn;
        o - 1 < 0 ? (u = 0,
        h = m[l]) : (u = m[o - 1],
        h = m[l] - m[o - 1]),
        i - 1 < 0 ? (d = 0,
        f = p[s]) : (d = p[i - 1],
        f = p[s] - p[i - 1]);
        var g = $("<canvas>").attr({
            width: Math.ceil(f * Store.devicePixelRatio),
            height: Math.ceil(h * Store.devicePixelRatio)
        }).css({
            width: f,
            height: h
        });
        luckysheetDrawMain(d, u, f, h, 1, 1, null, null, g);
        var y = g.get(0).getContext("2d");
        y.beginPath(),
        y.moveTo(0, 0),
        y.lineTo(0, Store.devicePixelRatio * h),
        y.lineWidth = 2 * Store.devicePixelRatio,
        y.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        y.stroke(),
        y.closePath(),
        y.beginPath(),
        y.moveTo(0, 0),
        y.lineTo(Store.devicePixelRatio * f, 0),
        y.lineWidth = 2 * Store.devicePixelRatio,
        y.strokeStyle = luckysheetdefaultstyle.strokeStyle,
        y.stroke(),
        y.closePath();
        var v = g.get(0).toDataURL("image/png");
        return v
    }
    function setWorkbookName(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if (null == e || 0 == e.toString().length)
            return tooltip.info("The name parameter is invalid.", "");
        $("#luckysheet_info_detail_input").val(e);
        var r = _objectSpread2({}, t)
          , a = r.success;
        a && "function" == typeof a && a()
    }
    function undo() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = $.extend(!0, {}, Store.jfredo[Store.jfredo.length - 1]);
        controlHistory.redo(new Event("custom")),
        luckysheetactiveCell();
        var r = _objectSpread2({}, e)
          , a = r.success;
        return setTimeout((function() {
            a && "function" == typeof a && a()
        }
        ), 1),
        t
    }
    function redo() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = $.extend(!0, {}, Store.jfundo[Store.jfundo.length - 1]);
        controlHistory.undo(new Event("custom")),
        luckysheetactiveCell();
        var r = _objectSpread2({}, e)
          , a = r.success;
        return setTimeout((function() {
            a && "function" == typeof a && a()
        }
        ), 1),
        t
    }
    function getAllSheets() {
        var e = $.extend(!0, [], Store.luckysheetfile);
        return e.forEach((function(e, t, r) {
            null != e.data && e.data.length > 0 && (e.celldata = sheetmanage.getGridData(e.data)),
            delete e.load,
            delete e.freezen
        }
        )),
        e
    }
    function getSheet() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.index
          , a = t.order
          , n = t.name;
        return null != r ? sheetmanage.getSheetByIndex(r) : null != a ? Store.luckysheetfile[a] : null != n ? sheetmanage.getSheetByName(n) : sheetmanage.getSheetByIndex()
    }
    function getSheetData() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = Store.luckysheetfile[a];
        if (null == n)
            return tooltip.info("The order parameter is invalid.", "");
        var o = $.extend(!0, [], n.data);
        return null != o && 0 != o.length || (o = $.extend(!0, [], sheetmanage.buildGridData(n))),
        o
    }
    function getConfig() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.order
          , a = void 0 === r ? getSheetIndex(Store.currentSheetIndex) : r
          , n = Store.luckysheetfile[a];
        if (null == n)
            return tooltip.info("The order parameter is invalid.", "");
        var o = $.extend(!0, {}, n.config);
        return o
    }
    function setConfig(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("object" != getObjType(e))
            return tooltip.info("The cfg parameter is invalid.", "");
        var r = _objectSpread2({}, t)
          , a = r.order
          , n = void 0 === a ? getSheetIndex(Store.currentSheetIndex) : a
          , o = r.success
          , l = Store.luckysheetfile[n];
        if (null == l)
            return tooltip.info("The order parameter is invalid.", "");
        l.config = e,
        l.index == Store.currentSheetIndex && (Store.config = e,
        ("rowhidden"in e || "colhidden"in e || "rowlen"in e || "columnlen"in e) && jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length),
        setTimeout((function() {
            luckysheetrefreshgrid()
        }
        ), 1)),
        o && "function" == typeof o && o()
    }
    function getLuckysheetfile() {
        return getluckysheetfile()
    }
    function setDataVerification(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
        if ("object" != getObjType(e))
            return tooltip.info("The optionItem parameter is invalid.", "");
        var r = _objectSpread2({}, e)
          , a = r.type
          , n = r.type2
          , o = void 0 === n ? null : n
          , l = r.value1
          , i = void 0 === l ? "" : l
          , s = r.value2
          , c = void 0 === s ? "" : s
          , u = r.remote
          , h = void 0 !== u && u
          , d = r.prohibitInput
          , f = void 0 !== d && d
          , m = r.hintShow
          , p = void 0 !== m && m
          , g = r.hintText
          , y = void 0 === g ? "" : g
          , v = r.checked
          , A = void 0 !== v && v
          , b = ["dropdown", "checkbox", "number", "number_integer", "number_decimal", "text_content", "text_length", "date", "validity"]
          , k = ["bw", "nb", "eq", "ne", "gt", "lt", "gte", "lte"]
          , w = ["include", "exclude", "equal"]
          , x = ["bw", "nb", "eq", "ne", "bf", "nbf", "af", "naf"]
          , S = ["card", "phone"];
        if (!b.includes(a))
            return tooltip.info("The optionItem.type parameter is invalid.", "");
        var _ = locale().dataVerification;
        if ("dropdown" == a) {
            if (0 == i.length)
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo1)
        } else if ("checkbox" == a) {
            if (0 == i.length || 0 == c.length)
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo2)
        } else if ("number" == a || "number_integer" == a || "number_decimal" == a) {
            if (!k.includes(o))
                return tooltip.info("The optionItem.type2 parameter is invalid.", "");
            if (!isRealNum(i))
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo3);
            if ("bw" == o || "nb" == o) {
                if (!isRealNum(c))
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo3);
                if (Number(c) < Number(i))
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo4)
            }
        } else if ("text_content" == a) {
            if (!w.includes(o))
                return tooltip.info("The optionItem.type2 parameter is invalid.", "");
            if (0 == i.length)
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo5)
        } else if ("text_length" == a) {
            if (!k.includes(o))
                return tooltip.info("The optionItem.type2 parameter is invalid.", "");
            if (!isRealNum(i))
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo3);
            if ("bw" == o || "nb" == o) {
                if (!isRealNum(c))
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo3);
                if (Number(c) < Number(i))
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo4)
            }
        } else if ("date" == a) {
            if (!x.includes(o))
                return tooltip.info("The optionItem.type2 parameter is invalid.", "");
            if (!isdatetime(i))
                return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo6);
            if ("bw" == o || "nb" == o) {
                if (!isdatetime(c))
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo6);
                if (diff(i, c) > 0)
                    return void tooltip.info('<i class="fa fa-exclamation-triangle"></i>', _.tooltipInfo7)
            }
        } else if ("validity" == a && !S.includes(o))
            return tooltip.info("The optionItem.type2 parameter is invalid.", "");
        if ("boolean" != getObjType(h))
            return tooltip.info("The optionItem.remote parameter is invalid.", "");
        if ("boolean" != getObjType(f))
            return tooltip.info("The optionItem.prohibitInput parameter is invalid.", "");
        if ("boolean" != getObjType(p))
            return tooltip.info("The optionItem.hintShow parameter is invalid.", "");
        var C = _objectSpread2({}, t)
          , T = C.range
          , E = void 0 === T ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : T
          , I = C.order
          , R = void 0 === I ? getSheetIndex(Store.currentSheetIndex) : I
          , B = C.success;
        if ("string" == getObjType(E)) {
            if (!luckysheetformula.iscelldata(E))
                return tooltip.info("The range parameter is invalid.", "");
            var N = luckysheetformula.getcellrange(E);
            E = {
                row: N.row,
                column: N.column
            }
        }
        if ("object" != getObjType(E) || null == E.row || null == E.column)
            return tooltip.info("The range parameter is invalid.", "");
        var F = Store.luckysheetfile[R];
        if (null == F)
            return tooltip.info("The order parameter is invalid.", "");
        var P = {
            type: a,
            type2: o,
            value1: i,
            value2: c,
            checked: A,
            remote: h,
            prohibitInput: f,
            hintShow: p,
            hintText: y
        }
          , L = $.extend(!0, {}, F.dataVerification)
          , O = $.extend(!0, [], F.data);
        0 == O.length && (O = sheetmanage.buildGridData(F));
        for (var D = E.row[0], M = E.row[1], U = E.column[0], H = E.column[1], q = D; q <= M; q++)
            for (var z = U; z <= H; z++)
                L[q + "_" + z] = P,
                "checkbox" == a && (P.checked ? setcellvalue(q, z, O, P.value1) : setcellvalue(q, z, O, P.value2));
        if (F.index == Store.currentSheetIndex) {
            var j = $.extend(!0, {}, F.dataVerification);
            "checkbox" == a ? dataVerificationCtrl.refOfCheckbox(j, L, Store.currentSheetIndex, O, E) : dataVerificationCtrl.ref(j, L, Store.currentSheetIndex)
        } else
            F.dataVerification = L,
            F.data = O;
        B && "function" == typeof B && B()
    }
    function deleteDataVerification() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = _objectSpread2({}, e)
          , r = t.range
          , a = void 0 === r ? Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] : r
          , n = t.order
          , o = void 0 === n ? getSheetIndex(Store.currentSheetIndex) : n
          , l = t.success;
        if ("string" == getObjType(a)) {
            if (!luckysheetformula.iscelldata(a))
                return tooltip.info("The range parameter is invalid.", "");
            var i = luckysheetformula.getcellrange(a);
            a = {
                row: i.row,
                column: i.column
            }
        }
        if ("object" != getObjType(a) || null == a.row || null == a.column)
            return tooltip.info("The range parameter is invalid.", "");
        var s = Store.luckysheetfile[o];
        if (null == s)
            return tooltip.info("The order parameter is invalid.", "");
        for (var c = $.extend(!0, {}, s.dataVerification), u = a.row[0], h = a.row[1], d = a.column[0], f = a.column[1], m = u; m <= h; m++)
            for (var p = d; p <= f; p++)
                delete c[m + "_" + p];
        if (s.index == Store.currentSheetIndex) {
            var g = $.extend(!0, {}, s.dataVerification);
            dataVerificationCtrl.ref(g, c, Store.currentSheetIndex)
        } else
            s.dataVerification = c;
        l && "function" == typeof l && l()
    }
    function transToCellData(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = _objectSpread2({}, t)
          , a = r.success;
        return setTimeout((function() {
            a && "function" == typeof a && a()
        }
        ), 0),
        sheetmanage.getGridData(e)
    }
    function transToData(e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
          , r = _objectSpread2({}, t)
          , a = r.success;
        return setTimeout((function() {
            a && "function" == typeof a && a()
        }
        ), 0),
        sheetmanage.buildGridData({
            celldata: e
        })
    }
    function toJson() {
        var e = Store.toJsonOptions;
        return e.title = $("#luckysheet_info_detail_input").val(),
        e.data = getAllSheets(),
        getluckysheetfile().forEach((function(t, r) {
            e.data[r].row = t.data.length,
            e.data[r].column = t.data[0].length
        }
        )),
        e
    }
    _export({
        target: "String",
        proto: !0,
        forced: !correctIsRegexpLogic("includes")
    }, {
        includes: function(e) {
            return !!~String(requireObjectCoercible(this)).indexOf(notARegexp(e), arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var api = Object.freeze({
        __proto__: null,
        getCellValue: getCellValue,
        setCellValue: setCellValue,
        clearCell: clearCell,
        deleteCell: deleteCell,
        setCellFormat: setCellFormat,
        find: find$1,
        replace: replace$1,
        exitEditMode: exitEditMode,
        frozenFirstRow: frozenFirstRow,
        frozenFirstColumn: frozenFirstColumn,
        frozenRowRange: frozenRowRange,
        frozenColumnRange: frozenColumnRange,
        cancelFrozen: cancelFrozen,
        setHorizontalFrozen: setHorizontalFrozen,
        setVerticalFrozen: setVerticalFrozen,
        setBothFrozen: setBothFrozen,
        insertRowOrColumn: insertRowOrColumn,
        insertRow: insertRow,
        insertColumn: insertColumn,
        deleteRowOrColumn: deleteRowOrColumn,
        deleteRow: deleteRow,
        deleteColumn: deleteColumn,
        hideRowOrColumn: hideRowOrColumn,
        showRowOrColumn: showRowOrColumn,
        hideRow: hideRow,
        showRow: showRow,
        hideColumn: hideColumn,
        showColumn: showColumn,
        setRowHeight: setRowHeight,
        setColumnWidth: setColumnWidth,
        getRowHeight: getRowHeight,
        getColumnWidth: getColumnWidth,
        getDefaultRowHeight: getDefaultRowHeight,
        getDefaultColWidth: getDefaultColWidth,
        getRange: getRange,
        getRangeValue: getRangeValue,
        getRangeHtml: getRangeHtml,
        getRangeArray: getRangeArray,
        getRangeJson: getRangeJson,
        getRangeDiagonal: getRangeDiagonal,
        getRangeBoolean: getRangeBoolean,
        setRangeShow: setRangeShow,
        setRangeValue: setRangeValue,
        setSingleRangeFormat: setSingleRangeFormat,
        setRangeFormat: setRangeFormat,
        setRangeFilter: setRangeFilter,
        setRangeMerge: setRangeMerge,
        cancelRangeMerge: cancelRangeMerge,
        setRangeSort: setRangeSort,
        setRangeSortMulti: setRangeSortMulti,
        setRangeConditionalFormatDefault: setRangeConditionalFormatDefault,
        setRangeConditionalFormat: setRangeConditionalFormat,
        deleteRangeConditionalFormat: deleteRangeConditionalFormat,
        clearRange: clearRange,
        deleteRange: deleteRange,
        matrixOperation: matrixOperation,
        matrixCalculation: matrixCalculation,
        setSheetAdd: setSheetAdd,
        setSheetDelete: setSheetDelete,
        setSheetCopy: setSheetCopy,
        setSheetHide: setSheetHide,
        setSheetShow: setSheetShow,
        setSheetActive: setSheetActive,
        setSheetName: setSheetName,
        setSheetColor: setSheetColor,
        setSheetMove: setSheetMove,
        setSheetOrder: setSheetOrder,
        setSheetZoom: setSheetZoom,
        showGridLines: showGridLines,
        hideGridLines: hideGridLines,
        refresh: refresh,
        scroll: scroll,
        resize: resize,
        getScreenshot: getScreenshot,
        setWorkbookName: setWorkbookName,
        undo: undo,
        redo: redo,
        getAllSheets: getAllSheets,
        getSheet: getSheet,
        getSheetData: getSheetData,
        getConfig: getConfig,
        setConfig: setConfig,
        getLuckysheetfile: getLuckysheetfile,
        setDataVerification: setDataVerification,
        deleteDataVerification: deleteDataVerification,
        transToCellData: transToCellData,
        transToData: transToData,
        toJson: toJson
    })
      , luckysheet$1 = {};
    function initialWorkBook() {
        luckysheetHandler(),
        initialFilterHandler(),
        initialMatrixOperation(),
        initialSheetBar(),
        formulaBarInitial(),
        rowColumnOperationInitial(),
        keyboardInitial(),
        orderByInitial(),
        zoomInitial(),
        printInitial()
    }
    luckysheet$1 = common_extend(api, luckysheet$1),
    luckysheet$1.create = function(setting) {
        for (var c in Store.toJsonOptions = {},
        setting)
            "data" !== c && (Store.toJsonOptions[c] = setting[c]);
        var extendsetting = common_extend(defaultSetting, setting)
          , loadurl = extendsetting.loadUrl
          , menu = extendsetting.menu
          , title = extendsetting.title
          , container = extendsetting.container;
        Store.container = container,
        Store.luckysheetfile = extendsetting.data,
        Store.defaultcolumnNum = extendsetting.column,
        Store.defaultrowNum = extendsetting.row,
        Store.fullscreenmode = extendsetting.fullscreenmode,
        Store.lang = extendsetting.lang,
        Store.allowEdit = extendsetting.allowEdit,
        Store.fontList = extendsetting.fontList,
        server.gridKey = extendsetting.gridKey,
        server.loadUrl = extendsetting.loadUrl,
        server.updateUrl = extendsetting.updateUrl,
        server.updateImageUrl = extendsetting.updateImageUrl,
        server.title = extendsetting.title,
        server.loadSheetUrl = extendsetting.loadSheetUrl,
        server.allowUpdate = extendsetting.allowUpdate,
        luckysheetConfigsetting.autoFormatw = extendsetting.autoFormatw,
        luckysheetConfigsetting.accuracy = extendsetting.accuracy,
        luckysheetConfigsetting.total = extendsetting.data[0].total,
        luckysheetConfigsetting.allowCopy = extendsetting.allowCopy,
        luckysheetConfigsetting.showtoolbar = extendsetting.showtoolbar,
        luckysheetConfigsetting.showtoolbarConfig = extendsetting.showtoolbarConfig,
        luckysheetConfigsetting.showinfobar = extendsetting.showinfobar,
        luckysheetConfigsetting.showsheetbar = extendsetting.showsheetbar,
        luckysheetConfigsetting.showsheetbarConfig = extendsetting.showsheetbarConfig,
        luckysheetConfigsetting.showstatisticBar = extendsetting.showstatisticBar,
        luckysheetConfigsetting.showstatisticBarConfig = extendsetting.showstatisticBarConfig,
        luckysheetConfigsetting.sheetFormulaBar = extendsetting.sheetFormulaBar,
        luckysheetConfigsetting.cellRightClickConfig = extendsetting.cellRightClickConfig,
        luckysheetConfigsetting.sheetRightClickConfig = extendsetting.sheetRightClickConfig,
        luckysheetConfigsetting.pointEdit = extendsetting.pointEdit,
        luckysheetConfigsetting.pointEditUpdate = extendsetting.pointEditUpdate,
        luckysheetConfigsetting.pointEditZoom = extendsetting.pointEditZoom,
        luckysheetConfigsetting.userInfo = extendsetting.userInfo,
        luckysheetConfigsetting.userMenuItem = extendsetting.userMenuItem,
        luckysheetConfigsetting.myFolderUrl = extendsetting.myFolderUrl,
        luckysheetConfigsetting.functionButton = extendsetting.functionButton,
        luckysheetConfigsetting.showConfigWindowResize = extendsetting.showConfigWindowResize,
        luckysheetConfigsetting.enableAddRow = extendsetting.enableAddRow,
        luckysheetConfigsetting.enableAddBackTop = extendsetting.enableAddBackTop,
        luckysheetConfigsetting.enablePage = extendsetting.enablePage,
        luckysheetConfigsetting.pageInfo = extendsetting.pageInfo,
        luckysheetConfigsetting.editMode = extendsetting.editMode,
        luckysheetConfigsetting.beforeCreateDom = extendsetting.beforeCreateDom,
        luckysheetConfigsetting.workbookCreateBefore = extendsetting.workbookCreateBefore,
        luckysheetConfigsetting.workbookCreateAfter = extendsetting.workbookCreateAfter,
        luckysheetConfigsetting.fireMousedown = extendsetting.fireMousedown,
        luckysheetConfigsetting.forceCalculation = extendsetting.forceCalculation,
        luckysheetConfigsetting.plugins = extendsetting.plugins,
        luckysheetConfigsetting.rowHeaderWidth = extendsetting.rowHeaderWidth,
        luckysheetConfigsetting.columnHeaderHeight = extendsetting.columnHeaderHeight,
        luckysheetConfigsetting.defaultColWidth = extendsetting.defaultColWidth,
        luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight,
        luckysheetConfigsetting.title = extendsetting.title,
        luckysheetConfigsetting.container = extendsetting.container,
        luckysheetConfigsetting.hook = extendsetting.hook,
        initPlugins(extendsetting.plugins, extendsetting.data),
        functionlist();
        var devicePixelRatio = extendsetting.devicePixelRatio;
        null == devicePixelRatio && (devicePixelRatio = 1),
        Store.devicePixelRatio = Math.ceil(devicePixelRatio),
        $("#" + container).append(luckysheetlodingHTML()),
        "" == loadurl ? (sheetmanage.initialjfFile(menu, title),
        initialWorkBook()) : $.post(loadurl, {
            gridKey: server.gridKey
        }, (function(d) {
            var data = eval("(" + d + ")");
            Store.luckysheetfile = data,
            sheetmanage.initialjfFile(menu, title),
            initialWorkBook(),
            server.allowUpdate && server.openWebSocket()
        }
        ))
    }
    ,
    luckysheet$1.getluckysheetfile = getluckysheetfile,
    luckysheet$1.getluckysheet_select_save = getluckysheet_select_save,
    luckysheet$1.setluckysheet_select_save = setluckysheet_select_save,
    luckysheet$1.getconfig = getconfig,
    luckysheet$1.getGridData = sheetmanage.getGridData,
    luckysheet$1.buildGridData = sheetmanage.buildGridData,
    luckysheet$1.luckysheetrefreshgrid = luckysheetrefreshgrid,
    luckysheet$1.jfrefreshgrid = jfrefreshgrid,
    luckysheet$1.getcellvalue = getcellvalue,
    luckysheet$1.setcellvalue = setcellvalue,
    luckysheet$1.getdatabyselection = getdatabyselection,
    luckysheet$1.sheetmanage = sheetmanage,
    luckysheet$1.flowdata = function() {
        return Store.flowdata
    }
    ,
    luckysheet$1.selectHightlightShow = selectHightlightShow,
    luckysheet$1.destroy = method.destroy;
    var objectPrototypeAccessorsForced = !fails((function() {
        var e = Math.random();
        __defineSetter__.call(null, e, (function() {}
        )),
        delete global_1[e]
    }
    ));
    function __firefox() {
        HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style),
        window.constructor.prototype.__defineGetter__("event", __window_event),
        Event.prototype.__defineGetter__("srcElement", __event_srcElement)
    }
    function __element_style() {
        return this.style
    }
    function __window_event() {
        return __window_event_constructor()
    }
    function __event_srcElement() {
        return this.target
    }
    function __window_event_constructor() {
        if (document.all)
            return window.event;
        for (var e = __window_event_constructor.caller; null != e; ) {
            var t = e.arguments[0];
            if (t)
                if (-1 != t.constructor.toString().indexOf("Event"))
                    return t;
            e = e.caller
        }
        return null
    }
    descriptors && _export({
        target: "Object",
        proto: !0,
        forced: objectPrototypeAccessorsForced
    }, {
        __defineGetter__: function(e, t) {
            objectDefineProperty.f(toObject(this), e, {
                get: aFunction$1(t),
                enumerable: !0,
                configurable: !0
            })
        }
    }),
    window.addEventListener && navigator.userAgent.indexOf("Firefox") > 0 && __firefox();
    var luckysheet$2 = luckysheet$1
      , extendStatics = function(e, t) {
        return (extendStatics = Object.setPrototypeOf || {
            __proto__: []
        }instanceof Array && function(e, t) {
            e.__proto__ = t
        }
        || function(e, t) {
            for (var r in t)
                t.hasOwnProperty(r) && (e[r] = t[r])
        }
        )(e, t)
    };
    /*!
     * html2canvas 1.0.0-rc.7 <https://html2canvas.hertzen.com>
     * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
     * Released under MIT License
     */
    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    function __extends(e, t) {
        function r() {
            this.constructor = e
        }
        extendStatics(e, t),
        e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype,
        new r)
    }
    var __assign = function() {
        return (__assign = Object.assign || function(e) {
            for (var t, r = 1, a = arguments.length; r < a; r++)
                for (var n in t = arguments[r])
                    Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
            return e
        }
        ).apply(this, arguments)
    };
    function __awaiter(e, t, r, a) {
        return new (r || (r = Promise))((function(n, o) {
            function l(e) {
                try {
                    s(a.next(e))
                } catch (e) {
                    o(e)
                }
            }
            function i(e) {
                try {
                    s(a.throw(e))
                } catch (e) {
                    o(e)
                }
            }
            function s(e) {
                e.done ? n(e.value) : new r((function(t) {
                    t(e.value)
                }
                )).then(l, i)
            }
            s((a = a.apply(e, t || [])).next())
        }
        ))
    }
    function __generator(e, t) {
        var r, a, n, o, l = {
            label: 0,
            sent: function() {
                if (1 & n[0])
                    throw n[1];
                return n[1]
            },
            trys: [],
            ops: []
        };
        return o = {
            next: i(0),
            throw: i(1),
            return: i(2)
        },
        "function" == typeof Symbol && (o[Symbol.iterator] = function() {
            return this
        }
        ),
        o;
        function i(o) {
            return function(i) {
                return function(o) {
                    if (r)
                        throw new TypeError("Generator is already executing.");
                    for (; l; )
                        try {
                            if (r = 1,
                            a && (n = 2 & o[0] ? a.return : o[0] ? a.throw || ((n = a.return) && n.call(a),
                            0) : a.next) && !(n = n.call(a, o[1])).done)
                                return n;
                            switch (a = 0,
                            n && (o = [2 & o[0], n.value]),
                            o[0]) {
                            case 0:
                            case 1:
                                n = o;
                                break;
                            case 4:
                                return l.label++,
                                {
                                    value: o[1],
                                    done: !1
                                };
                            case 5:
                                l.label++,
                                a = o[1],
                                o = [0];
                                continue;
                            case 7:
                                o = l.ops.pop(),
                                l.trys.pop();
                                continue;
                            default:
                                if (!(n = l.trys,
                                (n = n.length > 0 && n[n.length - 1]) || 6 !== o[0] && 2 !== o[0])) {
                                    l = 0;
                                    continue
                                }
                                if (3 === o[0] && (!n || o[1] > n[0] && o[1] < n[3])) {
                                    l.label = o[1];
                                    break
                                }
                                if (6 === o[0] && l.label < n[1]) {
                                    l.label = n[1],
                                    n = o;
                                    break
                                }
                                if (n && l.label < n[2]) {
                                    l.label = n[2],
                                    l.ops.push(o);
                                    break
                                }
                                n[2] && l.ops.pop(),
                                l.trys.pop();
                                continue
                            }
                            o = t.call(e, l)
                        } catch (e) {
                            o = [6, e],
                            a = 0
                        } finally {
                            r = n = 0
                        }
                    if (5 & o[0])
                        throw o[1];
                    return {
                        value: o[0] ? o[1] : void 0,
                        done: !0
                    }
                }([o, i])
            }
        }
    }
    for (var Bounds = function() {
        function e(e, t, r, a) {
            this.left = e,
            this.top = t,
            this.width = r,
            this.height = a
        }
        return e.prototype.add = function(t, r, a, n) {
            return new e(this.left + t,this.top + r,this.width + a,this.height + n)
        }
        ,
        e.fromClientRect = function(t) {
            return new e(t.left,t.top,t.width,t.height)
        }
        ,
        e
    }(), parseBounds = function(e) {
        return Bounds.fromClientRect(e.getBoundingClientRect())
    }, parseDocumentSize = function(e) {
        var t = e.body
          , r = e.documentElement;
        if (!t || !r)
            throw new Error("Unable to get document size");
        var a = Math.max(Math.max(t.scrollWidth, r.scrollWidth), Math.max(t.offsetWidth, r.offsetWidth), Math.max(t.clientWidth, r.clientWidth))
          , n = Math.max(Math.max(t.scrollHeight, r.scrollHeight), Math.max(t.offsetHeight, r.offsetHeight), Math.max(t.clientHeight, r.clientHeight));
        return new Bounds(0,0,a,n)
    }, toCodePoints = function(e) {
        for (var t = [], r = 0, a = e.length; r < a; ) {
            var n = e.charCodeAt(r++);
            if (n >= 55296 && n <= 56319 && r < a) {
                var o = e.charCodeAt(r++);
                56320 == (64512 & o) ? t.push(((1023 & n) << 10) + (1023 & o) + 65536) : (t.push(n),
                r--)
            } else
                t.push(n)
        }
        return t
    }, fromCodePoint = function() {
        for (var e = [], t = 0; t < arguments.length; t++)
            e[t] = arguments[t];
        if (String.fromCodePoint)
            return String.fromCodePoint.apply(String, e);
        var r = e.length;
        if (!r)
            return "";
        for (var a = [], n = -1, o = ""; ++n < r; ) {
            var l = e[n];
            l <= 65535 ? a.push(l) : (l -= 65536,
            a.push(55296 + (l >> 10), l % 1024 + 56320)),
            (n + 1 === r || a.length > 16384) && (o += String.fromCharCode.apply(String, a),
            a.length = 0)
        }
        return o
    }, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", lookup = "undefined" == typeof Uint8Array ? [] : new Uint8Array(256), i$2 = 0; i$2 < chars.length; i$2++)
        lookup[chars.charCodeAt(i$2)] = i$2;
    var decode = function(e) {
        var t, r, a, n, o, l = .75 * e.length, i = e.length, s = 0;
        "=" === e[e.length - 1] && (l--,
        "=" === e[e.length - 2] && l--);
        var c = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array && void 0 !== Uint8Array.prototype.slice ? new ArrayBuffer(l) : new Array(l)
          , u = Array.isArray(c) ? c : new Uint8Array(c);
        for (t = 0; t < i; t += 4)
            r = lookup[e.charCodeAt(t)],
            a = lookup[e.charCodeAt(t + 1)],
            n = lookup[e.charCodeAt(t + 2)],
            o = lookup[e.charCodeAt(t + 3)],
            u[s++] = r << 2 | a >> 4,
            u[s++] = (15 & a) << 4 | n >> 2,
            u[s++] = (3 & n) << 6 | 63 & o;
        return c
    }, polyUint16Array = function(e) {
        for (var t = e.length, r = [], a = 0; a < t; a += 2)
            r.push(e[a + 1] << 8 | e[a]);
        return r
    }, polyUint32Array = function(e) {
        for (var t = e.length, r = [], a = 0; a < t; a += 4)
            r.push(e[a + 3] << 24 | e[a + 2] << 16 | e[a + 1] << 8 | e[a]);
        return r
    }, UTRIE2_SHIFT_2 = 5, UTRIE2_SHIFT_1 = 11, UTRIE2_INDEX_SHIFT = 2, UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2, UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2, UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2, UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1, UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2, UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH, UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH, UTRIE2_UTF8_2B_INDEX_2_LENGTH = 32, UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH, UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1, UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2, UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1, slice16 = function(e, t, r) {
        return e.slice ? e.slice(t, r) : new Uint16Array(Array.prototype.slice.call(e, t, r))
    }, slice32 = function(e, t, r) {
        return e.slice ? e.slice(t, r) : new Uint32Array(Array.prototype.slice.call(e, t, r))
    }, createTrieFromBase64 = function(e) {
        var t = decode(e)
          , r = Array.isArray(t) ? polyUint32Array(t) : new Uint32Array(t)
          , a = Array.isArray(t) ? polyUint16Array(t) : new Uint16Array(t)
          , n = slice16(a, 12, r[4] / 2)
          , o = 2 === r[5] ? slice16(a, (24 + r[4]) / 2) : slice32(r, Math.ceil((24 + r[4]) / 4));
        return new Trie(r[0],r[1],r[2],r[3],n,o)
    }, Trie = function() {
        function e(e, t, r, a, n, o) {
            this.initialValue = e,
            this.errorValue = t,
            this.highStart = r,
            this.highValueIndex = a,
            this.index = n,
            this.data = o
        }
        return e.prototype.get = function(e) {
            var t;
            if (e >= 0) {
                if (e < 55296 || e > 56319 && e <= 65535)
                    return t = ((t = this.index[e >> UTRIE2_SHIFT_2]) << UTRIE2_INDEX_SHIFT) + (e & UTRIE2_DATA_MASK),
                    this.data[t];
                if (e <= 65535)
                    return t = ((t = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (e - 55296 >> UTRIE2_SHIFT_2)]) << UTRIE2_INDEX_SHIFT) + (e & UTRIE2_DATA_MASK),
                    this.data[t];
                if (e < this.highStart)
                    return t = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (e >> UTRIE2_SHIFT_1),
                    t = this.index[t],
                    t += e >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK,
                    t = ((t = this.index[t]) << UTRIE2_INDEX_SHIFT) + (e & UTRIE2_DATA_MASK),
                    this.data[t];
                if (e <= 1114111)
                    return this.data[this.highValueIndex]
            }
            return this.errorValue
        }
        ,
        e
    }(), base64 = " ", LETTER_NUMBER_MODIFIER = 50, BK = 1, CR = 2, LF = 3, CM = 4, NL = 5, WJ = 7, ZW = 8, GL = 9, SP = 10, ZWJ = 11, B2 = 12, BA = 13, BB = 14, HY = 15, CB = 16, CL = 17, CP = 18, EX = 19, IN = 20, NS = 21, OP = 22, QU = 23, IS = 24, NU = 25, PO = 26, PR = 27, SY = 28, AI = 29, AL = 30, CJ = 31, EB = 32, EM = 33, H2 = 34, H3 = 35, HL = 36, ID = 37, JL = 38, JV = 39, JT = 40, RI = 41, SA = 42, XX = 43, BREAK_MANDATORY = "!", BREAK_NOT_ALLOWED = "×", BREAK_ALLOWED = "÷", UnicodeTrie = createTrieFromBase64(base64), ALPHABETICS = [AL, HL], HARD_LINE_BREAKS = [BK, CR, LF, NL], SPACE = [SP, ZW], PREFIX_POSTFIX = [PR, PO], LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE), KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3], HYPHEN = [HY, BA], codePointsToCharacterClasses = function(e, t) {
        void 0 === t && (t = "strict");
        var r = []
          , a = []
          , n = [];
        return e.forEach((function(e, o) {
            var l = UnicodeTrie.get(e);
            if (l > LETTER_NUMBER_MODIFIER ? (n.push(!0),
            l -= LETTER_NUMBER_MODIFIER) : n.push(!1),
            -1 !== ["normal", "auto", "loose"].indexOf(t) && -1 !== [8208, 8211, 12316, 12448].indexOf(e))
                return a.push(o),
                r.push(CB);
            if (l === CM || l === ZWJ) {
                if (0 === o)
                    return a.push(o),
                    r.push(AL);
                var i = r[o - 1];
                return -1 === LINE_BREAKS.indexOf(i) ? (a.push(a[o - 1]),
                r.push(i)) : (a.push(o),
                r.push(AL))
            }
            return a.push(o),
            l === CJ ? r.push("strict" === t ? NS : ID) : l === SA || l === AI ? r.push(AL) : l === XX ? e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141 ? r.push(ID) : r.push(AL) : void r.push(l)
        }
        )),
        [a, r, n]
    }, isAdjacentWithSpaceIgnored = function(e, t, r, a) {
        var n = a[r];
        if (Array.isArray(e) ? -1 !== e.indexOf(n) : e === n)
            for (var o = r; o <= a.length; ) {
                if ((s = a[++o]) === t)
                    return !0;
                if (s !== SP)
                    break
            }
        if (n === SP)
            for (o = r; o > 0; ) {
                var l = a[--o];
                if (Array.isArray(e) ? -1 !== e.indexOf(l) : e === l)
                    for (var i = r; i <= a.length; ) {
                        var s;
                        if ((s = a[++i]) === t)
                            return !0;
                        if (s !== SP)
                            break
                    }
                if (l !== SP)
                    break
            }
        return !1
    }, previousNonSpaceClassType = function(e, t) {
        for (var r = e; r >= 0; ) {
            var a = t[r];
            if (a !== SP)
                return a;
            r--
        }
        return 0
    }, _lineBreakAtIndex = function(e, t, r, a, n) {
        if (0 === r[a])
            return BREAK_NOT_ALLOWED;
        var o = a - 1;
        if (Array.isArray(n) && !0 === n[o])
            return BREAK_NOT_ALLOWED;
        var l = o - 1
          , i = o + 1
          , s = t[o]
          , c = l >= 0 ? t[l] : 0
          , u = t[i];
        if (s === CR && u === LF)
            return BREAK_NOT_ALLOWED;
        if (-1 !== HARD_LINE_BREAKS.indexOf(s))
            return BREAK_MANDATORY;
        if (-1 !== HARD_LINE_BREAKS.indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (-1 !== SPACE.indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (previousNonSpaceClassType(o, t) === ZW)
            return BREAK_ALLOWED;
        if (UnicodeTrie.get(e[o]) === ZWJ && (u === ID || u === EB || u === EM))
            return BREAK_NOT_ALLOWED;
        if (s === WJ || u === WJ)
            return BREAK_NOT_ALLOWED;
        if (s === GL)
            return BREAK_NOT_ALLOWED;
        if (-1 === [SP, BA, HY].indexOf(s) && u === GL)
            return BREAK_NOT_ALLOWED;
        if (-1 !== [CL, CP, EX, IS, SY].indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (previousNonSpaceClassType(o, t) === OP)
            return BREAK_NOT_ALLOWED;
        if (isAdjacentWithSpaceIgnored(QU, OP, o, t))
            return BREAK_NOT_ALLOWED;
        if (isAdjacentWithSpaceIgnored([CL, CP], NS, o, t))
            return BREAK_NOT_ALLOWED;
        if (isAdjacentWithSpaceIgnored(B2, B2, o, t))
            return BREAK_NOT_ALLOWED;
        if (s === SP)
            return BREAK_ALLOWED;
        if (s === QU || u === QU)
            return BREAK_NOT_ALLOWED;
        if (u === CB || s === CB)
            return BREAK_ALLOWED;
        if (-1 !== [BA, HY, NS].indexOf(u) || s === BB)
            return BREAK_NOT_ALLOWED;
        if (c === HL && -1 !== HYPHEN.indexOf(s))
            return BREAK_NOT_ALLOWED;
        if (s === SY && u === HL)
            return BREAK_NOT_ALLOWED;
        if (u === IN && -1 !== ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(s))
            return BREAK_NOT_ALLOWED;
        if (-1 !== ALPHABETICS.indexOf(u) && s === NU || -1 !== ALPHABETICS.indexOf(s) && u === NU)
            return BREAK_NOT_ALLOWED;
        if (s === PR && -1 !== [ID, EB, EM].indexOf(u) || -1 !== [ID, EB, EM].indexOf(s) && u === PO)
            return BREAK_NOT_ALLOWED;
        if (-1 !== ALPHABETICS.indexOf(s) && -1 !== PREFIX_POSTFIX.indexOf(u) || -1 !== PREFIX_POSTFIX.indexOf(s) && -1 !== ALPHABETICS.indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (-1 !== [PR, PO].indexOf(s) && (u === NU || -1 !== [OP, HY].indexOf(u) && t[i + 1] === NU) || -1 !== [OP, HY].indexOf(s) && u === NU || s === NU && -1 !== [NU, SY, IS].indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (-1 !== [NU, SY, IS, CL, CP].indexOf(u))
            for (var h = o; h >= 0; ) {
                if ((d = t[h]) === NU)
                    return BREAK_NOT_ALLOWED;
                if (-1 === [SY, IS].indexOf(d))
                    break;
                h--
            }
        if (-1 !== [PR, PO].indexOf(u))
            for (h = -1 !== [CL, CP].indexOf(s) ? l : o; h >= 0; ) {
                var d;
                if ((d = t[h]) === NU)
                    return BREAK_NOT_ALLOWED;
                if (-1 === [SY, IS].indexOf(d))
                    break;
                h--
            }
        if (JL === s && -1 !== [JL, JV, H2, H3].indexOf(u) || -1 !== [JV, H2].indexOf(s) && -1 !== [JV, JT].indexOf(u) || -1 !== [JT, H3].indexOf(s) && u === JT)
            return BREAK_NOT_ALLOWED;
        if (-1 !== KOREAN_SYLLABLE_BLOCK.indexOf(s) && -1 !== [IN, PO].indexOf(u) || -1 !== KOREAN_SYLLABLE_BLOCK.indexOf(u) && s === PR)
            return BREAK_NOT_ALLOWED;
        if (-1 !== ALPHABETICS.indexOf(s) && -1 !== ALPHABETICS.indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (s === IS && -1 !== ALPHABETICS.indexOf(u))
            return BREAK_NOT_ALLOWED;
        if (-1 !== ALPHABETICS.concat(NU).indexOf(s) && u === OP || -1 !== ALPHABETICS.concat(NU).indexOf(u) && s === CP)
            return BREAK_NOT_ALLOWED;
        if (s === RI && u === RI) {
            for (var f = r[o], m = 1; f > 0 && t[--f] === RI; )
                m++;
            if (m % 2 != 0)
                return BREAK_NOT_ALLOWED
        }
        return s === EB && u === EM ? BREAK_NOT_ALLOWED : BREAK_ALLOWED
    }, cssFormattedClasses = function(e, t) {
        t || (t = {
            lineBreak: "normal",
            wordBreak: "normal"
        });
        var r = codePointsToCharacterClasses(e, t.lineBreak)
          , a = r[0]
          , n = r[1]
          , o = r[2];
        return "break-all" !== t.wordBreak && "break-word" !== t.wordBreak || (n = n.map((function(e) {
            return -1 !== [NU, AL, SA].indexOf(e) ? ID : e
        }
        ))),
        [a, n, "keep-all" === t.wordBreak ? o.map((function(t, r) {
            return t && e[r] >= 19968 && e[r] <= 40959
        }
        )) : void 0]
    }, Break = function() {
        function e(e, t, r, a) {
            this.codePoints = e,
            this.required = t === BREAK_MANDATORY,
            this.start = r,
            this.end = a
        }
        return e.prototype.slice = function() {
            return fromCodePoint.apply(void 0, this.codePoints.slice(this.start, this.end))
        }
        ,
        e
    }(), LineBreaker = function(e, t) {
        var r = toCodePoints(e)
          , a = cssFormattedClasses(r, t)
          , n = a[0]
          , o = a[1]
          , l = a[2]
          , i = r.length
          , s = 0
          , c = 0;
        return {
            next: function() {
                if (c >= i)
                    return {
                        done: !0,
                        value: null
                    };
                for (var e = BREAK_NOT_ALLOWED; c < i && (e = _lineBreakAtIndex(r, o, n, ++c, l)) === BREAK_NOT_ALLOWED; )
                    ;
                if (e !== BREAK_NOT_ALLOWED || c === i) {
                    var t = new Break(r,e,s,c);
                    return s = c,
                    {
                        value: t,
                        done: !1
                    }
                }
                return {
                    done: !0,
                    value: null
                }
            }
        }
    }, TokenType;
    !function(e) {
        e[e.STRING_TOKEN = 0] = "STRING_TOKEN",
        e[e.BAD_STRING_TOKEN = 1] = "BAD_STRING_TOKEN",
        e[e.LEFT_PARENTHESIS_TOKEN = 2] = "LEFT_PARENTHESIS_TOKEN",
        e[e.RIGHT_PARENTHESIS_TOKEN = 3] = "RIGHT_PARENTHESIS_TOKEN",
        e[e.COMMA_TOKEN = 4] = "COMMA_TOKEN",
        e[e.HASH_TOKEN = 5] = "HASH_TOKEN",
        e[e.DELIM_TOKEN = 6] = "DELIM_TOKEN",
        e[e.AT_KEYWORD_TOKEN = 7] = "AT_KEYWORD_TOKEN",
        e[e.PREFIX_MATCH_TOKEN = 8] = "PREFIX_MATCH_TOKEN",
        e[e.DASH_MATCH_TOKEN = 9] = "DASH_MATCH_TOKEN",
        e[e.INCLUDE_MATCH_TOKEN = 10] = "INCLUDE_MATCH_TOKEN",
        e[e.LEFT_CURLY_BRACKET_TOKEN = 11] = "LEFT_CURLY_BRACKET_TOKEN",
        e[e.RIGHT_CURLY_BRACKET_TOKEN = 12] = "RIGHT_CURLY_BRACKET_TOKEN",
        e[e.SUFFIX_MATCH_TOKEN = 13] = "SUFFIX_MATCH_TOKEN",
        e[e.SUBSTRING_MATCH_TOKEN = 14] = "SUBSTRING_MATCH_TOKEN",
        e[e.DIMENSION_TOKEN = 15] = "DIMENSION_TOKEN",
        e[e.PERCENTAGE_TOKEN = 16] = "PERCENTAGE_TOKEN",
        e[e.NUMBER_TOKEN = 17] = "NUMBER_TOKEN",
        e[e.FUNCTION = 18] = "FUNCTION",
        e[e.FUNCTION_TOKEN = 19] = "FUNCTION_TOKEN",
        e[e.IDENT_TOKEN = 20] = "IDENT_TOKEN",
        e[e.COLUMN_TOKEN = 21] = "COLUMN_TOKEN",
        e[e.URL_TOKEN = 22] = "URL_TOKEN",
        e[e.BAD_URL_TOKEN = 23] = "BAD_URL_TOKEN",
        e[e.CDC_TOKEN = 24] = "CDC_TOKEN",
        e[e.CDO_TOKEN = 25] = "CDO_TOKEN",
        e[e.COLON_TOKEN = 26] = "COLON_TOKEN",
        e[e.SEMICOLON_TOKEN = 27] = "SEMICOLON_TOKEN",
        e[e.LEFT_SQUARE_BRACKET_TOKEN = 28] = "LEFT_SQUARE_BRACKET_TOKEN",
        e[e.RIGHT_SQUARE_BRACKET_TOKEN = 29] = "RIGHT_SQUARE_BRACKET_TOKEN",
        e[e.UNICODE_RANGE_TOKEN = 30] = "UNICODE_RANGE_TOKEN",
        e[e.WHITESPACE_TOKEN = 31] = "WHITESPACE_TOKEN",
        e[e.EOF_TOKEN = 32] = "EOF_TOKEN"
    }(TokenType || (TokenType = {}));
    var FLAG_UNRESTRICTED = 1
      , FLAG_ID = 2
      , FLAG_INTEGER = 4
      , FLAG_NUMBER = 8
      , LINE_FEED = 10
      , SOLIDUS = 47
      , REVERSE_SOLIDUS = 92
      , CHARACTER_TABULATION = 9
      , SPACE$1 = 32
      , QUOTATION_MARK = 34
      , EQUALS_SIGN = 61
      , NUMBER_SIGN = 35
      , DOLLAR_SIGN = 36
      , PERCENTAGE_SIGN = 37
      , APOSTROPHE = 39
      , LEFT_PARENTHESIS = 40
      , RIGHT_PARENTHESIS = 41
      , LOW_LINE = 95
      , HYPHEN_MINUS = 45
      , EXCLAMATION_MARK = 33
      , LESS_THAN_SIGN = 60
      , GREATER_THAN_SIGN = 62
      , COMMERCIAL_AT = 64
      , LEFT_SQUARE_BRACKET = 91
      , RIGHT_SQUARE_BRACKET = 93
      , CIRCUMFLEX_ACCENT = 61
      , LEFT_CURLY_BRACKET = 123
      , QUESTION_MARK = 63
      , RIGHT_CURLY_BRACKET = 125
      , VERTICAL_LINE = 124
      , TILDE = 126
      , CONTROL = 128
      , REPLACEMENT_CHARACTER = 65533
      , ASTERISK = 42
      , PLUS_SIGN = 43
      , COMMA = 44
      , COLON = 58
      , SEMICOLON = 59
      , FULL_STOP = 46
      , NULL = 0
      , BACKSPACE = 8
      , LINE_TABULATION = 11
      , SHIFT_OUT = 14
      , INFORMATION_SEPARATOR_ONE = 31
      , DELETE = 127
      , EOF$1 = -1
      , ZERO = 48
      , a$1 = 97
      , e$1 = 101
      , f$7 = 102
      , u$1 = 117
      , z$1 = 122
      , A$1 = 65
      , E$1 = 69
      , F$1 = 70
      , U$1 = 85
      , Z$1 = 90
      , isDigit = function(e) {
        return e >= ZERO && e <= 57
    }
      , isSurrogateCodePoint = function(e) {
        return e >= 55296 && e <= 57343
    }
      , isHex = function(e) {
        return isDigit(e) || e >= A$1 && e <= F$1 || e >= a$1 && e <= f$7
    }
      , isLowerCaseLetter = function(e) {
        return e >= a$1 && e <= z$1
    }
      , isUpperCaseLetter = function(e) {
        return e >= A$1 && e <= Z$1
    }
      , isLetter = function(e) {
        return isLowerCaseLetter(e) || isUpperCaseLetter(e)
    }
      , isNonASCIICodePoint = function(e) {
        return e >= CONTROL
    }
      , isWhiteSpace = function(e) {
        return e === LINE_FEED || e === CHARACTER_TABULATION || e === SPACE$1
    }
      , isNameStartCodePoint = function(e) {
        return isLetter(e) || isNonASCIICodePoint(e) || e === LOW_LINE
    }
      , isNameCodePoint = function(e) {
        return isNameStartCodePoint(e) || isDigit(e) || e === HYPHEN_MINUS
    }
      , isNonPrintableCodePoint = function(e) {
        return e >= NULL && e <= BACKSPACE || e === LINE_TABULATION || e >= SHIFT_OUT && e <= INFORMATION_SEPARATOR_ONE || e === DELETE
    }
      , isValidEscape = function(e, t) {
        return e === REVERSE_SOLIDUS && t !== LINE_FEED
    }
      , isIdentifierStart = function(e, t, r) {
        return e === HYPHEN_MINUS ? isNameStartCodePoint(t) || isValidEscape(t, r) : !!isNameStartCodePoint(e) || !(e !== REVERSE_SOLIDUS || !isValidEscape(e, t))
    }
      , isNumberStart = function(e, t, r) {
        return e === PLUS_SIGN || e === HYPHEN_MINUS ? !!isDigit(t) || t === FULL_STOP && isDigit(r) : isDigit(e === FULL_STOP ? t : e)
    }
      , stringToNumber = function(e) {
        var t = 0
          , r = 1;
        e[t] !== PLUS_SIGN && e[t] !== HYPHEN_MINUS || (e[t] === HYPHEN_MINUS && (r = -1),
        t++);
        for (var a = []; isDigit(e[t]); )
            a.push(e[t++]);
        var n = a.length ? parseInt(fromCodePoint.apply(void 0, a), 10) : 0;
        e[t] === FULL_STOP && t++;
        for (var o = []; isDigit(e[t]); )
            o.push(e[t++]);
        var l = o.length
          , i = l ? parseInt(fromCodePoint.apply(void 0, o), 10) : 0;
        e[t] !== E$1 && e[t] !== e$1 || t++;
        var s = 1;
        e[t] !== PLUS_SIGN && e[t] !== HYPHEN_MINUS || (e[t] === HYPHEN_MINUS && (s = -1),
        t++);
        for (var c = []; isDigit(e[t]); )
            c.push(e[t++]);
        var u = c.length ? parseInt(fromCodePoint.apply(void 0, c), 10) : 0;
        return r * (n + i * Math.pow(10, -l)) * Math.pow(10, s * u)
    }
      , LEFT_PARENTHESIS_TOKEN = {
        type: TokenType.LEFT_PARENTHESIS_TOKEN
    }
      , RIGHT_PARENTHESIS_TOKEN = {
        type: TokenType.RIGHT_PARENTHESIS_TOKEN
    }
      , COMMA_TOKEN = {
        type: TokenType.COMMA_TOKEN
    }
      , SUFFIX_MATCH_TOKEN = {
        type: TokenType.SUFFIX_MATCH_TOKEN
    }
      , PREFIX_MATCH_TOKEN = {
        type: TokenType.PREFIX_MATCH_TOKEN
    }
      , COLUMN_TOKEN = {
        type: TokenType.COLUMN_TOKEN
    }
      , DASH_MATCH_TOKEN = {
        type: TokenType.DASH_MATCH_TOKEN
    }
      , INCLUDE_MATCH_TOKEN = {
        type: TokenType.INCLUDE_MATCH_TOKEN
    }
      , LEFT_CURLY_BRACKET_TOKEN = {
        type: TokenType.LEFT_CURLY_BRACKET_TOKEN
    }
      , RIGHT_CURLY_BRACKET_TOKEN = {
        type: TokenType.RIGHT_CURLY_BRACKET_TOKEN
    }
      , SUBSTRING_MATCH_TOKEN = {
        type: TokenType.SUBSTRING_MATCH_TOKEN
    }
      , BAD_URL_TOKEN = {
        type: TokenType.BAD_URL_TOKEN
    }
      , BAD_STRING_TOKEN = {
        type: TokenType.BAD_STRING_TOKEN
    }
      , CDO_TOKEN = {
        type: TokenType.CDO_TOKEN
    }
      , CDC_TOKEN = {
        type: TokenType.CDC_TOKEN
    }
      , COLON_TOKEN = {
        type: TokenType.COLON_TOKEN
    }
      , SEMICOLON_TOKEN = {
        type: TokenType.SEMICOLON_TOKEN
    }
      , LEFT_SQUARE_BRACKET_TOKEN = {
        type: TokenType.LEFT_SQUARE_BRACKET_TOKEN
    }
      , RIGHT_SQUARE_BRACKET_TOKEN = {
        type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN
    }
      , WHITESPACE_TOKEN = {
        type: TokenType.WHITESPACE_TOKEN
    }
      , EOF_TOKEN = {
        type: TokenType.EOF_TOKEN
    }
      , Tokenizer = function() {
        function e() {
            this._value = []
        }
        return e.prototype.write = function(e) {
            this._value = this._value.concat(toCodePoints(e))
        }
        ,
        e.prototype.read = function() {
            for (var e = [], t = this.consumeToken(); t !== EOF_TOKEN; )
                e.push(t),
                t = this.consumeToken();
            return e
        }
        ,
        e.prototype.consumeToken = function() {
            var e = this.consumeCodePoint();
            switch (e) {
            case QUOTATION_MARK:
                return this.consumeStringToken(QUOTATION_MARK);
            case NUMBER_SIGN:
                var t = this.peekCodePoint(0)
                  , r = this.peekCodePoint(1)
                  , a = this.peekCodePoint(2);
                if (isNameCodePoint(t) || isValidEscape(r, a)) {
                    var n = isIdentifierStart(t, r, a) ? FLAG_ID : FLAG_UNRESTRICTED
                      , o = this.consumeName();
                    return {
                        type: TokenType.HASH_TOKEN,
                        value: o,
                        flags: n
                    }
                }
                break;
            case DOLLAR_SIGN:
                if (this.peekCodePoint(0) === EQUALS_SIGN)
                    return this.consumeCodePoint(),
                    SUFFIX_MATCH_TOKEN;
                break;
            case APOSTROPHE:
                return this.consumeStringToken(APOSTROPHE);
            case LEFT_PARENTHESIS:
                return LEFT_PARENTHESIS_TOKEN;
            case RIGHT_PARENTHESIS:
                return RIGHT_PARENTHESIS_TOKEN;
            case ASTERISK:
                if (this.peekCodePoint(0) === EQUALS_SIGN)
                    return this.consumeCodePoint(),
                    SUBSTRING_MATCH_TOKEN;
                break;
            case PLUS_SIGN:
                if (isNumberStart(e, this.peekCodePoint(0), this.peekCodePoint(1)))
                    return this.reconsumeCodePoint(e),
                    this.consumeNumericToken();
                break;
            case COMMA:
                return COMMA_TOKEN;
            case HYPHEN_MINUS:
                var l = e
                  , i = this.peekCodePoint(0)
                  , s = this.peekCodePoint(1);
                if (isNumberStart(l, i, s))
                    return this.reconsumeCodePoint(e),
                    this.consumeNumericToken();
                if (isIdentifierStart(l, i, s))
                    return this.reconsumeCodePoint(e),
                    this.consumeIdentLikeToken();
                if (i === HYPHEN_MINUS && s === GREATER_THAN_SIGN)
                    return this.consumeCodePoint(),
                    this.consumeCodePoint(),
                    CDC_TOKEN;
                break;
            case FULL_STOP:
                if (isNumberStart(e, this.peekCodePoint(0), this.peekCodePoint(1)))
                    return this.reconsumeCodePoint(e),
                    this.consumeNumericToken();
                break;
            case SOLIDUS:
                if (this.peekCodePoint(0) === ASTERISK)
                    for (this.consumeCodePoint(); ; ) {
                        var c = this.consumeCodePoint();
                        if (c === ASTERISK && (c = this.consumeCodePoint()) === SOLIDUS)
                            return this.consumeToken();
                        if (c === EOF$1)
                            return this.consumeToken()
                    }
                break;
            case COLON:
                return COLON_TOKEN;
            case SEMICOLON:
                return SEMICOLON_TOKEN;
            case LESS_THAN_SIGN:
                if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS)
                    return this.consumeCodePoint(),
                    this.consumeCodePoint(),
                    CDO_TOKEN;
                break;
            case COMMERCIAL_AT:
                var u = this.peekCodePoint(0)
                  , h = this.peekCodePoint(1)
                  , d = this.peekCodePoint(2);
                if (isIdentifierStart(u, h, d)) {
                    o = this.consumeName();
                    return {
                        type: TokenType.AT_KEYWORD_TOKEN,
                        value: o
                    }
                }
                break;
            case LEFT_SQUARE_BRACKET:
                return LEFT_SQUARE_BRACKET_TOKEN;
            case REVERSE_SOLIDUS:
                if (isValidEscape(e, this.peekCodePoint(0)))
                    return this.reconsumeCodePoint(e),
                    this.consumeIdentLikeToken();
                break;
            case RIGHT_SQUARE_BRACKET:
                return RIGHT_SQUARE_BRACKET_TOKEN;
            case CIRCUMFLEX_ACCENT:
                if (this.peekCodePoint(0) === EQUALS_SIGN)
                    return this.consumeCodePoint(),
                    PREFIX_MATCH_TOKEN;
                break;
            case LEFT_CURLY_BRACKET:
                return LEFT_CURLY_BRACKET_TOKEN;
            case RIGHT_CURLY_BRACKET:
                return RIGHT_CURLY_BRACKET_TOKEN;
            case u$1:
            case U$1:
                var f = this.peekCodePoint(0)
                  , m = this.peekCodePoint(1);
                return f !== PLUS_SIGN || !isHex(m) && m !== QUESTION_MARK || (this.consumeCodePoint(),
                this.consumeUnicodeRangeToken()),
                this.reconsumeCodePoint(e),
                this.consumeIdentLikeToken();
            case VERTICAL_LINE:
                if (this.peekCodePoint(0) === EQUALS_SIGN)
                    return this.consumeCodePoint(),
                    DASH_MATCH_TOKEN;
                if (this.peekCodePoint(0) === VERTICAL_LINE)
                    return this.consumeCodePoint(),
                    COLUMN_TOKEN;
                break;
            case TILDE:
                if (this.peekCodePoint(0) === EQUALS_SIGN)
                    return this.consumeCodePoint(),
                    INCLUDE_MATCH_TOKEN;
                break;
            case EOF$1:
                return EOF_TOKEN
            }
            return isWhiteSpace(e) ? (this.consumeWhiteSpace(),
            WHITESPACE_TOKEN) : isDigit(e) ? (this.reconsumeCodePoint(e),
            this.consumeNumericToken()) : isNameStartCodePoint(e) ? (this.reconsumeCodePoint(e),
            this.consumeIdentLikeToken()) : {
                type: TokenType.DELIM_TOKEN,
                value: fromCodePoint(e)
            }
        }
        ,
        e.prototype.consumeCodePoint = function() {
            var e = this._value.shift();
            return void 0 === e ? -1 : e
        }
        ,
        e.prototype.reconsumeCodePoint = function(e) {
            this._value.unshift(e)
        }
        ,
        e.prototype.peekCodePoint = function(e) {
            return e >= this._value.length ? -1 : this._value[e]
        }
        ,
        e.prototype.consumeUnicodeRangeToken = function() {
            for (var e = [], t = this.consumeCodePoint(); isHex(t) && e.length < 6; )
                e.push(t),
                t = this.consumeCodePoint();
            for (var r = !1; t === QUESTION_MARK && e.length < 6; )
                e.push(t),
                t = this.consumeCodePoint(),
                r = !0;
            if (r) {
                var a = parseInt(fromCodePoint.apply(void 0, e.map((function(e) {
                    return e === QUESTION_MARK ? ZERO : e
                }
                ))), 16)
                  , n = parseInt(fromCodePoint.apply(void 0, e.map((function(e) {
                    return e === QUESTION_MARK ? F$1 : e
                }
                ))), 16);
                return {
                    type: TokenType.UNICODE_RANGE_TOKEN,
                    start: a,
                    end: n
                }
            }
            var o = parseInt(fromCodePoint.apply(void 0, e), 16);
            if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
                this.consumeCodePoint(),
                t = this.consumeCodePoint();
                for (var l = []; isHex(t) && l.length < 6; )
                    l.push(t),
                    t = this.consumeCodePoint();
                n = parseInt(fromCodePoint.apply(void 0, l), 16);
                return {
                    type: TokenType.UNICODE_RANGE_TOKEN,
                    start: o,
                    end: n
                }
            }
            return {
                type: TokenType.UNICODE_RANGE_TOKEN,
                start: o,
                end: o
            }
        }
        ,
        e.prototype.consumeIdentLikeToken = function() {
            var e = this.consumeName();
            return "url" === e.toLowerCase() && this.peekCodePoint(0) === LEFT_PARENTHESIS ? (this.consumeCodePoint(),
            this.consumeUrlToken()) : this.peekCodePoint(0) === LEFT_PARENTHESIS ? (this.consumeCodePoint(),
            {
                type: TokenType.FUNCTION_TOKEN,
                value: e
            }) : {
                type: TokenType.IDENT_TOKEN,
                value: e
            }
        }
        ,
        e.prototype.consumeUrlToken = function() {
            var e = [];
            if (this.consumeWhiteSpace(),
            this.peekCodePoint(0) === EOF$1)
                return {
                    type: TokenType.URL_TOKEN,
                    value: ""
                };
            var t = this.peekCodePoint(0);
            if (t === APOSTROPHE || t === QUOTATION_MARK) {
                var r = this.consumeStringToken(this.consumeCodePoint());
                return r.type === TokenType.STRING_TOKEN && (this.consumeWhiteSpace(),
                this.peekCodePoint(0) === EOF$1 || this.peekCodePoint(0) === RIGHT_PARENTHESIS) ? (this.consumeCodePoint(),
                {
                    type: TokenType.URL_TOKEN,
                    value: r.value
                }) : (this.consumeBadUrlRemnants(),
                BAD_URL_TOKEN)
            }
            for (; ; ) {
                var a = this.consumeCodePoint();
                if (a === EOF$1 || a === RIGHT_PARENTHESIS)
                    return {
                        type: TokenType.URL_TOKEN,
                        value: fromCodePoint.apply(void 0, e)
                    };
                if (isWhiteSpace(a))
                    return this.consumeWhiteSpace(),
                    this.peekCodePoint(0) === EOF$1 || this.peekCodePoint(0) === RIGHT_PARENTHESIS ? (this.consumeCodePoint(),
                    {
                        type: TokenType.URL_TOKEN,
                        value: fromCodePoint.apply(void 0, e)
                    }) : (this.consumeBadUrlRemnants(),
                    BAD_URL_TOKEN);
                if (a === QUOTATION_MARK || a === APOSTROPHE || a === LEFT_PARENTHESIS || isNonPrintableCodePoint(a))
                    return this.consumeBadUrlRemnants(),
                    BAD_URL_TOKEN;
                if (a === REVERSE_SOLIDUS) {
                    if (!isValidEscape(a, this.peekCodePoint(0)))
                        return this.consumeBadUrlRemnants(),
                        BAD_URL_TOKEN;
                    e.push(this.consumeEscapedCodePoint())
                } else
                    e.push(a)
            }
        }
        ,
        e.prototype.consumeWhiteSpace = function() {
            for (; isWhiteSpace(this.peekCodePoint(0)); )
                this.consumeCodePoint()
        }
        ,
        e.prototype.consumeBadUrlRemnants = function() {
            for (; ; ) {
                var e = this.consumeCodePoint();
                if (e === RIGHT_PARENTHESIS || e === EOF$1)
                    return;
                isValidEscape(e, this.peekCodePoint(0)) && this.consumeEscapedCodePoint()
            }
        }
        ,
        e.prototype.consumeStringSlice = function(e) {
            for (var t = ""; e > 0; ) {
                var r = Math.min(6e4, e);
                t += fromCodePoint.apply(void 0, this._value.splice(0, r)),
                e -= r
            }
            return this._value.shift(),
            t
        }
        ,
        e.prototype.consumeStringToken = function(e) {
            for (var t = "", r = 0; ; ) {
                var a = this._value[r];
                if (a === EOF$1 || void 0 === a || a === e)
                    return t += this.consumeStringSlice(r),
                    {
                        type: TokenType.STRING_TOKEN,
                        value: t
                    };
                if (a === LINE_FEED)
                    return this._value.splice(0, r),
                    BAD_STRING_TOKEN;
                if (a === REVERSE_SOLIDUS) {
                    var n = this._value[r + 1];
                    n !== EOF$1 && void 0 !== n && (n === LINE_FEED ? (t += this.consumeStringSlice(r),
                    r = -1,
                    this._value.shift()) : isValidEscape(a, n) && (t += this.consumeStringSlice(r),
                    t += fromCodePoint(this.consumeEscapedCodePoint()),
                    r = -1))
                }
                r++
            }
        }
        ,
        e.prototype.consumeNumber = function() {
            var e = []
              , t = FLAG_INTEGER
              , r = this.peekCodePoint(0);
            for (r !== PLUS_SIGN && r !== HYPHEN_MINUS || e.push(this.consumeCodePoint()); isDigit(this.peekCodePoint(0)); )
                e.push(this.consumeCodePoint());
            r = this.peekCodePoint(0);
            var a = this.peekCodePoint(1);
            if (r === FULL_STOP && isDigit(a))
                for (e.push(this.consumeCodePoint(), this.consumeCodePoint()),
                t = FLAG_NUMBER; isDigit(this.peekCodePoint(0)); )
                    e.push(this.consumeCodePoint());
            r = this.peekCodePoint(0),
            a = this.peekCodePoint(1);
            var n = this.peekCodePoint(2);
            if ((r === E$1 || r === e$1) && ((a === PLUS_SIGN || a === HYPHEN_MINUS) && isDigit(n) || isDigit(a)))
                for (e.push(this.consumeCodePoint(), this.consumeCodePoint()),
                t = FLAG_NUMBER; isDigit(this.peekCodePoint(0)); )
                    e.push(this.consumeCodePoint());
            return [stringToNumber(e), t]
        }
        ,
        e.prototype.consumeNumericToken = function() {
            var e = this.consumeNumber()
              , t = e[0]
              , r = e[1]
              , a = this.peekCodePoint(0)
              , n = this.peekCodePoint(1)
              , o = this.peekCodePoint(2);
            if (isIdentifierStart(a, n, o)) {
                var l = this.consumeName();
                return {
                    type: TokenType.DIMENSION_TOKEN,
                    number: t,
                    flags: r,
                    unit: l
                }
            }
            return a === PERCENTAGE_SIGN ? (this.consumeCodePoint(),
            {
                type: TokenType.PERCENTAGE_TOKEN,
                number: t,
                flags: r
            }) : {
                type: TokenType.NUMBER_TOKEN,
                number: t,
                flags: r
            }
        }
        ,
        e.prototype.consumeEscapedCodePoint = function() {
            var e = this.consumeCodePoint();
            if (isHex(e)) {
                for (var t = fromCodePoint(e); isHex(this.peekCodePoint(0)) && t.length < 6; )
                    t += fromCodePoint(this.consumeCodePoint());
                isWhiteSpace(this.peekCodePoint(0)) && this.consumeCodePoint();
                var r = parseInt(t, 16);
                return 0 === r || isSurrogateCodePoint(r) || r > 1114111 ? REPLACEMENT_CHARACTER : r
            }
            return e === EOF$1 ? REPLACEMENT_CHARACTER : e
        }
        ,
        e.prototype.consumeName = function() {
            for (var e = ""; ; ) {
                var t = this.consumeCodePoint();
                if (isNameCodePoint(t))
                    e += fromCodePoint(t);
                else {
                    if (!isValidEscape(t, this.peekCodePoint(0)))
                        return this.reconsumeCodePoint(t),
                        e;
                    e += fromCodePoint(this.consumeEscapedCodePoint())
                }
            }
        }
        ,
        e
    }()
      , Parser = function() {
        function e(e) {
            this._tokens = e
        }
        return e.create = function(t) {
            var r = new Tokenizer;
            return r.write(t),
            new e(r.read())
        }
        ,
        e.parseValue = function(t) {
            return e.create(t).parseComponentValue()
        }
        ,
        e.parseValues = function(t) {
            return e.create(t).parseComponentValues()
        }
        ,
        e.prototype.parseComponentValue = function() {
            for (var e = this.consumeToken(); e.type === TokenType.WHITESPACE_TOKEN; )
                e = this.consumeToken();
            if (e.type === TokenType.EOF_TOKEN)
                throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
            this.reconsumeToken(e);
            var t = this.consumeComponentValue();
            do {
                e = this.consumeToken()
            } while (e.type === TokenType.WHITESPACE_TOKEN);if (e.type === TokenType.EOF_TOKEN)
                return t;
            throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")
        }
        ,
        e.prototype.parseComponentValues = function() {
            for (var e = []; ; ) {
                var t = this.consumeComponentValue();
                if (t.type === TokenType.EOF_TOKEN)
                    return e;
                e.push(t),
                e.push()
            }
        }
        ,
        e.prototype.consumeComponentValue = function() {
            var e = this.consumeToken();
            switch (e.type) {
            case TokenType.LEFT_CURLY_BRACKET_TOKEN:
            case TokenType.LEFT_SQUARE_BRACKET_TOKEN:
            case TokenType.LEFT_PARENTHESIS_TOKEN:
                return this.consumeSimpleBlock(e.type);
            case TokenType.FUNCTION_TOKEN:
                return this.consumeFunction(e)
            }
            return e
        }
        ,
        e.prototype.consumeSimpleBlock = function(e) {
            for (var t = {
                type: e,
                values: []
            }, r = this.consumeToken(); ; ) {
                if (r.type === TokenType.EOF_TOKEN || isEndingTokenFor(r, e))
                    return t;
                this.reconsumeToken(r),
                t.values.push(this.consumeComponentValue()),
                r = this.consumeToken()
            }
        }
        ,
        e.prototype.consumeFunction = function(e) {
            for (var t = {
                name: e.value,
                values: [],
                type: TokenType.FUNCTION
            }; ; ) {
                var r = this.consumeToken();
                if (r.type === TokenType.EOF_TOKEN || r.type === TokenType.RIGHT_PARENTHESIS_TOKEN)
                    return t;
                this.reconsumeToken(r),
                t.values.push(this.consumeComponentValue())
            }
        }
        ,
        e.prototype.consumeToken = function() {
            var e = this._tokens.shift();
            return void 0 === e ? EOF_TOKEN : e
        }
        ,
        e.prototype.reconsumeToken = function(e) {
            this._tokens.unshift(e)
        }
        ,
        e
    }()
      , isDimensionToken = function(e) {
        return e.type === TokenType.DIMENSION_TOKEN
    }
      , isNumberToken = function(e) {
        return e.type === TokenType.NUMBER_TOKEN
    }
      , isIdentToken = function(e) {
        return e.type === TokenType.IDENT_TOKEN
    }
      , isStringToken = function(e) {
        return e.type === TokenType.STRING_TOKEN
    }
      , isIdentWithValue = function(e, t) {
        return isIdentToken(e) && e.value === t
    }
      , nonWhiteSpace = function(e) {
        return e.type !== TokenType.WHITESPACE_TOKEN
    }
      , nonFunctionArgSeparator = function(e) {
        return e.type !== TokenType.WHITESPACE_TOKEN && e.type !== TokenType.COMMA_TOKEN
    }
      , parseFunctionArgs = function(e) {
        var t = []
          , r = [];
        return e.forEach((function(e) {
            if (e.type === TokenType.COMMA_TOKEN) {
                if (0 === r.length)
                    throw new Error("Error parsing function args, zero tokens for arg");
                return t.push(r),
                void (r = [])
            }
            e.type !== TokenType.WHITESPACE_TOKEN && r.push(e)
        }
        )),
        r.length && t.push(r),
        t
    }
      , isEndingTokenFor = function(e, t) {
        return t === TokenType.LEFT_CURLY_BRACKET_TOKEN && e.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN || (t === TokenType.LEFT_SQUARE_BRACKET_TOKEN && e.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN || t === TokenType.LEFT_PARENTHESIS_TOKEN && e.type === TokenType.RIGHT_PARENTHESIS_TOKEN)
    }
      , isLength = function(e) {
        return e.type === TokenType.NUMBER_TOKEN || e.type === TokenType.DIMENSION_TOKEN
    }
      , isLengthPercentage = function(e) {
        return e.type === TokenType.PERCENTAGE_TOKEN || isLength(e)
    }
      , parseLengthPercentageTuple = function(e) {
        return e.length > 1 ? [e[0], e[1]] : [e[0]]
    }
      , ZERO_LENGTH = {
        type: TokenType.NUMBER_TOKEN,
        number: 0,
        flags: FLAG_INTEGER
    }
      , FIFTY_PERCENT = {
        type: TokenType.PERCENTAGE_TOKEN,
        number: 50,
        flags: FLAG_INTEGER
    }
      , HUNDRED_PERCENT = {
        type: TokenType.PERCENTAGE_TOKEN,
        number: 100,
        flags: FLAG_INTEGER
    }
      , getAbsoluteValueForTuple = function(e, t, r) {
        var a = e[0]
          , n = e[1];
        return [getAbsoluteValue(a, t), getAbsoluteValue(void 0 !== n ? n : a, r)]
    }
      , getAbsoluteValue = function(e, t) {
        if (e.type === TokenType.PERCENTAGE_TOKEN)
            return e.number / 100 * t;
        if (isDimensionToken(e))
            switch (e.unit) {
            case "rem":
            case "em":
                return 16 * e.number;
            case "px":
            default:
                return e.number
            }
        return e.number
    }
      , DEG = "deg"
      , GRAD = "grad"
      , RAD = "rad"
      , TURN = "turn"
      , angle = {
        name: "angle",
        parse: function(e) {
            if (e.type === TokenType.DIMENSION_TOKEN)
                switch (e.unit) {
                case DEG:
                    return Math.PI * e.number / 180;
                case GRAD:
                    return Math.PI / 200 * e.number;
                case RAD:
                    return e.number;
                case TURN:
                    return 2 * Math.PI * e.number
                }
            throw new Error("Unsupported angle type")
        }
    }
      , isAngle = function(e) {
        return e.type === TokenType.DIMENSION_TOKEN && (e.unit === DEG || e.unit === GRAD || e.unit === RAD || e.unit === TURN)
    }
      , parseNamedSide = function(e) {
        switch (e.filter(isIdentToken).map((function(e) {
            return e.value
        }
        )).join(" ")) {
        case "to bottom right":
        case "to right bottom":
        case "left top":
        case "top left":
            return [ZERO_LENGTH, ZERO_LENGTH];
        case "to top":
        case "bottom":
            return deg(0);
        case "to bottom left":
        case "to left bottom":
        case "right top":
        case "top right":
            return [ZERO_LENGTH, HUNDRED_PERCENT];
        case "to right":
        case "left":
            return deg(90);
        case "to top left":
        case "to left top":
        case "right bottom":
        case "bottom right":
            return [HUNDRED_PERCENT, HUNDRED_PERCENT];
        case "to bottom":
        case "top":
            return deg(180);
        case "to top right":
        case "to right top":
        case "left bottom":
        case "bottom left":
            return [HUNDRED_PERCENT, ZERO_LENGTH];
        case "to left":
        case "right":
            return deg(270)
        }
        return 0
    }
      , deg = function(e) {
        return Math.PI * e / 180
    }
      , color = {
        name: "color",
        parse: function(e) {
            if (e.type === TokenType.FUNCTION) {
                var t = SUPPORTED_COLOR_FUNCTIONS[e.name];
                if (void 0 === t)
                    throw new Error('Attempting to parse an unsupported color function "' + e.name + '"');
                return t(e.values)
            }
            if (e.type === TokenType.HASH_TOKEN) {
                if (3 === e.value.length) {
                    var r = e.value.substring(0, 1)
                      , a = e.value.substring(1, 2)
                      , n = e.value.substring(2, 3);
                    return pack$1(parseInt(r + r, 16), parseInt(a + a, 16), parseInt(n + n, 16), 1)
                }
                if (4 === e.value.length) {
                    r = e.value.substring(0, 1),
                    a = e.value.substring(1, 2),
                    n = e.value.substring(2, 3);
                    var o = e.value.substring(3, 4);
                    return pack$1(parseInt(r + r, 16), parseInt(a + a, 16), parseInt(n + n, 16), parseInt(o + o, 16) / 255)
                }
                if (6 === e.value.length) {
                    r = e.value.substring(0, 2),
                    a = e.value.substring(2, 4),
                    n = e.value.substring(4, 6);
                    return pack$1(parseInt(r, 16), parseInt(a, 16), parseInt(n, 16), 1)
                }
                if (8 === e.value.length) {
                    r = e.value.substring(0, 2),
                    a = e.value.substring(2, 4),
                    n = e.value.substring(4, 6),
                    o = e.value.substring(6, 8);
                    return pack$1(parseInt(r, 16), parseInt(a, 16), parseInt(n, 16), parseInt(o, 16) / 255)
                }
            }
            if (e.type === TokenType.IDENT_TOKEN) {
                var l = COLORS[e.value.toUpperCase()];
                if (void 0 !== l)
                    return l
            }
            return COLORS.TRANSPARENT
        }
    }
      , isTransparent = function(e) {
        return 0 == (255 & e)
    }
      , asString = function(e) {
        var t = 255 & e
          , r = 255 & e >> 8
          , a = 255 & e >> 16
          , n = 255 & e >> 24;
        return t < 255 ? "rgba(" + n + "," + a + "," + r + "," + t / 255 + ")" : "rgb(" + n + "," + a + "," + r + ")"
    }
      , pack$1 = function(e, t, r, a) {
        return (e << 24 | t << 16 | r << 8 | Math.round(255 * a) << 0) >>> 0
    }
      , getTokenColorValue = function(e, t) {
        if (e.type === TokenType.NUMBER_TOKEN)
            return e.number;
        if (e.type === TokenType.PERCENTAGE_TOKEN) {
            var r = 3 === t ? 1 : 255;
            return 3 === t ? e.number / 100 * r : Math.round(e.number / 100 * r)
        }
        return 0
    }
      , rgb = function(e) {
        var t = e.filter(nonFunctionArgSeparator);
        if (3 === t.length) {
            var r = t.map(getTokenColorValue)
              , a = r[0]
              , n = r[1]
              , o = r[2];
            return pack$1(a, n, o, 1)
        }
        if (4 === t.length) {
            var l = t.map(getTokenColorValue)
              , i = (a = l[0],
            n = l[1],
            o = l[2],
            l[3]);
            return pack$1(a, n, o, i)
        }
        return 0
    };
    function hue2rgb(e, t, r) {
        return r < 0 && (r += 1),
        r >= 1 && (r -= 1),
        r < 1 / 6 ? (t - e) * r * 6 + e : r < .5 ? t : r < 2 / 3 ? 6 * (t - e) * (2 / 3 - r) + e : e
    }
    var hsl = function(e) {
        var t = e.filter(nonFunctionArgSeparator)
          , r = t[0]
          , a = t[1]
          , n = t[2]
          , o = t[3]
          , l = (r.type === TokenType.NUMBER_TOKEN ? deg(r.number) : angle.parse(r)) / (2 * Math.PI)
          , i = isLengthPercentage(a) ? a.number / 100 : 0
          , s = isLengthPercentage(n) ? n.number / 100 : 0
          , c = void 0 !== o && isLengthPercentage(o) ? getAbsoluteValue(o, 1) : 1;
        if (0 === i)
            return pack$1(255 * s, 255 * s, 255 * s, 1);
        var u = s <= .5 ? s * (i + 1) : s + i - s * i
          , h = 2 * s - u
          , d = hue2rgb(h, u, l + 1 / 3)
          , f = hue2rgb(h, u, l)
          , m = hue2rgb(h, u, l - 1 / 3);
        return pack$1(255 * d, 255 * f, 255 * m, c)
    }, SUPPORTED_COLOR_FUNCTIONS = {
        hsl: hsl,
        hsla: hsl,
        rgb: rgb,
        rgba: rgb
    }, COLORS = {
        ALICEBLUE: 4042850303,
        ANTIQUEWHITE: 4209760255,
        AQUA: 16777215,
        AQUAMARINE: 2147472639,
        AZURE: 4043309055,
        BEIGE: 4126530815,
        BISQUE: 4293182719,
        BLACK: 255,
        BLANCHEDALMOND: 4293643775,
        BLUE: 65535,
        BLUEVIOLET: 2318131967,
        BROWN: 2771004159,
        BURLYWOOD: 3736635391,
        CADETBLUE: 1604231423,
        CHARTREUSE: 2147418367,
        CHOCOLATE: 3530104575,
        CORAL: 4286533887,
        CORNFLOWERBLUE: 1687547391,
        CORNSILK: 4294499583,
        CRIMSON: 3692313855,
        CYAN: 16777215,
        DARKBLUE: 35839,
        DARKCYAN: 9145343,
        DARKGOLDENROD: 3095837695,
        DARKGRAY: 2846468607,
        DARKGREEN: 6553855,
        DARKGREY: 2846468607,
        DARKKHAKI: 3182914559,
        DARKMAGENTA: 2332068863,
        DARKOLIVEGREEN: 1433087999,
        DARKORANGE: 4287365375,
        DARKORCHID: 2570243327,
        DARKRED: 2332033279,
        DARKSALMON: 3918953215,
        DARKSEAGREEN: 2411499519,
        DARKSLATEBLUE: 1211993087,
        DARKSLATEGRAY: 793726975,
        DARKSLATEGREY: 793726975,
        DARKTURQUOISE: 13554175,
        DARKVIOLET: 2483082239,
        DEEPPINK: 4279538687,
        DEEPSKYBLUE: 12582911,
        DIMGRAY: 1768516095,
        DIMGREY: 1768516095,
        DODGERBLUE: 512819199,
        FIREBRICK: 2988581631,
        FLORALWHITE: 4294635775,
        FORESTGREEN: 579543807,
        FUCHSIA: 4278255615,
        GAINSBORO: 3705462015,
        GHOSTWHITE: 4177068031,
        GOLD: 4292280575,
        GOLDENROD: 3668254975,
        GRAY: 2155905279,
        GREEN: 8388863,
        GREENYELLOW: 2919182335,
        GREY: 2155905279,
        HONEYDEW: 4043305215,
        HOTPINK: 4285117695,
        INDIANRED: 3445382399,
        INDIGO: 1258324735,
        IVORY: 4294963455,
        KHAKI: 4041641215,
        LAVENDER: 3873897215,
        LAVENDERBLUSH: 4293981695,
        LAWNGREEN: 2096890111,
        LEMONCHIFFON: 4294626815,
        LIGHTBLUE: 2916673279,
        LIGHTCORAL: 4034953471,
        LIGHTCYAN: 3774873599,
        LIGHTGOLDENRODYELLOW: 4210742015,
        LIGHTGRAY: 3553874943,
        LIGHTGREEN: 2431553791,
        LIGHTGREY: 3553874943,
        LIGHTPINK: 4290167295,
        LIGHTSALMON: 4288707327,
        LIGHTSEAGREEN: 548580095,
        LIGHTSKYBLUE: 2278488831,
        LIGHTSLATEGRAY: 2005441023,
        LIGHTSLATEGREY: 2005441023,
        LIGHTSTEELBLUE: 2965692159,
        LIGHTYELLOW: 4294959359,
        LIME: 16711935,
        LIMEGREEN: 852308735,
        LINEN: 4210091775,
        MAGENTA: 4278255615,
        MAROON: 2147483903,
        MEDIUMAQUAMARINE: 1724754687,
        MEDIUMBLUE: 52735,
        MEDIUMORCHID: 3126187007,
        MEDIUMPURPLE: 2473647103,
        MEDIUMSEAGREEN: 1018393087,
        MEDIUMSLATEBLUE: 2070474495,
        MEDIUMSPRINGGREEN: 16423679,
        MEDIUMTURQUOISE: 1221709055,
        MEDIUMVIOLETRED: 3340076543,
        MIDNIGHTBLUE: 421097727,
        MINTCREAM: 4127193855,
        MISTYROSE: 4293190143,
        MOCCASIN: 4293178879,
        NAVAJOWHITE: 4292783615,
        NAVY: 33023,
        OLDLACE: 4260751103,
        OLIVE: 2155872511,
        OLIVEDRAB: 1804477439,
        ORANGE: 4289003775,
        ORANGERED: 4282712319,
        ORCHID: 3664828159,
        PALEGOLDENROD: 4008225535,
        PALEGREEN: 2566625535,
        PALETURQUOISE: 2951671551,
        PALEVIOLETRED: 3681588223,
        PAPAYAWHIP: 4293907967,
        PEACHPUFF: 4292524543,
        PERU: 3448061951,
        PINK: 4290825215,
        PLUM: 3718307327,
        POWDERBLUE: 2967529215,
        PURPLE: 2147516671,
        REBECCAPURPLE: 1714657791,
        RED: 4278190335,
        ROSYBROWN: 3163525119,
        ROYALBLUE: 1097458175,
        SADDLEBROWN: 2336560127,
        SALMON: 4202722047,
        SANDYBROWN: 4104413439,
        SEAGREEN: 780883967,
        SEASHELL: 4294307583,
        SIENNA: 2689740287,
        SILVER: 3233857791,
        SKYBLUE: 2278484991,
        SLATEBLUE: 1784335871,
        SLATEGRAY: 1887473919,
        SLATEGREY: 1887473919,
        SNOW: 4294638335,
        SPRINGGREEN: 16744447,
        STEELBLUE: 1182971135,
        TAN: 3535047935,
        TEAL: 8421631,
        THISTLE: 3636451583,
        TOMATO: 4284696575,
        TRANSPARENT: 0,
        TURQUOISE: 1088475391,
        VIOLET: 4001558271,
        WHEAT: 4125012991,
        WHITE: 4294967295,
        WHITESMOKE: 4126537215,
        YELLOW: 4294902015,
        YELLOWGREEN: 2597139199
    }, PropertyDescriptorParsingType, BACKGROUND_CLIP;
    !function(e) {
        e[e.VALUE = 0] = "VALUE",
        e[e.LIST = 1] = "LIST",
        e[e.IDENT_VALUE = 2] = "IDENT_VALUE",
        e[e.TYPE_VALUE = 3] = "TYPE_VALUE",
        e[e.TOKEN_VALUE = 4] = "TOKEN_VALUE"
    }(PropertyDescriptorParsingType || (PropertyDescriptorParsingType = {})),
    function(e) {
        e[e.BORDER_BOX = 0] = "BORDER_BOX",
        e[e.PADDING_BOX = 1] = "PADDING_BOX",
        e[e.CONTENT_BOX = 2] = "CONTENT_BOX"
    }(BACKGROUND_CLIP || (BACKGROUND_CLIP = {}));
    var backgroundClip = {
        name: "background-clip",
        initialValue: "border-box",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return e.map((function(e) {
                if (isIdentToken(e))
                    switch (e.value) {
                    case "padding-box":
                        return BACKGROUND_CLIP.PADDING_BOX;
                    case "content-box":
                        return BACKGROUND_CLIP.CONTENT_BOX
                    }
                return BACKGROUND_CLIP.BORDER_BOX
            }
            ))
        }
    }, backgroundColor = {
        name: "background-color",
        initialValue: "transparent",
        prefix: !1,
        type: PropertyDescriptorParsingType.TYPE_VALUE,
        format: "color"
    }, parseColorStop = function(e) {
        var t = color.parse(e[0])
          , r = e[1];
        return r && isLengthPercentage(r) ? {
            color: t,
            stop: r
        } : {
            color: t,
            stop: null
        }
    }, processColorStops = function(e, t) {
        var r = e[0]
          , a = e[e.length - 1];
        null === r.stop && (r.stop = ZERO_LENGTH),
        null === a.stop && (a.stop = HUNDRED_PERCENT);
        for (var n = [], o = 0, l = 0; l < e.length; l++) {
            var i = e[l].stop;
            if (null !== i) {
                var s = getAbsoluteValue(i, t);
                s > o ? n.push(s) : n.push(o),
                o = s
            } else
                n.push(null)
        }
        var c = null;
        for (l = 0; l < n.length; l++) {
            var u = n[l];
            if (null === u)
                null === c && (c = l);
            else if (null !== c) {
                for (var h = l - c, d = (u - n[c - 1]) / (h + 1), f = 1; f <= h; f++)
                    n[c + f - 1] = d * f;
                c = null
            }
        }
        return e.map((function(e, r) {
            return {
                color: e.color,
                stop: Math.max(Math.min(1, n[r] / t), 0)
            }
        }
        ))
    }, getAngleFromCorner = function(e, t, r) {
        var a = t / 2
          , n = r / 2
          , o = getAbsoluteValue(e[0], t) - a
          , l = n - getAbsoluteValue(e[1], r);
        return (Math.atan2(l, o) + 2 * Math.PI) % (2 * Math.PI)
    }, calculateGradientDirection = function(e, t, r) {
        var a = "number" == typeof e ? e : getAngleFromCorner(e, t, r)
          , n = Math.abs(t * Math.sin(a)) + Math.abs(r * Math.cos(a))
          , o = t / 2
          , l = r / 2
          , i = n / 2
          , s = Math.sin(a - Math.PI / 2) * i
          , c = Math.cos(a - Math.PI / 2) * i;
        return [n, o - c, o + c, l - s, l + s]
    }, distance = function(e, t) {
        return Math.sqrt(e * e + t * t)
    }, findCorner = function(e, t, r, a, n) {
        return [[0, 0], [0, t], [e, 0], [e, t]].reduce((function(e, t) {
            var o = t[0]
              , l = t[1]
              , i = distance(r - o, a - l);
            return (n ? i < e.optimumDistance : i > e.optimumDistance) ? {
                optimumCorner: t,
                optimumDistance: i
            } : e
        }
        ), {
            optimumDistance: n ? 1 / 0 : -1 / 0,
            optimumCorner: null
        }).optimumCorner
    }, calculateRadius = function(e, t, r, a, n) {
        var o = 0
          , l = 0;
        switch (e.size) {
        case CSSRadialExtent.CLOSEST_SIDE:
            e.shape === CSSRadialShape.CIRCLE ? o = l = Math.min(Math.abs(t), Math.abs(t - a), Math.abs(r), Math.abs(r - n)) : e.shape === CSSRadialShape.ELLIPSE && (o = Math.min(Math.abs(t), Math.abs(t - a)),
            l = Math.min(Math.abs(r), Math.abs(r - n)));
            break;
        case CSSRadialExtent.CLOSEST_CORNER:
            if (e.shape === CSSRadialShape.CIRCLE)
                o = l = Math.min(distance(t, r), distance(t, r - n), distance(t - a, r), distance(t - a, r - n));
            else if (e.shape === CSSRadialShape.ELLIPSE) {
                var i = Math.min(Math.abs(r), Math.abs(r - n)) / Math.min(Math.abs(t), Math.abs(t - a))
                  , s = findCorner(a, n, t, r, !0)
                  , c = s[0]
                  , u = s[1];
                l = i * (o = distance(c - t, (u - r) / i))
            }
            break;
        case CSSRadialExtent.FARTHEST_SIDE:
            e.shape === CSSRadialShape.CIRCLE ? o = l = Math.max(Math.abs(t), Math.abs(t - a), Math.abs(r), Math.abs(r - n)) : e.shape === CSSRadialShape.ELLIPSE && (o = Math.max(Math.abs(t), Math.abs(t - a)),
            l = Math.max(Math.abs(r), Math.abs(r - n)));
            break;
        case CSSRadialExtent.FARTHEST_CORNER:
            if (e.shape === CSSRadialShape.CIRCLE)
                o = l = Math.max(distance(t, r), distance(t, r - n), distance(t - a, r), distance(t - a, r - n));
            else if (e.shape === CSSRadialShape.ELLIPSE) {
                i = Math.max(Math.abs(r), Math.abs(r - n)) / Math.max(Math.abs(t), Math.abs(t - a));
                var h = findCorner(a, n, t, r, !1);
                c = h[0],
                u = h[1];
                l = i * (o = distance(c - t, (u - r) / i))
            }
        }
        return Array.isArray(e.size) && (o = getAbsoluteValue(e.size[0], a),
        l = 2 === e.size.length ? getAbsoluteValue(e.size[1], n) : o),
        [o, l]
    }, linearGradient = function(e) {
        var t = deg(180)
          , r = [];
        return parseFunctionArgs(e).forEach((function(e, a) {
            if (0 === a) {
                var n = e[0];
                if (n.type === TokenType.IDENT_TOKEN && "to" === n.value)
                    return void (t = parseNamedSide(e));
                if (isAngle(n))
                    return void (t = angle.parse(n))
            }
            var o = parseColorStop(e);
            r.push(o)
        }
        )),
        {
            angle: t,
            stops: r,
            type: CSSImageType.LINEAR_GRADIENT
        }
    }, prefixLinearGradient = function(e) {
        var t = deg(180)
          , r = [];
        return parseFunctionArgs(e).forEach((function(e, a) {
            if (0 === a) {
                var n = e[0];
                if (n.type === TokenType.IDENT_TOKEN && -1 !== ["top", "left", "right", "bottom"].indexOf(n.value))
                    return void (t = parseNamedSide(e));
                if (isAngle(n))
                    return void (t = (angle.parse(n) + deg(270)) % deg(360))
            }
            var o = parseColorStop(e);
            r.push(o)
        }
        )),
        {
            angle: t,
            stops: r,
            type: CSSImageType.LINEAR_GRADIENT
        }
    }, testRangeBounds = function(e) {
        if (e.createRange) {
            var t = e.createRange();
            if (t.getBoundingClientRect) {
                var r = e.createElement("boundtest");
                r.style.height = "123px",
                r.style.display = "block",
                e.body.appendChild(r),
                t.selectNode(r);
                var a = t.getBoundingClientRect()
                  , n = Math.round(a.height);
                if (e.body.removeChild(r),
                123 === n)
                    return !0
            }
        }
        return !1
    }, testCORS = function() {
        return void 0 !== (new Image).crossOrigin
    }, testResponseType = function() {
        return "string" == typeof (new XMLHttpRequest).responseType
    }, testSVG = function(e) {
        var t = new Image
          , r = e.createElement("canvas")
          , a = r.getContext("2d");
        if (!a)
            return !1;
        t.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
        try {
            a.drawImage(t, 0, 0),
            r.toDataURL()
        } catch (e) {
            return !1
        }
        return !0
    }, isGreenPixel = function(e) {
        return 0 === e[0] && 255 === e[1] && 0 === e[2] && 255 === e[3]
    }, testForeignObject = function(e) {
        var t = e.createElement("canvas");
        t.width = 100,
        t.height = 100;
        var r = t.getContext("2d");
        if (!r)
            return Promise.reject(!1);
        r.fillStyle = "rgb(0, 255, 0)",
        r.fillRect(0, 0, 100, 100);
        var a = new Image
          , n = t.toDataURL();
        a.src = n;
        var o = createForeignObjectSVG(100, 100, 0, 0, a);
        return r.fillStyle = "red",
        r.fillRect(0, 0, 100, 100),
        loadSerializedSVG(o).then((function(t) {
            r.drawImage(t, 0, 0);
            var a = r.getImageData(0, 0, 100, 100).data;
            r.fillStyle = "red",
            r.fillRect(0, 0, 100, 100);
            var o = e.createElement("div");
            return o.style.backgroundImage = "url(" + n + ")",
            o.style.height = "100px",
            isGreenPixel(a) ? loadSerializedSVG(createForeignObjectSVG(100, 100, 0, 0, o)) : Promise.reject(!1)
        }
        )).then((function(e) {
            return r.drawImage(e, 0, 0),
            isGreenPixel(r.getImageData(0, 0, 100, 100).data)
        }
        )).catch((function() {
            return !1
        }
        ))
    }, createForeignObjectSVG = function(e, t, r, a, n) {
        var o = "http://www.w3.org/2000/svg"
          , l = document.createElementNS(o, "svg")
          , i = document.createElementNS(o, "foreignObject");
        return l.setAttributeNS(null, "width", e.toString()),
        l.setAttributeNS(null, "height", t.toString()),
        i.setAttributeNS(null, "width", "100%"),
        i.setAttributeNS(null, "height", "100%"),
        i.setAttributeNS(null, "x", r.toString()),
        i.setAttributeNS(null, "y", a.toString()),
        i.setAttributeNS(null, "externalResourcesRequired", "true"),
        l.appendChild(i),
        i.appendChild(n),
        l
    }, loadSerializedSVG = function(e) {
        return new Promise((function(t, r) {
            var a = new Image;
            a.onload = function() {
                return t(a)
            }
            ,
            a.onerror = r,
            a.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent((new XMLSerializer).serializeToString(e))
        }
        ))
    }, FEATURES = {
        get SUPPORT_RANGE_BOUNDS() {
            var e = testRangeBounds(document);
            return Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", {
                value: e
            }),
            e
        },
        get SUPPORT_SVG_DRAWING() {
            var e = testSVG(document);
            return Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", {
                value: e
            }),
            e
        },
        get SUPPORT_FOREIGNOBJECT_DRAWING() {
            var e = "function" == typeof Array.from && "function" == typeof window.fetch ? testForeignObject(document) : Promise.resolve(!1);
            return Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", {
                value: e
            }),
            e
        },
        get SUPPORT_CORS_IMAGES() {
            var e = testCORS();
            return Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", {
                value: e
            }),
            e
        },
        get SUPPORT_RESPONSE_TYPE() {
            var e = testResponseType();
            return Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", {
                value: e
            }),
            e
        },
        get SUPPORT_CORS_XHR() {
            var e = "withCredentials"in new XMLHttpRequest;
            return Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", {
                value: e
            }),
            e
        }
    }, Logger = function() {
        function e(e) {
            var t = e.id
              , r = e.enabled;
            this.id = t,
            this.enabled = r,
            this.start = Date.now()
        }
        return e.prototype.debug = function() {
            for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
            this.enabled && ("undefined" != typeof window && window.console && "function" == typeof console.debug ? console.debug.apply(console, [this.id, this.getTime() + "ms"].concat(e)) : this.info.apply(this, e))
        }
        ,
        e.prototype.getTime = function() {
            return Date.now() - this.start
        }
        ,
        e.create = function(t) {
            e.instances[t.id] = new e(t)
        }
        ,
        e.destroy = function(t) {
            delete e.instances[t]
        }
        ,
        e.getInstance = function(t) {
            var r = e.instances[t];
            if (void 0 === r)
                throw new Error("No logger instance found with id " + t);
            return r
        }
        ,
        e.prototype.info = function() {
            for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
            this.enabled && "undefined" != typeof window && window.console && "function" == typeof console.info && console.info.apply(console, [this.id, this.getTime() + "ms"].concat(e))
        }
        ,
        e.prototype.error = function() {
            for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
            this.enabled && ("undefined" != typeof window && window.console && "function" == typeof console.error ? console.error.apply(console, [this.id, this.getTime() + "ms"].concat(e)) : this.info.apply(this, e))
        }
        ,
        e.instances = {},
        e
    }(), CacheStorage = function() {
        function e() {}
        return e.create = function(t, r) {
            return e._caches[t] = new Cache(t,r)
        }
        ,
        e.destroy = function(t) {
            delete e._caches[t]
        }
        ,
        e.open = function(t) {
            var r = e._caches[t];
            if (void 0 !== r)
                return r;
            throw new Error('Cache with key "' + t + '" not found')
        }
        ,
        e.getOrigin = function(t) {
            var r = e._link;
            return r ? (r.href = t,
            r.href = r.href,
            r.protocol + r.hostname + r.port) : "about:blank"
        }
        ,
        e.isSameOrigin = function(t) {
            return e.getOrigin(t) === e._origin
        }
        ,
        e.setContext = function(t) {
            e._link = t.document.createElement("a"),
            e._origin = e.getOrigin(t.location.href)
        }
        ,
        e.getInstance = function() {
            var t = e._current;
            if (null === t)
                throw new Error("No cache instance attached");
            return t
        }
        ,
        e.attachInstance = function(t) {
            e._current = t
        }
        ,
        e.detachInstance = function() {
            e._current = null
        }
        ,
        e._caches = {},
        e._origin = "about:blank",
        e._current = null,
        e
    }(), Cache = function() {
        function e(e, t) {
            this.id = e,
            this._options = t,
            this._cache = {}
        }
        return e.prototype.addImage = function(e) {
            var t = Promise.resolve();
            return this.has(e) ? t : isBlobImage(e) || isRenderable(e) ? (this._cache[e] = this.loadImage(e),
            t) : t
        }
        ,
        e.prototype.match = function(e) {
            return this._cache[e]
        }
        ,
        e.prototype.loadImage = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t, r, a, n, o = this;
                return __generator(this, (function(l) {
                    switch (l.label) {
                    case 0:
                        return t = CacheStorage.isSameOrigin(e),
                        r = !isInlineImage(e) && !0 === this._options.useCORS && FEATURES.SUPPORT_CORS_IMAGES && !t,
                        a = !isInlineImage(e) && !t && "string" == typeof this._options.proxy && FEATURES.SUPPORT_CORS_XHR && !r,
                        t || !1 !== this._options.allowTaint || isInlineImage(e) || a || r ? (n = e,
                        a ? [4, this.proxy(n)] : [3, 2]) : [2];
                    case 1:
                        n = l.sent(),
                        l.label = 2;
                    case 2:
                        return Logger.getInstance(this.id).debug("Added image " + e.substring(0, 256)),
                        [4, new Promise((function(e, t) {
                            var a = new Image;
                            a.onload = function() {
                                return e(a)
                            }
                            ,
                            a.onerror = t,
                            (isInlineBase64Image(n) || r) && (a.crossOrigin = "anonymous"),
                            a.src = n,
                            !0 === a.complete && setTimeout((function() {
                                return e(a)
                            }
                            ), 500),
                            o._options.imageTimeout > 0 && setTimeout((function() {
                                return t("Timed out (" + o._options.imageTimeout + "ms) loading image")
                            }
                            ), o._options.imageTimeout)
                        }
                        ))];
                    case 3:
                        return [2, l.sent()]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.has = function(e) {
            return void 0 !== this._cache[e]
        }
        ,
        e.prototype.keys = function() {
            return Promise.resolve(Object.keys(this._cache))
        }
        ,
        e.prototype.proxy = function(e) {
            var t = this
              , r = this._options.proxy;
            if (!r)
                throw new Error("No proxy defined");
            var a = e.substring(0, 256);
            return new Promise((function(n, o) {
                var l = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text"
                  , i = new XMLHttpRequest;
                if (i.onload = function() {
                    if (200 === i.status)
                        if ("text" === l)
                            n(i.response);
                        else {
                            var e = new FileReader;
                            e.addEventListener("load", (function() {
                                return n(e.result)
                            }
                            ), !1),
                            e.addEventListener("error", (function(e) {
                                return o(e)
                            }
                            ), !1),
                            e.readAsDataURL(i.response)
                        }
                    else
                        o("Failed to proxy resource " + a + " with status code " + i.status)
                }
                ,
                i.onerror = o,
                i.open("GET", r + "?url=" + encodeURIComponent(e) + "&responseType=" + l),
                "text" !== l && i instanceof XMLHttpRequest && (i.responseType = l),
                t._options.imageTimeout) {
                    var s = t._options.imageTimeout;
                    i.timeout = s,
                    i.ontimeout = function() {
                        return o("Timed out (" + s + "ms) proxying " + a)
                    }
                }
                i.send()
            }
            ))
        }
        ,
        e
    }(), INLINE_SVG = /^data:image\/svg\+xml/i, INLINE_BASE64 = /^data:image\/.*;base64,/i, INLINE_IMG = /^data:image\/.*/i, isRenderable = function(e) {
        return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(e)
    }, isInlineImage = function(e) {
        return INLINE_IMG.test(e)
    }, isInlineBase64Image = function(e) {
        return INLINE_BASE64.test(e)
    }, isBlobImage = function(e) {
        return "blob" === e.substr(0, 4)
    }, isSVG = function(e) {
        return "svg" === e.substr(-3).toLowerCase() || INLINE_SVG.test(e)
    }, webkitGradient = function(e) {
        var t = deg(180)
          , r = []
          , a = CSSImageType.LINEAR_GRADIENT
          , n = CSSRadialShape.CIRCLE
          , o = CSSRadialExtent.FARTHEST_CORNER;
        return parseFunctionArgs(e).forEach((function(e, t) {
            var n = e[0];
            if (0 === t) {
                if (isIdentToken(n) && "linear" === n.value)
                    return void (a = CSSImageType.LINEAR_GRADIENT);
                if (isIdentToken(n) && "radial" === n.value)
                    return void (a = CSSImageType.RADIAL_GRADIENT)
            }
            if (n.type === TokenType.FUNCTION)
                if ("from" === n.name) {
                    var o = color.parse(n.values[0]);
                    r.push({
                        stop: ZERO_LENGTH,
                        color: o
                    })
                } else if ("to" === n.name) {
                    o = color.parse(n.values[0]);
                    r.push({
                        stop: HUNDRED_PERCENT,
                        color: o
                    })
                } else if ("color-stop" === n.name) {
                    var l = n.values.filter(nonFunctionArgSeparator);
                    if (2 === l.length) {
                        o = color.parse(l[1]);
                        var i = l[0];
                        isNumberToken(i) && r.push({
                            stop: {
                                type: TokenType.PERCENTAGE_TOKEN,
                                number: 100 * i.number,
                                flags: i.flags
                            },
                            color: o
                        })
                    }
                }
        }
        )),
        a === CSSImageType.LINEAR_GRADIENT ? {
            angle: (t + deg(180)) % deg(360),
            stops: r,
            type: a
        } : {
            size: o,
            shape: n,
            stops: r,
            position: [],
            type: a
        }
    }, CLOSEST_SIDE = "closest-side", FARTHEST_SIDE = "farthest-side", CLOSEST_CORNER = "closest-corner", FARTHEST_CORNER = "farthest-corner", CIRCLE = "circle", ELLIPSE = "ellipse", COVER = "cover", CONTAIN = "contain", radialGradient = function(e) {
        var t = CSSRadialShape.CIRCLE
          , r = CSSRadialExtent.FARTHEST_CORNER
          , a = []
          , n = [];
        return parseFunctionArgs(e).forEach((function(e, o) {
            var l = !0;
            if (0 === o) {
                var i = !1;
                l = e.reduce((function(e, a) {
                    if (i)
                        if (isIdentToken(a))
                            switch (a.value) {
                            case "center":
                                return n.push(FIFTY_PERCENT),
                                e;
                            case "top":
                            case "left":
                                return n.push(ZERO_LENGTH),
                                e;
                            case "right":
                            case "bottom":
                                return n.push(HUNDRED_PERCENT),
                                e
                            }
                        else
                            (isLengthPercentage(a) || isLength(a)) && n.push(a);
                    else if (isIdentToken(a))
                        switch (a.value) {
                        case CIRCLE:
                            return t = CSSRadialShape.CIRCLE,
                            !1;
                        case ELLIPSE:
                            return t = CSSRadialShape.ELLIPSE,
                            !1;
                        case "at":
                            return i = !0,
                            !1;
                        case CLOSEST_SIDE:
                            return r = CSSRadialExtent.CLOSEST_SIDE,
                            !1;
                        case COVER:
                        case FARTHEST_SIDE:
                            return r = CSSRadialExtent.FARTHEST_SIDE,
                            !1;
                        case CONTAIN:
                        case CLOSEST_CORNER:
                            return r = CSSRadialExtent.CLOSEST_CORNER,
                            !1;
                        case FARTHEST_CORNER:
                            return r = CSSRadialExtent.FARTHEST_CORNER,
                            !1
                        }
                    else if (isLength(a) || isLengthPercentage(a))
                        return Array.isArray(r) || (r = []),
                        r.push(a),
                        !1;
                    return e
                }
                ), l)
            }
            if (l) {
                var s = parseColorStop(e);
                a.push(s)
            }
        }
        )),
        {
            size: r,
            shape: t,
            stops: a,
            position: n,
            type: CSSImageType.RADIAL_GRADIENT
        }
    }, prefixRadialGradient = function(e) {
        var t = CSSRadialShape.CIRCLE
          , r = CSSRadialExtent.FARTHEST_CORNER
          , a = []
          , n = [];
        return parseFunctionArgs(e).forEach((function(e, o) {
            var l = !0;
            if (0 === o ? l = e.reduce((function(e, t) {
                if (isIdentToken(t))
                    switch (t.value) {
                    case "center":
                        return n.push(FIFTY_PERCENT),
                        !1;
                    case "top":
                    case "left":
                        return n.push(ZERO_LENGTH),
                        !1;
                    case "right":
                    case "bottom":
                        return n.push(HUNDRED_PERCENT),
                        !1
                    }
                else if (isLengthPercentage(t) || isLength(t))
                    return n.push(t),
                    !1;
                return e
            }
            ), l) : 1 === o && (l = e.reduce((function(e, a) {
                if (isIdentToken(a))
                    switch (a.value) {
                    case CIRCLE:
                        return t = CSSRadialShape.CIRCLE,
                        !1;
                    case ELLIPSE:
                        return t = CSSRadialShape.ELLIPSE,
                        !1;
                    case CONTAIN:
                    case CLOSEST_SIDE:
                        return r = CSSRadialExtent.CLOSEST_SIDE,
                        !1;
                    case FARTHEST_SIDE:
                        return r = CSSRadialExtent.FARTHEST_SIDE,
                        !1;
                    case CLOSEST_CORNER:
                        return r = CSSRadialExtent.CLOSEST_CORNER,
                        !1;
                    case COVER:
                    case FARTHEST_CORNER:
                        return r = CSSRadialExtent.FARTHEST_CORNER,
                        !1
                    }
                else if (isLength(a) || isLengthPercentage(a))
                    return Array.isArray(r) || (r = []),
                    r.push(a),
                    !1;
                return e
            }
            ), l)),
            l) {
                var i = parseColorStop(e);
                a.push(i)
            }
        }
        )),
        {
            size: r,
            shape: t,
            stops: a,
            position: n,
            type: CSSImageType.RADIAL_GRADIENT
        }
    }, CSSImageType;
    !function(e) {
        e[e.URL = 0] = "URL",
        e[e.LINEAR_GRADIENT = 1] = "LINEAR_GRADIENT",
        e[e.RADIAL_GRADIENT = 2] = "RADIAL_GRADIENT"
    }(CSSImageType || (CSSImageType = {}));
    var isLinearGradient = function(e) {
        return e.type === CSSImageType.LINEAR_GRADIENT
    }, isRadialGradient = function(e) {
        return e.type === CSSImageType.RADIAL_GRADIENT
    }, CSSRadialShape, CSSRadialExtent;
    !function(e) {
        e[e.CIRCLE = 0] = "CIRCLE",
        e[e.ELLIPSE = 1] = "ELLIPSE"
    }(CSSRadialShape || (CSSRadialShape = {})),
    function(e) {
        e[e.CLOSEST_SIDE = 0] = "CLOSEST_SIDE",
        e[e.FARTHEST_SIDE = 1] = "FARTHEST_SIDE",
        e[e.CLOSEST_CORNER = 2] = "CLOSEST_CORNER",
        e[e.FARTHEST_CORNER = 3] = "FARTHEST_CORNER"
    }(CSSRadialExtent || (CSSRadialExtent = {}));
    var image = {
        name: "image",
        parse: function(e) {
            if (e.type === TokenType.URL_TOKEN) {
                var t = {
                    url: e.value,
                    type: CSSImageType.URL
                };
                return CacheStorage.getInstance().addImage(e.value),
                t
            }
            if (e.type === TokenType.FUNCTION) {
                var r = SUPPORTED_IMAGE_FUNCTIONS[e.name];
                if (void 0 === r)
                    throw new Error('Attempting to parse an unsupported image function "' + e.name + '"');
                return r(e.values)
            }
            throw new Error("Unsupported image type")
        }
    };
    function isSupportedImage(e) {
        return e.type !== TokenType.FUNCTION || SUPPORTED_IMAGE_FUNCTIONS[e.name]
    }
    var SUPPORTED_IMAGE_FUNCTIONS = {
        "linear-gradient": linearGradient,
        "-moz-linear-gradient": prefixLinearGradient,
        "-ms-linear-gradient": prefixLinearGradient,
        "-o-linear-gradient": prefixLinearGradient,
        "-webkit-linear-gradient": prefixLinearGradient,
        "radial-gradient": radialGradient,
        "-moz-radial-gradient": prefixRadialGradient,
        "-ms-radial-gradient": prefixRadialGradient,
        "-o-radial-gradient": prefixRadialGradient,
        "-webkit-radial-gradient": prefixRadialGradient,
        "-webkit-gradient": webkitGradient
    }, backgroundImage = {
        name: "background-image",
        initialValue: "none",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            if (0 === e.length)
                return [];
            var t = e[0];
            return t.type === TokenType.IDENT_TOKEN && "none" === t.value ? [] : e.filter((function(e) {
                return nonFunctionArgSeparator(e) && isSupportedImage(e)
            }
            )).map(image.parse)
        }
    }, backgroundOrigin = {
        name: "background-origin",
        initialValue: "border-box",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return e.map((function(e) {
                if (isIdentToken(e))
                    switch (e.value) {
                    case "padding-box":
                        return 1;
                    case "content-box":
                        return 2
                    }
                return 0
            }
            ))
        }
    }, backgroundPosition = {
        name: "background-position",
        initialValue: "0% 0%",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            return parseFunctionArgs(e).map((function(e) {
                return e.filter(isLengthPercentage)
            }
            )).map(parseLengthPercentageTuple)
        }
    }, BACKGROUND_REPEAT;
    !function(e) {
        e[e.REPEAT = 0] = "REPEAT",
        e[e.NO_REPEAT = 1] = "NO_REPEAT",
        e[e.REPEAT_X = 2] = "REPEAT_X",
        e[e.REPEAT_Y = 3] = "REPEAT_Y"
    }(BACKGROUND_REPEAT || (BACKGROUND_REPEAT = {}));
    var backgroundRepeat = {
        name: "background-repeat",
        initialValue: "repeat",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return parseFunctionArgs(e).map((function(e) {
                return e.filter(isIdentToken).map((function(e) {
                    return e.value
                }
                )).join(" ")
            }
            )).map(parseBackgroundRepeat)
        }
    }, parseBackgroundRepeat = function(e) {
        switch (e) {
        case "no-repeat":
            return BACKGROUND_REPEAT.NO_REPEAT;
        case "repeat-x":
        case "repeat no-repeat":
            return BACKGROUND_REPEAT.REPEAT_X;
        case "repeat-y":
        case "no-repeat repeat":
            return BACKGROUND_REPEAT.REPEAT_Y;
        case "repeat":
        default:
            return BACKGROUND_REPEAT.REPEAT
        }
    }, BACKGROUND_SIZE;
    !function(e) {
        e.AUTO = "auto",
        e.CONTAIN = "contain",
        e.COVER = "cover"
    }(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
    var backgroundSize = {
        name: "background-size",
        initialValue: "0",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return parseFunctionArgs(e).map((function(e) {
                return e.filter(isBackgroundSizeInfoToken)
            }
            ))
        }
    }, isBackgroundSizeInfoToken = function(e) {
        return isIdentToken(e) || isLengthPercentage(e)
    }, borderColorForSide = function(e) {
        return {
            name: "border-" + e + "-color",
            initialValue: "transparent",
            prefix: !1,
            type: PropertyDescriptorParsingType.TYPE_VALUE,
            format: "color"
        }
    }, borderTopColor = borderColorForSide("top"), borderRightColor = borderColorForSide("right"), borderBottomColor = borderColorForSide("bottom"), borderLeftColor = borderColorForSide("left"), borderRadiusForSide = function(e) {
        return {
            name: "border-radius-" + e,
            initialValue: "0 0",
            prefix: !1,
            type: PropertyDescriptorParsingType.LIST,
            parse: function(e) {
                return parseLengthPercentageTuple(e.filter(isLengthPercentage))
            }
        }
    }, borderTopLeftRadius = borderRadiusForSide("top-left"), borderTopRightRadius = borderRadiusForSide("top-right"), borderBottomRightRadius = borderRadiusForSide("bottom-right"), borderBottomLeftRadius = borderRadiusForSide("bottom-left"), BORDER_STYLE;
    !function(e) {
        e[e.NONE = 0] = "NONE",
        e[e.SOLID = 1] = "SOLID"
    }(BORDER_STYLE || (BORDER_STYLE = {}));
    var borderStyleForSide = function(e) {
        return {
            name: "border-" + e + "-style",
            initialValue: "solid",
            prefix: !1,
            type: PropertyDescriptorParsingType.IDENT_VALUE,
            parse: function(e) {
                switch (e) {
                case "none":
                    return BORDER_STYLE.NONE
                }
                return BORDER_STYLE.SOLID
            }
        }
    }, borderTopStyle = borderStyleForSide("top"), borderRightStyle = borderStyleForSide("right"), borderBottomStyle = borderStyleForSide("bottom"), borderLeftStyle = borderStyleForSide("left"), borderWidthForSide = function(e) {
        return {
            name: "border-" + e + "-width",
            initialValue: "0",
            type: PropertyDescriptorParsingType.VALUE,
            prefix: !1,
            parse: function(e) {
                return isDimensionToken(e) ? e.number : 0
            }
        }
    }, borderTopWidth = borderWidthForSide("top"), borderRightWidth = borderWidthForSide("right"), borderBottomWidth = borderWidthForSide("bottom"), borderLeftWidth = borderWidthForSide("left"), color$1 = {
        name: "color",
        initialValue: "transparent",
        prefix: !1,
        type: PropertyDescriptorParsingType.TYPE_VALUE,
        format: "color"
    }, display = {
        name: "display",
        initialValue: "inline-block",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return e.filter(isIdentToken).reduce((function(e, t) {
                return e | parseDisplayValue(t.value)
            }
            ), 0)
        }
    }, parseDisplayValue = function(e) {
        switch (e) {
        case "block":
            return 2;
        case "inline":
            return 4;
        case "run-in":
            return 8;
        case "flow":
            return 16;
        case "flow-root":
            return 32;
        case "table":
            return 64;
        case "flex":
        case "-webkit-flex":
            return 128;
        case "grid":
        case "-ms-grid":
            return 256;
        case "ruby":
            return 512;
        case "subgrid":
            return 1024;
        case "list-item":
            return 2048;
        case "table-row-group":
            return 4096;
        case "table-header-group":
            return 8192;
        case "table-footer-group":
            return 16384;
        case "table-row":
            return 32768;
        case "table-cell":
            return 65536;
        case "table-column-group":
            return 131072;
        case "table-column":
            return 262144;
        case "table-caption":
            return 524288;
        case "ruby-base":
            return 1048576;
        case "ruby-text":
            return 2097152;
        case "ruby-base-container":
            return 4194304;
        case "ruby-text-container":
            return 8388608;
        case "contents":
            return 16777216;
        case "inline-block":
            return 33554432;
        case "inline-list-item":
            return 67108864;
        case "inline-table":
            return 134217728;
        case "inline-flex":
            return 268435456;
        case "inline-grid":
            return 536870912
        }
        return 0
    }, FLOAT;
    !function(e) {
        e[e.NONE = 0] = "NONE",
        e[e.LEFT = 1] = "LEFT",
        e[e.RIGHT = 2] = "RIGHT",
        e[e.INLINE_START = 3] = "INLINE_START",
        e[e.INLINE_END = 4] = "INLINE_END"
    }(FLOAT || (FLOAT = {}));
    var float = {
        name: "float",
        initialValue: "none",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "left":
                return FLOAT.LEFT;
            case "right":
                return FLOAT.RIGHT;
            case "inline-start":
                return FLOAT.INLINE_START;
            case "inline-end":
                return FLOAT.INLINE_END
            }
            return FLOAT.NONE
        }
    }, letterSpacing = {
        name: "letter-spacing",
        initialValue: "0",
        prefix: !1,
        type: PropertyDescriptorParsingType.VALUE,
        parse: function(e) {
            return e.type === TokenType.IDENT_TOKEN && "normal" === e.value ? 0 : e.type === TokenType.NUMBER_TOKEN || e.type === TokenType.DIMENSION_TOKEN ? e.number : 0
        }
    }, LINE_BREAK;
    !function(e) {
        e.NORMAL = "normal",
        e.STRICT = "strict"
    }(LINE_BREAK || (LINE_BREAK = {}));
    var lineBreak = {
        name: "line-break",
        initialValue: "normal",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "strict":
                return LINE_BREAK.STRICT;
            case "normal":
            default:
                return LINE_BREAK.NORMAL
            }
        }
    }, lineHeight = {
        name: "line-height",
        initialValue: "normal",
        prefix: !1,
        type: PropertyDescriptorParsingType.TOKEN_VALUE
    }, computeLineHeight = function(e, t) {
        return isIdentToken(e) && "normal" === e.value ? 1.2 * t : e.type === TokenType.NUMBER_TOKEN ? t * e.number : isLengthPercentage(e) ? getAbsoluteValue(e, t) : t
    }, listStyleImage = {
        name: "list-style-image",
        initialValue: "none",
        type: PropertyDescriptorParsingType.VALUE,
        prefix: !1,
        parse: function(e) {
            return e.type === TokenType.IDENT_TOKEN && "none" === e.value ? null : image.parse(e)
        }
    }, LIST_STYLE_POSITION;
    !function(e) {
        e[e.INSIDE = 0] = "INSIDE",
        e[e.OUTSIDE = 1] = "OUTSIDE"
    }(LIST_STYLE_POSITION || (LIST_STYLE_POSITION = {}));
    var listStylePosition = {
        name: "list-style-position",
        initialValue: "outside",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "inside":
                return LIST_STYLE_POSITION.INSIDE;
            case "outside":
            default:
                return LIST_STYLE_POSITION.OUTSIDE
            }
        }
    }, LIST_STYLE_TYPE;
    !function(e) {
        e[e.NONE = -1] = "NONE",
        e[e.DISC = 0] = "DISC",
        e[e.CIRCLE = 1] = "CIRCLE",
        e[e.SQUARE = 2] = "SQUARE",
        e[e.DECIMAL = 3] = "DECIMAL",
        e[e.CJK_DECIMAL = 4] = "CJK_DECIMAL",
        e[e.DECIMAL_LEADING_ZERO = 5] = "DECIMAL_LEADING_ZERO",
        e[e.LOWER_ROMAN = 6] = "LOWER_ROMAN",
        e[e.UPPER_ROMAN = 7] = "UPPER_ROMAN",
        e[e.LOWER_GREEK = 8] = "LOWER_GREEK",
        e[e.LOWER_ALPHA = 9] = "LOWER_ALPHA",
        e[e.UPPER_ALPHA = 10] = "UPPER_ALPHA",
        e[e.ARABIC_INDIC = 11] = "ARABIC_INDIC",
        e[e.ARMENIAN = 12] = "ARMENIAN",
        e[e.BENGALI = 13] = "BENGALI",
        e[e.CAMBODIAN = 14] = "CAMBODIAN",
        e[e.CJK_EARTHLY_BRANCH = 15] = "CJK_EARTHLY_BRANCH",
        e[e.CJK_HEAVENLY_STEM = 16] = "CJK_HEAVENLY_STEM",
        e[e.CJK_IDEOGRAPHIC = 17] = "CJK_IDEOGRAPHIC",
        e[e.DEVANAGARI = 18] = "DEVANAGARI",
        e[e.ETHIOPIC_NUMERIC = 19] = "ETHIOPIC_NUMERIC",
        e[e.GEORGIAN = 20] = "GEORGIAN",
        e[e.GUJARATI = 21] = "GUJARATI",
        e[e.GURMUKHI = 22] = "GURMUKHI",
        e[e.HEBREW = 22] = "HEBREW",
        e[e.HIRAGANA = 23] = "HIRAGANA",
        e[e.HIRAGANA_IROHA = 24] = "HIRAGANA_IROHA",
        e[e.JAPANESE_FORMAL = 25] = "JAPANESE_FORMAL",
        e[e.JAPANESE_INFORMAL = 26] = "JAPANESE_INFORMAL",
        e[e.KANNADA = 27] = "KANNADA",
        e[e.KATAKANA = 28] = "KATAKANA",
        e[e.KATAKANA_IROHA = 29] = "KATAKANA_IROHA",
        e[e.KHMER = 30] = "KHMER",
        e[e.KOREAN_HANGUL_FORMAL = 31] = "KOREAN_HANGUL_FORMAL",
        e[e.KOREAN_HANJA_FORMAL = 32] = "KOREAN_HANJA_FORMAL",
        e[e.KOREAN_HANJA_INFORMAL = 33] = "KOREAN_HANJA_INFORMAL",
        e[e.LAO = 34] = "LAO",
        e[e.LOWER_ARMENIAN = 35] = "LOWER_ARMENIAN",
        e[e.MALAYALAM = 36] = "MALAYALAM",
        e[e.MONGOLIAN = 37] = "MONGOLIAN",
        e[e.MYANMAR = 38] = "MYANMAR",
        e[e.ORIYA = 39] = "ORIYA",
        e[e.PERSIAN = 40] = "PERSIAN",
        e[e.SIMP_CHINESE_FORMAL = 41] = "SIMP_CHINESE_FORMAL",
        e[e.SIMP_CHINESE_INFORMAL = 42] = "SIMP_CHINESE_INFORMAL",
        e[e.TAMIL = 43] = "TAMIL",
        e[e.TELUGU = 44] = "TELUGU",
        e[e.THAI = 45] = "THAI",
        e[e.TIBETAN = 46] = "TIBETAN",
        e[e.TRAD_CHINESE_FORMAL = 47] = "TRAD_CHINESE_FORMAL",
        e[e.TRAD_CHINESE_INFORMAL = 48] = "TRAD_CHINESE_INFORMAL",
        e[e.UPPER_ARMENIAN = 49] = "UPPER_ARMENIAN",
        e[e.DISCLOSURE_OPEN = 50] = "DISCLOSURE_OPEN",
        e[e.DISCLOSURE_CLOSED = 51] = "DISCLOSURE_CLOSED"
    }(LIST_STYLE_TYPE || (LIST_STYLE_TYPE = {}));
    var listStyleType = {
        name: "list-style-type",
        initialValue: "none",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "disc":
                return LIST_STYLE_TYPE.DISC;
            case "circle":
                return LIST_STYLE_TYPE.CIRCLE;
            case "square":
                return LIST_STYLE_TYPE.SQUARE;
            case "decimal":
                return LIST_STYLE_TYPE.DECIMAL;
            case "cjk-decimal":
                return LIST_STYLE_TYPE.CJK_DECIMAL;
            case "decimal-leading-zero":
                return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
            case "lower-roman":
                return LIST_STYLE_TYPE.LOWER_ROMAN;
            case "upper-roman":
                return LIST_STYLE_TYPE.UPPER_ROMAN;
            case "lower-greek":
                return LIST_STYLE_TYPE.LOWER_GREEK;
            case "lower-alpha":
                return LIST_STYLE_TYPE.LOWER_ALPHA;
            case "upper-alpha":
                return LIST_STYLE_TYPE.UPPER_ALPHA;
            case "arabic-indic":
                return LIST_STYLE_TYPE.ARABIC_INDIC;
            case "armenian":
                return LIST_STYLE_TYPE.ARMENIAN;
            case "bengali":
                return LIST_STYLE_TYPE.BENGALI;
            case "cambodian":
                return LIST_STYLE_TYPE.CAMBODIAN;
            case "cjk-earthly-branch":
                return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
            case "cjk-heavenly-stem":
                return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
            case "cjk-ideographic":
                return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
            case "devanagari":
                return LIST_STYLE_TYPE.DEVANAGARI;
            case "ethiopic-numeric":
                return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
            case "georgian":
                return LIST_STYLE_TYPE.GEORGIAN;
            case "gujarati":
                return LIST_STYLE_TYPE.GUJARATI;
            case "gurmukhi":
                return LIST_STYLE_TYPE.GURMUKHI;
            case "hebrew":
                return LIST_STYLE_TYPE.HEBREW;
            case "hiragana":
                return LIST_STYLE_TYPE.HIRAGANA;
            case "hiragana-iroha":
                return LIST_STYLE_TYPE.HIRAGANA_IROHA;
            case "japanese-formal":
                return LIST_STYLE_TYPE.JAPANESE_FORMAL;
            case "japanese-informal":
                return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
            case "kannada":
                return LIST_STYLE_TYPE.KANNADA;
            case "katakana":
                return LIST_STYLE_TYPE.KATAKANA;
            case "katakana-iroha":
                return LIST_STYLE_TYPE.KATAKANA_IROHA;
            case "khmer":
                return LIST_STYLE_TYPE.KHMER;
            case "korean-hangul-formal":
                return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
            case "korean-hanja-formal":
                return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
            case "korean-hanja-informal":
                return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
            case "lao":
                return LIST_STYLE_TYPE.LAO;
            case "lower-armenian":
                return LIST_STYLE_TYPE.LOWER_ARMENIAN;
            case "malayalam":
                return LIST_STYLE_TYPE.MALAYALAM;
            case "mongolian":
                return LIST_STYLE_TYPE.MONGOLIAN;
            case "myanmar":
                return LIST_STYLE_TYPE.MYANMAR;
            case "oriya":
                return LIST_STYLE_TYPE.ORIYA;
            case "persian":
                return LIST_STYLE_TYPE.PERSIAN;
            case "simp-chinese-formal":
                return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
            case "simp-chinese-informal":
                return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
            case "tamil":
                return LIST_STYLE_TYPE.TAMIL;
            case "telugu":
                return LIST_STYLE_TYPE.TELUGU;
            case "thai":
                return LIST_STYLE_TYPE.THAI;
            case "tibetan":
                return LIST_STYLE_TYPE.TIBETAN;
            case "trad-chinese-formal":
                return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
            case "trad-chinese-informal":
                return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
            case "upper-armenian":
                return LIST_STYLE_TYPE.UPPER_ARMENIAN;
            case "disclosure-open":
                return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
            case "disclosure-closed":
                return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
            case "none":
            default:
                return LIST_STYLE_TYPE.NONE
            }
        }
    }, marginForSide = function(e) {
        return {
            name: "margin-" + e,
            initialValue: "0",
            prefix: !1,
            type: PropertyDescriptorParsingType.TOKEN_VALUE
        }
    }, marginTop = marginForSide("top"), marginRight = marginForSide("right"), marginBottom = marginForSide("bottom"), marginLeft = marginForSide("left"), OVERFLOW;
    !function(e) {
        e[e.VISIBLE = 0] = "VISIBLE",
        e[e.HIDDEN = 1] = "HIDDEN",
        e[e.SCROLL = 2] = "SCROLL",
        e[e.AUTO = 3] = "AUTO"
    }(OVERFLOW || (OVERFLOW = {}));
    var overflow = {
        name: "overflow",
        initialValue: "visible",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return e.filter(isIdentToken).map((function(e) {
                switch (e.value) {
                case "hidden":
                    return OVERFLOW.HIDDEN;
                case "scroll":
                    return OVERFLOW.SCROLL;
                case "auto":
                    return OVERFLOW.AUTO;
                case "visible":
                default:
                    return OVERFLOW.VISIBLE
                }
            }
            ))
        }
    }, OVERFLOW_WRAP;
    !function(e) {
        e.NORMAL = "normal",
        e.BREAK_WORD = "break-word"
    }(OVERFLOW_WRAP || (OVERFLOW_WRAP = {}));
    var overflowWrap = {
        name: "overflow-wrap",
        initialValue: "normal",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "break-word":
                return OVERFLOW_WRAP.BREAK_WORD;
            case "normal":
            default:
                return OVERFLOW_WRAP.NORMAL
            }
        }
    }, paddingForSide = function(e) {
        return {
            name: "padding-" + e,
            initialValue: "0",
            prefix: !1,
            type: PropertyDescriptorParsingType.TYPE_VALUE,
            format: "length-percentage"
        }
    }, paddingTop = paddingForSide("top"), paddingRight = paddingForSide("right"), paddingBottom = paddingForSide("bottom"), paddingLeft = paddingForSide("left"), TEXT_ALIGN;
    !function(e) {
        e[e.LEFT = 0] = "LEFT",
        e[e.CENTER = 1] = "CENTER",
        e[e.RIGHT = 2] = "RIGHT"
    }(TEXT_ALIGN || (TEXT_ALIGN = {}));
    var textAlign = {
        name: "text-align",
        initialValue: "left",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "right":
                return TEXT_ALIGN.RIGHT;
            case "center":
            case "justify":
                return TEXT_ALIGN.CENTER;
            case "left":
            default:
                return TEXT_ALIGN.LEFT
            }
        }
    }, POSITION;
    !function(e) {
        e[e.STATIC = 0] = "STATIC",
        e[e.RELATIVE = 1] = "RELATIVE",
        e[e.ABSOLUTE = 2] = "ABSOLUTE",
        e[e.FIXED = 3] = "FIXED",
        e[e.STICKY = 4] = "STICKY"
    }(POSITION || (POSITION = {}));
    var position = {
        name: "position",
        initialValue: "static",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "relative":
                return POSITION.RELATIVE;
            case "absolute":
                return POSITION.ABSOLUTE;
            case "fixed":
                return POSITION.FIXED;
            case "sticky":
                return POSITION.STICKY
            }
            return POSITION.STATIC
        }
    }, textShadow = {
        name: "text-shadow",
        initialValue: "none",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            return 1 === e.length && isIdentWithValue(e[0], "none") ? [] : parseFunctionArgs(e).map((function(e) {
                for (var t = {
                    color: COLORS.TRANSPARENT,
                    offsetX: ZERO_LENGTH,
                    offsetY: ZERO_LENGTH,
                    blur: ZERO_LENGTH
                }, r = 0, a = 0; a < e.length; a++) {
                    var n = e[a];
                    isLength(n) ? (0 === r ? t.offsetX = n : 1 === r ? t.offsetY = n : t.blur = n,
                    r++) : t.color = color.parse(n)
                }
                return t
            }
            ))
        }
    }, TEXT_TRANSFORM;
    !function(e) {
        e[e.NONE = 0] = "NONE",
        e[e.LOWERCASE = 1] = "LOWERCASE",
        e[e.UPPERCASE = 2] = "UPPERCASE",
        e[e.CAPITALIZE = 3] = "CAPITALIZE"
    }(TEXT_TRANSFORM || (TEXT_TRANSFORM = {}));
    var textTransform = {
        name: "text-transform",
        initialValue: "none",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "uppercase":
                return TEXT_TRANSFORM.UPPERCASE;
            case "lowercase":
                return TEXT_TRANSFORM.LOWERCASE;
            case "capitalize":
                return TEXT_TRANSFORM.CAPITALIZE
            }
            return TEXT_TRANSFORM.NONE
        }
    }, transform = {
        name: "transform",
        initialValue: "none",
        prefix: !0,
        type: PropertyDescriptorParsingType.VALUE,
        parse: function(e) {
            if (e.type === TokenType.IDENT_TOKEN && "none" === e.value)
                return null;
            if (e.type === TokenType.FUNCTION) {
                var t = SUPPORTED_TRANSFORM_FUNCTIONS[e.name];
                if (void 0 === t)
                    throw new Error('Attempting to parse an unsupported transform function "' + e.name + '"');
                return t(e.values)
            }
            return null
        }
    }, matrix$1 = function(e) {
        var t = e.filter((function(e) {
            return e.type === TokenType.NUMBER_TOKEN
        }
        )).map((function(e) {
            return e.number
        }
        ));
        return 6 === t.length ? t : null
    }, matrix3d = function(e) {
        var t = e.filter((function(e) {
            return e.type === TokenType.NUMBER_TOKEN
        }
        )).map((function(e) {
            return e.number
        }
        ))
          , r = t[0]
          , a = t[1]
          , n = (t[2],
        t[3],
        t[4])
          , o = t[5]
          , l = (t[6],
        t[7],
        t[8],
        t[9],
        t[10],
        t[11],
        t[12])
          , i = t[13];
        t[14],
        t[15];
        return 16 === t.length ? [r, a, n, o, l, i] : null
    }, SUPPORTED_TRANSFORM_FUNCTIONS = {
        matrix: matrix$1,
        matrix3d: matrix3d
    }, DEFAULT_VALUE = {
        type: TokenType.PERCENTAGE_TOKEN,
        number: 50,
        flags: FLAG_INTEGER
    }, DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE], transformOrigin = {
        name: "transform-origin",
        initialValue: "50% 50%",
        prefix: !0,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            var t = e.filter(isLengthPercentage);
            return 2 !== t.length ? DEFAULT : [t[0], t[1]]
        }
    }, VISIBILITY;
    !function(e) {
        e[e.VISIBLE = 0] = "VISIBLE",
        e[e.HIDDEN = 1] = "HIDDEN",
        e[e.COLLAPSE = 2] = "COLLAPSE"
    }(VISIBILITY || (VISIBILITY = {}));
    var visibility = {
        name: "visible",
        initialValue: "none",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "hidden":
                return VISIBILITY.HIDDEN;
            case "collapse":
                return VISIBILITY.COLLAPSE;
            case "visible":
            default:
                return VISIBILITY.VISIBLE
            }
        }
    }, WORD_BREAK;
    !function(e) {
        e.NORMAL = "normal",
        e.BREAK_ALL = "break-all",
        e.KEEP_ALL = "keep-all"
    }(WORD_BREAK || (WORD_BREAK = {}));
    var wordBreak = {
        name: "word-break",
        initialValue: "normal",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "break-all":
                return WORD_BREAK.BREAK_ALL;
            case "keep-all":
                return WORD_BREAK.KEEP_ALL;
            case "normal":
            default:
                return WORD_BREAK.NORMAL
            }
        }
    }, zIndex = {
        name: "z-index",
        initialValue: "auto",
        prefix: !1,
        type: PropertyDescriptorParsingType.VALUE,
        parse: function(e) {
            if (e.type === TokenType.IDENT_TOKEN)
                return {
                    auto: !0,
                    order: 0
                };
            if (isNumberToken(e))
                return {
                    auto: !1,
                    order: e.number
                };
            throw new Error("Invalid z-index number parsed")
        }
    }, opacity = {
        name: "opacity",
        initialValue: "1",
        type: PropertyDescriptorParsingType.VALUE,
        prefix: !1,
        parse: function(e) {
            return isNumberToken(e) ? e.number : 1
        }
    }, textDecorationColor = {
        name: "text-decoration-color",
        initialValue: "transparent",
        prefix: !1,
        type: PropertyDescriptorParsingType.TYPE_VALUE,
        format: "color"
    }, textDecorationLine = {
        name: "text-decoration-line",
        initialValue: "none",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            return e.filter(isIdentToken).map((function(e) {
                switch (e.value) {
                case "underline":
                    return 1;
                case "overline":
                    return 2;
                case "line-through":
                    return 3;
                case "none":
                    return 4
                }
                return 0
            }
            )).filter((function(e) {
                return 0 !== e
            }
            ))
        }
    }, fontFamily = {
        name: "font-family",
        initialValue: "",
        prefix: !1,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            var t = []
              , r = [];
            return e.forEach((function(e) {
                switch (e.type) {
                case TokenType.IDENT_TOKEN:
                case TokenType.STRING_TOKEN:
                    t.push(e.value);
                    break;
                case TokenType.NUMBER_TOKEN:
                    t.push(e.number.toString());
                    break;
                case TokenType.COMMA_TOKEN:
                    r.push(t.join(" ")),
                    t.length = 0
                }
            }
            )),
            t.length && r.push(t.join(" ")),
            r.map((function(e) {
                return -1 === e.indexOf(" ") ? e : "'" + e + "'"
            }
            ))
        }
    }, fontSize = {
        name: "font-size",
        initialValue: "0",
        prefix: !1,
        type: PropertyDescriptorParsingType.TYPE_VALUE,
        format: "length"
    }, fontWeight = {
        name: "font-weight",
        initialValue: "normal",
        type: PropertyDescriptorParsingType.VALUE,
        prefix: !1,
        parse: function(e) {
            if (isNumberToken(e))
                return e.number;
            if (isIdentToken(e))
                switch (e.value) {
                case "bold":
                    return 700;
                case "normal":
                default:
                    return 400
                }
            return 400
        }
    }, fontVariant = {
        name: "font-variant",
        initialValue: "none",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            return e.filter(isIdentToken).map((function(e) {
                return e.value
            }
            ))
        }
    }, FONT_STYLE;
    !function(e) {
        e.NORMAL = "normal",
        e.ITALIC = "italic",
        e.OBLIQUE = "oblique"
    }(FONT_STYLE || (FONT_STYLE = {}));
    var fontStyle = {
        name: "font-style",
        initialValue: "normal",
        prefix: !1,
        type: PropertyDescriptorParsingType.IDENT_VALUE,
        parse: function(e) {
            switch (e) {
            case "oblique":
                return FONT_STYLE.OBLIQUE;
            case "italic":
                return FONT_STYLE.ITALIC;
            case "normal":
            default:
                return FONT_STYLE.NORMAL
            }
        }
    }, contains = function(e, t) {
        return 0 != (e & t)
    }, content = {
        name: "content",
        initialValue: "none",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            if (0 === e.length)
                return [];
            var t = e[0];
            return t.type === TokenType.IDENT_TOKEN && "none" === t.value ? [] : e
        }
    }, counterIncrement = {
        name: "counter-increment",
        initialValue: "none",
        prefix: !0,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            if (0 === e.length)
                return null;
            var t = e[0];
            if (t.type === TokenType.IDENT_TOKEN && "none" === t.value)
                return null;
            for (var r = [], a = e.filter(nonWhiteSpace), n = 0; n < a.length; n++) {
                var o = a[n]
                  , l = a[n + 1];
                if (o.type === TokenType.IDENT_TOKEN) {
                    var i = l && isNumberToken(l) ? l.number : 1;
                    r.push({
                        counter: o.value,
                        increment: i
                    })
                }
            }
            return r
        }
    }, counterReset = {
        name: "counter-reset",
        initialValue: "none",
        prefix: !0,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            if (0 === e.length)
                return [];
            for (var t = [], r = e.filter(nonWhiteSpace), a = 0; a < r.length; a++) {
                var n = r[a]
                  , o = r[a + 1];
                if (isIdentToken(n) && "none" !== n.value) {
                    var l = o && isNumberToken(o) ? o.number : 0;
                    t.push({
                        counter: n.value,
                        reset: l
                    })
                }
            }
            return t
        }
    }, quotes = {
        name: "quotes",
        initialValue: "none",
        prefix: !0,
        type: PropertyDescriptorParsingType.LIST,
        parse: function(e) {
            if (0 === e.length)
                return null;
            var t = e[0];
            if (t.type === TokenType.IDENT_TOKEN && "none" === t.value)
                return null;
            var r = []
              , a = e.filter(isStringToken);
            if (a.length % 2 != 0)
                return null;
            for (var n = 0; n < a.length; n += 2) {
                var o = a[n].value
                  , l = a[n + 1].value;
                r.push({
                    open: o,
                    close: l
                })
            }
            return r
        }
    }, getQuote = function(e, t, r) {
        if (!e)
            return "";
        var a = e[Math.min(t, e.length - 1)];
        return a ? r ? a.open : a.close : ""
    }, boxShadow = {
        name: "box-shadow",
        initialValue: "none",
        type: PropertyDescriptorParsingType.LIST,
        prefix: !1,
        parse: function(e) {
            return 1 === e.length && isIdentWithValue(e[0], "none") ? [] : parseFunctionArgs(e).map((function(e) {
                for (var t = {
                    color: 255,
                    offsetX: ZERO_LENGTH,
                    offsetY: ZERO_LENGTH,
                    blur: ZERO_LENGTH,
                    spread: ZERO_LENGTH,
                    inset: !1
                }, r = 0, a = 0; a < e.length; a++) {
                    var n = e[a];
                    isIdentWithValue(n, "inset") ? t.inset = !0 : isLength(n) ? (0 === r ? t.offsetX = n : 1 === r ? t.offsetY = n : 2 === r ? t.blur = n : t.spread = n,
                    r++) : t.color = color.parse(n)
                }
                return t
            }
            ))
        }
    }, CSSParsedDeclaration = function() {
        function e(e) {
            this.backgroundClip = parse(backgroundClip, e.backgroundClip),
            this.backgroundColor = parse(backgroundColor, e.backgroundColor),
            this.backgroundImage = parse(backgroundImage, e.backgroundImage),
            this.backgroundOrigin = parse(backgroundOrigin, e.backgroundOrigin),
            this.backgroundPosition = parse(backgroundPosition, e.backgroundPosition),
            this.backgroundRepeat = parse(backgroundRepeat, e.backgroundRepeat),
            this.backgroundSize = parse(backgroundSize, e.backgroundSize),
            this.borderTopColor = parse(borderTopColor, e.borderTopColor),
            this.borderRightColor = parse(borderRightColor, e.borderRightColor),
            this.borderBottomColor = parse(borderBottomColor, e.borderBottomColor),
            this.borderLeftColor = parse(borderLeftColor, e.borderLeftColor),
            this.borderTopLeftRadius = parse(borderTopLeftRadius, e.borderTopLeftRadius),
            this.borderTopRightRadius = parse(borderTopRightRadius, e.borderTopRightRadius),
            this.borderBottomRightRadius = parse(borderBottomRightRadius, e.borderBottomRightRadius),
            this.borderBottomLeftRadius = parse(borderBottomLeftRadius, e.borderBottomLeftRadius),
            this.borderTopStyle = parse(borderTopStyle, e.borderTopStyle),
            this.borderRightStyle = parse(borderRightStyle, e.borderRightStyle),
            this.borderBottomStyle = parse(borderBottomStyle, e.borderBottomStyle),
            this.borderLeftStyle = parse(borderLeftStyle, e.borderLeftStyle),
            this.borderTopWidth = parse(borderTopWidth, e.borderTopWidth),
            this.borderRightWidth = parse(borderRightWidth, e.borderRightWidth),
            this.borderBottomWidth = parse(borderBottomWidth, e.borderBottomWidth),
            this.borderLeftWidth = parse(borderLeftWidth, e.borderLeftWidth),
            this.boxShadow = parse(boxShadow, e.boxShadow),
            this.color = parse(color$1, e.color),
            this.display = parse(display, e.display),
            this.float = parse(float, e.cssFloat),
            this.fontFamily = parse(fontFamily, e.fontFamily),
            this.fontSize = parse(fontSize, e.fontSize),
            this.fontStyle = parse(fontStyle, e.fontStyle),
            this.fontVariant = parse(fontVariant, e.fontVariant),
            this.fontWeight = parse(fontWeight, e.fontWeight),
            this.letterSpacing = parse(letterSpacing, e.letterSpacing),
            this.lineBreak = parse(lineBreak, e.lineBreak),
            this.lineHeight = parse(lineHeight, e.lineHeight),
            this.listStyleImage = parse(listStyleImage, e.listStyleImage),
            this.listStylePosition = parse(listStylePosition, e.listStylePosition),
            this.listStyleType = parse(listStyleType, e.listStyleType),
            this.marginTop = parse(marginTop, e.marginTop),
            this.marginRight = parse(marginRight, e.marginRight),
            this.marginBottom = parse(marginBottom, e.marginBottom),
            this.marginLeft = parse(marginLeft, e.marginLeft),
            this.opacity = parse(opacity, e.opacity);
            var t = parse(overflow, e.overflow);
            this.overflowX = t[0],
            this.overflowY = t[t.length > 1 ? 1 : 0],
            this.overflowWrap = parse(overflowWrap, e.overflowWrap),
            this.paddingTop = parse(paddingTop, e.paddingTop),
            this.paddingRight = parse(paddingRight, e.paddingRight),
            this.paddingBottom = parse(paddingBottom, e.paddingBottom),
            this.paddingLeft = parse(paddingLeft, e.paddingLeft),
            this.position = parse(position, e.position),
            this.textAlign = parse(textAlign, e.textAlign),
            this.textDecorationColor = parse(textDecorationColor, e.textDecorationColor || e.color),
            this.textDecorationLine = parse(textDecorationLine, e.textDecorationLine),
            this.textShadow = parse(textShadow, e.textShadow),
            this.textTransform = parse(textTransform, e.textTransform),
            this.transform = parse(transform, e.transform),
            this.transformOrigin = parse(transformOrigin, e.transformOrigin),
            this.visibility = parse(visibility, e.visibility),
            this.wordBreak = parse(wordBreak, e.wordBreak),
            this.zIndex = parse(zIndex, e.zIndex)
        }
        return e.prototype.isVisible = function() {
            return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE
        }
        ,
        e.prototype.isTransparent = function() {
            return isTransparent(this.backgroundColor)
        }
        ,
        e.prototype.isTransformed = function() {
            return null !== this.transform
        }
        ,
        e.prototype.isPositioned = function() {
            return this.position !== POSITION.STATIC
        }
        ,
        e.prototype.isPositionedWithZIndex = function() {
            return this.isPositioned() && !this.zIndex.auto
        }
        ,
        e.prototype.isFloating = function() {
            return this.float !== FLOAT.NONE
        }
        ,
        e.prototype.isInlineLevel = function() {
            return contains(this.display, 4) || contains(this.display, 33554432) || contains(this.display, 268435456) || contains(this.display, 536870912) || contains(this.display, 67108864) || contains(this.display, 134217728)
        }
        ,
        e
    }(), CSSParsedPseudoDeclaration = function(e) {
        this.content = parse(content, e.content),
        this.quotes = parse(quotes, e.quotes)
    }, CSSParsedCounterDeclaration = function(e) {
        this.counterIncrement = parse(counterIncrement, e.counterIncrement),
        this.counterReset = parse(counterReset, e.counterReset)
    }, parse = function(e, t) {
        var r = new Tokenizer
          , a = null != t ? t.toString() : e.initialValue;
        r.write(a);
        var n = new Parser(r.read());
        switch (e.type) {
        case PropertyDescriptorParsingType.IDENT_VALUE:
            var o = n.parseComponentValue();
            return e.parse(isIdentToken(o) ? o.value : e.initialValue);
        case PropertyDescriptorParsingType.VALUE:
            return e.parse(n.parseComponentValue());
        case PropertyDescriptorParsingType.LIST:
            return e.parse(n.parseComponentValues());
        case PropertyDescriptorParsingType.TOKEN_VALUE:
            return n.parseComponentValue();
        case PropertyDescriptorParsingType.TYPE_VALUE:
            switch (e.format) {
            case "angle":
                return angle.parse(n.parseComponentValue());
            case "color":
                return color.parse(n.parseComponentValue());
            case "image":
                return image.parse(n.parseComponentValue());
            case "length":
                var l = n.parseComponentValue();
                return isLength(l) ? l : ZERO_LENGTH;
            case "length-percentage":
                var i = n.parseComponentValue();
                return isLengthPercentage(i) ? i : ZERO_LENGTH
            }
        }
        throw new Error("Attempting to parse unsupported css format type " + e.format)
    }, ElementContainer = function(e) {
        this.styles = new CSSParsedDeclaration(window.getComputedStyle(e, null)),
        this.textNodes = [],
        this.elements = [],
        null !== this.styles.transform && isHTMLElementNode(e) && (e.style.transform = "none"),
        this.bounds = parseBounds(e),
        this.flags = 0
    }, TextBounds = function(e, t) {
        this.text = e,
        this.bounds = t
    }, parseTextBounds = function(e, t, r) {
        var a = breakText(e, t)
          , n = []
          , o = 0;
        return a.forEach((function(e) {
            if (t.textDecorationLine.length || e.trim().length > 0)
                if (FEATURES.SUPPORT_RANGE_BOUNDS)
                    n.push(new TextBounds(e,getRangeBounds(r, o, e.length)));
                else {
                    var a = r.splitText(e.length);
                    n.push(new TextBounds(e,getWrapperBounds(r))),
                    r = a
                }
            else
                FEATURES.SUPPORT_RANGE_BOUNDS || (r = r.splitText(e.length));
            o += e.length
        }
        )),
        n
    }, getWrapperBounds = function(e) {
        var t = e.ownerDocument;
        if (t) {
            var r = t.createElement("html2canvaswrapper");
            r.appendChild(e.cloneNode(!0));
            var a = e.parentNode;
            if (a) {
                a.replaceChild(r, e);
                var n = parseBounds(r);
                return r.firstChild && a.replaceChild(r.firstChild, r),
                n
            }
        }
        return new Bounds(0,0,0,0)
    }, getRangeBounds = function(e, t, r) {
        var a = e.ownerDocument;
        if (!a)
            throw new Error("Node has no owner document");
        var n = a.createRange();
        return n.setStart(e, t),
        n.setEnd(e, t + r),
        Bounds.fromClientRect(n.getBoundingClientRect())
    }, breakText = function(e, t) {
        return 0 !== t.letterSpacing ? toCodePoints(e).map((function(e) {
            return fromCodePoint(e)
        }
        )) : breakWords(e, t)
    }, breakWords = function(e, t) {
        for (var r, a = LineBreaker(e, {
            lineBreak: t.lineBreak,
            wordBreak: t.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? "break-word" : t.wordBreak
        }), n = []; !(r = a.next()).done; )
            r.value && n.push(r.value.slice());
        return n
    }, TextContainer = function(e, t) {
        this.text = transform$1(e.data, t.textTransform),
        this.textBounds = parseTextBounds(this.text, t, e)
    }, transform$1 = function(e, t) {
        switch (t) {
        case TEXT_TRANSFORM.LOWERCASE:
            return e.toLowerCase();
        case TEXT_TRANSFORM.CAPITALIZE:
            return e.replace(CAPITALIZE, capitalize);
        case TEXT_TRANSFORM.UPPERCASE:
            return e.toUpperCase();
        default:
            return e
        }
    }, CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g, capitalize = function(e, t, r) {
        return e.length > 0 ? t + r.toUpperCase() : e
    }, ImageElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            return r.src = t.currentSrc || t.src,
            r.intrinsicWidth = t.naturalWidth,
            r.intrinsicHeight = t.naturalHeight,
            CacheStorage.getInstance().addImage(r.src),
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), CanvasElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            return r.canvas = t,
            r.intrinsicWidth = t.width,
            r.intrinsicHeight = t.height,
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), SVGElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this
              , a = new XMLSerializer;
            return r.svg = "data:image/svg+xml," + encodeURIComponent(a.serializeToString(t)),
            r.intrinsicWidth = t.width.baseVal.value,
            r.intrinsicHeight = t.height.baseVal.value,
            CacheStorage.getInstance().addImage(r.svg),
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), LIElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            return r.value = t.value,
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), OLElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            return r.start = t.start,
            r.reversed = "boolean" == typeof t.reversed && !0 === t.reversed,
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), CHECKBOX_BORDER_RADIUS = [{
        type: TokenType.DIMENSION_TOKEN,
        flags: 0,
        unit: "px",
        number: 3
    }], RADIO_BORDER_RADIUS = [{
        type: TokenType.PERCENTAGE_TOKEN,
        flags: 0,
        number: 50
    }], reformatInputBounds = function(e) {
        return e.width > e.height ? new Bounds(e.left + (e.width - e.height) / 2,e.top,e.height,e.height) : e.width < e.height ? new Bounds(e.left,e.top + (e.height - e.width) / 2,e.width,e.width) : e
    }, getInputValue = function(e) {
        var t = e.type === PASSWORD ? new Array(e.value.length + 1).join("•") : e.value;
        return 0 === t.length ? e.placeholder || "" : t
    }, CHECKBOX = "checkbox", RADIO = "radio", PASSWORD = "password", INPUT_COLOR = 707406591, InputElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            switch (r.type = t.type.toLowerCase(),
            r.checked = t.checked,
            r.value = getInputValue(t),
            r.type !== CHECKBOX && r.type !== RADIO || (r.styles.backgroundColor = 3739148031,
            r.styles.borderTopColor = r.styles.borderRightColor = r.styles.borderBottomColor = r.styles.borderLeftColor = 2779096575,
            r.styles.borderTopWidth = r.styles.borderRightWidth = r.styles.borderBottomWidth = r.styles.borderLeftWidth = 1,
            r.styles.borderTopStyle = r.styles.borderRightStyle = r.styles.borderBottomStyle = r.styles.borderLeftStyle = BORDER_STYLE.SOLID,
            r.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX],
            r.styles.backgroundOrigin = [0],
            r.bounds = reformatInputBounds(r.bounds)),
            r.type) {
            case CHECKBOX:
                r.styles.borderTopRightRadius = r.styles.borderTopLeftRadius = r.styles.borderBottomRightRadius = r.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
                break;
            case RADIO:
                r.styles.borderTopRightRadius = r.styles.borderTopLeftRadius = r.styles.borderBottomRightRadius = r.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS
            }
            return r
        }
        return __extends(t, e),
        t
    }(ElementContainer), SelectElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this
              , a = t.options[t.selectedIndex || 0];
            return r.value = a && a.text || "",
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), TextareaElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            return r.value = t.value,
            r
        }
        return __extends(t, e),
        t
    }(ElementContainer), parseColor = function(e) {
        return color.parse(Parser.create(e).parseComponentValue())
    }, IFrameElementContainer = function(e) {
        function t(t) {
            var r = e.call(this, t) || this;
            r.src = t.src,
            r.width = parseInt(t.width, 10) || 0,
            r.height = parseInt(t.height, 10) || 0,
            r.backgroundColor = r.styles.backgroundColor;
            try {
                if (t.contentWindow && t.contentWindow.document && t.contentWindow.document.documentElement) {
                    r.tree = parseTree(t.contentWindow.document.documentElement);
                    var a = t.contentWindow.document.documentElement ? parseColor(getComputedStyle(t.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT
                      , n = t.contentWindow.document.body ? parseColor(getComputedStyle(t.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT;
                    r.backgroundColor = isTransparent(a) ? isTransparent(n) ? r.styles.backgroundColor : n : a
                }
            } catch (e) {}
            return r
        }
        return __extends(t, e),
        t
    }(ElementContainer), LIST_OWNERS = ["OL", "UL", "MENU"], parseNodeTree = function(e, t, r) {
        for (var a = e.firstChild, n = void 0; a; a = n)
            if (n = a.nextSibling,
            isTextNode(a) && a.data.trim().length > 0)
                t.textNodes.push(new TextContainer(a,t.styles));
            else if (isElementNode(a)) {
                var o = createContainer(a);
                o.styles.isVisible() && (createsRealStackingContext(a, o, r) ? o.flags |= 4 : createsStackingContext(o.styles) && (o.flags |= 2),
                -1 !== LIST_OWNERS.indexOf(a.tagName) && (o.flags |= 8),
                t.elements.push(o),
                isTextareaElement(a) || isSVGElement(a) || isSelectElement(a) || parseNodeTree(a, o, r))
            }
    }, createContainer = function(e) {
        return isImageElement(e) ? new ImageElementContainer(e) : isCanvasElement(e) ? new CanvasElementContainer(e) : isSVGElement(e) ? new SVGElementContainer(e) : isLIElement(e) ? new LIElementContainer(e) : isOLElement(e) ? new OLElementContainer(e) : isInputElement(e) ? new InputElementContainer(e) : isSelectElement(e) ? new SelectElementContainer(e) : isTextareaElement(e) ? new TextareaElementContainer(e) : isIFrameElement(e) ? new IFrameElementContainer(e) : new ElementContainer(e)
    }, parseTree = function(e) {
        var t = createContainer(e);
        return t.flags |= 4,
        parseNodeTree(e, t, t),
        t
    }, createsRealStackingContext = function(e, t, r) {
        return t.styles.isPositionedWithZIndex() || t.styles.opacity < 1 || t.styles.isTransformed() || isBodyElement(e) && r.styles.isTransparent()
    }, createsStackingContext = function(e) {
        return e.isPositioned() || e.isFloating()
    }, isTextNode = function(e) {
        return e.nodeType === Node.TEXT_NODE
    }, isElementNode = function(e) {
        return e.nodeType === Node.ELEMENT_NODE
    }, isHTMLElementNode = function(e) {
        return isElementNode(e) && void 0 !== e.style && !isSVGElementNode(e)
    }, isSVGElementNode = function(e) {
        return "object" == typeof e.className
    }, isLIElement = function(e) {
        return "LI" === e.tagName
    }, isOLElement = function(e) {
        return "OL" === e.tagName
    }, isInputElement = function(e) {
        return "INPUT" === e.tagName
    }, isHTMLElement = function(e) {
        return "HTML" === e.tagName
    }, isSVGElement = function(e) {
        return "svg" === e.tagName
    }, isBodyElement = function(e) {
        return "BODY" === e.tagName
    }, isCanvasElement = function(e) {
        return "CANVAS" === e.tagName
    }, isImageElement = function(e) {
        return "IMG" === e.tagName
    }, isIFrameElement = function(e) {
        return "IFRAME" === e.tagName
    }, isStyleElement = function(e) {
        return "STYLE" === e.tagName
    }, isScriptElement = function(e) {
        return "SCRIPT" === e.tagName
    }, isTextareaElement = function(e) {
        return "TEXTAREA" === e.tagName
    }, isSelectElement = function(e) {
        return "SELECT" === e.tagName
    }, CounterState = function() {
        function e() {
            this.counters = {}
        }
        return e.prototype.getCounterValue = function(e) {
            var t = this.counters[e];
            return t && t.length ? t[t.length - 1] : 1
        }
        ,
        e.prototype.getCounterValues = function(e) {
            var t = this.counters[e];
            return t || []
        }
        ,
        e.prototype.pop = function(e) {
            var t = this;
            e.forEach((function(e) {
                return t.counters[e].pop()
            }
            ))
        }
        ,
        e.prototype.parse = function(e) {
            var t = this
              , r = e.counterIncrement
              , a = e.counterReset
              , n = !0;
            null !== r && r.forEach((function(e) {
                var r = t.counters[e.counter];
                r && 0 !== e.increment && (n = !1,
                r[Math.max(0, r.length - 1)] += e.increment)
            }
            ));
            var o = [];
            return n && a.forEach((function(e) {
                var r = t.counters[e.counter];
                o.push(e.counter),
                r || (r = t.counters[e.counter] = []),
                r.push(e.reset)
            }
            )),
            o
        }
        ,
        e
    }(), ROMAN_UPPER = {
        integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
        values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
    }, ARMENIAN = {
        integers: [9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
        values: ["Ք", "Փ", "Ւ", "Ց", "Ր", "Տ", "Վ", "Ս", "Ռ", "Ջ", "Պ", "Չ", "Ո", "Շ", "Ն", "Յ", "Մ", "Ճ", "Ղ", "Ձ", "Հ", "Կ", "Ծ", "Խ", "Լ", "Ի", "Ժ", "Թ", "Ը", "Է", "Զ", "Ե", "Դ", "Գ", "Բ", "Ա"]
    }, HEBREW = {
        integers: [1e4, 9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
        values: ["י׳", "ט׳", "ח׳", "ז׳", "ו׳", "ה׳", "ד׳", "ג׳", "ב׳", "א׳", "ת", "ש", "ר", "ק", "צ", "פ", "ע", "ס", "נ", "מ", "ל", "כ", "יט", "יח", "יז", "טז", "טו", "י", "ט", "ח", "ז", "ו", "ה", "ד", "ג", "ב", "א"]
    }, GEORGIAN = {
        integers: [1e4, 9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
        values: ["ჵ", "ჰ", "ჯ", "ჴ", "ხ", "ჭ", "წ", "ძ", "ც", "ჩ", "შ", "ყ", "ღ", "ქ", "ფ", "ჳ", "ტ", "ს", "რ", "ჟ", "პ", "ო", "ჲ", "ნ", "მ", "ლ", "კ", "ი", "თ", "ჱ", "ზ", "ვ", "ე", "დ", "გ", "ბ", "ა"]
    }, createAdditiveCounter = function(e, t, r, a, n, o) {
        return e < t || e > r ? createCounterText(e, n, o.length > 0) : a.integers.reduce((function(t, r, n) {
            for (; e >= r; )
                e -= r,
                t += a.values[n];
            return t
        }
        ), "") + o
    }, createCounterStyleWithSymbolResolver = function(e, t, r, a) {
        var n = "";
        do {
            r || e--,
            n = a(e) + n,
            e /= t
        } while (e * t >= t);return n
    }, createCounterStyleFromRange = function(e, t, r, a, n) {
        var o = r - t + 1;
        return (e < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(e), o, a, (function(e) {
            return fromCodePoint(Math.floor(e % o) + t)
        }
        )) + n)
    }, createCounterStyleFromSymbols = function(e, t, r) {
        void 0 === r && (r = ". ");
        var a = t.length;
        return createCounterStyleWithSymbolResolver(Math.abs(e), a, !1, (function(e) {
            return t[Math.floor(e % a)]
        }
        )) + r
    }, CJK_ZEROS = 1, CJK_TEN_COEFFICIENTS = 2, CJK_TEN_HIGH_COEFFICIENTS = 4, CJK_HUNDRED_COEFFICIENTS = 8, createCJKCounter = function(e, t, r, a, n, o) {
        if (e < -9999 || e > 9999)
            return createCounterText(e, LIST_STYLE_TYPE.CJK_DECIMAL, n.length > 0);
        var l = Math.abs(e)
          , i = n;
        if (0 === l)
            return t[0] + i;
        for (var s = 0; l > 0 && s <= 4; s++) {
            var c = l % 10;
            0 === c && contains(o, CJK_ZEROS) && "" !== i ? i = t[c] + i : c > 1 || 1 === c && 0 === s || 1 === c && 1 === s && contains(o, CJK_TEN_COEFFICIENTS) || 1 === c && 1 === s && contains(o, CJK_TEN_HIGH_COEFFICIENTS) && e > 100 || 1 === c && s > 1 && contains(o, CJK_HUNDRED_COEFFICIENTS) ? i = t[c] + (s > 0 ? r[s - 1] : "") + i : 1 === c && s > 0 && (i = r[s - 1] + i),
            l = Math.floor(l / 10)
        }
        return (e < 0 ? a : "") + i
    }, CHINESE_INFORMAL_MULTIPLIERS = "十百千萬", CHINESE_FORMAL_MULTIPLIERS = "拾佰仟萬", JAPANESE_NEGATIVE = "マイナス", KOREAN_NEGATIVE = "마이너스", createCounterText = function(e, t, r) {
        var a = r ? ". " : ""
          , n = r ? "、" : ""
          , o = r ? ", " : ""
          , l = r ? " " : "";
        switch (t) {
        case LIST_STYLE_TYPE.DISC:
            return "•" + l;
        case LIST_STYLE_TYPE.CIRCLE:
            return "◦" + l;
        case LIST_STYLE_TYPE.SQUARE:
            return "◾" + l;
        case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
            var i = createCounterStyleFromRange(e, 48, 57, !0, a);
            return i.length < 4 ? "0" + i : i;
        case LIST_STYLE_TYPE.CJK_DECIMAL:
            return createCounterStyleFromSymbols(e, "〇一二三四五六七八九", n);
        case LIST_STYLE_TYPE.LOWER_ROMAN:
            return createAdditiveCounter(e, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, a).toLowerCase();
        case LIST_STYLE_TYPE.UPPER_ROMAN:
            return createAdditiveCounter(e, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, a);
        case LIST_STYLE_TYPE.LOWER_GREEK:
            return createCounterStyleFromRange(e, 945, 969, !1, a);
        case LIST_STYLE_TYPE.LOWER_ALPHA:
            return createCounterStyleFromRange(e, 97, 122, !1, a);
        case LIST_STYLE_TYPE.UPPER_ALPHA:
            return createCounterStyleFromRange(e, 65, 90, !1, a);
        case LIST_STYLE_TYPE.ARABIC_INDIC:
            return createCounterStyleFromRange(e, 1632, 1641, !0, a);
        case LIST_STYLE_TYPE.ARMENIAN:
        case LIST_STYLE_TYPE.UPPER_ARMENIAN:
            return createAdditiveCounter(e, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, a);
        case LIST_STYLE_TYPE.LOWER_ARMENIAN:
            return createAdditiveCounter(e, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, a).toLowerCase();
        case LIST_STYLE_TYPE.BENGALI:
            return createCounterStyleFromRange(e, 2534, 2543, !0, a);
        case LIST_STYLE_TYPE.CAMBODIAN:
        case LIST_STYLE_TYPE.KHMER:
            return createCounterStyleFromRange(e, 6112, 6121, !0, a);
        case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
            return createCounterStyleFromSymbols(e, "子丑寅卯辰巳午未申酉戌亥", n);
        case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
            return createCounterStyleFromSymbols(e, "甲乙丙丁戊己庚辛壬癸", n);
        case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
        case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
            return createCJKCounter(e, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "負", n, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
            return createCJKCounter(e, "零壹貳參肆伍陸柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "負", n, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
            return createCJKCounter(e, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "负", n, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
            return createCJKCounter(e, "零壹贰叁肆伍陆柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "负", n, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case LIST_STYLE_TYPE.JAPANESE_INFORMAL:
            return createCJKCounter(e, "〇一二三四五六七八九", "十百千万", JAPANESE_NEGATIVE, n, 0);
        case LIST_STYLE_TYPE.JAPANESE_FORMAL:
            return createCJKCounter(e, "零壱弐参四伍六七八九", "拾百千万", JAPANESE_NEGATIVE, n, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
            return createCJKCounter(e, "영일이삼사오육칠팔구", "십백천만", KOREAN_NEGATIVE, o, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
            return createCJKCounter(e, "零一二三四五六七八九", "十百千萬", KOREAN_NEGATIVE, o, 0);
        case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
            return createCJKCounter(e, "零壹貳參四五六七八九", "拾百千", KOREAN_NEGATIVE, o, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case LIST_STYLE_TYPE.DEVANAGARI:
            return createCounterStyleFromRange(e, 2406, 2415, !0, a);
        case LIST_STYLE_TYPE.GEORGIAN:
            return createAdditiveCounter(e, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, a);
        case LIST_STYLE_TYPE.GUJARATI:
            return createCounterStyleFromRange(e, 2790, 2799, !0, a);
        case LIST_STYLE_TYPE.GURMUKHI:
            return createCounterStyleFromRange(e, 2662, 2671, !0, a);
        case LIST_STYLE_TYPE.HEBREW:
            return createAdditiveCounter(e, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, a);
        case LIST_STYLE_TYPE.HIRAGANA:
            return createCounterStyleFromSymbols(e, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");
        case LIST_STYLE_TYPE.HIRAGANA_IROHA:
            return createCounterStyleFromSymbols(e, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");
        case LIST_STYLE_TYPE.KANNADA:
            return createCounterStyleFromRange(e, 3302, 3311, !0, a);
        case LIST_STYLE_TYPE.KATAKANA:
            return createCounterStyleFromSymbols(e, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", n);
        case LIST_STYLE_TYPE.KATAKANA_IROHA:
            return createCounterStyleFromSymbols(e, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", n);
        case LIST_STYLE_TYPE.LAO:
            return createCounterStyleFromRange(e, 3792, 3801, !0, a);
        case LIST_STYLE_TYPE.MONGOLIAN:
            return createCounterStyleFromRange(e, 6160, 6169, !0, a);
        case LIST_STYLE_TYPE.MYANMAR:
            return createCounterStyleFromRange(e, 4160, 4169, !0, a);
        case LIST_STYLE_TYPE.ORIYA:
            return createCounterStyleFromRange(e, 2918, 2927, !0, a);
        case LIST_STYLE_TYPE.PERSIAN:
            return createCounterStyleFromRange(e, 1776, 1785, !0, a);
        case LIST_STYLE_TYPE.TAMIL:
            return createCounterStyleFromRange(e, 3046, 3055, !0, a);
        case LIST_STYLE_TYPE.TELUGU:
            return createCounterStyleFromRange(e, 3174, 3183, !0, a);
        case LIST_STYLE_TYPE.THAI:
            return createCounterStyleFromRange(e, 3664, 3673, !0, a);
        case LIST_STYLE_TYPE.TIBETAN:
            return createCounterStyleFromRange(e, 3872, 3881, !0, a);
        case LIST_STYLE_TYPE.DECIMAL:
        default:
            return createCounterStyleFromRange(e, 48, 57, !0, a)
        }
    }, IGNORE_ATTRIBUTE = "data-html2canvas-ignore", DocumentCloner = function() {
        function e(e, t) {
            if (this.options = t,
            this.scrolledElements = [],
            this.referenceElement = e,
            this.counters = new CounterState,
            this.quoteDepth = 0,
            !e.ownerDocument)
                throw new Error("Cloned element does not have an owner document");
            this.documentElement = this.cloneNode(e.ownerDocument.documentElement)
        }
        return e.prototype.toIFrame = function(e, t) {
            var r = this
              , a = createIFrameContainer(e, t);
            if (!a.contentWindow)
                return Promise.reject("Unable to find iframe window");
            var n = e.defaultView.pageXOffset
              , o = e.defaultView.pageYOffset
              , l = a.contentWindow
              , i = l.document
              , s = iframeLoader(a).then((function() {
                return __awaiter(r, void 0, void 0, (function() {
                    var e;
                    return __generator(this, (function(r) {
                        switch (r.label) {
                        case 0:
                            return this.scrolledElements.forEach(restoreNodeScroll),
                            l && (l.scrollTo(t.left, t.top),
                            !/(iPad|iPhone|iPod)/g.test(navigator.userAgent) || l.scrollY === t.top && l.scrollX === t.left || (i.documentElement.style.top = -t.top + "px",
                            i.documentElement.style.left = -t.left + "px",
                            i.documentElement.style.position = "absolute")),
                            e = this.options.onclone,
                            void 0 === this.clonedReferenceElement ? [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")] : i.fonts && i.fonts.ready ? [4, i.fonts.ready] : [3, 2];
                        case 1:
                            r.sent(),
                            r.label = 2;
                        case 2:
                            return "function" == typeof e ? [2, Promise.resolve().then((function() {
                                return e(i)
                            }
                            )).then((function() {
                                return a
                            }
                            ))] : [2, a]
                        }
                    }
                    ))
                }
                ))
            }
            ));
            return i.open(),
            i.write(serializeDoctype(document.doctype) + "<html></html>"),
            restoreOwnerScroll(this.referenceElement.ownerDocument, n, o),
            i.replaceChild(i.adoptNode(this.documentElement), i.documentElement),
            i.close(),
            s
        }
        ,
        e.prototype.createElementClone = function(e) {
            if (isCanvasElement(e))
                return this.createCanvasClone(e);
            if (isStyleElement(e))
                return this.createStyleClone(e);
            var t = e.cloneNode(!1);
            return isImageElement(t) && "lazy" === t.loading && (t.loading = "eager"),
            t
        }
        ,
        e.prototype.createStyleClone = function(e) {
            try {
                var t = e.sheet;
                if (t && t.cssRules) {
                    var r = [].slice.call(t.cssRules, 0).reduce((function(e, t) {
                        return t && "string" == typeof t.cssText ? e + t.cssText : e
                    }
                    ), "")
                      , a = e.cloneNode(!1);
                    return a.textContent = r,
                    a
                }
            } catch (e) {
                if (Logger.getInstance(this.options.id).error("Unable to access cssRules property", e),
                "SecurityError" !== e.name)
                    throw e
            }
            return e.cloneNode(!1)
        }
        ,
        e.prototype.createCanvasClone = function(e) {
            if (this.options.inlineImages && e.ownerDocument) {
                var t = e.ownerDocument.createElement("img");
                try {
                    return t.src = e.toDataURL(),
                    t
                } catch (e) {
                    Logger.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")
                }
            }
            var r = e.cloneNode(!1);
            try {
                r.width = e.width,
                r.height = e.height;
                var a = e.getContext("2d")
                  , n = r.getContext("2d");
                return n && (a ? n.putImageData(a.getImageData(0, 0, e.width, e.height), 0, 0) : n.drawImage(e, 0, 0)),
                r
            } catch (e) {}
            return r
        }
        ,
        e.prototype.cloneNode = function(e) {
            if (isTextNode(e))
                return document.createTextNode(e.data);
            if (!e.ownerDocument)
                return e.cloneNode(!1);
            var t = e.ownerDocument.defaultView;
            if (t && isElementNode(e) && (isHTMLElementNode(e) || isSVGElementNode(e))) {
                var r = this.createElementClone(e)
                  , a = t.getComputedStyle(e)
                  , n = t.getComputedStyle(e, ":before")
                  , o = t.getComputedStyle(e, ":after");
                this.referenceElement === e && isHTMLElementNode(r) && (this.clonedReferenceElement = r),
                isBodyElement(r) && createPseudoHideStyles(r);
                for (var l = this.counters.parse(new CSSParsedCounterDeclaration(a)), i = this.resolvePseudoContent(e, r, n, PseudoElementType.BEFORE), s = e.firstChild; s; s = s.nextSibling)
                    isElementNode(s) && (isScriptElement(s) || s.hasAttribute(IGNORE_ATTRIBUTE) || "function" == typeof this.options.ignoreElements && this.options.ignoreElements(s)) || this.options.copyStyles && isElementNode(s) && isStyleElement(s) || r.appendChild(this.cloneNode(s));
                i && r.insertBefore(i, r.firstChild);
                var c = this.resolvePseudoContent(e, r, o, PseudoElementType.AFTER);
                return c && r.appendChild(c),
                this.counters.pop(l),
                a && (this.options.copyStyles || isSVGElementNode(e)) && !isIFrameElement(e) && copyCSSStyles(a, r),
                0 === e.scrollTop && 0 === e.scrollLeft || this.scrolledElements.push([r, e.scrollLeft, e.scrollTop]),
                (isTextareaElement(e) || isSelectElement(e)) && (isTextareaElement(r) || isSelectElement(r)) && (r.value = e.value),
                r
            }
            return e.cloneNode(!1)
        }
        ,
        e.prototype.resolvePseudoContent = function(e, t, r, a) {
            var n = this;
            if (r) {
                var o = r.content
                  , l = t.ownerDocument;
                if (l && o && "none" !== o && "-moz-alt-content" !== o && "none" !== r.display) {
                    this.counters.parse(new CSSParsedCounterDeclaration(r));
                    var i = new CSSParsedPseudoDeclaration(r)
                      , s = l.createElement("html2canvaspseudoelement");
                    copyCSSStyles(r, s),
                    i.content.forEach((function(t) {
                        if (t.type === TokenType.STRING_TOKEN)
                            s.appendChild(l.createTextNode(t.value));
                        else if (t.type === TokenType.URL_TOKEN) {
                            var r = l.createElement("img");
                            r.src = t.value,
                            r.style.opacity = "1",
                            s.appendChild(r)
                        } else if (t.type === TokenType.FUNCTION) {
                            if ("attr" === t.name) {
                                var a = t.values.filter(isIdentToken);
                                a.length && s.appendChild(l.createTextNode(e.getAttribute(a[0].value) || ""))
                            } else if ("counter" === t.name) {
                                var o = t.values.filter(nonFunctionArgSeparator)
                                  , c = o[0]
                                  , u = o[1];
                                if (c && isIdentToken(c)) {
                                    var h = n.counters.getCounterValue(c.value)
                                      , d = u && isIdentToken(u) ? listStyleType.parse(u.value) : LIST_STYLE_TYPE.DECIMAL;
                                    s.appendChild(l.createTextNode(createCounterText(h, d, !1)))
                                }
                            } else if ("counters" === t.name) {
                                var f = t.values.filter(nonFunctionArgSeparator)
                                  , m = (c = f[0],
                                f[1]);
                                u = f[2];
                                if (c && isIdentToken(c)) {
                                    var p = n.counters.getCounterValues(c.value)
                                      , g = u && isIdentToken(u) ? listStyleType.parse(u.value) : LIST_STYLE_TYPE.DECIMAL
                                      , y = m && m.type === TokenType.STRING_TOKEN ? m.value : ""
                                      , v = p.map((function(e) {
                                        return createCounterText(e, g, !1)
                                    }
                                    )).join(y);
                                    s.appendChild(l.createTextNode(v))
                                }
                            }
                        } else if (t.type === TokenType.IDENT_TOKEN)
                            switch (t.value) {
                            case "open-quote":
                                s.appendChild(l.createTextNode(getQuote(i.quotes, n.quoteDepth++, !0)));
                                break;
                            case "close-quote":
                                s.appendChild(l.createTextNode(getQuote(i.quotes, --n.quoteDepth, !1)));
                                break;
                            default:
                                s.appendChild(l.createTextNode(t.value))
                            }
                    }
                    )),
                    s.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
                    var c = a === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
                    return isSVGElementNode(t) ? t.className.baseValue += c : t.className += c,
                    s
                }
            }
        }
        ,
        e.destroy = function(e) {
            return !!e.parentNode && (e.parentNode.removeChild(e),
            !0)
        }
        ,
        e
    }(), PseudoElementType;
    !function(e) {
        e[e.BEFORE = 0] = "BEFORE",
        e[e.AFTER = 1] = "AFTER"
    }(PseudoElementType || (PseudoElementType = {}));
    var createIFrameContainer = function(e, t) {
        var r = e.createElement("iframe");
        return r.className = "html2canvas-container",
        r.style.visibility = "hidden",
        r.style.position = "fixed",
        r.style.left = "-10000px",
        r.style.top = "0px",
        r.style.border = "0",
        r.width = t.width.toString(),
        r.height = t.height.toString(),
        r.scrolling = "no",
        r.setAttribute(IGNORE_ATTRIBUTE, "true"),
        e.body.appendChild(r),
        r
    }, iframeLoader = function(e) {
        return new Promise((function(t, r) {
            var a = e.contentWindow;
            if (!a)
                return r("No window assigned for iframe");
            var n = a.document;
            a.onload = e.onload = n.onreadystatechange = function() {
                a.onload = e.onload = n.onreadystatechange = null;
                var r = setInterval((function() {
                    n.body.childNodes.length > 0 && "complete" === n.readyState && (clearInterval(r),
                    t(e))
                }
                ), 50)
            }
        }
        ))
    }, copyCSSStyles = function(e, t) {
        for (var r = e.length - 1; r >= 0; r--) {
            var a = e.item(r);
            "content" !== a && t.style.setProperty(a, e.getPropertyValue(a))
        }
        return t
    }, serializeDoctype = function(e) {
        var t = "";
        return e && (t += "<!DOCTYPE ",
        e.name && (t += e.name),
        e.internalSubset && (t += e.internalSubset),
        e.publicId && (t += '"' + e.publicId + '"'),
        e.systemId && (t += '"' + e.systemId + '"'),
        t += ">"),
        t
    }, restoreOwnerScroll = function(e, t, r) {
        e && e.defaultView && (t !== e.defaultView.pageXOffset || r !== e.defaultView.pageYOffset) && e.defaultView.scrollTo(t, r)
    }, restoreNodeScroll = function(e) {
        var t = e[0]
          , r = e[1]
          , a = e[2];
        t.scrollLeft = r,
        t.scrollTop = a
    }, PSEUDO_BEFORE = ":before", PSEUDO_AFTER = ":after", PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before", PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after", PSEUDO_HIDE_ELEMENT_STYLE = '{\n    content: "" !important;\n    display: none !important;\n}', createPseudoHideStyles = function(e) {
        createStyles(e, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n         ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE)
    }, createStyles = function(e, t) {
        var r = e.ownerDocument;
        if (r) {
            var a = r.createElement("style");
            a.textContent = t,
            e.appendChild(a)
        }
    }, PathType;
    !function(e) {
        e[e.VECTOR = 0] = "VECTOR",
        e[e.BEZIER_CURVE = 1] = "BEZIER_CURVE"
    }(PathType || (PathType = {}));
    var equalPath = function(e, t) {
        return e.length === t.length && e.some((function(e, r) {
            return e === t[r]
        }
        ))
    }, transformPath = function(e, t, r, a, n) {
        return e.map((function(e, o) {
            switch (o) {
            case 0:
                return e.add(t, r);
            case 1:
                return e.add(t + a, r);
            case 2:
                return e.add(t + a, r + n);
            case 3:
                return e.add(t, r + n)
            }
            return e
        }
        ))
    }, Vector = function() {
        function e(e, t) {
            this.type = PathType.VECTOR,
            this.x = e,
            this.y = t
        }
        return e.prototype.add = function(t, r) {
            return new e(this.x + t,this.y + r)
        }
        ,
        e
    }(), lerp = function(e, t, r) {
        return new Vector(e.x + (t.x - e.x) * r,e.y + (t.y - e.y) * r)
    }, BezierCurve = function() {
        function e(e, t, r, a) {
            this.type = PathType.BEZIER_CURVE,
            this.start = e,
            this.startControl = t,
            this.endControl = r,
            this.end = a
        }
        return e.prototype.subdivide = function(t, r) {
            var a = lerp(this.start, this.startControl, t)
              , n = lerp(this.startControl, this.endControl, t)
              , o = lerp(this.endControl, this.end, t)
              , l = lerp(a, n, t)
              , i = lerp(n, o, t)
              , s = lerp(l, i, t);
            return r ? new e(this.start,a,l,s) : new e(s,i,o,this.end)
        }
        ,
        e.prototype.add = function(t, r) {
            return new e(this.start.add(t, r),this.startControl.add(t, r),this.endControl.add(t, r),this.end.add(t, r))
        }
        ,
        e.prototype.reverse = function() {
            return new e(this.end,this.endControl,this.startControl,this.start)
        }
        ,
        e
    }(), isBezierCurve = function(e) {
        return e.type === PathType.BEZIER_CURVE
    }, BoundCurves = function(e) {
        var t = e.styles
          , r = e.bounds
          , a = getAbsoluteValueForTuple(t.borderTopLeftRadius, r.width, r.height)
          , n = a[0]
          , o = a[1]
          , l = getAbsoluteValueForTuple(t.borderTopRightRadius, r.width, r.height)
          , i = l[0]
          , s = l[1]
          , c = getAbsoluteValueForTuple(t.borderBottomRightRadius, r.width, r.height)
          , u = c[0]
          , h = c[1]
          , d = getAbsoluteValueForTuple(t.borderBottomLeftRadius, r.width, r.height)
          , f = d[0]
          , m = d[1]
          , p = [];
        p.push((n + i) / r.width),
        p.push((f + u) / r.width),
        p.push((o + m) / r.height),
        p.push((s + h) / r.height);
        var g = Math.max.apply(Math, p);
        g > 1 && (n /= g,
        o /= g,
        i /= g,
        s /= g,
        u /= g,
        h /= g,
        f /= g,
        m /= g);
        var y = r.width - i
          , v = r.height - h
          , A = r.width - u
          , b = r.height - m
          , k = t.borderTopWidth
          , w = t.borderRightWidth
          , x = t.borderBottomWidth
          , S = t.borderLeftWidth
          , _ = getAbsoluteValue(t.paddingTop, e.bounds.width)
          , C = getAbsoluteValue(t.paddingRight, e.bounds.width)
          , T = getAbsoluteValue(t.paddingBottom, e.bounds.width)
          , E = getAbsoluteValue(t.paddingLeft, e.bounds.width);
        this.topLeftBorderBox = n > 0 || o > 0 ? getCurvePoints(r.left, r.top, n, o, CORNER.TOP_LEFT) : new Vector(r.left,r.top),
        this.topRightBorderBox = i > 0 || s > 0 ? getCurvePoints(r.left + y, r.top, i, s, CORNER.TOP_RIGHT) : new Vector(r.left + r.width,r.top),
        this.bottomRightBorderBox = u > 0 || h > 0 ? getCurvePoints(r.left + A, r.top + v, u, h, CORNER.BOTTOM_RIGHT) : new Vector(r.left + r.width,r.top + r.height),
        this.bottomLeftBorderBox = f > 0 || m > 0 ? getCurvePoints(r.left, r.top + b, f, m, CORNER.BOTTOM_LEFT) : new Vector(r.left,r.top + r.height),
        this.topLeftPaddingBox = n > 0 || o > 0 ? getCurvePoints(r.left + S, r.top + k, Math.max(0, n - S), Math.max(0, o - k), CORNER.TOP_LEFT) : new Vector(r.left + S,r.top + k),
        this.topRightPaddingBox = i > 0 || s > 0 ? getCurvePoints(r.left + Math.min(y, r.width + S), r.top + k, y > r.width + S ? 0 : i - S, s - k, CORNER.TOP_RIGHT) : new Vector(r.left + r.width - w,r.top + k),
        this.bottomRightPaddingBox = u > 0 || h > 0 ? getCurvePoints(r.left + Math.min(A, r.width - S), r.top + Math.min(v, r.height + k), Math.max(0, u - w), h - x, CORNER.BOTTOM_RIGHT) : new Vector(r.left + r.width - w,r.top + r.height - x),
        this.bottomLeftPaddingBox = f > 0 || m > 0 ? getCurvePoints(r.left + S, r.top + b, Math.max(0, f - S), m - x, CORNER.BOTTOM_LEFT) : new Vector(r.left + S,r.top + r.height - x),
        this.topLeftContentBox = n > 0 || o > 0 ? getCurvePoints(r.left + S + E, r.top + k + _, Math.max(0, n - (S + E)), Math.max(0, o - (k + _)), CORNER.TOP_LEFT) : new Vector(r.left + S + E,r.top + k + _),
        this.topRightContentBox = i > 0 || s > 0 ? getCurvePoints(r.left + Math.min(y, r.width + S + E), r.top + k + _, y > r.width + S + E ? 0 : i - S + E, s - (k + _), CORNER.TOP_RIGHT) : new Vector(r.left + r.width - (w + C),r.top + k + _),
        this.bottomRightContentBox = u > 0 || h > 0 ? getCurvePoints(r.left + Math.min(A, r.width - (S + E)), r.top + Math.min(v, r.height + k + _), Math.max(0, u - (w + C)), h - (x + T), CORNER.BOTTOM_RIGHT) : new Vector(r.left + r.width - (w + C),r.top + r.height - (x + T)),
        this.bottomLeftContentBox = f > 0 || m > 0 ? getCurvePoints(r.left + S + E, r.top + b, Math.max(0, f - (S + E)), m - (x + T), CORNER.BOTTOM_LEFT) : new Vector(r.left + S + E,r.top + r.height - (x + T))
    }, CORNER;
    !function(e) {
        e[e.TOP_LEFT = 0] = "TOP_LEFT",
        e[e.TOP_RIGHT = 1] = "TOP_RIGHT",
        e[e.BOTTOM_RIGHT = 2] = "BOTTOM_RIGHT",
        e[e.BOTTOM_LEFT = 3] = "BOTTOM_LEFT"
    }(CORNER || (CORNER = {}));
    var getCurvePoints = function(e, t, r, a, n) {
        var o = (Math.sqrt(2) - 1) / 3 * 4
          , l = r * o
          , i = a * o
          , s = e + r
          , c = t + a;
        switch (n) {
        case CORNER.TOP_LEFT:
            return new BezierCurve(new Vector(e,c),new Vector(e,c - i),new Vector(s - l,t),new Vector(s,t));
        case CORNER.TOP_RIGHT:
            return new BezierCurve(new Vector(e,t),new Vector(e + l,t),new Vector(s,c - i),new Vector(s,c));
        case CORNER.BOTTOM_RIGHT:
            return new BezierCurve(new Vector(s,t),new Vector(s,t + i),new Vector(e + l,c),new Vector(e,c));
        case CORNER.BOTTOM_LEFT:
        default:
            return new BezierCurve(new Vector(s,c),new Vector(s - l,c),new Vector(e,t + i),new Vector(e,t))
        }
    }
      , calculateBorderBoxPath = function(e) {
        return [e.topLeftBorderBox, e.topRightBorderBox, e.bottomRightBorderBox, e.bottomLeftBorderBox]
    }
      , calculateContentBoxPath = function(e) {
        return [e.topLeftContentBox, e.topRightContentBox, e.bottomRightContentBox, e.bottomLeftContentBox]
    }
      , calculatePaddingBoxPath = function(e) {
        return [e.topLeftPaddingBox, e.topRightPaddingBox, e.bottomRightPaddingBox, e.bottomLeftPaddingBox]
    }
      , TransformEffect = function(e, t, r) {
        this.type = 0,
        this.offsetX = e,
        this.offsetY = t,
        this.matrix = r,
        this.target = 6
    }
      , ClipEffect = function(e, t) {
        this.type = 1,
        this.target = t,
        this.path = e
    }
      , isTransformEffect = function(e) {
        return 0 === e.type
    }
      , isClipEffect = function(e) {
        return 1 === e.type
    }
      , StackingContext = function(e) {
        this.element = e,
        this.inlineLevel = [],
        this.nonInlineLevel = [],
        this.negativeZIndex = [],
        this.zeroOrAutoZIndexOrTransformedOrOpacity = [],
        this.positiveZIndex = [],
        this.nonPositionedFloats = [],
        this.nonPositionedInlineLevel = []
    }
      , ElementPaint = function() {
        function e(e, t) {
            if (this.container = e,
            this.effects = t.slice(0),
            this.curves = new BoundCurves(e),
            null !== e.styles.transform) {
                var r = e.bounds.left + e.styles.transformOrigin[0].number
                  , a = e.bounds.top + e.styles.transformOrigin[1].number
                  , n = e.styles.transform;
                this.effects.push(new TransformEffect(r,a,n))
            }
            if (e.styles.overflowX !== OVERFLOW.VISIBLE) {
                var o = calculateBorderBoxPath(this.curves)
                  , l = calculatePaddingBoxPath(this.curves);
                equalPath(o, l) ? this.effects.push(new ClipEffect(o,6)) : (this.effects.push(new ClipEffect(o,2)),
                this.effects.push(new ClipEffect(l,4)))
            }
        }
        return e.prototype.getParentEffects = function() {
            var e = this.effects.slice(0);
            if (this.container.styles.overflowX !== OVERFLOW.VISIBLE) {
                var t = calculateBorderBoxPath(this.curves)
                  , r = calculatePaddingBoxPath(this.curves);
                equalPath(t, r) || e.push(new ClipEffect(r,6))
            }
            return e
        }
        ,
        e
    }()
      , parseStackTree = function(e, t, r, a) {
        e.container.elements.forEach((function(n) {
            var o = contains(n.flags, 4)
              , l = contains(n.flags, 2)
              , i = new ElementPaint(n,e.getParentEffects());
            contains(n.styles.display, 2048) && a.push(i);
            var s = contains(n.flags, 8) ? [] : a;
            if (o || l) {
                var c = o || n.styles.isPositioned() ? r : t
                  , u = new StackingContext(i);
                if (n.styles.isPositioned() || n.styles.opacity < 1 || n.styles.isTransformed()) {
                    var h = n.styles.zIndex.order;
                    if (h < 0) {
                        var d = 0;
                        c.negativeZIndex.some((function(e, t) {
                            return h > e.element.container.styles.zIndex.order ? (d = t,
                            !1) : d > 0
                        }
                        )),
                        c.negativeZIndex.splice(d, 0, u)
                    } else if (h > 0) {
                        var f = 0;
                        c.positiveZIndex.some((function(e, t) {
                            return h >= e.element.container.styles.zIndex.order ? (f = t + 1,
                            !1) : f > 0
                        }
                        )),
                        c.positiveZIndex.splice(f, 0, u)
                    } else
                        c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)
                } else
                    n.styles.isFloating() ? c.nonPositionedFloats.push(u) : c.nonPositionedInlineLevel.push(u);
                parseStackTree(i, u, o ? u : r, s)
            } else
                n.styles.isInlineLevel() ? t.inlineLevel.push(i) : t.nonInlineLevel.push(i),
                parseStackTree(i, t, r, s);
            contains(n.flags, 8) && processListItems(n, s)
        }
        ))
    }
      , processListItems = function(e, t) {
        for (var r = e instanceof OLElementContainer ? e.start : 1, a = e instanceof OLElementContainer && e.reversed, n = 0; n < t.length; n++) {
            var o = t[n];
            o.container instanceof LIElementContainer && "number" == typeof o.container.value && 0 !== o.container.value && (r = o.container.value),
            o.listValue = createCounterText(r, o.container.styles.listStyleType, !0),
            r += a ? -1 : 1
        }
    }
      , parseStackingContexts = function(e) {
        var t = new ElementPaint(e,[])
          , r = new StackingContext(t)
          , a = [];
        return parseStackTree(t, r, r, a),
        processListItems(t.container, a),
        r
    }
      , parsePathForBorder = function(e, t) {
        switch (t) {
        case 0:
            return createPathFromCurves(e.topLeftBorderBox, e.topLeftPaddingBox, e.topRightBorderBox, e.topRightPaddingBox);
        case 1:
            return createPathFromCurves(e.topRightBorderBox, e.topRightPaddingBox, e.bottomRightBorderBox, e.bottomRightPaddingBox);
        case 2:
            return createPathFromCurves(e.bottomRightBorderBox, e.bottomRightPaddingBox, e.bottomLeftBorderBox, e.bottomLeftPaddingBox);
        case 3:
        default:
            return createPathFromCurves(e.bottomLeftBorderBox, e.bottomLeftPaddingBox, e.topLeftBorderBox, e.topLeftPaddingBox)
        }
    }
      , createPathFromCurves = function(e, t, r, a) {
        var n = [];
        return isBezierCurve(e) ? n.push(e.subdivide(.5, !1)) : n.push(e),
        isBezierCurve(r) ? n.push(r.subdivide(.5, !0)) : n.push(r),
        isBezierCurve(a) ? n.push(a.subdivide(.5, !0).reverse()) : n.push(a),
        isBezierCurve(t) ? n.push(t.subdivide(.5, !1).reverse()) : n.push(t),
        n
    }
      , paddingBox = function(e) {
        var t = e.bounds
          , r = e.styles;
        return t.add(r.borderLeftWidth, r.borderTopWidth, -(r.borderRightWidth + r.borderLeftWidth), -(r.borderTopWidth + r.borderBottomWidth))
    }
      , contentBox = function(e) {
        var t = e.styles
          , r = e.bounds
          , a = getAbsoluteValue(t.paddingLeft, r.width)
          , n = getAbsoluteValue(t.paddingRight, r.width)
          , o = getAbsoluteValue(t.paddingTop, r.width)
          , l = getAbsoluteValue(t.paddingBottom, r.width);
        return r.add(a + t.borderLeftWidth, o + t.borderTopWidth, -(t.borderRightWidth + t.borderLeftWidth + a + n), -(t.borderTopWidth + t.borderBottomWidth + o + l))
    }
      , calculateBackgroundPositioningArea = function(e, t) {
        return 0 === e ? t.bounds : 2 === e ? contentBox(t) : paddingBox(t)
    }
      , calculateBackgroundPaintingArea = function(e, t) {
        return e === BACKGROUND_CLIP.BORDER_BOX ? t.bounds : e === BACKGROUND_CLIP.CONTENT_BOX ? contentBox(t) : paddingBox(t)
    }
      , calculateBackgroundRendering = function(e, t, r) {
        var a = calculateBackgroundPositioningArea(getBackgroundValueForIndex(e.styles.backgroundOrigin, t), e)
          , n = calculateBackgroundPaintingArea(getBackgroundValueForIndex(e.styles.backgroundClip, t), e)
          , o = calculateBackgroundSize(getBackgroundValueForIndex(e.styles.backgroundSize, t), r, a)
          , l = o[0]
          , i = o[1]
          , s = getAbsoluteValueForTuple(getBackgroundValueForIndex(e.styles.backgroundPosition, t), a.width - l, a.height - i);
        return [calculateBackgroundRepeatPath(getBackgroundValueForIndex(e.styles.backgroundRepeat, t), s, o, a, n), Math.round(a.left + s[0]), Math.round(a.top + s[1]), l, i]
    }
      , isAuto = function(e) {
        return isIdentToken(e) && e.value === BACKGROUND_SIZE.AUTO
    }
      , hasIntrinsicValue = function(e) {
        return "number" == typeof e
    }
      , calculateBackgroundSize = function(e, t, r) {
        var a = t[0]
          , n = t[1]
          , o = t[2]
          , l = e[0]
          , i = e[1];
        if (isLengthPercentage(l) && i && isLengthPercentage(i))
            return [getAbsoluteValue(l, r.width), getAbsoluteValue(i, r.height)];
        var s = hasIntrinsicValue(o);
        if (isIdentToken(l) && (l.value === BACKGROUND_SIZE.CONTAIN || l.value === BACKGROUND_SIZE.COVER))
            return hasIntrinsicValue(o) ? r.width / r.height < o != (l.value === BACKGROUND_SIZE.COVER) ? [r.width, r.width / o] : [r.height * o, r.height] : [r.width, r.height];
        var c = hasIntrinsicValue(a)
          , u = hasIntrinsicValue(n)
          , h = c || u;
        if (isAuto(l) && (!i || isAuto(i)))
            return c && u ? [a, n] : s || h ? h && s ? [c ? a : n * o, u ? n : a / o] : [c ? a : r.width, u ? n : r.height] : [r.width, r.height];
        if (s) {
            var d = 0
              , f = 0;
            return isLengthPercentage(l) ? d = getAbsoluteValue(l, r.width) : isLengthPercentage(i) && (f = getAbsoluteValue(i, r.height)),
            isAuto(l) ? d = f * o : i && !isAuto(i) || (f = d / o),
            [d, f]
        }
        var m = null
          , p = null;
        if (isLengthPercentage(l) ? m = getAbsoluteValue(l, r.width) : i && isLengthPercentage(i) && (p = getAbsoluteValue(i, r.height)),
        null === m || i && !isAuto(i) || (p = c && u ? m / a * n : r.height),
        null !== p && isAuto(l) && (m = c && u ? p / n * a : r.width),
        null !== m && null !== p)
            return [m, p];
        throw new Error("Unable to calculate background-size for element")
    }
      , getBackgroundValueForIndex = function(e, t) {
        var r = e[t];
        return void 0 === r ? e[0] : r
    }
      , calculateBackgroundRepeatPath = function(e, t, r, a, n) {
        var o = t[0]
          , l = t[1]
          , i = r[0]
          , s = r[1];
        switch (e) {
        case BACKGROUND_REPEAT.REPEAT_X:
            return [new Vector(Math.round(a.left),Math.round(a.top + l)), new Vector(Math.round(a.left + a.width),Math.round(a.top + l)), new Vector(Math.round(a.left + a.width),Math.round(s + a.top + l)), new Vector(Math.round(a.left),Math.round(s + a.top + l))];
        case BACKGROUND_REPEAT.REPEAT_Y:
            return [new Vector(Math.round(a.left + o),Math.round(a.top)), new Vector(Math.round(a.left + o + i),Math.round(a.top)), new Vector(Math.round(a.left + o + i),Math.round(a.height + a.top)), new Vector(Math.round(a.left + o),Math.round(a.height + a.top))];
        case BACKGROUND_REPEAT.NO_REPEAT:
            return [new Vector(Math.round(a.left + o),Math.round(a.top + l)), new Vector(Math.round(a.left + o + i),Math.round(a.top + l)), new Vector(Math.round(a.left + o + i),Math.round(a.top + l + s)), new Vector(Math.round(a.left + o),Math.round(a.top + l + s))];
        default:
            return [new Vector(Math.round(n.left),Math.round(n.top)), new Vector(Math.round(n.left + n.width),Math.round(n.top)), new Vector(Math.round(n.left + n.width),Math.round(n.height + n.top)), new Vector(Math.round(n.left),Math.round(n.height + n.top))]
        }
    }
      , SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
      , SAMPLE_TEXT = "Hidden Text"
      , FontMetrics = function() {
        function e(e) {
            this._data = {},
            this._document = e
        }
        return e.prototype.parseMetrics = function(e, t) {
            var r = this._document.createElement("div")
              , a = this._document.createElement("img")
              , n = this._document.createElement("span")
              , o = this._document.body;
            r.style.visibility = "hidden",
            r.style.fontFamily = e,
            r.style.fontSize = t,
            r.style.margin = "0",
            r.style.padding = "0",
            o.appendChild(r),
            a.src = SMALL_IMAGE,
            a.width = 1,
            a.height = 1,
            a.style.margin = "0",
            a.style.padding = "0",
            a.style.verticalAlign = "baseline",
            n.style.fontFamily = e,
            n.style.fontSize = t,
            n.style.margin = "0",
            n.style.padding = "0",
            n.appendChild(this._document.createTextNode(SAMPLE_TEXT)),
            r.appendChild(n),
            r.appendChild(a);
            var l = a.offsetTop - n.offsetTop + 2;
            r.removeChild(n),
            r.appendChild(this._document.createTextNode(SAMPLE_TEXT)),
            r.style.lineHeight = "normal",
            a.style.verticalAlign = "super";
            var i = a.offsetTop - r.offsetTop + 2;
            return o.removeChild(r),
            {
                baseline: l,
                middle: i
            }
        }
        ,
        e.prototype.getMetrics = function(e, t) {
            var r = e + " " + t;
            return void 0 === this._data[r] && (this._data[r] = this.parseMetrics(e, t)),
            this._data[r]
        }
        ,
        e
    }()
      , MASK_OFFSET = 1e4
      , CanvasRenderer = function() {
        function e(e) {
            this._activeEffects = [],
            this.canvas = e.canvas ? e.canvas : document.createElement("canvas"),
            this.ctx = this.canvas.getContext("2d"),
            this.options = e,
            e.canvas || (this.canvas.width = Math.floor(e.width * e.scale),
            this.canvas.height = Math.floor(e.height * e.scale),
            this.canvas.style.width = e.width + "px",
            this.canvas.style.height = e.height + "px"),
            this.fontMetrics = new FontMetrics(document),
            this.ctx.scale(this.options.scale, this.options.scale),
            this.ctx.translate(-e.x + e.scrollX, -e.y + e.scrollY),
            this.ctx.textBaseline = "bottom",
            this._activeEffects = [],
            Logger.getInstance(e.id).debug("Canvas renderer initialized (" + e.width + "x" + e.height + " at " + e.x + "," + e.y + ") with scale " + e.scale)
        }
        return e.prototype.applyEffects = function(e, t) {
            for (var r = this; this._activeEffects.length; )
                this.popEffect();
            e.filter((function(e) {
                return contains(e.target, t)
            }
            )).forEach((function(e) {
                return r.applyEffect(e)
            }
            ))
        }
        ,
        e.prototype.applyEffect = function(e) {
            this.ctx.save(),
            isTransformEffect(e) && (this.ctx.translate(e.offsetX, e.offsetY),
            this.ctx.transform(e.matrix[0], e.matrix[1], e.matrix[2], e.matrix[3], e.matrix[4], e.matrix[5]),
            this.ctx.translate(-e.offsetX, -e.offsetY)),
            isClipEffect(e) && (this.path(e.path),
            this.ctx.clip()),
            this._activeEffects.push(e)
        }
        ,
        e.prototype.popEffect = function() {
            this._activeEffects.pop(),
            this.ctx.restore()
        }
        ,
        e.prototype.renderStack = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t;
                return __generator(this, (function(r) {
                    switch (r.label) {
                    case 0:
                        return (t = e.element.container.styles).isVisible() ? (this.ctx.globalAlpha = t.opacity,
                        [4, this.renderStackContent(e)]) : [3, 2];
                    case 1:
                        r.sent(),
                        r.label = 2;
                    case 2:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderNode = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                return __generator(this, (function(t) {
                    switch (t.label) {
                    case 0:
                        return e.container.styles.isVisible() ? [4, this.renderNodeBackgroundAndBorders(e)] : [3, 3];
                    case 1:
                        return t.sent(),
                        [4, this.renderNodeContent(e)];
                    case 2:
                        t.sent(),
                        t.label = 3;
                    case 3:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderTextWithLetterSpacing = function(e, t) {
            var r = this;
            0 === t ? this.ctx.fillText(e.text, e.bounds.left, e.bounds.top + e.bounds.height) : toCodePoints(e.text).map((function(e) {
                return fromCodePoint(e)
            }
            )).reduce((function(t, a) {
                return r.ctx.fillText(a, t, e.bounds.top + e.bounds.height),
                t + r.ctx.measureText(a).width
            }
            ), e.bounds.left)
        }
        ,
        e.prototype.createFontStyle = function(e) {
            var t = e.fontVariant.filter((function(e) {
                return "normal" === e || "small-caps" === e
            }
            )).join("")
              , r = e.fontFamily.join(", ")
              , a = isDimensionToken(e.fontSize) ? "" + e.fontSize.number + e.fontSize.unit : e.fontSize.number + "px";
            return [[e.fontStyle, t, e.fontWeight, a, r].join(" "), r, a]
        }
        ,
        e.prototype.renderTextNode = function(e, t) {
            return __awaiter(this, void 0, void 0, (function() {
                var r, a, n, o, l = this;
                return __generator(this, (function(i) {
                    return r = this.createFontStyle(t),
                    a = r[0],
                    n = r[1],
                    o = r[2],
                    this.ctx.font = a,
                    e.textBounds.forEach((function(e) {
                        l.ctx.fillStyle = asString(t.color),
                        l.renderTextWithLetterSpacing(e, t.letterSpacing);
                        var r = t.textShadow;
                        r.length && e.text.trim().length && (r.slice(0).reverse().forEach((function(t) {
                            l.ctx.shadowColor = asString(t.color),
                            l.ctx.shadowOffsetX = t.offsetX.number * l.options.scale,
                            l.ctx.shadowOffsetY = t.offsetY.number * l.options.scale,
                            l.ctx.shadowBlur = t.blur.number,
                            l.ctx.fillText(e.text, e.bounds.left, e.bounds.top + e.bounds.height)
                        }
                        )),
                        l.ctx.shadowColor = "",
                        l.ctx.shadowOffsetX = 0,
                        l.ctx.shadowOffsetY = 0,
                        l.ctx.shadowBlur = 0),
                        t.textDecorationLine.length && (l.ctx.fillStyle = asString(t.textDecorationColor || t.color),
                        t.textDecorationLine.forEach((function(t) {
                            switch (t) {
                            case 1:
                                var r = l.fontMetrics.getMetrics(n, o).baseline;
                                l.ctx.fillRect(e.bounds.left, Math.round(e.bounds.top + r), e.bounds.width, 1);
                                break;
                            case 2:
                                l.ctx.fillRect(e.bounds.left, Math.round(e.bounds.top), e.bounds.width, 1);
                                break;
                            case 3:
                                var a = l.fontMetrics.getMetrics(n, o).middle;
                                l.ctx.fillRect(e.bounds.left, Math.ceil(e.bounds.top + a), e.bounds.width, 1)
                            }
                        }
                        )))
                    }
                    )),
                    [2]
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderReplacedElement = function(e, t, r) {
            if (r && e.intrinsicWidth > 0 && e.intrinsicHeight > 0) {
                var a = contentBox(e)
                  , n = calculatePaddingBoxPath(t);
                this.path(n),
                this.ctx.save(),
                this.ctx.clip(),
                this.ctx.drawImage(r, 0, 0, e.intrinsicWidth, e.intrinsicHeight, a.left, a.top, a.width, a.height),
                this.ctx.restore()
            }
        }
        ,
        e.prototype.renderNodeContent = function(t) {
            return __awaiter(this, void 0, void 0, (function() {
                var r, a, n, o, l, i, s, c, u, h, d, f, m, p;
                return __generator(this, (function(g) {
                    switch (g.label) {
                    case 0:
                        this.applyEffects(t.effects, 4),
                        r = t.container,
                        a = t.curves,
                        n = r.styles,
                        o = 0,
                        l = r.textNodes,
                        g.label = 1;
                    case 1:
                        return o < l.length ? (i = l[o],
                        [4, this.renderTextNode(i, n)]) : [3, 4];
                    case 2:
                        g.sent(),
                        g.label = 3;
                    case 3:
                        return o++,
                        [3, 1];
                    case 4:
                        if (!(r instanceof ImageElementContainer))
                            return [3, 8];
                        g.label = 5;
                    case 5:
                        return g.trys.push([5, 7, , 8]),
                        [4, this.options.cache.match(r.src)];
                    case 6:
                        return f = g.sent(),
                        this.renderReplacedElement(r, a, f),
                        [3, 8];
                    case 7:
                        return g.sent(),
                        Logger.getInstance(this.options.id).error("Error loading image " + r.src),
                        [3, 8];
                    case 8:
                        if (r instanceof CanvasElementContainer && this.renderReplacedElement(r, a, r.canvas),
                        !(r instanceof SVGElementContainer))
                            return [3, 12];
                        g.label = 9;
                    case 9:
                        return g.trys.push([9, 11, , 12]),
                        [4, this.options.cache.match(r.svg)];
                    case 10:
                        return f = g.sent(),
                        this.renderReplacedElement(r, a, f),
                        [3, 12];
                    case 11:
                        return g.sent(),
                        Logger.getInstance(this.options.id).error("Error loading svg " + r.svg.substring(0, 255)),
                        [3, 12];
                    case 12:
                        return r instanceof IFrameElementContainer && r.tree ? [4, new e({
                            id: this.options.id,
                            scale: this.options.scale,
                            backgroundColor: r.backgroundColor,
                            x: 0,
                            y: 0,
                            scrollX: 0,
                            scrollY: 0,
                            width: r.width,
                            height: r.height,
                            cache: this.options.cache,
                            windowWidth: r.width,
                            windowHeight: r.height
                        }).render(r.tree)] : [3, 14];
                    case 13:
                        s = g.sent(),
                        r.width && r.height && this.ctx.drawImage(s, 0, 0, r.width, r.height, r.bounds.left, r.bounds.top, r.bounds.width, r.bounds.height),
                        g.label = 14;
                    case 14:
                        if (r instanceof InputElementContainer && (c = Math.min(r.bounds.width, r.bounds.height),
                        r.type === CHECKBOX ? r.checked && (this.ctx.save(),
                        this.path([new Vector(r.bounds.left + .39363 * c,r.bounds.top + .79 * c), new Vector(r.bounds.left + .16 * c,r.bounds.top + .5549 * c), new Vector(r.bounds.left + .27347 * c,r.bounds.top + .44071 * c), new Vector(r.bounds.left + .39694 * c,r.bounds.top + .5649 * c), new Vector(r.bounds.left + .72983 * c,r.bounds.top + .23 * c), new Vector(r.bounds.left + .84 * c,r.bounds.top + .34085 * c), new Vector(r.bounds.left + .39363 * c,r.bounds.top + .79 * c)]),
                        this.ctx.fillStyle = asString(INPUT_COLOR),
                        this.ctx.fill(),
                        this.ctx.restore()) : r.type === RADIO && r.checked && (this.ctx.save(),
                        this.ctx.beginPath(),
                        this.ctx.arc(r.bounds.left + c / 2, r.bounds.top + c / 2, c / 4, 0, 2 * Math.PI, !0),
                        this.ctx.fillStyle = asString(INPUT_COLOR),
                        this.ctx.fill(),
                        this.ctx.restore())),
                        isTextInputElement(r) && r.value.length) {
                            switch (this.ctx.font = this.createFontStyle(n)[0],
                            this.ctx.fillStyle = asString(n.color),
                            this.ctx.textBaseline = "middle",
                            this.ctx.textAlign = canvasTextAlign(r.styles.textAlign),
                            p = contentBox(r),
                            u = 0,
                            r.styles.textAlign) {
                            case TEXT_ALIGN.CENTER:
                                u += p.width / 2;
                                break;
                            case TEXT_ALIGN.RIGHT:
                                u += p.width
                            }
                            h = p.add(u, 0, 0, -p.height / 2 + 1),
                            this.ctx.save(),
                            this.path([new Vector(p.left,p.top), new Vector(p.left + p.width,p.top), new Vector(p.left + p.width,p.top + p.height), new Vector(p.left,p.top + p.height)]),
                            this.ctx.clip(),
                            this.renderTextWithLetterSpacing(new TextBounds(r.value,h), n.letterSpacing),
                            this.ctx.restore(),
                            this.ctx.textBaseline = "bottom",
                            this.ctx.textAlign = "left"
                        }
                        if (!contains(r.styles.display, 2048))
                            return [3, 20];
                        if (null === r.styles.listStyleImage)
                            return [3, 19];
                        if ((d = r.styles.listStyleImage).type !== CSSImageType.URL)
                            return [3, 18];
                        f = void 0,
                        m = d.url,
                        g.label = 15;
                    case 15:
                        return g.trys.push([15, 17, , 18]),
                        [4, this.options.cache.match(m)];
                    case 16:
                        return f = g.sent(),
                        this.ctx.drawImage(f, r.bounds.left - (f.width + 10), r.bounds.top),
                        [3, 18];
                    case 17:
                        return g.sent(),
                        Logger.getInstance(this.options.id).error("Error loading list-style-image " + m),
                        [3, 18];
                    case 18:
                        return [3, 20];
                    case 19:
                        t.listValue && r.styles.listStyleType !== LIST_STYLE_TYPE.NONE && (this.ctx.font = this.createFontStyle(n)[0],
                        this.ctx.fillStyle = asString(n.color),
                        this.ctx.textBaseline = "middle",
                        this.ctx.textAlign = "right",
                        p = new Bounds(r.bounds.left,r.bounds.top + getAbsoluteValue(r.styles.paddingTop, r.bounds.width),r.bounds.width,computeLineHeight(n.lineHeight, n.fontSize.number) / 2 + 1),
                        this.renderTextWithLetterSpacing(new TextBounds(t.listValue,p), n.letterSpacing),
                        this.ctx.textBaseline = "bottom",
                        this.ctx.textAlign = "left"),
                        g.label = 20;
                    case 20:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderStackContent = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t, r, a, n, o, l, i, s, c, u, h, d, f, m, p;
                return __generator(this, (function(g) {
                    switch (g.label) {
                    case 0:
                        return [4, this.renderNodeBackgroundAndBorders(e.element)];
                    case 1:
                        g.sent(),
                        t = 0,
                        r = e.negativeZIndex,
                        g.label = 2;
                    case 2:
                        return t < r.length ? (p = r[t],
                        [4, this.renderStack(p)]) : [3, 5];
                    case 3:
                        g.sent(),
                        g.label = 4;
                    case 4:
                        return t++,
                        [3, 2];
                    case 5:
                        return [4, this.renderNodeContent(e.element)];
                    case 6:
                        g.sent(),
                        a = 0,
                        n = e.nonInlineLevel,
                        g.label = 7;
                    case 7:
                        return a < n.length ? (p = n[a],
                        [4, this.renderNode(p)]) : [3, 10];
                    case 8:
                        g.sent(),
                        g.label = 9;
                    case 9:
                        return a++,
                        [3, 7];
                    case 10:
                        o = 0,
                        l = e.nonPositionedFloats,
                        g.label = 11;
                    case 11:
                        return o < l.length ? (p = l[o],
                        [4, this.renderStack(p)]) : [3, 14];
                    case 12:
                        g.sent(),
                        g.label = 13;
                    case 13:
                        return o++,
                        [3, 11];
                    case 14:
                        i = 0,
                        s = e.nonPositionedInlineLevel,
                        g.label = 15;
                    case 15:
                        return i < s.length ? (p = s[i],
                        [4, this.renderStack(p)]) : [3, 18];
                    case 16:
                        g.sent(),
                        g.label = 17;
                    case 17:
                        return i++,
                        [3, 15];
                    case 18:
                        c = 0,
                        u = e.inlineLevel,
                        g.label = 19;
                    case 19:
                        return c < u.length ? (p = u[c],
                        [4, this.renderNode(p)]) : [3, 22];
                    case 20:
                        g.sent(),
                        g.label = 21;
                    case 21:
                        return c++,
                        [3, 19];
                    case 22:
                        h = 0,
                        d = e.zeroOrAutoZIndexOrTransformedOrOpacity,
                        g.label = 23;
                    case 23:
                        return h < d.length ? (p = d[h],
                        [4, this.renderStack(p)]) : [3, 26];
                    case 24:
                        g.sent(),
                        g.label = 25;
                    case 25:
                        return h++,
                        [3, 23];
                    case 26:
                        f = 0,
                        m = e.positiveZIndex,
                        g.label = 27;
                    case 27:
                        return f < m.length ? (p = m[f],
                        [4, this.renderStack(p)]) : [3, 30];
                    case 28:
                        g.sent(),
                        g.label = 29;
                    case 29:
                        return f++,
                        [3, 27];
                    case 30:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.mask = function(e) {
            this.ctx.beginPath(),
            this.ctx.moveTo(0, 0),
            this.ctx.lineTo(this.canvas.width, 0),
            this.ctx.lineTo(this.canvas.width, this.canvas.height),
            this.ctx.lineTo(0, this.canvas.height),
            this.ctx.lineTo(0, 0),
            this.formatPath(e.slice(0).reverse()),
            this.ctx.closePath()
        }
        ,
        e.prototype.path = function(e) {
            this.ctx.beginPath(),
            this.formatPath(e),
            this.ctx.closePath()
        }
        ,
        e.prototype.formatPath = function(e) {
            var t = this;
            e.forEach((function(e, r) {
                var a = isBezierCurve(e) ? e.start : e;
                0 === r ? t.ctx.moveTo(a.x, a.y) : t.ctx.lineTo(a.x, a.y),
                isBezierCurve(e) && t.ctx.bezierCurveTo(e.startControl.x, e.startControl.y, e.endControl.x, e.endControl.y, e.end.x, e.end.y)
            }
            ))
        }
        ,
        e.prototype.renderRepeat = function(e, t, r, a) {
            this.path(e),
            this.ctx.fillStyle = t,
            this.ctx.translate(r, a),
            this.ctx.fill(),
            this.ctx.translate(-r, -a)
        }
        ,
        e.prototype.resizeImage = function(e, t, r) {
            if (e.width === t && e.height === r)
                return e;
            var a = this.canvas.ownerDocument.createElement("canvas");
            return a.width = t,
            a.height = r,
            a.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, t, r),
            a
        }
        ,
        e.prototype.renderBackgroundImage = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t, r, a, n, o, l;
                return __generator(this, (function(i) {
                    switch (i.label) {
                    case 0:
                        t = e.styles.backgroundImage.length - 1,
                        r = function(r) {
                            var n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S, _, C, T, E, I, R, B, N, F, P;
                            return __generator(this, (function($) {
                                switch ($.label) {
                                case 0:
                                    if (r.type !== CSSImageType.URL)
                                        return [3, 5];
                                    n = void 0,
                                    o = r.url,
                                    $.label = 1;
                                case 1:
                                    return $.trys.push([1, 3, , 4]),
                                    [4, a.options.cache.match(o)];
                                case 2:
                                    return n = $.sent(),
                                    [3, 4];
                                case 3:
                                    return $.sent(),
                                    Logger.getInstance(a.options.id).error("Error loading background-image " + o),
                                    [3, 4];
                                case 4:
                                    return n && (l = calculateBackgroundRendering(e, t, [n.width, n.height, n.width / n.height]),
                                    A = l[0],
                                    _ = l[1],
                                    C = l[2],
                                    w = l[3],
                                    x = l[4],
                                    y = a.ctx.createPattern(a.resizeImage(n, w, x), "repeat"),
                                    a.renderRepeat(A, y, _, C)),
                                    [3, 6];
                                case 5:
                                    isLinearGradient(r) ? (i = calculateBackgroundRendering(e, t, [null, null, null]),
                                    A = i[0],
                                    _ = i[1],
                                    C = i[2],
                                    w = i[3],
                                    x = i[4],
                                    s = calculateGradientDirection(r.angle, w, x),
                                    c = s[0],
                                    u = s[1],
                                    h = s[2],
                                    d = s[3],
                                    f = s[4],
                                    (m = document.createElement("canvas")).width = w,
                                    m.height = x,
                                    p = m.getContext("2d"),
                                    g = p.createLinearGradient(u, d, h, f),
                                    processColorStops(r.stops, c).forEach((function(e) {
                                        return g.addColorStop(e.stop, asString(e.color))
                                    }
                                    )),
                                    p.fillStyle = g,
                                    p.fillRect(0, 0, w, x),
                                    w > 0 && x > 0 && (y = a.ctx.createPattern(m, "repeat"),
                                    a.renderRepeat(A, y, _, C))) : isRadialGradient(r) && (v = calculateBackgroundRendering(e, t, [null, null, null]),
                                    A = v[0],
                                    b = v[1],
                                    k = v[2],
                                    w = v[3],
                                    x = v[4],
                                    S = 0 === r.position.length ? [FIFTY_PERCENT] : r.position,
                                    _ = getAbsoluteValue(S[0], w),
                                    C = getAbsoluteValue(S[S.length - 1], x),
                                    T = calculateRadius(r, _, C, w, x),
                                    E = T[0],
                                    I = T[1],
                                    E > 0 && E > 0 && (R = a.ctx.createRadialGradient(b + _, k + C, 0, b + _, k + C, E),
                                    processColorStops(r.stops, 2 * E).forEach((function(e) {
                                        return R.addColorStop(e.stop, asString(e.color))
                                    }
                                    )),
                                    a.path(A),
                                    a.ctx.fillStyle = R,
                                    E !== I ? (B = e.bounds.left + .5 * e.bounds.width,
                                    N = e.bounds.top + .5 * e.bounds.height,
                                    P = 1 / (F = I / E),
                                    a.ctx.save(),
                                    a.ctx.translate(B, N),
                                    a.ctx.transform(1, 0, 0, F, 0, 0),
                                    a.ctx.translate(-B, -N),
                                    a.ctx.fillRect(b, P * (k - N) + N, w, x * P),
                                    a.ctx.restore()) : a.ctx.fill())),
                                    $.label = 6;
                                case 6:
                                    return t--,
                                    [2]
                                }
                            }
                            ))
                        }
                        ,
                        a = this,
                        n = 0,
                        o = e.styles.backgroundImage.slice(0).reverse(),
                        i.label = 1;
                    case 1:
                        return n < o.length ? (l = o[n],
                        [5, r(l)]) : [3, 4];
                    case 2:
                        i.sent(),
                        i.label = 3;
                    case 3:
                        return n++,
                        [3, 1];
                    case 4:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderBorder = function(e, t, r) {
            return __awaiter(this, void 0, void 0, (function() {
                return __generator(this, (function(a) {
                    return this.path(parsePathForBorder(r, t)),
                    this.ctx.fillStyle = asString(e),
                    this.ctx.fill(),
                    [2]
                }
                ))
            }
            ))
        }
        ,
        e.prototype.renderNodeBackgroundAndBorders = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t, r, a, n, o, l, i, s, c = this;
                return __generator(this, (function(u) {
                    switch (u.label) {
                    case 0:
                        return this.applyEffects(e.effects, 2),
                        t = e.container.styles,
                        r = !isTransparent(t.backgroundColor) || t.backgroundImage.length,
                        a = [{
                            style: t.borderTopStyle,
                            color: t.borderTopColor
                        }, {
                            style: t.borderRightStyle,
                            color: t.borderRightColor
                        }, {
                            style: t.borderBottomStyle,
                            color: t.borderBottomColor
                        }, {
                            style: t.borderLeftStyle,
                            color: t.borderLeftColor
                        }],
                        n = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(t.backgroundClip, 0), e.curves),
                        r || t.boxShadow.length ? (this.ctx.save(),
                        this.path(n),
                        this.ctx.clip(),
                        isTransparent(t.backgroundColor) || (this.ctx.fillStyle = asString(t.backgroundColor),
                        this.ctx.fill()),
                        [4, this.renderBackgroundImage(e.container)]) : [3, 2];
                    case 1:
                        u.sent(),
                        this.ctx.restore(),
                        t.boxShadow.slice(0).reverse().forEach((function(t) {
                            c.ctx.save();
                            var r = calculateBorderBoxPath(e.curves)
                              , a = t.inset ? 0 : MASK_OFFSET
                              , n = transformPath(r, -a + (t.inset ? 1 : -1) * t.spread.number, (t.inset ? 1 : -1) * t.spread.number, t.spread.number * (t.inset ? -2 : 2), t.spread.number * (t.inset ? -2 : 2));
                            t.inset ? (c.path(r),
                            c.ctx.clip(),
                            c.mask(n)) : (c.mask(r),
                            c.ctx.clip(),
                            c.path(n)),
                            c.ctx.shadowOffsetX = t.offsetX.number + a,
                            c.ctx.shadowOffsetY = t.offsetY.number,
                            c.ctx.shadowColor = asString(t.color),
                            c.ctx.shadowBlur = t.blur.number,
                            c.ctx.fillStyle = t.inset ? asString(t.color) : "rgba(0,0,0,1)",
                            c.ctx.fill(),
                            c.ctx.restore()
                        }
                        )),
                        u.label = 2;
                    case 2:
                        o = 0,
                        l = 0,
                        i = a,
                        u.label = 3;
                    case 3:
                        return l < i.length ? (s = i[l]).style === BORDER_STYLE.NONE || isTransparent(s.color) ? [3, 5] : [4, this.renderBorder(s.color, o, e.curves)] : [3, 7];
                    case 4:
                        u.sent(),
                        u.label = 5;
                    case 5:
                        o++,
                        u.label = 6;
                    case 6:
                        return l++,
                        [3, 3];
                    case 7:
                        return [2]
                    }
                }
                ))
            }
            ))
        }
        ,
        e.prototype.render = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t;
                return __generator(this, (function(r) {
                    switch (r.label) {
                    case 0:
                        return this.options.backgroundColor && (this.ctx.fillStyle = asString(this.options.backgroundColor),
                        this.ctx.fillRect(this.options.x - this.options.scrollX, this.options.y - this.options.scrollY, this.options.width, this.options.height)),
                        t = parseStackingContexts(e),
                        [4, this.renderStack(t)];
                    case 1:
                        return r.sent(),
                        this.applyEffects([], 2),
                        [2, this.canvas]
                    }
                }
                ))
            }
            ))
        }
        ,
        e
    }()
      , isTextInputElement = function(e) {
        return e instanceof TextareaElementContainer || (e instanceof SelectElementContainer || e instanceof InputElementContainer && e.type !== RADIO && e.type !== CHECKBOX)
    }
      , calculateBackgroundCurvedPaintingArea = function(e, t) {
        switch (e) {
        case BACKGROUND_CLIP.BORDER_BOX:
            return calculateBorderBoxPath(t);
        case BACKGROUND_CLIP.CONTENT_BOX:
            return calculateContentBoxPath(t);
        case BACKGROUND_CLIP.PADDING_BOX:
        default:
            return calculatePaddingBoxPath(t)
        }
    }
      , canvasTextAlign = function(e) {
        switch (e) {
        case TEXT_ALIGN.CENTER:
            return "center";
        case TEXT_ALIGN.RIGHT:
            return "right";
        case TEXT_ALIGN.LEFT:
        default:
            return "left"
        }
    }
      , ForeignObjectRenderer = function() {
        function e(e) {
            this.canvas = e.canvas ? e.canvas : document.createElement("canvas"),
            this.ctx = this.canvas.getContext("2d"),
            this.options = e,
            this.canvas.width = Math.floor(e.width * e.scale),
            this.canvas.height = Math.floor(e.height * e.scale),
            this.canvas.style.width = e.width + "px",
            this.canvas.style.height = e.height + "px",
            this.ctx.scale(this.options.scale, this.options.scale),
            this.ctx.translate(-e.x + e.scrollX, -e.y + e.scrollY),
            Logger.getInstance(e.id).debug("EXPERIMENTAL ForeignObject renderer initialized (" + e.width + "x" + e.height + " at " + e.x + "," + e.y + ") with scale " + e.scale)
        }
        return e.prototype.render = function(e) {
            return __awaiter(this, void 0, void 0, (function() {
                var t, r;
                return __generator(this, (function(a) {
                    switch (a.label) {
                    case 0:
                        return t = createForeignObjectSVG(Math.max(this.options.windowWidth, this.options.width) * this.options.scale, Math.max(this.options.windowHeight, this.options.height) * this.options.scale, this.options.scrollX * this.options.scale, this.options.scrollY * this.options.scale, e),
                        [4, loadSerializedSVG$1(t)];
                    case 1:
                        return r = a.sent(),
                        this.options.backgroundColor && (this.ctx.fillStyle = asString(this.options.backgroundColor),
                        this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale)),
                        this.ctx.drawImage(r, -this.options.x * this.options.scale, -this.options.y * this.options.scale),
                        [2, this.canvas]
                    }
                }
                ))
            }
            ))
        }
        ,
        e
    }()
      , loadSerializedSVG$1 = function(e) {
        return new Promise((function(t, r) {
            var a = new Image;
            a.onload = function() {
                t(a)
            }
            ,
            a.onerror = r,
            a.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent((new XMLSerializer).serializeToString(e))
        }
        ))
    }
      , _this = void 0
      , parseColor$1 = function(e) {
        return color.parse(Parser.create(e).parseComponentValue())
    }
      , html2canvas$1 = function(e, t) {
        return void 0 === t && (t = {}),
        renderElement(e, t)
    };
    "undefined" != typeof window && CacheStorage.setContext(window);
    var renderElement = function(e, t) {
        return __awaiter(_this, void 0, void 0, (function() {
            var r, a, n, o, l, i, s, c, u, h, d, f, m, p, g, y, v, A, b, k, w, x, S;
            return __generator(this, (function(_) {
                switch (_.label) {
                case 0:
                    if (!(r = e.ownerDocument))
                        throw new Error("Element is not attached to a Document");
                    if (!(a = r.defaultView))
                        throw new Error("Document is not attached to a Window");
                    return n = (Math.round(1e3 * Math.random()) + Date.now()).toString(16),
                    o = isBodyElement(e) || isHTMLElement(e) ? parseDocumentSize(r) : parseBounds(e),
                    l = o.width,
                    i = o.height,
                    s = o.left,
                    c = o.top,
                    u = __assign({}, {
                        allowTaint: !1,
                        imageTimeout: 15e3,
                        proxy: void 0,
                        useCORS: !1
                    }, t),
                    h = {
                        backgroundColor: "#ffffff",
                        cache: t.cache ? t.cache : CacheStorage.create(n, u),
                        logging: !0,
                        removeContainer: !0,
                        foreignObjectRendering: !1,
                        scale: a.devicePixelRatio || 1,
                        windowWidth: a.innerWidth,
                        windowHeight: a.innerHeight,
                        scrollX: a.pageXOffset,
                        scrollY: a.pageYOffset,
                        x: s,
                        y: c,
                        width: Math.ceil(l),
                        height: Math.ceil(i),
                        id: n
                    },
                    d = __assign({}, h, u, t),
                    f = new Bounds(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),
                    Logger.create({
                        id: n,
                        enabled: d.logging
                    }),
                    Logger.getInstance(n).debug("Starting document clone"),
                    m = new DocumentCloner(e,{
                        id: n,
                        onclone: d.onclone,
                        ignoreElements: d.ignoreElements,
                        inlineImages: d.foreignObjectRendering,
                        copyStyles: d.foreignObjectRendering
                    }),
                    (p = m.clonedReferenceElement) ? [4, m.toIFrame(r, f)] : [2, Promise.reject("Unable to find element in cloned iframe")];
                case 1:
                    return g = _.sent(),
                    y = r.documentElement ? parseColor$1(getComputedStyle(r.documentElement).backgroundColor) : COLORS.TRANSPARENT,
                    v = r.body ? parseColor$1(getComputedStyle(r.body).backgroundColor) : COLORS.TRANSPARENT,
                    A = t.backgroundColor,
                    b = "string" == typeof A ? parseColor$1(A) : null === A ? COLORS.TRANSPARENT : 4294967295,
                    k = e === r.documentElement ? isTransparent(y) ? isTransparent(v) ? b : v : y : b,
                    w = {
                        id: n,
                        cache: d.cache,
                        canvas: d.canvas,
                        backgroundColor: k,
                        scale: d.scale,
                        x: d.x,
                        y: d.y,
                        scrollX: d.scrollX,
                        scrollY: d.scrollY,
                        width: d.width,
                        height: d.height,
                        windowWidth: d.windowWidth,
                        windowHeight: d.windowHeight
                    },
                    d.foreignObjectRendering ? (Logger.getInstance(n).debug("Document cloned, using foreign object rendering"),
                    [4, new ForeignObjectRenderer(w).render(p)]) : [3, 3];
                case 2:
                    return x = _.sent(),
                    [3, 5];
                case 3:
                    return Logger.getInstance(n).debug("Document cloned, using computed rendering"),
                    CacheStorage.attachInstance(d.cache),
                    Logger.getInstance(n).debug("Starting DOM parsing"),
                    S = parseTree(p),
                    CacheStorage.detachInstance(),
                    k === S.styles.backgroundColor && (S.styles.backgroundColor = COLORS.TRANSPARENT),
                    Logger.getInstance(n).debug("Starting renderer"),
                    [4, new CanvasRenderer(w).render(S)];
                case 4:
                    x = _.sent(),
                    _.label = 5;
                case 5:
                    return !0 === d.removeContainer && (DocumentCloner.destroy(g) || Logger.getInstance(n).error("Cannot detach cloned iframe as it is not in the DOM anymore")),
                    Logger.getInstance(n).debug("Finished rendering"),
                    Logger.destroy(n),
                    CacheStorage.destroy(n),
                    [2, x]
                }
            }
            ))
        }
        ))
    }
      , html2canvas_esm = Object.freeze({
        __proto__: null,
        default: html2canvas$1
    });
    /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */
    function _toConsumableArray(e) {
        if (Array.isArray(e)) {
            for (var t = 0, r = Array(e.length); t < e.length; t++)
                r[t] = e[t];
            return r
        }
        return Array.from(e)
    }
    var hasOwnProperty$1 = Object.hasOwnProperty
      , setPrototypeOf = Object.setPrototypeOf
      , isFrozen = Object.isFrozen
      , freeze = Object.freeze
      , seal = Object.seal
      , create = Object.create
      , _ref = "undefined" != typeof Reflect && Reflect
      , apply = _ref.apply
      , construct = _ref.construct;
    apply || (apply = function(e, t, r) {
        return e.apply(t, r)
    }
    ),
    freeze || (freeze = function(e) {
        return e
    }
    ),
    seal || (seal = function(e) {
        return e
    }
    ),
    construct || (construct = function(e, t) {
        return new (Function.prototype.bind.apply(e, [null].concat(_toConsumableArray(t))))
    }
    );
    var arrayForEach$1 = unapply(Array.prototype.forEach)
      , arrayPop = unapply(Array.prototype.pop)
      , arrayPush$1 = unapply(Array.prototype.push)
      , stringToLowerCase = unapply(String.prototype.toLowerCase)
      , stringMatch = unapply(String.prototype.match)
      , stringReplace = unapply(String.prototype.replace)
      , stringIndexOf = unapply(String.prototype.indexOf)
      , stringTrim$1 = unapply(String.prototype.trim)
      , regExpTest = unapply(RegExp.prototype.test)
      , typeErrorCreate = unconstruct(TypeError);
    function unapply(e) {
        return function(t) {
            for (var r = arguments.length, a = Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
                a[n - 1] = arguments[n];
            return apply(e, t, a)
        }
    }
    function unconstruct(e) {
        return function() {
            for (var t = arguments.length, r = Array(t), a = 0; a < t; a++)
                r[a] = arguments[a];
            return construct(e, r)
        }
    }
    function addToSet(e, t) {
        setPrototypeOf && setPrototypeOf(e, null);
        for (var r = t.length; r--; ) {
            var a = t[r];
            if ("string" == typeof a) {
                var n = stringToLowerCase(a);
                n !== a && (isFrozen(t) || (t[r] = n),
                a = n)
            }
            e[a] = !0
        }
        return e
    }
    function clone(e) {
        var t = create(null)
          , r = void 0;
        for (r in e)
            apply(hasOwnProperty$1, e, [r]) && (t[r] = e[r]);
        return t
    }
    var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"])
      , svg = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "audio", "canvas", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "video", "view", "vkern"])
      , svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"])
      , mathMl = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"])
      , text = freeze(["#text"])
      , html$1$1 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns"])
      , svg$1 = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"])
      , mathMl$1 = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"])
      , xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"])
      , MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm)
      , ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm)
      , DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/)
      , ARIA_ATTR = seal(/^aria-[\-\w]+$/)
      , IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i)
      , IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i)
      , ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g)
      , _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
        return typeof e
    }
    : function(e) {
        return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
    }
    ;
    function _toConsumableArray$1(e) {
        if (Array.isArray(e)) {
            for (var t = 0, r = Array(e.length); t < e.length; t++)
                r[t] = e[t];
            return r
        }
        return Array.from(e)
    }
    var getGlobal = function() {
        return "undefined" == typeof window ? null : window
    }
      , _createTrustedTypesPolicy = function(e, t) {
        if ("object" !== (void 0 === e ? "undefined" : _typeof$1(e)) || "function" != typeof e.createPolicy)
            return null;
        var r = null;
        t.currentScript && t.currentScript.hasAttribute("data-tt-policy-suffix") && (r = t.currentScript.getAttribute("data-tt-policy-suffix"));
        var a = "dompurify" + (r ? "#" + r : "");
        try {
            return e.createPolicy(a, {
                createHTML: function(e) {
                    return e
                }
            })
        } catch (e) {
            return console.warn("TrustedTypes policy " + a + " could not be created."),
            null
        }
    };
    function createDOMPurify() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getGlobal()
          , t = function(e) {
            return createDOMPurify(e)
        };
        if (t.version = "2.1.1",
        t.removed = [],
        !e || !e.document || 9 !== e.document.nodeType)
            return t.isSupported = !1,
            t;
        var r = e.document
          , a = e.document
          , n = e.DocumentFragment
          , o = e.HTMLTemplateElement
          , l = e.Node
          , i = e.NodeFilter
          , s = e.NamedNodeMap
          , c = void 0 === s ? e.NamedNodeMap || e.MozNamedAttrMap : s
          , u = e.Text
          , h = e.Comment
          , d = e.DOMParser
          , f = e.trustedTypes;
        if ("function" == typeof o) {
            var m = a.createElement("template");
            m.content && m.content.ownerDocument && (a = m.content.ownerDocument)
        }
        var p = _createTrustedTypesPolicy(f, r)
          , g = p && K ? p.createHTML("") : ""
          , y = a
          , v = y.implementation
          , A = y.createNodeIterator
          , b = y.getElementsByTagName
          , k = y.createDocumentFragment
          , w = r.importNode
          , x = {};
        try {
            x = clone(a).documentMode ? a.documentMode : {}
        } catch (e) {}
        var S = {};
        t.isSupported = v && void 0 !== v.createHTMLDocument && 9 !== x;
        var _ = MUSTACHE_EXPR
          , C = ERB_EXPR
          , T = DATA_ATTR
          , E = ARIA_ATTR
          , I = IS_SCRIPT_OR_DATA
          , R = ATTR_WHITESPACE
          , B = IS_ALLOWED_URI
          , N = null
          , F = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)))
          , P = null
          , $ = addToSet({}, [].concat(_toConsumableArray$1(html$1$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)))
          , L = null
          , O = null
          , D = !0
          , M = !0
          , U = !1
          , H = !1
          , q = !1
          , z = !1
          , j = !1
          , V = !1
          , Q = !1
          , G = !1
          , K = !1
          , W = !0
          , Y = !0
          , X = !1
          , J = {}
          , Z = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"])
          , ee = null
          , te = addToSet({}, ["audio", "video", "img", "source", "image", "track"])
          , re = null
          , ae = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "summary", "title", "value", "style", "xmlns"])
          , ne = null
          , oe = a.createElement("form")
          , le = function(e) {
            ne && ne === e || (e && "object" === (void 0 === e ? "undefined" : _typeof$1(e)) || (e = {}),
            e = clone(e),
            N = "ALLOWED_TAGS"in e ? addToSet({}, e.ALLOWED_TAGS) : F,
            P = "ALLOWED_ATTR"in e ? addToSet({}, e.ALLOWED_ATTR) : $,
            re = "ADD_URI_SAFE_ATTR"in e ? addToSet(clone(ae), e.ADD_URI_SAFE_ATTR) : ae,
            ee = "ADD_DATA_URI_TAGS"in e ? addToSet(clone(te), e.ADD_DATA_URI_TAGS) : te,
            L = "FORBID_TAGS"in e ? addToSet({}, e.FORBID_TAGS) : {},
            O = "FORBID_ATTR"in e ? addToSet({}, e.FORBID_ATTR) : {},
            J = "USE_PROFILES"in e && e.USE_PROFILES,
            D = !1 !== e.ALLOW_ARIA_ATTR,
            M = !1 !== e.ALLOW_DATA_ATTR,
            U = e.ALLOW_UNKNOWN_PROTOCOLS || !1,
            H = e.SAFE_FOR_TEMPLATES || !1,
            q = e.WHOLE_DOCUMENT || !1,
            V = e.RETURN_DOM || !1,
            Q = e.RETURN_DOM_FRAGMENT || !1,
            G = e.RETURN_DOM_IMPORT || !1,
            K = e.RETURN_TRUSTED_TYPE || !1,
            j = e.FORCE_BODY || !1,
            W = !1 !== e.SANITIZE_DOM,
            Y = !1 !== e.KEEP_CONTENT,
            X = e.IN_PLACE || !1,
            B = e.ALLOWED_URI_REGEXP || B,
            H && (M = !1),
            Q && (V = !0),
            J && (N = addToSet({}, [].concat(_toConsumableArray$1(text))),
            P = [],
            !0 === J.html && (addToSet(N, html$1),
            addToSet(P, html$1$1)),
            !0 === J.svg && (addToSet(N, svg),
            addToSet(P, svg$1),
            addToSet(P, xml)),
            !0 === J.svgFilters && (addToSet(N, svgFilters),
            addToSet(P, svg$1),
            addToSet(P, xml)),
            !0 === J.mathMl && (addToSet(N, mathMl),
            addToSet(P, mathMl$1),
            addToSet(P, xml))),
            e.ADD_TAGS && (N === F && (N = clone(N)),
            addToSet(N, e.ADD_TAGS)),
            e.ADD_ATTR && (P === $ && (P = clone(P)),
            addToSet(P, e.ADD_ATTR)),
            e.ADD_URI_SAFE_ATTR && addToSet(re, e.ADD_URI_SAFE_ATTR),
            Y && (N["#text"] = !0),
            q && addToSet(N, ["html", "head", "body"]),
            N.table && (addToSet(N, ["tbody"]),
            delete L.tbody),
            freeze && freeze(e),
            ne = e)
        }
          , ie = function(e) {
            arrayPush$1(t.removed, {
                element: e
            });
            try {
                e.parentNode.removeChild(e)
            } catch (t) {
                e.outerHTML = g
            }
        }
          , se = function(e, r) {
            try {
                arrayPush$1(t.removed, {
                    attribute: r.getAttributeNode(e),
                    from: r
                })
            } catch (e) {
                arrayPush$1(t.removed, {
                    attribute: null,
                    from: r
                })
            }
            r.removeAttribute(e)
        }
          , ce = function(e) {
            var t = void 0
              , r = void 0;
            if (j)
                e = "<remove></remove>" + e;
            else {
                var n = stringMatch(e, /^[\r\n\t ]+/);
                r = n && n[0]
            }
            var o = p ? p.createHTML(e) : e;
            try {
                t = (new d).parseFromString(o, "text/html")
            } catch (e) {}
            if (!t || !t.documentElement) {
                var l = (t = v.createHTMLDocument("")).body;
                l.parentNode.removeChild(l.parentNode.firstElementChild),
                l.outerHTML = o
            }
            return e && r && t.body.insertBefore(a.createTextNode(r), t.body.childNodes[0] || null),
            b.call(t, q ? "html" : "body")[0]
        }
          , ue = function(e) {
            return A.call(e.ownerDocument || e, e, i.SHOW_ELEMENT | i.SHOW_COMMENT | i.SHOW_TEXT, (function() {
                return i.FILTER_ACCEPT
            }
            ), !1)
        }
          , he = function(e) {
            return !(e instanceof u || e instanceof h) && !("string" == typeof e.nodeName && "string" == typeof e.textContent && "function" == typeof e.removeChild && e.attributes instanceof c && "function" == typeof e.removeAttribute && "function" == typeof e.setAttribute && "string" == typeof e.namespaceURI)
        }
          , de = function(e) {
            return "object" === (void 0 === l ? "undefined" : _typeof$1(l)) ? e instanceof l : e && "object" === (void 0 === e ? "undefined" : _typeof$1(e)) && "number" == typeof e.nodeType && "string" == typeof e.nodeName
        }
          , fe = function(e, r, a) {
            S[e] && arrayForEach$1(S[e], (function(e) {
                e.call(t, r, a, ne)
            }
            ))
        }
          , me = function(e) {
            var r = void 0;
            if (fe("beforeSanitizeElements", e, null),
            he(e))
                return ie(e),
                !0;
            if (stringMatch(e.nodeName, /[\u0080-\uFFFF]/))
                return ie(e),
                !0;
            var a = stringToLowerCase(e.nodeName);
            if (fe("uponSanitizeElement", e, {
                tagName: a,
                allowedTags: N
            }),
            ("svg" === a || "math" === a) && 0 !== e.querySelectorAll("p, br").length)
                return ie(e),
                !0;
            if (!de(e.firstElementChild) && (!de(e.content) || !de(e.content.firstElementChild)) && regExpTest(/<[!/\w]/g, e.innerHTML) && regExpTest(/<[!/\w]/g, e.textContent))
                return ie(e),
                !0;
            if (!N[a] || L[a]) {
                if (Y && !Z[a] && "function" == typeof e.insertAdjacentHTML)
                    try {
                        var n = e.innerHTML;
                        e.insertAdjacentHTML("AfterEnd", p ? p.createHTML(n) : n)
                    } catch (e) {}
                return ie(e),
                !0
            }
            return "noscript" !== a && "noembed" !== a || !regExpTest(/<\/no(script|embed)/i, e.innerHTML) ? (H && 3 === e.nodeType && (r = e.textContent,
            r = stringReplace(r, _, " "),
            r = stringReplace(r, C, " "),
            e.textContent !== r && (arrayPush$1(t.removed, {
                element: e.cloneNode()
            }),
            e.textContent = r)),
            fe("afterSanitizeElements", e, null),
            !1) : (ie(e),
            !0)
        }
          , pe = function(e, t, r) {
            if (W && ("id" === t || "name" === t) && (r in a || r in oe))
                return !1;
            if (M && regExpTest(T, t))
                ;
            else if (D && regExpTest(E, t))
                ;
            else {
                if (!P[t] || O[t])
                    return !1;
                if (re[t])
                    ;
                else if (regExpTest(B, stringReplace(r, R, "")))
                    ;
                else if ("src" !== t && "xlink:href" !== t && "href" !== t || "script" === e || 0 !== stringIndexOf(r, "data:") || !ee[e]) {
                    if (U && !regExpTest(I, stringReplace(r, R, "")))
                        ;
                    else if (r)
                        return !1
                } else
                    ;
            }
            return !0
        }
          , ge = function(e) {
            var r = void 0
              , a = void 0
              , n = void 0
              , o = void 0;
            fe("beforeSanitizeAttributes", e, null);
            var l = e.attributes;
            if (l) {
                var i = {
                    attrName: "",
                    attrValue: "",
                    keepAttr: !0,
                    allowedAttributes: P
                };
                for (o = l.length; o--; ) {
                    var s = r = l[o]
                      , c = s.name
                      , u = s.namespaceURI;
                    if (a = stringTrim$1(r.value),
                    n = stringToLowerCase(c),
                    i.attrName = n,
                    i.attrValue = a,
                    i.keepAttr = !0,
                    i.forceKeepAttr = void 0,
                    fe("uponSanitizeAttribute", e, i),
                    a = i.attrValue,
                    !i.forceKeepAttr && (se(c, e),
                    i.keepAttr))
                        if (regExpTest(/\/>/i, a))
                            se(c, e);
                        else {
                            H && (a = stringReplace(a, _, " "),
                            a = stringReplace(a, C, " "));
                            var h = e.nodeName.toLowerCase();
                            if (pe(h, n, a))
                                try {
                                    u ? e.setAttributeNS(u, c, a) : e.setAttribute(c, a),
                                    arrayPop(t.removed)
                                } catch (e) {}
                        }
                }
                fe("afterSanitizeAttributes", e, null)
            }
        }
          , ye = function e(t) {
            var r = void 0
              , a = ue(t);
            for (fe("beforeSanitizeShadowDOM", t, null); r = a.nextNode(); )
                fe("uponSanitizeShadowNode", r, null),
                me(r) || (r.content instanceof n && e(r.content),
                ge(r));
            fe("afterSanitizeShadowDOM", t, null)
        };
        return t.sanitize = function(a, o) {
            var i = void 0
              , s = void 0
              , c = void 0
              , u = void 0
              , h = void 0;
            if (a || (a = "\x3c!--\x3e"),
            "string" != typeof a && !de(a)) {
                if ("function" != typeof a.toString)
                    throw typeErrorCreate("toString is not a function");
                if ("string" != typeof (a = a.toString()))
                    throw typeErrorCreate("dirty is not a string, aborting")
            }
            if (!t.isSupported) {
                if ("object" === _typeof$1(e.toStaticHTML) || "function" == typeof e.toStaticHTML) {
                    if ("string" == typeof a)
                        return e.toStaticHTML(a);
                    if (de(a))
                        return e.toStaticHTML(a.outerHTML)
                }
                return a
            }
            if (z || le(o),
            t.removed = [],
            "string" == typeof a && (X = !1),
            X)
                ;
            else if (a instanceof l)
                1 === (s = (i = ce("\x3c!----\x3e")).ownerDocument.importNode(a, !0)).nodeType && "BODY" === s.nodeName || "HTML" === s.nodeName ? i = s : i.appendChild(s);
            else {
                if (!V && !H && !q && -1 === a.indexOf("<"))
                    return p && K ? p.createHTML(a) : a;
                if (!(i = ce(a)))
                    return V ? null : g
            }
            i && j && ie(i.firstChild);
            for (var d = ue(X ? a : i); c = d.nextNode(); )
                3 === c.nodeType && c === u || me(c) || (c.content instanceof n && ye(c.content),
                ge(c),
                u = c);
            if (u = null,
            X)
                return a;
            if (V) {
                if (Q)
                    for (h = k.call(i.ownerDocument); i.firstChild; )
                        h.appendChild(i.firstChild);
                else
                    h = i;
                return G && (h = w.call(r, h, !0)),
                h
            }
            var f = q ? i.outerHTML : i.innerHTML;
            return H && (f = stringReplace(f, _, " "),
            f = stringReplace(f, C, " ")),
            p && K ? p.createHTML(f) : f
        }
        ,
        t.setConfig = function(e) {
            le(e),
            z = !0
        }
        ,
        t.clearConfig = function() {
            ne = null,
            z = !1
        }
        ,
        t.isValidAttribute = function(e, t, r) {
            ne || le({});
            var a = stringToLowerCase(e)
              , n = stringToLowerCase(t);
            return pe(a, n, r)
        }
        ,
        t.addHook = function(e, t) {
            "function" == typeof t && (S[e] = S[e] || [],
            arrayPush$1(S[e], t))
        }
        ,
        t.removeHook = function(e) {
            S[e] && arrayPop(S[e])
        }
        ,
        t.removeHooks = function(e) {
            S[e] && (S[e] = [])
        }
        ,
        t.removeAllHooks = function() {
            S = {}
        }
        ,
        t
    }
    var purify = createDOMPurify(), purify_es = Object.freeze({
        __proto__: null,
        default: purify
    }), getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f, nativeStartsWith = "".startsWith, min$7 = Math.min, CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic("startsWith"), MDN_POLYFILL_BUG = !(CORRECT_IS_REGEXP_LOGIC || (descriptor = getOwnPropertyDescriptor$3(String.prototype, "startsWith"),
    !descriptor || descriptor.writable)), descriptor;
    function _arrayWithHoles(e) {
        if (Array.isArray(e))
            return e
    }
    _export({
        target: "String",
        proto: !0,
        forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC
    }, {
        startsWith: function(e) {
            var t = String(requireObjectCoercible(this));
            notARegexp(e);
            var r = toLength(min$7(arguments.length > 1 ? arguments[1] : void 0, t.length))
              , a = String(e);
            return nativeStartsWith ? nativeStartsWith.call(t, a, r) : t.slice(r, r + a.length) === a
        }
    });
    var arrayWithHoles = _arrayWithHoles;
    function _iterableToArrayLimit(e, t) {
        if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) {
            var r = []
              , a = !0
              , n = !1
              , o = void 0;
            try {
                for (var l, i = e[Symbol.iterator](); !(a = (l = i.next()).done) && (r.push(l.value),
                !t || r.length !== t); a = !0)
                    ;
            } catch (e) {
                n = !0,
                o = e
            } finally {
                try {
                    a || null == i.return || i.return()
                } finally {
                    if (n)
                        throw o
                }
            }
            return r
        }
    }
    var iterableToArrayLimit = _iterableToArrayLimit;
    function _arrayLikeToArray$1(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, a = new Array(t); r < t; r++)
            a[r] = e[r];
        return a
    }
    var arrayLikeToArray = _arrayLikeToArray$1;
    function _unsupportedIterableToArray$1(e, t) {
        if (e) {
            if ("string" == typeof e)
                return arrayLikeToArray(e, t);
            var r = Object.prototype.toString.call(e).slice(8, -1);
            return "Object" === r && e.constructor && (r = e.constructor.name),
            "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? arrayLikeToArray(e, t) : void 0
        }
    }
    var unsupportedIterableToArray = _unsupportedIterableToArray$1;
    function _nonIterableRest() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
    }
    var nonIterableRest = _nonIterableRest;
    function _slicedToArray(e, t) {
        return arrayWithHoles(e) || iterableToArrayLimit(e, t) || unsupportedIterableToArray(e, t) || nonIterableRest()
    }
    var slicedToArray = _slicedToArray
      , f$8 = wellKnownSymbol
      , wellKnownSymbolWrapped = {
        f: f$8
    }
      , defineProperty$9 = objectDefineProperty.f
      , defineWellKnownSymbol = function(e) {
        var t = path.Symbol || (path.Symbol = {});
        has(t, e) || defineProperty$9(t, e, {
            value: wellKnownSymbolWrapped.f(e)
        })
    }
      , $forEach$2 = arrayIteration.forEach
      , HIDDEN = sharedKey("hidden")
      , SYMBOL = "Symbol"
      , PROTOTYPE$2 = "prototype"
      , TO_PRIMITIVE = wellKnownSymbol("toPrimitive")
      , setInternalState$7 = internalState.set
      , getInternalState$3 = internalState.getterFor(SYMBOL)
      , ObjectPrototype$3 = Object[PROTOTYPE$2]
      , $Symbol = global_1.Symbol
      , $stringify = getBuiltIn("JSON", "stringify")
      , nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f
      , nativeDefineProperty$1 = objectDefineProperty.f
      , nativeGetOwnPropertyNames$2 = objectGetOwnPropertyNamesExternal.f
      , nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f
      , AllSymbols = shared("symbols")
      , ObjectPrototypeSymbols = shared("op-symbols")
      , StringToSymbolRegistry = shared("string-to-symbol-registry")
      , SymbolToStringRegistry = shared("symbol-to-string-registry")
      , WellKnownSymbolsStore$1 = shared("wks")
      , QObject = global_1.QObject
      , USE_SETTER = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild
      , setSymbolDescriptor = descriptors && fails((function() {
        return 7 != objectCreate(nativeDefineProperty$1({}, "a", {
            get: function() {
                return nativeDefineProperty$1(this, "a", {
                    value: 7
                }).a
            }
        })).a
    }
    )) ? function(e, t, r) {
        var a = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$3, t);
        a && delete ObjectPrototype$3[t],
        nativeDefineProperty$1(e, t, r),
        a && e !== ObjectPrototype$3 && nativeDefineProperty$1(ObjectPrototype$3, t, a)
    }
    : nativeDefineProperty$1
      , wrap = function(e, t) {
        var r = AllSymbols[e] = objectCreate($Symbol[PROTOTYPE$2]);
        return setInternalState$7(r, {
            type: SYMBOL,
            tag: e,
            description: t
        }),
        descriptors || (r.description = t),
        r
    }
      , isSymbol = useSymbolAsUid ? function(e) {
        return "symbol" == typeof e
    }
    : function(e) {
        return Object(e)instanceof $Symbol
    }
      , $defineProperty = function(e, t, r) {
        e === ObjectPrototype$3 && $defineProperty(ObjectPrototypeSymbols, t, r),
        anObject(e);
        var a = toPrimitive(t, !0);
        return anObject(r),
        has(AllSymbols, a) ? (r.enumerable ? (has(e, HIDDEN) && e[HIDDEN][a] && (e[HIDDEN][a] = !1),
        r = objectCreate(r, {
            enumerable: createPropertyDescriptor(0, !1)
        })) : (has(e, HIDDEN) || nativeDefineProperty$1(e, HIDDEN, createPropertyDescriptor(1, {})),
        e[HIDDEN][a] = !0),
        setSymbolDescriptor(e, a, r)) : nativeDefineProperty$1(e, a, r)
    }
      , $defineProperties = function(e, t) {
        anObject(e);
        var r = toIndexedObject(t)
          , a = objectKeys(r).concat($getOwnPropertySymbols(r));
        return $forEach$2(a, (function(t) {
            descriptors && !$propertyIsEnumerable.call(r, t) || $defineProperty(e, t, r[t])
        }
        )),
        e
    }
      , $create = function(e, t) {
        return void 0 === t ? objectCreate(e) : $defineProperties(objectCreate(e), t)
    }
      , $propertyIsEnumerable = function(e) {
        var t = toPrimitive(e, !0)
          , r = nativePropertyIsEnumerable$1.call(this, t);
        return !(this === ObjectPrototype$3 && has(AllSymbols, t) && !has(ObjectPrototypeSymbols, t)) && (!(r || !has(this, t) || !has(AllSymbols, t) || has(this, HIDDEN) && this[HIDDEN][t]) || r)
    }
      , $getOwnPropertyDescriptor = function(e, t) {
        var r = toIndexedObject(e)
          , a = toPrimitive(t, !0);
        if (r !== ObjectPrototype$3 || !has(AllSymbols, a) || has(ObjectPrototypeSymbols, a)) {
            var n = nativeGetOwnPropertyDescriptor$1(r, a);
            return !n || !has(AllSymbols, a) || has(r, HIDDEN) && r[HIDDEN][a] || (n.enumerable = !0),
            n
        }
    }
      , $getOwnPropertyNames = function(e) {
        var t = nativeGetOwnPropertyNames$2(toIndexedObject(e))
          , r = [];
        return $forEach$2(t, (function(e) {
            has(AllSymbols, e) || has(hiddenKeys, e) || r.push(e)
        }
        )),
        r
    }
      , $getOwnPropertySymbols = function(e) {
        var t = e === ObjectPrototype$3
          , r = nativeGetOwnPropertyNames$2(t ? ObjectPrototypeSymbols : toIndexedObject(e))
          , a = [];
        return $forEach$2(r, (function(e) {
            !has(AllSymbols, e) || t && !has(ObjectPrototype$3, e) || a.push(AllSymbols[e])
        }
        )),
        a
    };
    if (nativeSymbol || ($Symbol = function() {
        if (this instanceof $Symbol)
            throw TypeError("Symbol is not a constructor");
        var e = arguments.length && void 0 !== arguments[0] ? String(arguments[0]) : void 0
          , t = uid(e)
          , r = function(e) {
            this === ObjectPrototype$3 && r.call(ObjectPrototypeSymbols, e),
            has(this, HIDDEN) && has(this[HIDDEN], t) && (this[HIDDEN][t] = !1),
            setSymbolDescriptor(this, t, createPropertyDescriptor(1, e))
        };
        return descriptors && USE_SETTER && setSymbolDescriptor(ObjectPrototype$3, t, {
            configurable: !0,
            set: r
        }),
        wrap(t, e)
    }
    ,
    redefine($Symbol[PROTOTYPE$2], "toString", (function() {
        return getInternalState$3(this).tag
    }
    )),
    redefine($Symbol, "withoutSetter", (function(e) {
        return wrap(uid(e), e)
    }
    )),
    objectPropertyIsEnumerable.f = $propertyIsEnumerable,
    objectDefineProperty.f = $defineProperty,
    objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor,
    objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames,
    objectGetOwnPropertySymbols.f = $getOwnPropertySymbols,
    wellKnownSymbolWrapped.f = function(e) {
        return wrap(wellKnownSymbol(e), e)
    }
    ,
    descriptors && (nativeDefineProperty$1($Symbol[PROTOTYPE$2], "description", {
        configurable: !0,
        get: function() {
            return getInternalState$3(this).description
        }
    }),
    redefine(ObjectPrototype$3, "propertyIsEnumerable", $propertyIsEnumerable, {
        unsafe: !0
    }))),
    _export({
        global: !0,
        wrap: !0,
        forced: !nativeSymbol,
        sham: !nativeSymbol
    }, {
        Symbol: $Symbol
    }),
    $forEach$2(objectKeys(WellKnownSymbolsStore$1), (function(e) {
        defineWellKnownSymbol(e)
    }
    )),
    _export({
        target: SYMBOL,
        stat: !0,
        forced: !nativeSymbol
    }, {
        for: function(e) {
            var t = String(e);
            if (has(StringToSymbolRegistry, t))
                return StringToSymbolRegistry[t];
            var r = $Symbol(t);
            return StringToSymbolRegistry[t] = r,
            SymbolToStringRegistry[r] = t,
            r
        },
        keyFor: function(e) {
            if (!isSymbol(e))
                throw TypeError(e + " is not a symbol");
            if (has(SymbolToStringRegistry, e))
                return SymbolToStringRegistry[e]
        },
        useSetter: function() {
            USE_SETTER = !0
        },
        useSimple: function() {
            USE_SETTER = !1
        }
    }),
    _export({
        target: "Object",
        stat: !0,
        forced: !nativeSymbol,
        sham: !descriptors
    }, {
        create: $create,
        defineProperty: $defineProperty,
        defineProperties: $defineProperties,
        getOwnPropertyDescriptor: $getOwnPropertyDescriptor
    }),
    _export({
        target: "Object",
        stat: !0,
        forced: !nativeSymbol
    }, {
        getOwnPropertyNames: $getOwnPropertyNames,
        getOwnPropertySymbols: $getOwnPropertySymbols
    }),
    _export({
        target: "Object",
        stat: !0,
        forced: fails((function() {
            objectGetOwnPropertySymbols.f(1)
        }
        ))
    }, {
        getOwnPropertySymbols: function(e) {
            return objectGetOwnPropertySymbols.f(toObject(e))
        }
    }),
    $stringify) {
        var FORCED_JSON_STRINGIFY = !nativeSymbol || fails((function() {
            var e = $Symbol();
            return "[null]" != $stringify([e]) || "{}" != $stringify({
                a: e
            }) || "{}" != $stringify(Object(e))
        }
        ));
        _export({
            target: "JSON",
            stat: !0,
            forced: FORCED_JSON_STRINGIFY
        }, {
            stringify: function(e, t, r) {
                for (var a, n = [e], o = 1; arguments.length > o; )
                    n.push(arguments[o++]);
                if (a = t,
                (isObject(t) || void 0 !== e) && !isSymbol(e))
                    return isArray(t) || (t = function(e, t) {
                        if ("function" == typeof a && (t = a.call(this, e, t)),
                        !isSymbol(t))
                            return t
                    }
                    ),
                    n[1] = t,
                    $stringify.apply(null, n)
            }
        })
    }
    $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || createNonEnumerableProperty($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf),
    setToStringTag($Symbol, SYMBOL),
    hiddenKeys[HIDDEN] = !0;
    var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f
      , FAILS_ON_PRIMITIVES$2 = fails((function() {
        nativeGetOwnPropertyDescriptor$2(1)
    }
    ))
      , FORCED$8 = !descriptors || FAILS_ON_PRIMITIVES$2;
    _export({
        target: "Object",
        stat: !0,
        forced: FORCED$8,
        sham: !descriptors
    }, {
        getOwnPropertyDescriptor: function(e, t) {
            return nativeGetOwnPropertyDescriptor$2(toIndexedObject(e), t)
        }
    }),
    _export({
        target: "Object",
        stat: !0,
        sham: !descriptors
    }, {
        getOwnPropertyDescriptors: function(e) {
            for (var t, r, a = toIndexedObject(e), n = objectGetOwnPropertyDescriptor.f, o = ownKeys(a), l = {}, i = 0; o.length > i; )
                void 0 !== (r = n(a, t = o[i++])) && createProperty(l, t, r);
            return l
        }
    });
    var runtime_1 = createCommonjsModule((function(e) {
        var t = function(e) {
            var t = Object.prototype
              , r = t.hasOwnProperty
              , a = "function" == typeof Symbol ? Symbol : {}
              , n = a.iterator || "@@iterator"
              , o = a.asyncIterator || "@@asyncIterator"
              , l = a.toStringTag || "@@toStringTag";
            function i(e, t, r) {
                return Object.defineProperty(e, t, {
                    value: r,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }),
                e[t]
            }
            try {
                i({}, "")
            } catch (e) {
                i = function(e, t, r) {
                    return e[t] = r
                }
            }
            function s(e, t, r, a) {
                var n = t && t.prototype instanceof h ? t : h
                  , o = Object.create(n.prototype)
                  , l = new x(a || []);
                return o._invoke = function(e, t, r) {
                    var a = "suspendedStart";
                    return function(n, o) {
                        if ("executing" === a)
                            throw new Error("Generator is already running");
                        if ("completed" === a) {
                            if ("throw" === n)
                                throw o;
                            return _()
                        }
                        for (r.method = n,
                        r.arg = o; ; ) {
                            var l = r.delegate;
                            if (l) {
                                var i = b(l, r);
                                if (i) {
                                    if (i === u)
                                        continue;
                                    return i
                                }
                            }
                            if ("next" === r.method)
                                r.sent = r._sent = r.arg;
                            else if ("throw" === r.method) {
                                if ("suspendedStart" === a)
                                    throw a = "completed",
                                    r.arg;
                                r.dispatchException(r.arg)
                            } else
                                "return" === r.method && r.abrupt("return", r.arg);
                            a = "executing";
                            var s = c(e, t, r);
                            if ("normal" === s.type) {
                                if (a = r.done ? "completed" : "suspendedYield",
                                s.arg === u)
                                    continue;
                                return {
                                    value: s.arg,
                                    done: r.done
                                }
                            }
                            "throw" === s.type && (a = "completed",
                            r.method = "throw",
                            r.arg = s.arg)
                        }
                    }
                }(e, r, l),
                o
            }
            function c(e, t, r) {
                try {
                    return {
                        type: "normal",
                        arg: e.call(t, r)
                    }
                } catch (e) {
                    return {
                        type: "throw",
                        arg: e
                    }
                }
            }
            e.wrap = s;
            var u = {};
            function h() {}
            function d() {}
            function f() {}
            var m = {};
            m[n] = function() {
                return this
            }
            ;
            var p = Object.getPrototypeOf
              , g = p && p(p(S([])));
            g && g !== t && r.call(g, n) && (m = g);
            var y = f.prototype = h.prototype = Object.create(m);
            function v(e) {
                ["next", "throw", "return"].forEach((function(t) {
                    i(e, t, (function(e) {
                        return this._invoke(t, e)
                    }
                    ))
                }
                ))
            }
            function A(e, t) {
                var a;
                this._invoke = function(n, o) {
                    function l() {
                        return new t((function(a, l) {
                            !function a(n, o, l, i) {
                                var s = c(e[n], e, o);
                                if ("throw" !== s.type) {
                                    var u = s.arg
                                      , h = u.value;
                                    return h && "object" == typeof h && r.call(h, "__await") ? t.resolve(h.__await).then((function(e) {
                                        a("next", e, l, i)
                                    }
                                    ), (function(e) {
                                        a("throw", e, l, i)
                                    }
                                    )) : t.resolve(h).then((function(e) {
                                        u.value = e,
                                        l(u)
                                    }
                                    ), (function(e) {
                                        return a("throw", e, l, i)
                                    }
                                    ))
                                }
                                i(s.arg)
                            }(n, o, a, l)
                        }
                        ))
                    }
                    return a = a ? a.then(l, l) : l()
                }
            }
            function b(e, t) {
                var r = e.iterator[t.method];
                if (void 0 === r) {
                    if (t.delegate = null,
                    "throw" === t.method) {
                        if (e.iterator.return && (t.method = "return",
                        t.arg = void 0,
                        b(e, t),
                        "throw" === t.method))
                            return u;
                        t.method = "throw",
                        t.arg = new TypeError("The iterator does not provide a 'throw' method")
                    }
                    return u
                }
                var a = c(r, e.iterator, t.arg);
                if ("throw" === a.type)
                    return t.method = "throw",
                    t.arg = a.arg,
                    t.delegate = null,
                    u;
                var n = a.arg;
                return n ? n.done ? (t[e.resultName] = n.value,
                t.next = e.nextLoc,
                "return" !== t.method && (t.method = "next",
                t.arg = void 0),
                t.delegate = null,
                u) : n : (t.method = "throw",
                t.arg = new TypeError("iterator result is not an object"),
                t.delegate = null,
                u)
            }
            function k(e) {
                var t = {
                    tryLoc: e[0]
                };
                1 in e && (t.catchLoc = e[1]),
                2 in e && (t.finallyLoc = e[2],
                t.afterLoc = e[3]),
                this.tryEntries.push(t)
            }
            function w(e) {
                var t = e.completion || {};
                t.type = "normal",
                delete t.arg,
                e.completion = t
            }
            function x(e) {
                this.tryEntries = [{
                    tryLoc: "root"
                }],
                e.forEach(k, this),
                this.reset(!0)
            }
            function S(e) {
                if (e) {
                    var t = e[n];
                    if (t)
                        return t.call(e);
                    if ("function" == typeof e.next)
                        return e;
                    if (!isNaN(e.length)) {
                        var a = -1
                          , o = function t() {
                            for (; ++a < e.length; )
                                if (r.call(e, a))
                                    return t.value = e[a],
                                    t.done = !1,
                                    t;
                            return t.value = void 0,
                            t.done = !0,
                            t
                        };
                        return o.next = o
                    }
                }
                return {
                    next: _
                }
            }
            function _() {
                return {
                    value: void 0,
                    done: !0
                }
            }
            return d.prototype = y.constructor = f,
            f.constructor = d,
            d.displayName = i(f, l, "GeneratorFunction"),
            e.isGeneratorFunction = function(e) {
                var t = "function" == typeof e && e.constructor;
                return !!t && (t === d || "GeneratorFunction" === (t.displayName || t.name))
            }
            ,
            e.mark = function(e) {
                return Object.setPrototypeOf ? Object.setPrototypeOf(e, f) : (e.__proto__ = f,
                i(e, l, "GeneratorFunction")),
                e.prototype = Object.create(y),
                e
            }
            ,
            e.awrap = function(e) {
                return {
                    __await: e
                }
            }
            ,
            v(A.prototype),
            A.prototype[o] = function() {
                return this
            }
            ,
            e.AsyncIterator = A,
            e.async = function(t, r, a, n, o) {
                void 0 === o && (o = Promise);
                var l = new A(s(t, r, a, n),o);
                return e.isGeneratorFunction(r) ? l : l.next().then((function(e) {
                    return e.done ? e.value : l.next()
                }
                ))
            }
            ,
            v(y),
            i(y, l, "Generator"),
            y[n] = function() {
                return this
            }
            ,
            y.toString = function() {
                return "[object Generator]"
            }
            ,
            e.keys = function(e) {
                var t = [];
                for (var r in e)
                    t.push(r);
                return t.reverse(),
                function r() {
                    for (; t.length; ) {
                        var a = t.pop();
                        if (a in e)
                            return r.value = a,
                            r.done = !1,
                            r
                    }
                    return r.done = !0,
                    r
                }
            }
            ,
            e.values = S,
            x.prototype = {
                constructor: x,
                reset: function(e) {
                    if (this.prev = 0,
                    this.next = 0,
                    this.sent = this._sent = void 0,
                    this.done = !1,
                    this.delegate = null,
                    this.method = "next",
                    this.arg = void 0,
                    this.tryEntries.forEach(w),
                    !e)
                        for (var t in this)
                            "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0)
                },
                stop: function() {
                    this.done = !0;
                    var e = this.tryEntries[0].completion;
                    if ("throw" === e.type)
                        throw e.arg;
                    return this.rval
                },
                dispatchException: function(e) {
                    if (this.done)
                        throw e;
                    var t = this;
                    function a(r, a) {
                        return l.type = "throw",
                        l.arg = e,
                        t.next = r,
                        a && (t.method = "next",
                        t.arg = void 0),
                        !!a
                    }
                    for (var n = this.tryEntries.length - 1; n >= 0; --n) {
                        var o = this.tryEntries[n]
                          , l = o.completion;
                        if ("root" === o.tryLoc)
                            return a("end");
                        if (o.tryLoc <= this.prev) {
                            var i = r.call(o, "catchLoc")
                              , s = r.call(o, "finallyLoc");
                            if (i && s) {
                                if (this.prev < o.catchLoc)
                                    return a(o.catchLoc, !0);
                                if (this.prev < o.finallyLoc)
                                    return a(o.finallyLoc)
                            } else if (i) {
                                if (this.prev < o.catchLoc)
                                    return a(o.catchLoc, !0)
                            } else {
                                if (!s)
                                    throw new Error("try statement without catch or finally");
                                if (this.prev < o.finallyLoc)
                                    return a(o.finallyLoc)
                            }
                        }
                    }
                },
                abrupt: function(e, t) {
                    for (var a = this.tryEntries.length - 1; a >= 0; --a) {
                        var n = this.tryEntries[a];
                        if (n.tryLoc <= this.prev && r.call(n, "finallyLoc") && this.prev < n.finallyLoc) {
                            var o = n;
                            break
                        }
                    }
                    o && ("break" === e || "continue" === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null);
                    var l = o ? o.completion : {};
                    return l.type = e,
                    l.arg = t,
                    o ? (this.method = "next",
                    this.next = o.finallyLoc,
                    u) : this.complete(l)
                },
                complete: function(e, t) {
                    if ("throw" === e.type)
                        throw e.arg;
                    return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg,
                    this.method = "return",
                    this.next = "end") : "normal" === e.type && t && (this.next = t),
                    u
                },
                finish: function(e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var r = this.tryEntries[t];
                        if (r.finallyLoc === e)
                            return this.complete(r.completion, r.afterLoc),
                            w(r),
                            u
                    }
                },
                catch: function(e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var r = this.tryEntries[t];
                        if (r.tryLoc === e) {
                            var a = r.completion;
                            if ("throw" === a.type) {
                                var n = a.arg;
                                w(r)
                            }
                            return n
                        }
                    }
                    throw new Error("illegal catch attempt")
                },
                delegateYield: function(e, t, r) {
                    return this.delegate = {
                        iterator: S(e),
                        resultName: t,
                        nextLoc: r
                    },
                    "next" === this.method && (this.arg = void 0),
                    u
                }
            },
            e
        }(e.exports);
        try {
            regeneratorRuntime = t
        } catch (e) {
            Function("r", "regeneratorRuntime = r")(t)
        }
    }
    ))
      , regenerator = runtime_1;
    function asyncGeneratorStep(e, t, r, a, n, o, l) {
        try {
            var i = e[o](l)
              , s = i.value
        } catch (e) {
            return void r(e)
        }
        i.done ? t(s) : Promise.resolve(s).then(a, n)
    }
    function _asyncToGenerator(e) {
        return function() {
            var t = this
              , r = arguments;
            return new Promise((function(a, n) {
                var o = e.apply(t, r);
                function l(e) {
                    asyncGeneratorStep(o, a, n, l, i, "next", e)
                }
                function i(e) {
                    asyncGeneratorStep(o, a, n, l, i, "throw", e)
                }
                l(void 0)
            }
            ))
        }
    }
    var asyncToGenerator = _asyncToGenerator;
    function _defineProperty$1(e, t, r) {
        return t in e ? Object.defineProperty(e, t, {
            value: r,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = r,
        e
    }
    var defineProperty$a = _defineProperty$1;
    function _classCallCheck(e, t) {
        if (!(e instanceof t))
            throw new TypeError("Cannot call a class as a function")
    }
    var classCallCheck = _classCallCheck;
    function _defineProperties(e, t) {
        for (var r = 0; r < t.length; r++) {
            var a = t[r];
            a.enumerable = a.enumerable || !1,
            a.configurable = !0,
            "value"in a && (a.writable = !0),
            Object.defineProperty(e, a.key, a)
        }
    }
    function _createClass(e, t, r) {
        return t && _defineProperties(e.prototype, t),
        r && _defineProperties(e, r),
        e
    }
    var createClass$1 = _createClass
      , $every$1 = arrayIteration.every
      , STRICT_METHOD$5 = arrayMethodIsStrict("every")
      , USES_TO_LENGTH$a = arrayMethodUsesToLength("every");
    _export({
        target: "Array",
        proto: !0,
        forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$a
    }, {
        every: function(e) {
            return $every$1(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var $reduce$1 = arrayReduce.left
      , STRICT_METHOD$6 = arrayMethodIsStrict("reduce")
      , USES_TO_LENGTH$b = arrayMethodUsesToLength("reduce", {
        1: 0
    });
    _export({
        target: "Array",
        proto: !0,
        forced: !STRICT_METHOD$6 || !USES_TO_LENGTH$b
    }, {
        reduce: function(e) {
            return $reduce$1(this, e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var nativePromiseConstructor = global_1.Promise, engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent), location$1 = global_1.location, set$2 = global_1.setImmediate, clear = global_1.clearImmediate, process$2 = global_1.process, MessageChannel = global_1.MessageChannel, Dispatch = global_1.Dispatch, counter = 0, queue = {}, ONREADYSTATECHANGE = "onreadystatechange", defer, channel, port, run = function(e) {
        if (queue.hasOwnProperty(e)) {
            var t = queue[e];
            delete queue[e],
            t()
        }
    }, runner = function(e) {
        return function() {
            run(e)
        }
    }, listener = function(e) {
        run(e.data)
    }, post = function(e) {
        global_1.postMessage(e + "", location$1.protocol + "//" + location$1.host)
    };
    set$2 && clear || (set$2 = function(e) {
        for (var t = [], r = 1; arguments.length > r; )
            t.push(arguments[r++]);
        return queue[++counter] = function() {
            ("function" == typeof e ? e : Function(e)).apply(void 0, t)
        }
        ,
        defer(counter),
        counter
    }
    ,
    clear = function(e) {
        delete queue[e]
    }
    ,
    "process" == classofRaw(process$2) ? defer = function(e) {
        process$2.nextTick(runner(e))
    }
    : Dispatch && Dispatch.now ? defer = function(e) {
        Dispatch.now(runner(e))
    }
    : MessageChannel && !engineIsIos ? (channel = new MessageChannel,
    port = channel.port2,
    channel.port1.onmessage = listener,
    defer = functionBindContext(port.postMessage, port, 1)) : !global_1.addEventListener || "function" != typeof postMessage || global_1.importScripts || fails(post) || "file:" === location$1.protocol ? defer = ONREADYSTATECHANGE in documentCreateElement("script") ? function(e) {
        html.appendChild(documentCreateElement("script"))[ONREADYSTATECHANGE] = function() {
            html.removeChild(this),
            run(e)
        }
    }
    : function(e) {
        setTimeout(runner(e), 0)
    }
    : (defer = post,
    global_1.addEventListener("message", listener, !1)));
    var task = {
        set: set$2,
        clear: clear
    }, getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f, macrotask = task.set, MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver, process$3 = global_1.process, Promise$1 = global_1.Promise, IS_NODE = "process" == classofRaw(process$3), queueMicrotaskDescriptor = getOwnPropertyDescriptor$4(global_1, "queueMicrotask"), queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value, flush, head, last, notify, toggle, node, promise, then;
    queueMicrotask || (flush = function() {
        var e, t;
        for (IS_NODE && (e = process$3.domain) && e.exit(); head; ) {
            t = head.fn,
            head = head.next;
            try {
                t()
            } catch (e) {
                throw head ? notify() : last = void 0,
                e
            }
        }
        last = void 0,
        e && e.enter()
    }
    ,
    IS_NODE ? notify = function() {
        process$3.nextTick(flush)
    }
    : MutationObserver && !engineIsIos ? (toggle = !0,
    node = document.createTextNode(""),
    new MutationObserver(flush).observe(node, {
        characterData: !0
    }),
    notify = function() {
        node.data = toggle = !toggle
    }
    ) : Promise$1 && Promise$1.resolve ? (promise = Promise$1.resolve(void 0),
    then = promise.then,
    notify = function() {
        then.call(promise, flush)
    }
    ) : notify = function() {
        macrotask.call(global_1, flush)
    }
    );
    var microtask = queueMicrotask || function(e) {
        var t = {
            fn: e,
            next: void 0
        };
        last && (last.next = t),
        head || (head = t,
        notify()),
        last = t
    }
    , PromiseCapability = function(e) {
        var t, r;
        this.promise = new e((function(e, a) {
            if (void 0 !== t || void 0 !== r)
                throw TypeError("Bad Promise constructor");
            t = e,
            r = a
        }
        )),
        this.resolve = aFunction$1(t),
        this.reject = aFunction$1(r)
    }, f$9 = function(e) {
        return new PromiseCapability(e)
    }, newPromiseCapability = {
        f: f$9
    }, promiseResolve = function(e, t) {
        if (anObject(e),
        isObject(t) && t.constructor === e)
            return t;
        var r = newPromiseCapability.f(e);
        return (0,
        r.resolve)(t),
        r.promise
    }, hostReportErrors = function(e, t) {
        var r = global_1.console;
        r && r.error && (1 === arguments.length ? r.error(e) : r.error(e, t))
    }, perform = function(e) {
        try {
            return {
                error: !1,
                value: e()
            }
        } catch (e) {
            return {
                error: !0,
                value: e
            }
        }
    }, task$1 = task.set, SPECIES$6 = wellKnownSymbol("species"), PROMISE = "Promise", getInternalState$4 = internalState.get, setInternalState$8 = internalState.set, getInternalPromiseState = internalState.getterFor(PROMISE), PromiseConstructor = nativePromiseConstructor, TypeError$1 = global_1.TypeError, document$2 = global_1.document, process$4 = global_1.process, $fetch$1 = getBuiltIn("fetch"), newPromiseCapability$1 = newPromiseCapability.f, newGenericPromiseCapability = newPromiseCapability$1, IS_NODE$1 = "process" == classofRaw(process$4), DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent), UNHANDLED_REJECTION = "unhandledrejection", REJECTION_HANDLED = "rejectionhandled", PENDING = 0, FULFILLED = 1, REJECTED = 2, HANDLED = 1, UNHANDLED = 2, Internal, OwnPromiseCapability, PromiseWrapper, nativeThen, FORCED$9 = isForced_1(PROMISE, (function() {
        if (!(inspectSource(PromiseConstructor) !== String(PromiseConstructor))) {
            if (66 === engineV8Version)
                return !0;
            if (!IS_NODE$1 && "function" != typeof PromiseRejectionEvent)
                return !0
        }
        if (engineV8Version >= 51 && /native code/.test(PromiseConstructor))
            return !1;
        var e = PromiseConstructor.resolve(1)
          , t = function(e) {
            e((function() {}
            ), (function() {}
            ))
        };
        return (e.constructor = {})[SPECIES$6] = t,
        !(e.then((function() {}
        ))instanceof t)
    }
    )), INCORRECT_ITERATION = FORCED$9 || !checkCorrectnessOfIteration((function(e) {
        PromiseConstructor.all(e).catch((function() {}
        ))
    }
    )), isThenable = function(e) {
        var t;
        return !(!isObject(e) || "function" != typeof (t = e.then)) && t
    }, notify$1 = function(e, t, r) {
        if (!t.notified) {
            t.notified = !0;
            var a = t.reactions;
            microtask((function() {
                for (var n = t.value, o = t.state == FULFILLED, l = 0; a.length > l; ) {
                    var i, s, c, u = a[l++], h = o ? u.ok : u.fail, d = u.resolve, f = u.reject, m = u.domain;
                    try {
                        h ? (o || (t.rejection === UNHANDLED && onHandleUnhandled(e, t),
                        t.rejection = HANDLED),
                        !0 === h ? i = n : (m && m.enter(),
                        i = h(n),
                        m && (m.exit(),
                        c = !0)),
                        i === u.promise ? f(TypeError$1("Promise-chain cycle")) : (s = isThenable(i)) ? s.call(i, d, f) : d(i)) : f(n)
                    } catch (e) {
                        m && !c && m.exit(),
                        f(e)
                    }
                }
                t.reactions = [],
                t.notified = !1,
                r && !t.rejection && onUnhandled(e, t)
            }
            ))
        }
    }, dispatchEvent = function(e, t, r) {
        var a, n;
        DISPATCH_EVENT ? ((a = document$2.createEvent("Event")).promise = t,
        a.reason = r,
        a.initEvent(e, !1, !0),
        global_1.dispatchEvent(a)) : a = {
            promise: t,
            reason: r
        },
        (n = global_1["on" + e]) ? n(a) : e === UNHANDLED_REJECTION && hostReportErrors("Unhandled promise rejection", r)
    }, onUnhandled = function(e, t) {
        task$1.call(global_1, (function() {
            var r, a = t.value;
            if (isUnhandled(t) && (r = perform((function() {
                IS_NODE$1 ? process$4.emit("unhandledRejection", a, e) : dispatchEvent(UNHANDLED_REJECTION, e, a)
            }
            )),
            t.rejection = IS_NODE$1 || isUnhandled(t) ? UNHANDLED : HANDLED,
            r.error))
                throw r.value
        }
        ))
    }, isUnhandled = function(e) {
        return e.rejection !== HANDLED && !e.parent
    }, onHandleUnhandled = function(e, t) {
        task$1.call(global_1, (function() {
            IS_NODE$1 ? process$4.emit("rejectionHandled", e) : dispatchEvent(REJECTION_HANDLED, e, t.value)
        }
        ))
    }, bind = function(e, t, r, a) {
        return function(n) {
            e(t, r, n, a)
        }
    }, internalReject = function(e, t, r, a) {
        t.done || (t.done = !0,
        a && (t = a),
        t.value = r,
        t.state = REJECTED,
        notify$1(e, t, !0))
    }, internalResolve = function(e, t, r, a) {
        if (!t.done) {
            t.done = !0,
            a && (t = a);
            try {
                if (e === r)
                    throw TypeError$1("Promise can't be resolved itself");
                var n = isThenable(r);
                n ? microtask((function() {
                    var a = {
                        done: !1
                    };
                    try {
                        n.call(r, bind(internalResolve, e, a, t), bind(internalReject, e, a, t))
                    } catch (r) {
                        internalReject(e, a, r, t)
                    }
                }
                )) : (t.value = r,
                t.state = FULFILLED,
                notify$1(e, t, !1))
            } catch (r) {
                internalReject(e, {
                    done: !1
                }, r, t)
            }
        }
    };
    FORCED$9 && (PromiseConstructor = function(e) {
        anInstance(this, PromiseConstructor, PROMISE),
        aFunction$1(e),
        Internal.call(this);
        var t = getInternalState$4(this);
        try {
            e(bind(internalResolve, this, t), bind(internalReject, this, t))
        } catch (e) {
            internalReject(this, t, e)
        }
    }
    ,
    Internal = function(e) {
        setInternalState$8(this, {
            type: PROMISE,
            done: !1,
            notified: !1,
            parent: !1,
            reactions: [],
            rejection: !1,
            state: PENDING,
            value: void 0
        })
    }
    ,
    Internal.prototype = redefineAll(PromiseConstructor.prototype, {
        then: function(e, t) {
            var r = getInternalPromiseState(this)
              , a = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
            return a.ok = "function" != typeof e || e,
            a.fail = "function" == typeof t && t,
            a.domain = IS_NODE$1 ? process$4.domain : void 0,
            r.parent = !0,
            r.reactions.push(a),
            r.state != PENDING && notify$1(this, r, !1),
            a.promise
        },
        catch: function(e) {
            return this.then(void 0, e)
        }
    }),
    OwnPromiseCapability = function() {
        var e = new Internal
          , t = getInternalState$4(e);
        this.promise = e,
        this.resolve = bind(internalResolve, e, t),
        this.reject = bind(internalReject, e, t)
    }
    ,
    newPromiseCapability.f = newPromiseCapability$1 = function(e) {
        return e === PromiseConstructor || e === PromiseWrapper ? new OwnPromiseCapability(e) : newGenericPromiseCapability(e)
    }
    ,
    "function" == typeof nativePromiseConstructor && (nativeThen = nativePromiseConstructor.prototype.then,
    redefine(nativePromiseConstructor.prototype, "then", (function(e, t) {
        var r = this;
        return new PromiseConstructor((function(e, t) {
            nativeThen.call(r, e, t)
        }
        )).then(e, t)
    }
    ), {
        unsafe: !0
    }),
    "function" == typeof $fetch$1 && _export({
        global: !0,
        enumerable: !0,
        forced: !0
    }, {
        fetch: function(e) {
            return promiseResolve(PromiseConstructor, $fetch$1.apply(global_1, arguments))
        }
    }))),
    _export({
        global: !0,
        wrap: !0,
        forced: FORCED$9
    }, {
        Promise: PromiseConstructor
    }),
    setToStringTag(PromiseConstructor, PROMISE, !1),
    setSpecies(PROMISE),
    PromiseWrapper = getBuiltIn(PROMISE),
    _export({
        target: PROMISE,
        stat: !0,
        forced: FORCED$9
    }, {
        reject: function(e) {
            var t = newPromiseCapability$1(this);
            return t.reject.call(void 0, e),
            t.promise
        }
    }),
    _export({
        target: PROMISE,
        stat: !0,
        forced: FORCED$9
    }, {
        resolve: function(e) {
            return promiseResolve(this, e)
        }
    }),
    _export({
        target: PROMISE,
        stat: !0,
        forced: INCORRECT_ITERATION
    }, {
        all: function(e) {
            var t = this
              , r = newPromiseCapability$1(t)
              , a = r.resolve
              , n = r.reject
              , o = perform((function() {
                var r = aFunction$1(t.resolve)
                  , o = []
                  , l = 0
                  , i = 1;
                iterate_1(e, (function(e) {
                    var s = l++
                      , c = !1;
                    o.push(void 0),
                    i++,
                    r.call(t, e).then((function(e) {
                        c || (c = !0,
                        o[s] = e,
                        --i || a(o))
                    }
                    ), n)
                }
                )),
                --i || a(o)
            }
            ));
            return o.error && n(o.value),
            r.promise
        },
        race: function(e) {
            var t = this
              , r = newPromiseCapability$1(t)
              , a = r.reject
              , n = perform((function() {
                var n = aFunction$1(t.resolve);
                iterate_1(e, (function(e) {
                    n.call(t, e).then(r.resolve, a)
                }
                ))
            }
            ));
            return n.error && a(n.value),
            r.promise
        }
    });
    for (var performanceNow = createCommonjsModule((function(e) {
        (function() {
            var t, r, a, n, o, l;
            "undefined" != typeof performance && null !== performance && performance.now ? e.exports = function() {
                return performance.now()
            }
            : "undefined" != typeof process && null !== process && process.hrtime ? (e.exports = function() {
                return (t() - o) / 1e6
            }
            ,
            r = process.hrtime,
            n = (t = function() {
                var e;
                return 1e9 * (e = r())[0] + e[1]
            }
            )(),
            l = 1e9 * process.uptime(),
            o = n - l) : Date.now ? (e.exports = function() {
                return Date.now() - a
            }
            ,
            a = Date.now()) : (e.exports = function() {
                return (new Date).getTime() - a
            }
            ,
            a = (new Date).getTime())
        }
        ).call(commonjsGlobal)
    }
    )), root = "undefined" == typeof window ? commonjsGlobal : window, vendors = ["moz", "webkit"], suffix = "AnimationFrame", raf = root["request" + suffix], caf = root["cancel" + suffix] || root["cancelRequest" + suffix], i$3 = 0; !raf && i$3 < vendors.length; i$3++)
        raf = root[vendors[i$3] + "Request" + suffix],
        caf = root[vendors[i$3] + "Cancel" + suffix] || root[vendors[i$3] + "CancelRequest" + suffix];
    if (!raf || !caf) {
        var last$1 = 0
          , id$1 = 0
          , queue$1 = []
          , frameDuration = 1e3 / 60;
        raf = function(e) {
            if (0 === queue$1.length) {
                var t = performanceNow()
                  , r = Math.max(0, frameDuration - (t - last$1));
                last$1 = r + t,
                setTimeout((function() {
                    var e = queue$1.slice(0);
                    queue$1.length = 0;
                    for (var t = 0; t < e.length; t++)
                        if (!e[t].cancelled)
                            try {
                                e[t].callback(last$1)
                            } catch (e) {
                                setTimeout((function() {
                                    throw e
                                }
                                ), 0)
                            }
                }
                ), Math.round(r))
            }
            return queue$1.push({
                handle: ++id$1,
                callback: e,
                cancelled: !1
            }),
            id$1
        }
        ,
        caf = function(e) {
            for (var t = 0; t < queue$1.length; t++)
                queue$1[t].handle === e && (queue$1[t].cancelled = !0)
        }
    }
    var raf_1 = function(e) {
        return raf.call(root, e)
    }
      , cancel = function() {
        caf.apply(root, arguments)
    }
      , polyfill = function(e) {
        e || (e = root),
        e.requestAnimationFrame = raf,
        e.cancelAnimationFrame = caf
    };
    raf_1.cancel = cancel,
    raf_1.polyfill = polyfill;
    var rgbcolor = function(e) {
        this.ok = !1,
        this.alpha = 1,
        "#" == e.charAt(0) && (e = e.substr(1, 6)),
        e = (e = e.replace(/ /g, "")).toLowerCase();
        var t = {
            aliceblue: "f0f8ff",
            antiquewhite: "faebd7",
            aqua: "00ffff",
            aquamarine: "7fffd4",
            azure: "f0ffff",
            beige: "f5f5dc",
            bisque: "ffe4c4",
            black: "000000",
            blanchedalmond: "ffebcd",
            blue: "0000ff",
            blueviolet: "8a2be2",
            brown: "a52a2a",
            burlywood: "deb887",
            cadetblue: "5f9ea0",
            chartreuse: "7fff00",
            chocolate: "d2691e",
            coral: "ff7f50",
            cornflowerblue: "6495ed",
            cornsilk: "fff8dc",
            crimson: "dc143c",
            cyan: "00ffff",
            darkblue: "00008b",
            darkcyan: "008b8b",
            darkgoldenrod: "b8860b",
            darkgray: "a9a9a9",
            darkgreen: "006400",
            darkkhaki: "bdb76b",
            darkmagenta: "8b008b",
            darkolivegreen: "556b2f",
            darkorange: "ff8c00",
            darkorchid: "9932cc",
            darkred: "8b0000",
            darksalmon: "e9967a",
            darkseagreen: "8fbc8f",
            darkslateblue: "483d8b",
            darkslategray: "2f4f4f",
            darkturquoise: "00ced1",
            darkviolet: "9400d3",
            deeppink: "ff1493",
            deepskyblue: "00bfff",
            dimgray: "696969",
            dodgerblue: "1e90ff",
            feldspar: "d19275",
            firebrick: "b22222",
            floralwhite: "fffaf0",
            forestgreen: "228b22",
            fuchsia: "ff00ff",
            gainsboro: "dcdcdc",
            ghostwhite: "f8f8ff",
            gold: "ffd700",
            goldenrod: "daa520",
            gray: "808080",
            green: "008000",
            greenyellow: "adff2f",
            honeydew: "f0fff0",
            hotpink: "ff69b4",
            indianred: "cd5c5c",
            indigo: "4b0082",
            ivory: "fffff0",
            khaki: "f0e68c",
            lavender: "e6e6fa",
            lavenderblush: "fff0f5",
            lawngreen: "7cfc00",
            lemonchiffon: "fffacd",
            lightblue: "add8e6",
            lightcoral: "f08080",
            lightcyan: "e0ffff",
            lightgoldenrodyellow: "fafad2",
            lightgrey: "d3d3d3",
            lightgreen: "90ee90",
            lightpink: "ffb6c1",
            lightsalmon: "ffa07a",
            lightseagreen: "20b2aa",
            lightskyblue: "87cefa",
            lightslateblue: "8470ff",
            lightslategray: "778899",
            lightsteelblue: "b0c4de",
            lightyellow: "ffffe0",
            lime: "00ff00",
            limegreen: "32cd32",
            linen: "faf0e6",
            magenta: "ff00ff",
            maroon: "800000",
            mediumaquamarine: "66cdaa",
            mediumblue: "0000cd",
            mediumorchid: "ba55d3",
            mediumpurple: "9370d8",
            mediumseagreen: "3cb371",
            mediumslateblue: "7b68ee",
            mediumspringgreen: "00fa9a",
            mediumturquoise: "48d1cc",
            mediumvioletred: "c71585",
            midnightblue: "191970",
            mintcream: "f5fffa",
            mistyrose: "ffe4e1",
            moccasin: "ffe4b5",
            navajowhite: "ffdead",
            navy: "000080",
            oldlace: "fdf5e6",
            olive: "808000",
            olivedrab: "6b8e23",
            orange: "ffa500",
            orangered: "ff4500",
            orchid: "da70d6",
            palegoldenrod: "eee8aa",
            palegreen: "98fb98",
            paleturquoise: "afeeee",
            palevioletred: "d87093",
            papayawhip: "ffefd5",
            peachpuff: "ffdab9",
            peru: "cd853f",
            pink: "ffc0cb",
            plum: "dda0dd",
            powderblue: "b0e0e6",
            purple: "800080",
            rebeccapurple: "663399",
            red: "ff0000",
            rosybrown: "bc8f8f",
            royalblue: "4169e1",
            saddlebrown: "8b4513",
            salmon: "fa8072",
            sandybrown: "f4a460",
            seagreen: "2e8b57",
            seashell: "fff5ee",
            sienna: "a0522d",
            silver: "c0c0c0",
            skyblue: "87ceeb",
            slateblue: "6a5acd",
            slategray: "708090",
            snow: "fffafa",
            springgreen: "00ff7f",
            steelblue: "4682b4",
            tan: "d2b48c",
            teal: "008080",
            thistle: "d8bfd8",
            tomato: "ff6347",
            turquoise: "40e0d0",
            violet: "ee82ee",
            violetred: "d02090",
            wheat: "f5deb3",
            white: "ffffff",
            whitesmoke: "f5f5f5",
            yellow: "ffff00",
            yellowgreen: "9acd32"
        };
        e = t[e] || e;
        for (var r = [{
            re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
            example: ["rgba(123, 234, 45, 0.8)", "rgba(255,234,245,1.0)"],
            process: function(e) {
                return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3]), parseFloat(e[4])]
            }
        }, {
            re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
            example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
            process: function(e) {
                return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3])]
            }
        }, {
            re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
            example: ["#00ff00", "336699"],
            process: function(e) {
                return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
            }
        }, {
            re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
            example: ["#fb0", "f0f"],
            process: function(e) {
                return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
            }
        }], a = 0; a < r.length; a++) {
            var n = r[a].re
              , o = r[a].process
              , l = n.exec(e);
            if (l) {
                var i = o(l);
                this.r = i[0],
                this.g = i[1],
                this.b = i[2],
                i.length > 3 && (this.alpha = i[3]),
                this.ok = !0
            }
        }
        this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r,
        this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g,
        this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b,
        this.alpha = this.alpha < 0 ? 0 : this.alpha > 1 || isNaN(this.alpha) ? 1 : this.alpha,
        this.toRGB = function() {
            return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")"
        }
        ,
        this.toRGBA = function() {
            return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + this.alpha + ")"
        }
        ,
        this.toHex = function() {
            var e = this.r.toString(16)
              , t = this.g.toString(16)
              , r = this.b.toString(16);
            return 1 == e.length && (e = "0" + e),
            1 == t.length && (t = "0" + t),
            1 == r.length && (r = "0" + r),
            "#" + e + t + r
        }
        ,
        this.getHelpXML = function() {
            for (var e = new Array, a = 0; a < r.length; a++)
                for (var n = r[a].example, o = 0; o < n.length; o++)
                    e[e.length] = n[o];
            for (var l in t)
                e[e.length] = l;
            var i = document.createElement("ul");
            i.setAttribute("id", "rgbcolor-examples");
            for (a = 0; a < e.length; a++)
                try {
                    var s = document.createElement("li")
                      , c = new RGBColor(e[a])
                      , u = document.createElement("div");
                    u.style.cssText = "margin: 3px; border: 1px solid black; background:" + c.toHex() + "; color:" + c.toHex(),
                    u.appendChild(document.createTextNode("test"));
                    var h = document.createTextNode(" " + e[a] + " -> " + c.toRGB() + " -> " + c.toHex());
                    s.appendChild(u),
                    s.appendChild(h),
                    i.appendChild(s)
                } catch (e) {}
            return i
        }
    }
      , slice = [].slice
      , factories = {}
      , construct$1 = function(e, t, r) {
        if (!(t in factories)) {
            for (var a = [], n = 0; n < t; n++)
                a[n] = "a[" + n + "]";
            factories[t] = Function("C,a", "return new C(" + a.join(",") + ")")
        }
        return factories[t](e, r)
    }
      , functionBind = Function.bind || function(e) {
        var t = aFunction$1(this)
          , r = slice.call(arguments, 1)
          , a = function() {
            var n = r.concat(slice.call(arguments));
            return this instanceof a ? construct$1(t, n.length, n) : t.apply(e, n)
        };
        return isObject(t.prototype) && (a.prototype = t.prototype),
        a
    }
      , nativeConstruct = getBuiltIn("Reflect", "construct")
      , NEW_TARGET_BUG = fails((function() {
        function e() {}
        return !(nativeConstruct((function() {}
        ), [], e)instanceof e)
    }
    ))
      , ARGS_BUG = !fails((function() {
        nativeConstruct((function() {}
        ))
    }
    ))
      , FORCED$a = NEW_TARGET_BUG || ARGS_BUG;
    _export({
        target: "Reflect",
        stat: !0,
        forced: FORCED$a,
        sham: FORCED$a
    }, {
        construct: function(e, t) {
            aFunction$1(e),
            anObject(t);
            var r = arguments.length < 3 ? e : aFunction$1(arguments[2]);
            if (ARGS_BUG && !NEW_TARGET_BUG)
                return nativeConstruct(e, t, r);
            if (e == r) {
                switch (t.length) {
                case 0:
                    return new e;
                case 1:
                    return new e(t[0]);
                case 2:
                    return new e(t[0],t[1]);
                case 3:
                    return new e(t[0],t[1],t[2]);
                case 4:
                    return new e(t[0],t[1],t[2],t[3])
                }
                var a = [null];
                return a.push.apply(a, t),
                new (functionBind.apply(e, a))
            }
            var n = r.prototype
              , o = objectCreate(isObject(n) ? n : Object.prototype)
              , l = Function.apply.call(e, o, t);
            return isObject(l) ? l : o
        }
    });
    var _typeof_1 = createCommonjsModule((function(e) {
        function t(r) {
            return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? e.exports = t = function(e) {
                return typeof e
            }
            : e.exports = t = function(e) {
                return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
            }
            ,
            t(r)
        }
        e.exports = t
    }
    ));
    function _assertThisInitialized(e) {
        if (void 0 === e)
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e
    }
    var assertThisInitialized = _assertThisInitialized;
    function _possibleConstructorReturn(e, t) {
        return !t || "object" !== _typeof_1(t) && "function" != typeof t ? assertThisInitialized(e) : t
    }
    var possibleConstructorReturn = _possibleConstructorReturn
      , getPrototypeOf = createCommonjsModule((function(e) {
        function t(r) {
            return e.exports = t = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
                return e.__proto__ || Object.getPrototypeOf(e)
            }
            ,
            t(r)
        }
        e.exports = t
    }
    ))
      , setPrototypeOf$1 = createCommonjsModule((function(e) {
        function t(r, a) {
            return e.exports = t = Object.setPrototypeOf || function(e, t) {
                return e.__proto__ = t,
                e
            }
            ,
            t(r, a)
        }
        e.exports = t
    }
    ));
    function _inherits(e, t) {
        if ("function" != typeof t && null !== t)
            throw new TypeError("Super expression must either be null or a function");
        e.prototype = Object.create(t && t.prototype, {
            constructor: {
                value: e,
                writable: !0,
                configurable: !0
            }
        }),
        t && setPrototypeOf$1(e, t)
    }
    var inherits = _inherits
      , INCORRECT_ITERATION$1 = !checkCorrectnessOfIteration((function(e) {
        Array.from(e)
    }
    ));
    _export({
        target: "Array",
        stat: !0,
        forced: INCORRECT_ITERATION$1
    }, {
        from: arrayFrom
    });
    var $some$1 = arrayIteration.some
      , STRICT_METHOD$7 = arrayMethodIsStrict("some")
      , USES_TO_LENGTH$c = arrayMethodUsesToLength("some");
    function _arrayWithoutHoles(e) {
        if (Array.isArray(e))
            return arrayLikeToArray(e)
    }
    _export({
        target: "Array",
        proto: !0,
        forced: !STRICT_METHOD$7 || !USES_TO_LENGTH$c
    }, {
        some: function(e) {
            return $some$1(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
    });
    var arrayWithoutHoles = _arrayWithoutHoles;
    function _iterableToArray(e) {
        if ("undefined" != typeof Symbol && Symbol.iterator in Object(e))
            return Array.from(e)
    }
    var iterableToArray = _iterableToArray;
    function _nonIterableSpread() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
    }
    var nonIterableSpread = _nonIterableSpread;
    function _toConsumableArray$2(e) {
        return arrayWithoutHoles(e) || iterableToArray(e) || unsupportedIterableToArray(e) || nonIterableSpread()
    }
    var toConsumableArray = _toConsumableArray$2
      , nativeReverse = [].reverse
      , test$2 = [1, 2];
    function _superPropBase(e, t) {
        for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = getPrototypeOf(e)); )
            ;
        return e
    }
    _export({
        target: "Array",
        proto: !0,
        forced: String(test$2) === String(test$2.reverse())
    }, {
        reverse: function() {
            return isArray(this) && (this.length = this.length),
            nativeReverse.call(this)
        }
    });
    var superPropBase = _superPropBase
      , get$2 = createCommonjsModule((function(e) {
        function t(r, a, n) {
            return "undefined" != typeof Reflect && Reflect.get ? e.exports = t = Reflect.get : e.exports = t = function(e, t, r) {
                var a = superPropBase(e, t);
                if (a) {
                    var n = Object.getOwnPropertyDescriptor(a, t);
                    return n.get ? n.get.call(r) : n.value
                }
            }
            ,
            t(r, a, n || r)
        }
        e.exports = t
    }
    ))
      , getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f;
    _export({
        target: "Reflect",
        stat: !0
    }, {
        deleteProperty: function(e, t) {
            var r = getOwnPropertyDescriptor$5(anObject(e), t);
            return !(r && !r.configurable) && delete e[t]
        }
    });
    var defineProperty$b = objectDefineProperty.f
      , NativeSymbol = global_1.Symbol;
    if (descriptors && "function" == typeof NativeSymbol && (!("description"in NativeSymbol.prototype) || void 0 !== NativeSymbol().description)) {
        var EmptyStringDescriptionStore = {}
          , SymbolWrapper = function() {
            var e = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0])
              , t = this instanceof SymbolWrapper ? new NativeSymbol(e) : void 0 === e ? NativeSymbol() : NativeSymbol(e);
            return "" === e && (EmptyStringDescriptionStore[t] = !0),
            t
        };
        copyConstructorProperties(SymbolWrapper, NativeSymbol);
        var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
        symbolPrototype.constructor = SymbolWrapper;
        var symbolToString = symbolPrototype.toString
          , native = "Symbol(test)" == String(NativeSymbol("test"))
          , regexp = /^Symbol\((.*)\)[^)]+$/;
        defineProperty$b(symbolPrototype, "description", {
            configurable: !0,
            get: function() {
                var e = isObject(this) ? this.valueOf() : this
                  , t = symbolToString.call(e);
                if (has(EmptyStringDescriptionStore, e))
                    return "";
                var r = native ? t.slice(7, -1) : t.replace(regexp, "$1");
                return "" === r ? void 0 : r
            }
        }),
        _export({
            global: !0,
            forced: !0
        }, {
            Symbol: SymbolWrapper
        })
    }
    defineWellKnownSymbol("iterator");
    var nativeApply = getBuiltIn("Reflect", "apply")
      , functionApply = Function.apply
      , OPTIONAL_ARGUMENTS_LIST = !fails((function() {
        nativeApply((function() {}
        ))
    }
    ));
    function _typeof$2(e) {
        return (_typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
            return typeof e
        }
        : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        }
        )(e)
    }
    function _classCallCheck$1(e, t) {
        if (!(e instanceof t))
            throw new TypeError("Cannot call a class as a function")
    }
    _export({
        target: "Reflect",
        stat: !0,
        forced: OPTIONAL_ARGUMENTS_LIST
    }, {
        apply: function(e, t, r) {
            return aFunction$1(e),
            anObject(r),
            nativeApply ? nativeApply(e, t, r) : functionApply.call(e, t, r)
        }
    }),
    _export({
        target: "Reflect",
        stat: !0,
        sham: !correctPrototypeGetter
    }, {
        getPrototypeOf: function(e) {
            return objectGetPrototypeOf(anObject(e))
        }
    });
    var mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259]
      , shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
    function getImageDataFromCanvas(e, t, r, a, n) {
        if ("string" == typeof e && (e = document.getElementById(e)),
        !e || "object" !== _typeof$2(e) || !("getContext"in e))
            throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");
        var o = e.getContext("2d");
        try {
            return o.getImageData(t, r, a, n)
        } catch (e) {
            throw new Error("unable to access image data: " + e)
        }
    }
    function processCanvasRGBA(e, t, r, a, n, o) {
        if (!(isNaN(o) || o < 1)) {
            o |= 0;
            var l = getImageDataFromCanvas(e, t, r, a, n);
            l = processImageDataRGBA(l, t, r, a, n, o),
            e.getContext("2d").putImageData(l, t, r)
        }
    }
    function processImageDataRGBA(e, t, r, a, n, o) {
        for (var l, i = e.data, s = 2 * o + 1, c = a - 1, u = n - 1, h = o + 1, d = h * (h + 1) / 2, f = new BlurStack, m = f, p = 1; p < s; p++)
            m = m.next = new BlurStack,
            p === h && (l = m);
        m.next = f;
        for (var g = null, y = null, v = 0, A = 0, b = mulTable[o], k = shgTable[o], w = 0; w < n; w++) {
            m = f;
            for (var x = i[A], S = i[A + 1], _ = i[A + 2], C = i[A + 3], T = 0; T < h; T++)
                m.r = x,
                m.g = S,
                m.b = _,
                m.a = C,
                m = m.next;
            for (var E = 0, I = 0, R = 0, B = 0, N = h * x, F = h * S, P = h * _, $ = h * C, L = d * x, O = d * S, D = d * _, M = d * C, U = 1; U < h; U++) {
                var H = A + ((c < U ? c : U) << 2)
                  , q = i[H]
                  , z = i[H + 1]
                  , j = i[H + 2]
                  , V = i[H + 3]
                  , Q = h - U;
                L += (m.r = q) * Q,
                O += (m.g = z) * Q,
                D += (m.b = j) * Q,
                M += (m.a = V) * Q,
                E += q,
                I += z,
                R += j,
                B += V,
                m = m.next
            }
            g = f,
            y = l;
            for (var G = 0; G < a; G++) {
                var K = M * b >> k;
                if (i[A + 3] = K,
                0 !== K) {
                    var W = 255 / K;
                    i[A] = (L * b >> k) * W,
                    i[A + 1] = (O * b >> k) * W,
                    i[A + 2] = (D * b >> k) * W
                } else
                    i[A] = i[A + 1] = i[A + 2] = 0;
                L -= N,
                O -= F,
                D -= P,
                M -= $,
                N -= g.r,
                F -= g.g,
                P -= g.b,
                $ -= g.a;
                var Y = G + o + 1;
                Y = v + (Y < c ? Y : c) << 2,
                L += E += g.r = i[Y],
                O += I += g.g = i[Y + 1],
                D += R += g.b = i[Y + 2],
                M += B += g.a = i[Y + 3],
                g = g.next;
                var X = y
                  , J = X.r
                  , Z = X.g
                  , ee = X.b
                  , te = X.a;
                N += J,
                F += Z,
                P += ee,
                $ += te,
                E -= J,
                I -= Z,
                R -= ee,
                B -= te,
                y = y.next,
                A += 4
            }
            v += a
        }
        for (var re = 0; re < a; re++) {
            var ae = i[A = re << 2]
              , ne = i[A + 1]
              , oe = i[A + 2]
              , le = i[A + 3]
              , ie = h * ae
              , se = h * ne
              , ce = h * oe
              , ue = h * le
              , he = d * ae
              , de = d * ne
              , fe = d * oe
              , me = d * le;
            m = f;
            for (var pe = 0; pe < h; pe++)
                m.r = ae,
                m.g = ne,
                m.b = oe,
                m.a = le,
                m = m.next;
            for (var ge = a, ye = 0, ve = 0, Ae = 0, be = 0, ke = 1; ke <= o; ke++) {
                A = ge + re << 2;
                var we = h - ke;
                he += (m.r = ae = i[A]) * we,
                de += (m.g = ne = i[A + 1]) * we,
                fe += (m.b = oe = i[A + 2]) * we,
                me += (m.a = le = i[A + 3]) * we,
                be += ae,
                ye += ne,
                ve += oe,
                Ae += le,
                m = m.next,
                ke < u && (ge += a)
            }
            A = re,
            g = f,
            y = l;
            for (var xe = 0; xe < n; xe++) {
                var Se = A << 2;
                i[Se + 3] = le = me * b >> k,
                le > 0 ? (le = 255 / le,
                i[Se] = (he * b >> k) * le,
                i[Se + 1] = (de * b >> k) * le,
                i[Se + 2] = (fe * b >> k) * le) : i[Se] = i[Se + 1] = i[Se + 2] = 0,
                he -= ie,
                de -= se,
                fe -= ce,
                me -= ue,
                ie -= g.r,
                se -= g.g,
                ce -= g.b,
                ue -= g.a,
                Se = re + ((Se = xe + h) < u ? Se : u) * a << 2,
                he += be += g.r = i[Se],
                de += ye += g.g = i[Se + 1],
                fe += ve += g.b = i[Se + 2],
                me += Ae += g.a = i[Se + 3],
                g = g.next,
                ie += ae = y.r,
                se += ne = y.g,
                ce += oe = y.b,
                ue += le = y.a,
                be -= ae,
                ye -= ne,
                ve -= oe,
                Ae -= le,
                y = y.next,
                A += a
            }
        }
        return e
    }
    var BlurStack = function e() {
        _classCallCheck$1(this, e),
        this.r = 0,
        this.g = 0,
        this.b = 0,
        this.a = 0,
        this.next = null
    };
    function compressSpaces(e) {
        return e.replace(/(?!\u3000)\s+/gm, " ")
    }
    function trimLeft(e) {
        return e.replace(/^[\n \t]+/, "")
    }
    function trimRight(e) {
        return e.replace(/[\n \t]+$/, "")
    }
    function toNumbers(e) {
        return ((e || "").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || []).map(parseFloat)
    }
    var allUppercase = /^[A-Z-]+$/;
    function normalizeAttributeName(e) {
        return allUppercase.test(e) ? e.toLowerCase() : e
    }
    function parseExternalUrl(e) {
        var t = e.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/) || [];
        return t[2] || t[3] || t[4]
    }
    function normalizeColor(e) {
        if (!e.startsWith("rgb"))
            return e;
        var t = 3;
        return e.replace(/\d+(\.\d+)?/g, (function(e, r) {
            return t-- && r ? String(Math.round(parseFloat(e))) : e
        }
        ))
    }
    var attributeRegex = /(\[[^\]]+\])/g
      , idRegex = /(#[^\s\+>~\.\[:]+)/g
      , classRegex = /(\.[^\s\+>~\.\[:]+)/g
      , pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi
      , pseudoClassWithBracketsRegex = /(:[\w-]+\([^\)]*\))/gi
      , pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g
      , elementRegex = /([^\s\+>~\.\[:]+)/g;
    function findSelectorMatch(e, t) {
        var r = e.match(t);
        return r ? [e.replace(t, " "), r.length] : [e, 0]
    }
    function getSelectorSpecificity(e) {
        var t = [0, 0, 0]
          , r = e.replace(/:not\(([^\)]*)\)/g, "     $1 ").replace(/{[\s\S]*/gm, " ")
          , a = 0
          , n = findSelectorMatch(r, attributeRegex)
          , o = slicedToArray(n, 2);
        r = o[0],
        a = o[1],
        t[1] += a;
        var l = findSelectorMatch(r, idRegex)
          , i = slicedToArray(l, 2);
        r = i[0],
        a = i[1],
        t[0] += a;
        var s = findSelectorMatch(r, classRegex)
          , c = slicedToArray(s, 2);
        r = c[0],
        a = c[1],
        t[1] += a;
        var u = findSelectorMatch(r, pseudoElementRegex)
          , h = slicedToArray(u, 2);
        r = h[0],
        a = h[1],
        t[2] += a;
        var d = findSelectorMatch(r, pseudoClassWithBracketsRegex)
          , f = slicedToArray(d, 2);
        r = f[0],
        a = f[1],
        t[1] += a;
        var m = findSelectorMatch(r, pseudoClassRegex)
          , p = slicedToArray(m, 2);
        r = p[0],
        a = p[1],
        t[1] += a;
        var g = findSelectorMatch(r = r.replace(/[\*\s\+>~]/g, " ").replace(/[#\.]/g, " "), elementRegex)
          , y = slicedToArray(g, 2);
        return r = y[0],
        a = y[1],
        t[2] += a,
        t.join("")
    }
    var PSEUDO_ZERO = 1e-8;
    function vectorMagnitude(e) {
        return Math.sqrt(Math.pow(e[0], 2) + Math.pow(e[1], 2))
    }
    function vectorsRatio(e, t) {
        return (e[0] * t[0] + e[1] * t[1]) / (vectorMagnitude(e) * vectorMagnitude(t))
    }
    function vectorsAngle(e, t) {
        return (e[0] * t[1] < e[1] * t[0] ? -1 : 1) * Math.acos(vectorsRatio(e, t))
    }
    function CB1(e) {
        return e * e * e
    }
    function CB2(e) {
        return 3 * e * e * (1 - e)
    }
    function CB3(e) {
        return 3 * e * (1 - e) * (1 - e)
    }
    function CB4(e) {
        return (1 - e) * (1 - e) * (1 - e)
    }
    function QB1(e) {
        return e * e
    }
    function QB2(e) {
        return 2 * e * (1 - e)
    }
    function QB3(e) {
        return (1 - e) * (1 - e)
    }
    function createCommonjsModule$1(e, t) {
        return e(t = {
            exports: {}
        }, t.exports),
        t.exports
    }
    var runtime_1$1 = createCommonjsModule$1((function(e) {
        var t = function(e) {
            var t = Object.prototype
              , r = t.hasOwnProperty
              , a = "function" == typeof Symbol ? Symbol : {}
              , n = a.iterator || "@@iterator"
              , o = a.asyncIterator || "@@asyncIterator"
              , l = a.toStringTag || "@@toStringTag";
            function i(e, t, r, a) {
                var n = t && t.prototype instanceof u ? t : u
                  , o = Object.create(n.prototype)
                  , l = new w(a || []);
                return o._invoke = function(e, t, r) {
                    var a = "suspendedStart";
                    return function(n, o) {
                        if ("executing" === a)
                            throw new Error("Generator is already running");
                        if ("completed" === a) {
                            if ("throw" === n)
                                throw o;
                            return S()
                        }
                        for (r.method = n,
                        r.arg = o; ; ) {
                            var l = r.delegate;
                            if (l) {
                                var i = A(l, r);
                                if (i) {
                                    if (i === c)
                                        continue;
                                    return i
                                }
                            }
                            if ("next" === r.method)
                                r.sent = r._sent = r.arg;
                            else if ("throw" === r.method) {
                                if ("suspendedStart" === a)
                                    throw a = "completed",
                                    r.arg;
                                r.dispatchException(r.arg)
                            } else
                                "return" === r.method && r.abrupt("return", r.arg);
                            a = "executing";
                            var u = s(e, t, r);
                            if ("normal" === u.type) {
                                if (a = r.done ? "completed" : "suspendedYield",
                                u.arg === c)
                                    continue;
                                return {
                                    value: u.arg,
                                    done: r.done
                                }
                            }
                            "throw" === u.type && (a = "completed",
                            r.method = "throw",
                            r.arg = u.arg)
                        }
                    }
                }(e, r, l),
                o
            }
            function s(e, t, r) {
                try {
                    return {
                        type: "normal",
                        arg: e.call(t, r)
                    }
                } catch (e) {
                    return {
                        type: "throw",
                        arg: e
                    }
                }
            }
            e.wrap = i;
            var c = {};
            function u() {}
            function h() {}
            function d() {}
            var f = {};
            f[n] = function() {
                return this
            }
            ;
            var m = Object.getPrototypeOf
              , p = m && m(m(x([])));
            p && p !== t && r.call(p, n) && (f = p);
            var g = d.prototype = u.prototype = Object.create(f);
            function y(e) {
                ["next", "throw", "return"].forEach((function(t) {
                    e[t] = function(e) {
                        return this._invoke(t, e)
                    }
                }
                ))
            }
            function v(e, t) {
                var a;
                this._invoke = function(n, o) {
                    function l() {
                        return new t((function(a, l) {
                            !function a(n, o, l, i) {
                                var c = s(e[n], e, o);
                                if ("throw" !== c.type) {
                                    var u = c.arg
                                      , h = u.value;
                                    return h && "object" == typeof h && r.call(h, "__await") ? t.resolve(h.__await).then((function(e) {
                                        a("next", e, l, i)
                                    }
                                    ), (function(e) {
                                        a("throw", e, l, i)
                                    }
                                    )) : t.resolve(h).then((function(e) {
                                        u.value = e,
                                        l(u)
                                    }
                                    ), (function(e) {
                                        return a("throw", e, l, i)
                                    }
                                    ))
                                }
                                i(c.arg)
                            }(n, o, a, l)
                        }
                        ))
                    }
                    return a = a ? a.then(l, l) : l()
                }
            }
            function A(e, t) {
                var r = e.iterator[t.method];
                if (void 0 === r) {
                    if (t.delegate = null,
                    "throw" === t.method) {
                        if (e.iterator.return && (t.method = "return",
                        t.arg = void 0,
                        A(e, t),
                        "throw" === t.method))
                            return c;
                        t.method = "throw",
                        t.arg = new TypeError("The iterator does not provide a 'throw' method")
                    }
                    return c
                }
                var a = s(r, e.iterator, t.arg);
                if ("throw" === a.type)
                    return t.method = "throw",
                    t.arg = a.arg,
                    t.delegate = null,
                    c;
                var n = a.arg;
                return n ? n.done ? (t[e.resultName] = n.value,
                t.next = e.nextLoc,
                "return" !== t.method && (t.method = "next",
                t.arg = void 0),
                t.delegate = null,
                c) : n : (t.method = "throw",
                t.arg = new TypeError("iterator result is not an object"),
                t.delegate = null,
                c)
            }
            function b(e) {
                var t = {
                    tryLoc: e[0]
                };
                1 in e && (t.catchLoc = e[1]),
                2 in e && (t.finallyLoc = e[2],
                t.afterLoc = e[3]),
                this.tryEntries.push(t)
            }
            function k(e) {
                var t = e.completion || {};
                t.type = "normal",
                delete t.arg,
                e.completion = t
            }
            function w(e) {
                this.tryEntries = [{
                    tryLoc: "root"
                }],
                e.forEach(b, this),
                this.reset(!0)
            }
            function x(e) {
                if (e) {
                    var t = e[n];
                    if (t)
                        return t.call(e);
                    if ("function" == typeof e.next)
                        return e;
                    if (!isNaN(e.length)) {
                        var a = -1
                          , o = function t() {
                            for (; ++a < e.length; )
                                if (r.call(e, a))
                                    return t.value = e[a],
                                    t.done = !1,
                                    t;
                            return t.value = void 0,
                            t.done = !0,
                            t
                        };
                        return o.next = o
                    }
                }
                return {
                    next: S
                }
            }
            function S() {
                return {
                    value: void 0,
                    done: !0
                }
            }
            return h.prototype = g.constructor = d,
            d.constructor = h,
            d[l] = h.displayName = "GeneratorFunction",
            e.isGeneratorFunction = function(e) {
                var t = "function" == typeof e && e.constructor;
                return !!t && (t === h || "GeneratorFunction" === (t.displayName || t.name))
            }
            ,
            e.mark = function(e) {
                return Object.setPrototypeOf ? Object.setPrototypeOf(e, d) : (e.__proto__ = d,
                l in e || (e[l] = "GeneratorFunction")),
                e.prototype = Object.create(g),
                e
            }
            ,
            e.awrap = function(e) {
                return {
                    __await: e
                }
            }
            ,
            y(v.prototype),
            v.prototype[o] = function() {
                return this
            }
            ,
            e.AsyncIterator = v,
            e.async = function(t, r, a, n, o) {
                void 0 === o && (o = Promise);
                var l = new v(i(t, r, a, n),o);
                return e.isGeneratorFunction(r) ? l : l.next().then((function(e) {
                    return e.done ? e.value : l.next()
                }
                ))
            }
            ,
            y(g),
            g[l] = "Generator",
            g[n] = function() {
                return this
            }
            ,
            g.toString = function() {
                return "[object Generator]"
            }
            ,
            e.keys = function(e) {
                var t = [];
                for (var r in e)
                    t.push(r);
                return t.reverse(),
                function r() {
                    for (; t.length; ) {
                        var a = t.pop();
                        if (a in e)
                            return r.value = a,
                            r.done = !1,
                            r
                    }
                    return r.done = !0,
                    r
                }
            }
            ,
            e.values = x,
            w.prototype = {
                constructor: w,
                reset: function(e) {
                    if (this.prev = 0,
                    this.next = 0,
                    this.sent = this._sent = void 0,
                    this.done = !1,
                    this.delegate = null,
                    this.method = "next",
                    this.arg = void 0,
                    this.tryEntries.forEach(k),
                    !e)
                        for (var t in this)
                            "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0)
                },
                stop: function() {
                    this.done = !0;
                    var e = this.tryEntries[0].completion;
                    if ("throw" === e.type)
                        throw e.arg;
                    return this.rval
                },
                dispatchException: function(e) {
                    if (this.done)
                        throw e;
                    var t = this;
                    function a(r, a) {
                        return l.type = "throw",
                        l.arg = e,
                        t.next = r,
                        a && (t.method = "next",
                        t.arg = void 0),
                        !!a
                    }
                    for (var n = this.tryEntries.length - 1; n >= 0; --n) {
                        var o = this.tryEntries[n]
                          , l = o.completion;
                        if ("root" === o.tryLoc)
                            return a("end");
                        if (o.tryLoc <= this.prev) {
                            var i = r.call(o, "catchLoc")
                              , s = r.call(o, "finallyLoc");
                            if (i && s) {
                                if (this.prev < o.catchLoc)
                                    return a(o.catchLoc, !0);
                                if (this.prev < o.finallyLoc)
                                    return a(o.finallyLoc)
                            } else if (i) {
                                if (this.prev < o.catchLoc)
                                    return a(o.catchLoc, !0)
                            } else {
                                if (!s)
                                    throw new Error("try statement without catch or finally");
                                if (this.prev < o.finallyLoc)
                                    return a(o.finallyLoc)
                            }
                        }
                    }
                },
                abrupt: function(e, t) {
                    for (var a = this.tryEntries.length - 1; a >= 0; --a) {
                        var n = this.tryEntries[a];
                        if (n.tryLoc <= this.prev && r.call(n, "finallyLoc") && this.prev < n.finallyLoc) {
                            var o = n;
                            break
                        }
                    }
                    o && ("break" === e || "continue" === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null);
                    var l = o ? o.completion : {};
                    return l.type = e,
                    l.arg = t,
                    o ? (this.method = "next",
                    this.next = o.finallyLoc,
                    c) : this.complete(l)
                },
                complete: function(e, t) {
                    if ("throw" === e.type)
                        throw e.arg;
                    return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg,
                    this.method = "return",
                    this.next = "end") : "normal" === e.type && t && (this.next = t),
                    c
                },
                finish: function(e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var r = this.tryEntries[t];
                        if (r.finallyLoc === e)
                            return this.complete(r.completion, r.afterLoc),
                            k(r),
                            c
                    }
                },
                catch: function(e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var r = this.tryEntries[t];
                        if (r.tryLoc === e) {
                            var a = r.completion;
                            if ("throw" === a.type) {
                                var n = a.arg;
                                k(r)
                            }
                            return n
                        }
                    }
                    throw new Error("illegal catch attempt")
                },
                delegateYield: function(e, t, r) {
                    return this.delegate = {
                        iterator: x(e),
                        resultName: t,
                        nextLoc: r
                    },
                    "next" === this.method && (this.arg = void 0),
                    c
                }
            },
            e
        }(e.exports);
        try {
            regeneratorRuntime = t
        } catch (e) {
            Function("r", "regeneratorRuntime = r")(t)
        }
    }
    ))
      , Property = function() {
        function e(t, r, a) {
            classCallCheck(this, e),
            this.document = t,
            this.name = r,
            this.value = a,
            this.isNormalizedColor = !1
        }
        return createClass$1(e, [{
            key: "hasValue",
            value: function() {
                var e = this.value;
                return null !== e && "" !== e && 0 !== e && void 0 !== e
            }
        }, {
            key: "isString",
            value: function(e) {
                var t = this.value
                  , r = "string" == typeof t;
                return r && e ? e.test(t) : r
            }
        }, {
            key: "isUrlDefinition",
            value: function() {
                return this.isString(/^url\(/)
            }
        }, {
            key: "isPixels",
            value: function() {
                if (!this.hasValue())
                    return !1;
                var e = this.getString();
                switch (!0) {
                case /px$/.test(e):
                case /^[0-9]+$/.test(e):
                    return !0;
                default:
                    return !1
                }
            }
        }, {
            key: "setValue",
            value: function(e) {
                return this.value = e,
                this
            }
        }, {
            key: "getValue",
            value: function(e) {
                return void 0 === e || this.hasValue() ? this.value : e
            }
        }, {
            key: "getNumber",
            value: function(e) {
                if (!this.hasValue())
                    return void 0 === e ? 0 : parseFloat(e);
                var t = this.value
                  , r = parseFloat(t);
                return this.isString(/%$/) && (r /= 100),
                r
            }
        }, {
            key: "getString",
            value: function(e) {
                return void 0 === e || this.hasValue() ? void 0 === this.value ? "" : String(this.value) : String(e)
            }
        }, {
            key: "getColor",
            value: function(e) {
                var t = this.getString(e);
                return this.isNormalizedColor || (this.isNormalizedColor = !0,
                t = normalizeColor(t),
                this.value = t),
                t
            }
        }, {
            key: "getDpi",
            value: function() {
                return 96
            }
        }, {
            key: "getRem",
            value: function() {
                return this.document.rootEmSize
            }
        }, {
            key: "getEm",
            value: function() {
                return this.document.emSize
            }
        }, {
            key: "getUnits",
            value: function() {
                return this.getString().replace(/[0-9\.\-]/g, "")
            }
        }, {
            key: "getPixels",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                if (!this.hasValue())
                    return 0;
                var r = "boolean" == typeof e ? [void 0, e] : [e]
                  , a = slicedToArray(r, 2)
                  , n = a[0]
                  , o = a[1]
                  , l = this.document.screen.viewPort;
                switch (!0) {
                case this.isString(/vmin$/):
                    return this.getNumber() / 100 * Math.min(l.computeSize("x"), l.computeSize("y"));
                case this.isString(/vmax$/):
                    return this.getNumber() / 100 * Math.max(l.computeSize("x"), l.computeSize("y"));
                case this.isString(/vw$/):
                    return this.getNumber() / 100 * l.computeSize("x");
                case this.isString(/vh$/):
                    return this.getNumber() / 100 * l.computeSize("y");
                case this.isString(/rem$/):
                    return this.getNumber() * this.getRem();
                case this.isString(/em$/):
                    return this.getNumber() * this.getEm();
                case this.isString(/ex$/):
                    return this.getNumber() * this.getEm() / 2;
                case this.isString(/px$/):
                    return this.getNumber();
                case this.isString(/pt$/):
                    return this.getNumber() * this.getDpi() * (1 / 72);
                case this.isString(/pc$/):
                    return 15 * this.getNumber();
                case this.isString(/cm$/):
                    return this.getNumber() * this.getDpi() / 2.54;
                case this.isString(/mm$/):
                    return this.getNumber() * this.getDpi() / 25.4;
                case this.isString(/in$/):
                    return this.getNumber() * this.getDpi();
                case this.isString(/%$/) && o:
                    return this.getNumber() * this.getEm();
                case this.isString(/%$/):
                    return this.getNumber() * l.computeSize(n);
                default:
                    var i = this.getNumber();
                    return t && i < 1 ? i * l.computeSize(n) : i
                }
            }
        }, {
            key: "getMilliseconds",
            value: function() {
                return this.hasValue() ? this.isString(/ms$/) ? this.getNumber() : 1e3 * this.getNumber() : 0
            }
        }, {
            key: "getRadians",
            value: function() {
                if (!this.hasValue())
                    return 0;
                switch (!0) {
                case this.isString(/deg$/):
                    return this.getNumber() * (Math.PI / 180);
                case this.isString(/grad$/):
                    return this.getNumber() * (Math.PI / 200);
                case this.isString(/rad$/):
                    return this.getNumber();
                default:
                    return this.getNumber() * (Math.PI / 180)
                }
            }
        }, {
            key: "getDefinition",
            value: function() {
                var e = this.getString()
                  , t = e.match(/#([^\)'"]+)/);
                return t && (t = t[1]),
                t || (t = e),
                this.document.definitions[t]
            }
        }, {
            key: "getFillStyleDefinition",
            value: function(e, t) {
                var r = this.getDefinition();
                if (!r)
                    return null;
                if ("function" == typeof r.createGradient)
                    return r.createGradient(this.document.ctx, e, t);
                if ("function" == typeof r.createPattern) {
                    if (r.getHrefAttribute().hasValue()) {
                        var a = r.getAttribute("patternTransform");
                        r = r.getHrefAttribute().getDefinition(),
                        a.hasValue() && r.getAttribute("patternTransform", !0).setValue(a.value)
                    }
                    return r.createPattern(this.document.ctx, e, t)
                }
                return null
            }
        }, {
            key: "getTextBaseline",
            value: function() {
                return this.hasValue() ? e.textBaselineMapping[this.getString()] : null
            }
        }, {
            key: "addOpacity",
            value: function(t) {
                for (var r = this.getColor(), a = r.length, n = 0, o = 0; o < a && ("," === r[o] && n++,
                3 !== n); o++)
                    ;
                if (t.hasValue() && this.isString() && 3 !== n) {
                    var l = new rgbcolor(r);
                    l.ok && (l.alpha = t.getNumber(),
                    r = l.toRGBA())
                }
                return new e(this.document,this.name,r)
            }
        }], [{
            key: "empty",
            value: function(t) {
                return new e(t,"EMPTY","")
            }
        }]),
        e
    }();
    Property.textBaselineMapping = {
        baseline: "alphabetic",
        "before-edge": "top",
        "text-before-edge": "top",
        middle: "middle",
        central: "middle",
        "after-edge": "bottom",
        "text-after-edge": "bottom",
        ideographic: "ideographic",
        alphabetic: "alphabetic",
        hanging: "hanging",
        mathematical: "alphabetic"
    };
    var ViewPort = function() {
        function e() {
            classCallCheck(this, e),
            this.viewPorts = []
        }
        return createClass$1(e, [{
            key: "clear",
            value: function() {
                this.viewPorts = []
            }
        }, {
            key: "setCurrent",
            value: function(e, t) {
                this.viewPorts.push({
                    width: e,
                    height: t
                })
            }
        }, {
            key: "removeCurrent",
            value: function() {
                this.viewPorts.pop()
            }
        }, {
            key: "getCurrent",
            value: function() {
                var e = this.viewPorts;
                return e[e.length - 1]
            }
        }, {
            key: "computeSize",
            value: function(e) {
                return "number" == typeof e ? e : "x" === e ? this.width : "y" === e ? this.height : Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2)
            }
        }, {
            key: "width",
            get: function() {
                return this.getCurrent().width
            }
        }, {
            key: "height",
            get: function() {
                return this.getCurrent().height
            }
        }]),
        e
    }()
      , Point = function() {
        function e(t, r) {
            classCallCheck(this, e),
            this.x = t,
            this.y = r
        }
        return createClass$1(e, [{
            key: "angleTo",
            value: function(e) {
                return Math.atan2(e.y - this.y, e.x - this.x)
            }
        }, {
            key: "applyTransform",
            value: function(e) {
                var t = this.x
                  , r = this.y
                  , a = t * e[0] + r * e[2] + e[4]
                  , n = t * e[1] + r * e[3] + e[5];
                this.x = a,
                this.y = n
            }
        }], [{
            key: "parse",
            value: function(t) {
                var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
                  , a = toNumbers(t)
                  , n = slicedToArray(a, 2)
                  , o = n[0]
                  , l = void 0 === o ? r : o
                  , i = n[1]
                  , s = void 0 === i ? r : i;
                return new e(l,s)
            }
        }, {
            key: "parseScale",
            value: function(t) {
                var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1
                  , a = toNumbers(t)
                  , n = slicedToArray(a, 2)
                  , o = n[0]
                  , l = void 0 === o ? r : o
                  , i = n[1]
                  , s = void 0 === i ? l : i;
                return new e(l,s)
            }
        }, {
            key: "parsePath",
            value: function(t) {
                for (var r = toNumbers(t), a = r.length, n = [], o = 0; o < a; o += 2)
                    n.push(new e(r[o],r[o + 1]));
                return n
            }
        }]),
        e
    }()
      , Mouse = function() {
        function e(t) {
            classCallCheck(this, e),
            this.screen = t,
            this.working = !1,
            this.events = [],
            this.eventElements = [],
            this.onClick = this.onClick.bind(this),
            this.onMouseMove = this.onMouseMove.bind(this)
        }
        return createClass$1(e, [{
            key: "isWorking",
            value: function() {
                return this.working
            }
        }, {
            key: "start",
            value: function() {
                if (!this.working) {
                    var e = this.screen
                      , t = this.onClick
                      , r = this.onMouseMove
                      , a = e.ctx.canvas;
                    a.onclick = t,
                    a.onmousemove = r,
                    this.working = !0
                }
            }
        }, {
            key: "stop",
            value: function() {
                if (this.working) {
                    var e = this.screen.ctx.canvas;
                    this.working = !1,
                    e.onclick = null,
                    e.onmousemove = null
                }
            }
        }, {
            key: "hasEvents",
            value: function() {
                return this.working && this.events.length > 0
            }
        }, {
            key: "runEvents",
            value: function() {
                if (this.working) {
                    var e = this.screen
                      , t = this.events
                      , r = this.eventElements
                      , a = e.ctx.canvas.style;
                    a && (a.cursor = ""),
                    t.forEach((function(e, t) {
                        for (var a = e.run, n = r[t]; n; )
                            a(n),
                            n = n.parent
                    }
                    )),
                    this.events = [],
                    this.eventElements = []
                }
            }
        }, {
            key: "checkPath",
            value: function(e, t) {
                if (this.working && t) {
                    var r = this.events
                      , a = this.eventElements;
                    r.forEach((function(r, n) {
                        var o = r.x
                          , l = r.y;
                        !a[n] && t.isPointInPath && t.isPointInPath(o, l) && (a[n] = e)
                    }
                    ))
                }
            }
        }, {
            key: "checkBoundingBox",
            value: function(e, t) {
                if (this.working && t) {
                    var r = this.events
                      , a = this.eventElements;
                    r.forEach((function(r, n) {
                        var o = r.x
                          , l = r.y;
                        !a[n] && t.isPointInBox(o, l) && (a[n] = e)
                    }
                    ))
                }
            }
        }, {
            key: "mapXY",
            value: function(e, t) {
                for (var r = this.screen, a = r.window, n = r.ctx, o = new Point(e,t), l = n.canvas; l; )
                    o.x -= l.offsetLeft,
                    o.y -= l.offsetTop,
                    l = l.offsetParent;
                return a.scrollX && (o.x += a.scrollX),
                a.scrollY && (o.y += a.scrollY),
                o
            }
        }, {
            key: "onClick",
            value: function(e) {
                var t = this.mapXY((e || event).clientX, (e || event).clientY)
                  , r = t.x
                  , a = t.y;
                this.events.push({
                    type: "onclick",
                    x: r,
                    y: a,
                    run: function(e) {
                        e.onClick && e.onClick()
                    }
                })
            }
        }, {
            key: "onMouseMove",
            value: function(e) {
                var t = this.mapXY((e || event).clientX, (e || event).clientY)
                  , r = t.x
                  , a = t.y;
                this.events.push({
                    type: "onmousemove",
                    x: r,
                    y: a,
                    run: function(e) {
                        e.onMouseMove && e.onMouseMove()
                    }
                })
            }
        }]),
        e
    }()
      , defaultWindow = "undefined" != typeof window ? window : null
      , defaultFetch = "undefined" != typeof fetch ? fetch.bind(void 0) : null
      , Screen = function() {
        function e(t) {
            var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
              , a = r.fetch
              , n = void 0 === a ? defaultFetch : a
              , o = r.window
              , l = void 0 === o ? defaultWindow : o;
            classCallCheck(this, e),
            this.ctx = t,
            this.FRAMERATE = 30,
            this.MAX_VIRTUAL_PIXELS = 3e4,
            this.CLIENT_WIDTH = 800,
            this.CLIENT_HEIGHT = 600,
            this.viewPort = new ViewPort,
            this.mouse = new Mouse(this),
            this.animations = [],
            this.waits = [],
            this.frameDuration = 0,
            this.isReadyLock = !1,
            this.isFirstRender = !0,
            this.intervalId = null,
            this.window = l,
            this.fetch = n
        }
        return createClass$1(e, [{
            key: "wait",
            value: function(e) {
                this.waits.push(e)
            }
        }, {
            key: "ready",
            value: function() {
                return this.readyPromise ? this.readyPromise : Promise.resolve()
            }
        }, {
            key: "isReady",
            value: function() {
                if (this.isReadyLock)
                    return !0;
                var e = this.waits.every((function(e) {
                    return e()
                }
                ));
                return e && (this.waits = [],
                this.resolveReady && this.resolveReady()),
                this.isReadyLock = e,
                e
            }
        }, {
            key: "setDefaults",
            value: function(e) {
                e.strokeStyle = "rgba(0,0,0,0)",
                e.lineCap = "butt",
                e.lineJoin = "miter",
                e.miterLimit = 4
            }
        }, {
            key: "setViewBox",
            value: function(e) {
                var t = e.document
                  , r = e.ctx
                  , a = e.aspectRatio
                  , n = e.width
                  , o = e.desiredWidth
                  , l = e.height
                  , i = e.desiredHeight
                  , s = e.minX
                  , c = void 0 === s ? 0 : s
                  , u = e.minY
                  , h = void 0 === u ? 0 : u
                  , d = e.refX
                  , f = e.refY
                  , m = e.clip
                  , p = void 0 !== m && m
                  , g = e.clipX
                  , y = void 0 === g ? 0 : g
                  , v = e.clipY
                  , A = void 0 === v ? 0 : v
                  , b = compressSpaces(a).replace(/^defer\s/, "").split(" ")
                  , k = slicedToArray(b, 2)
                  , w = k[0] || "xMidYMid"
                  , x = k[1] || "meet"
                  , S = n / o
                  , _ = l / i
                  , C = Math.min(S, _)
                  , T = Math.max(S, _)
                  , E = o
                  , I = i;
                "meet" === x && (E *= C,
                I *= C),
                "slice" === x && (E *= T,
                I *= T);
                var R = new Property(t,"refX",d)
                  , B = new Property(t,"refY",f)
                  , N = R.hasValue() && B.hasValue();
                if (N && r.translate(-C * R.getPixels("x"), -C * B.getPixels("y")),
                p) {
                    var F = C * y
                      , P = C * A;
                    r.beginPath(),
                    r.moveTo(F, P),
                    r.lineTo(n, P),
                    r.lineTo(n, l),
                    r.lineTo(F, l),
                    r.closePath(),
                    r.clip()
                }
                if (!N) {
                    var $ = "meet" === x && C === _
                      , L = "slice" === x && T === _
                      , O = "meet" === x && C === S
                      , D = "slice" === x && T === S;
                    /^xMid/.test(w) && ($ || L) && r.translate(n / 2 - E / 2, 0),
                    /YMid$/.test(w) && (O || D) && r.translate(0, l / 2 - I / 2),
                    /^xMax/.test(w) && ($ || L) && r.translate(n - E, 0),
                    /YMax$/.test(w) && (O || D) && r.translate(0, l - I)
                }
                switch (!0) {
                case "none" === w:
                    r.scale(S, _);
                    break;
                case "meet" === x:
                    r.scale(C, C);
                    break;
                case "slice" === x:
                    r.scale(T, T)
                }
                r.translate(-c, -h)
            }
        }, {
            key: "start",
            value: function(e) {
                var t = this
                  , r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
                  , a = r.enableRedraw
                  , n = void 0 !== a && a
                  , o = r.ignoreMouse
                  , l = void 0 !== o && o
                  , i = r.ignoreAnimation
                  , s = void 0 !== i && i
                  , c = r.ignoreDimensions
                  , u = void 0 !== c && c
                  , h = r.ignoreClear
                  , d = void 0 !== h && h
                  , f = r.forceRedraw
                  , m = r.scaleWidth
                  , p = r.scaleHeight
                  , g = r.offsetX
                  , y = r.offsetY
                  , v = this.FRAMERATE
                  , A = this.mouse
                  , b = 1e3 / v;
                if (this.frameDuration = b,
                this.readyPromise = new Promise((function(e) {
                    t.resolveReady = e
                }
                )),
                this.isReady() && this.render(e, u, d, m, p, g, y),
                n) {
                    var k = Date.now()
                      , w = k
                      , x = 0
                      , S = function r() {
                        k = Date.now(),
                        (x = k - w) >= b && (w = k - x % b,
                        t.shouldUpdate(s, f) && (t.render(e, u, d, m, p, g, y),
                        A.runEvents())),
                        t.intervalId = raf_1(r)
                    };
                    l || A.start(),
                    this.intervalId = raf_1(S)
                }
            }
        }, {
            key: "stop",
            value: function() {
                this.intervalId && (raf_1.cancel(this.intervalId),
                this.intervalId = null),
                this.mouse.stop()
            }
        }, {
            key: "shouldUpdate",
            value: function(e, t) {
                if (!e) {
                    var r = this.frameDuration
                      , a = this.animations.reduce((function(e, t) {
                        return t.update(r) || e
                    }
                    ), !1);
                    if (a)
                        return !0
                }
                return !("function" != typeof t || !t()) || (!(this.isReadyLock || !this.isReady()) || !!this.mouse.hasEvents())
            }
        }, {
            key: "render",
            value: function(e, t, r, a, n, o, l) {
                var i = this.CLIENT_WIDTH
                  , s = this.CLIENT_HEIGHT
                  , c = this.viewPort
                  , u = this.ctx
                  , h = this.isFirstRender
                  , d = u.canvas;
                c.clear(),
                d.width && d.height ? c.setCurrent(d.width, d.height) : c.setCurrent(i, s);
                var f = e.getStyle("width")
                  , m = e.getStyle("height");
                !t && (h || "number" != typeof a && "number" != typeof n) && (f.hasValue() && (d.width = f.getPixels("x"),
                d.style && (d.style.width = "".concat(d.width, "px"))),
                m.hasValue() && (d.height = m.getPixels("y"),
                d.style && (d.style.height = "".concat(d.height, "px"))));
                var p = d.clientWidth || d.width
                  , g = d.clientHeight || d.height;
                if (t && f.hasValue() && m.hasValue() && (p = f.getPixels("x"),
                g = m.getPixels("y")),
                c.setCurrent(p, g),
                "number" == typeof o && e.getAttribute("x", !0).setValue(o),
                "number" == typeof l && e.getAttribute("y", !0).setValue(l),
                "number" == typeof a || "number" == typeof n) {
                    var y = toNumbers(e.getAttribute("viewBox").getString())
                      , v = 0
                      , A = 0;
                    if ("number" == typeof a) {
                        var b = e.getStyle("width");
                        b.hasValue() ? v = b.getPixels("x") / a : isNaN(y[2]) || (v = y[2] / a)
                    }
                    if ("number" == typeof n) {
                        var k = e.getStyle("height");
                        k.hasValue() ? A = k.getPixels("y") / n : isNaN(y[3]) || (A = y[3] / n)
                    }
                    v || (v = A),
                    A || (A = v),
                    e.getAttribute("width", !0).setValue(a),
                    e.getAttribute("height", !0).setValue(n);
                    var w = e.getStyle("transform", !0, !0);
                    w.setValue("".concat(w.getString(), " scale(").concat(1 / v, ", ").concat(1 / A, ")"))
                }
                r || u.clearRect(0, 0, p, g),
                e.render(u),
                h && (this.isFirstRender = !1)
            }
        }]),
        e
    }();
    Screen.defaultWindow = defaultWindow,
    Screen.defaultFetch = defaultFetch;
    var defaultFetch$1 = Screen.defaultFetch
      , DefaultDOMParser = "undefined" != typeof DOMParser ? DOMParser : null
      , Parser$1 = function() {
        function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
              , r = t.fetch
              , a = void 0 === r ? defaultFetch$1 : r
              , n = t.DOMParser
              , o = void 0 === n ? DefaultDOMParser : n;
            classCallCheck(this, e),
            this.fetch = a,
            this.DOMParser = o
        }
        var t, r;
        return createClass$1(e, [{
            key: "parse",
            value: (r = asyncToGenerator(regenerator.mark((function e(t) {
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            if (!/^</.test(t)) {
                                e.next = 2;
                                break
                            }
                            return e.abrupt("return", this.parseFromString(t));
                        case 2:
                            return e.abrupt("return", this.load(t));
                        case 3:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this)
            }
            ))),
            function(e) {
                return r.apply(this, arguments)
            }
            )
        }, {
            key: "parseFromString",
            value: function(e) {
                var t = new this.DOMParser;
                try {
                    return this.checkDocument(t.parseFromString(e, "image/svg+xml"))
                } catch (r) {
                    return this.checkDocument(t.parseFromString(e, "text/xml"))
                }
            }
        }, {
            key: "checkDocument",
            value: function(e) {
                var t = e.getElementsByTagName("parsererror")[0];
                if (t)
                    throw new Error(t.textContent);
                return e
            }
        }, {
            key: "load",
            value: (t = asyncToGenerator(regenerator.mark((function e(t) {
                var r, a;
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            return e.next = 2,
                            this.fetch(t);
                        case 2:
                            return r = e.sent,
                            e.next = 5,
                            r.text();
                        case 5:
                            return a = e.sent,
                            e.abrupt("return", this.parseFromString(a));
                        case 7:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this)
            }
            ))),
            function(e) {
                return t.apply(this, arguments)
            }
            )
        }]),
        e
    }()
      , Translate = function() {
        function e(t, r) {
            classCallCheck(this, e),
            this.type = "translate",
            this.point = null,
            this.point = Point.parse(r)
        }
        return createClass$1(e, [{
            key: "apply",
            value: function(e) {
                var t = this.point
                  , r = t.x
                  , a = t.y;
                e.translate(r || 0, a || 0)
            }
        }, {
            key: "unapply",
            value: function(e) {
                var t = this.point
                  , r = t.x
                  , a = t.y;
                e.translate(-1 * r || 0, -1 * a || 0)
            }
        }, {
            key: "applyToPoint",
            value: function(e) {
                var t = this.point
                  , r = t.x
                  , a = t.y;
                e.applyTransform([1, 0, 0, 1, r || 0, a || 0])
            }
        }]),
        e
    }()
      , Rotate = function() {
        function e(t, r) {
            var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
            classCallCheck(this, e),
            this.type = "rotate",
            this.angle = null,
            this.cx = 0,
            this.cy = 0;
            var n = toNumbers(r);
            this.angle = new Property(t,"angle",n[0]),
            this.cx = (n[1] || 0) + (a[0] || 0),
            this.cy = (n[2] || 0) + (a[1] || 0)
        }
        return createClass$1(e, [{
            key: "apply",
            value: function(e) {
                var t = this.cx
                  , r = this.cy
                  , a = this.angle;
                e.translate(t, r),
                e.rotate(a.getRadians()),
                e.translate(-t, -r)
            }
        }, {
            key: "unapply",
            value: function(e) {
                var t = this.cx
                  , r = this.cy
                  , a = this.angle;
                e.translate(t, r),
                e.rotate(-1 * a.getRadians()),
                e.translate(-t, -r)
            }
        }, {
            key: "applyToPoint",
            value: function(e) {
                var t = this.cx
                  , r = this.cy
                  , a = this.angle.getRadians();
                e.applyTransform([1, 0, 0, 1, t || 0, r || 0]),
                e.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]),
                e.applyTransform([1, 0, 0, 1, -t || 0, -r || 0])
            }
        }]),
        e
    }()
      , Scale = function() {
        function e(t, r) {
            classCallCheck(this, e),
            this.type = "scale",
            this.scale = null;
            var a = Point.parseScale(r);
            0 !== a.x && 0 !== a.y || (a.x = PSEUDO_ZERO,
            a.y = PSEUDO_ZERO),
            this.scale = a
        }
        return createClass$1(e, [{
            key: "apply",
            value: function(e) {
                var t = this.scale
                  , r = t.x
                  , a = t.y;
                e.scale(r, a || r)
            }
        }, {
            key: "unapply",
            value: function(e) {
                var t = this.scale
                  , r = t.x
                  , a = t.y;
                e.scale(1 / r, 1 / a || r)
            }
        }, {
            key: "applyToPoint",
            value: function(e) {
                var t = this.scale
                  , r = t.x
                  , a = t.y;
                e.applyTransform([r || 0, 0, 0, a || 0, 0, 0])
            }
        }]),
        e
    }()
      , Matrix = function() {
        function e(t, r) {
            classCallCheck(this, e),
            this.type = "matrix",
            this.matrix = [],
            this.matrix = toNumbers(r)
        }
        return createClass$1(e, [{
            key: "apply",
            value: function(e) {
                var t = this.matrix;
                e.transform(t[0], t[1], t[2], t[3], t[4], t[5])
            }
        }, {
            key: "unapply",
            value: function(e) {
                var t = this.matrix
                  , r = t[0]
                  , a = t[2]
                  , n = t[4]
                  , o = t[1]
                  , l = t[3]
                  , i = t[5]
                  , s = 1 / (r * (1 * l - 0 * i) - a * (1 * o - 0 * i) + n * (0 * o - 0 * l));
                e.transform(s * (1 * l - 0 * i), s * (0 * i - 1 * o), s * (0 * n - 1 * a), s * (1 * r - 0 * n), s * (a * i - n * l), s * (n * o - r * i))
            }
        }, {
            key: "applyToPoint",
            value: function(e) {
                e.applyTransform(this.matrix)
            }
        }]),
        e
    }();
    function _createSuper(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var Skew = function(e) {
        inherits(r, e);
        var t = _createSuper(r);
        function r(e, a) {
            var n;
            return classCallCheck(this, r),
            (n = t.call(this, e, a)).type = "skew",
            n.angle = null,
            n.angle = new Property(e,"angle",a),
            n
        }
        return r
    }(Matrix);
    function _createSuper$1(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$1()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$1() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var SkewX = function(e) {
        inherits(r, e);
        var t = _createSuper$1(r);
        function r(e, a) {
            var n;
            return classCallCheck(this, r),
            (n = t.call(this, e, a)).type = "skewX",
            n.matrix = [1, 0, Math.tan(n.angle.getRadians()), 1, 0, 0],
            n
        }
        return r
    }(Skew);
    function _createSuper$2(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$2()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$2() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var SkewY = function(e) {
        inherits(r, e);
        var t = _createSuper$2(r);
        function r(e, a) {
            var n;
            return classCallCheck(this, r),
            (n = t.call(this, e, a)).type = "skewY",
            n.matrix = [1, Math.tan(n.angle.getRadians()), 0, 1, 0, 0],
            n
        }
        return r
    }(Skew);
    function parseTransforms(e) {
        return compressSpaces(e).trim().replace(/\)([a-zA-Z])/g, ") $1").replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/)
    }
    function parseTransform(e) {
        var t = e.split("(")
          , r = slicedToArray(t, 2)
          , a = r[0]
          , n = r[1];
        return [a.trim(), n.trim().replace(")", "")]
    }
    var Transform = function() {
        function e(t, r, a) {
            var n = this;
            classCallCheck(this, e),
            this.document = t,
            this.transforms = [];
            var o = parseTransforms(r)
              , l = a ? toNumbers(a) : [];
            o.forEach((function(t) {
                if ("none" !== t) {
                    var r = parseTransform(t)
                      , a = slicedToArray(r, 2)
                      , o = a[0]
                      , i = a[1]
                      , s = e.transformTypes[o];
                    void 0 !== s && n.transforms.push(new s(n.document,i,l))
                }
            }
            ))
        }
        return createClass$1(e, [{
            key: "apply",
            value: function(e) {
                for (var t = this.transforms, r = t.length, a = 0; a < r; a++)
                    t[a].apply(e)
            }
        }, {
            key: "unapply",
            value: function(e) {
                for (var t = this.transforms, r = t.length - 1; r >= 0; r--)
                    t[r].unapply(e)
            }
        }, {
            key: "applyToPoint",
            value: function(e) {
                for (var t = this.transforms, r = t.length, a = 0; a < r; a++)
                    t[a].applyToPoint(e)
            }
        }], [{
            key: "fromElement",
            value: function(t, r) {
                var a = r.getStyle("transform", !1, !0)
                  , n = r.getStyle("transform-origin", !1, !0);
                return a.hasValue() ? new e(t,a.getString(),n.getString()) : null
            }
        }]),
        e
    }();
    Transform.transformTypes = {
        translate: Translate,
        rotate: Rotate,
        scale: Scale,
        matrix: Matrix,
        skewX: SkewX,
        skewY: SkewY
    };
    var Element = function() {
        function e(t, r) {
            var a = this
              , n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
            if (classCallCheck(this, e),
            this.document = t,
            this.node = r,
            this.captureTextNodes = n,
            this.attributes = {},
            this.styles = {},
            this.stylesSpecificity = {},
            this.animationFrozen = !1,
            this.animationFrozenValue = "",
            this.parent = null,
            this.children = [],
            r && 1 === r.nodeType) {
                if (Array.from(r.attributes).forEach((function(e) {
                    var r = normalizeAttributeName(e.nodeName);
                    a.attributes[r] = new Property(t,r,e.value)
                }
                )),
                this.addStylesFromStyleDefinition(),
                this.getAttribute("style").hasValue()) {
                    var o = this.getAttribute("style").getString().split(";").map((function(e) {
                        return e.trim()
                    }
                    ));
                    o.forEach((function(e) {
                        if (e) {
                            var r = e.split(":").map((function(e) {
                                return e.trim()
                            }
                            ))
                              , n = slicedToArray(r, 2)
                              , o = n[0]
                              , l = n[1];
                            a.styles[o] = new Property(t,o,l)
                        }
                    }
                    ))
                }
                var l = t.definitions
                  , i = this.getAttribute("id");
                i.hasValue() && (l[i.getValue()] || (l[i.getValue()] = this)),
                Array.from(r.childNodes).forEach((function(e) {
                    if (1 === e.nodeType)
                        a.addChild(e);
                    else if (n && (3 === e.nodeType || 4 === e.nodeType)) {
                        var r = t.createTextNode(e);
                        r.getText().length > 0 && a.addChild(r)
                    }
                }
                ))
            }
        }
        return createClass$1(e, [{
            key: "getAttribute",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
                  , r = this.attributes[e];
                if (!r && t) {
                    var a = new Property(this.document,e,"");
                    return this.attributes[e] = a,
                    a
                }
                return r || Property.empty(this.document)
            }
        }, {
            key: "getHrefAttribute",
            value: function() {
                for (var e in this.attributes)
                    if ("href" === e || /:href$/.test(e))
                        return this.attributes[e];
                return Property.empty(this.document)
            }
        }, {
            key: "getStyle",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
                  , r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
                  , a = this.styles[e];
                if (a)
                    return a;
                var n = this.getAttribute(e);
                if (n && n.hasValue())
                    return this.styles[e] = n,
                    n;
                if (!r) {
                    var o = this.parent;
                    if (o) {
                        var l = o.getStyle(e);
                        if (l && l.hasValue())
                            return l
                    }
                }
                if (t) {
                    var i = new Property(this.document,e,"");
                    return this.styles[e] = i,
                    i
                }
                return a || Property.empty(this.document)
            }
        }, {
            key: "render",
            value: function(e) {
                if ("none" !== this.getStyle("display").getString() && "hidden" !== this.getStyle("visibility").getString()) {
                    if (e.save(),
                    this.getStyle("mask").hasValue()) {
                        var t = this.getStyle("mask").getDefinition();
                        t && (this.applyEffects(e),
                        t.apply(e, this))
                    } else if ("none" !== this.getStyle("filter").getValue("none")) {
                        var r = this.getStyle("filter").getDefinition();
                        r && (this.applyEffects(e),
                        r.apply(e, this))
                    } else
                        this.setContext(e),
                        this.renderChildren(e),
                        this.clearContext(e);
                    e.restore()
                }
            }
        }, {
            key: "setContext",
            value: function(e) {}
        }, {
            key: "applyEffects",
            value: function(e) {
                var t = Transform.fromElement(this.document, this);
                t && t.apply(e);
                var r = this.getStyle("clip-path", !1, !0);
                if (r.hasValue()) {
                    var a = r.getDefinition();
                    a && a.apply(e)
                }
            }
        }, {
            key: "clearContext",
            value: function(e) {}
        }, {
            key: "renderChildren",
            value: function(e) {
                this.children.forEach((function(t) {
                    t.render(e)
                }
                ))
            }
        }, {
            key: "addChild",
            value: function(t) {
                var r = t instanceof e ? t : this.document.createElement(t);
                r.parent = this,
                e.ignoreChildTypes.includes(r.type) || this.children.push(r)
            }
        }, {
            key: "matchesSelector",
            value: function(e) {
                var t = this.node;
                if ("function" == typeof t.matches)
                    return t.matches(e);
                var r = t.getAttribute("class");
                return !(!r || "" === r) && r.split(" ").some((function(t) {
                    if (".".concat(t) === e)
                        return !0
                }
                ))
            }
        }, {
            key: "addStylesFromStyleDefinition",
            value: function() {
                var e = this.document
                  , t = e.styles
                  , r = e.stylesSpecificity;
                for (var a in t)
                    if ("@" !== a[0] && this.matchesSelector(a)) {
                        var n = t[a]
                          , o = r[a];
                        if (n)
                            for (var l in n) {
                                var i = this.stylesSpecificity[l];
                                void 0 === i && (i = "000"),
                                o >= i && (this.styles[l] = n[l],
                                this.stylesSpecificity[l] = o)
                            }
                    }
            }
        }, {
            key: "removeStyles",
            value: function(e, t) {
                return t.reduce((function(t, r) {
                    var a = e.getStyle(r);
                    if (!a.hasValue())
                        return t;
                    var n = a.getString();
                    return a.setValue(""),
                    [].concat(toConsumableArray(t), [[r, n]])
                }
                ), [])
            }
        }, {
            key: "restoreStyles",
            value: function(e, t) {
                t.forEach((function(t) {
                    var r = slicedToArray(t, 2)
                      , a = r[0]
                      , n = r[1];
                    e.getStyle(a, !0).setValue(n)
                }
                ))
            }
        }]),
        e
    }();
    function _createSuper$3(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$3()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$3() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    Element.ignoreChildTypes = ["title"];
    var UnknownElement = function(e) {
        inherits(r, e);
        var t = _createSuper$3(r);
        function r(e, a, n) {
            return classCallCheck(this, r),
            t.call(this, e, a, n)
        }
        return r
    }(Element);
    function wrapFontFamily(e) {
        var t = e.trim();
        return /^('|")/.test(t) ? t : '"'.concat(t, '"')
    }
    function prepareFontFamily(e) {
        return "undefined" == typeof process ? e : e.trim().split(",").map(wrapFontFamily).join(",")
    }
    function prepareFontStyle(e) {
        if (!e)
            return "";
        var t = e.trim().toLowerCase();
        switch (t) {
        case "normal":
        case "italic":
        case "oblique":
        case "inherit":
        case "initial":
        case "unset":
            return t;
        default:
            return /^oblique\s+(-|)\d+deg$/.test(t) ? t : ""
        }
    }
    function prepareFontWeight(e) {
        if (!e)
            return "";
        var t = e.trim().toLowerCase();
        switch (t) {
        case "normal":
        case "bold":
        case "lighter":
        case "bolder":
        case "inherit":
        case "initial":
        case "unset":
            return t;
        default:
            return /^[\d.]+$/.test(t) ? t : ""
        }
    }
    var Font = function() {
        function e(t, r, a, n, o, l) {
            classCallCheck(this, e);
            var i = l ? "string" == typeof l ? e.parse(l) : l : {};
            this.fontFamily = o || i.fontFamily,
            this.fontSize = n || i.fontSize,
            this.fontStyle = t || i.fontStyle,
            this.fontWeight = a || i.fontWeight,
            this.fontVariant = r || i.fontVariant
        }
        return createClass$1(e, [{
            key: "toString",
            value: function() {
                return [prepareFontStyle(this.fontStyle), this.fontVariant, prepareFontWeight(this.fontWeight), this.fontSize, prepareFontFamily(this.fontFamily)].join(" ").trim()
            }
        }], [{
            key: "parse",
            value: function() {
                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""
                  , r = arguments.length > 1 ? arguments[1] : void 0
                  , a = ""
                  , n = ""
                  , o = ""
                  , l = ""
                  , i = ""
                  , s = compressSpaces(t).trim().split(" ")
                  , c = {
                    fontSize: !1,
                    fontStyle: !1,
                    fontWeight: !1,
                    fontVariant: !1
                };
                return s.forEach((function(t) {
                    switch (!0) {
                    case !c.fontStyle && e.styles.includes(t):
                        "inherit" !== t && (a = t),
                        c.fontStyle = !0;
                        break;
                    case !c.fontVariant && e.variants.includes(t):
                        "inherit" !== t && (n = t),
                        c.fontStyle = !0,
                        c.fontVariant = !0;
                        break;
                    case !c.fontWeight && e.weights.includes(t):
                        "inherit" !== t && (o = t),
                        c.fontStyle = !0,
                        c.fontVariant = !0,
                        c.fontWeight = !0;
                        break;
                    case !c.fontSize:
                        if ("inherit" !== t) {
                            var r = t.split("/")
                              , s = slicedToArray(r, 1);
                            l = s[0]
                        }
                        c.fontStyle = !0,
                        c.fontVariant = !0,
                        c.fontWeight = !0,
                        c.fontSize = !0;
                        break;
                    default:
                        "inherit" !== t && (i += t)
                    }
                }
                )),
                new e(a,n,o,l,i,r)
            }
        }]),
        e
    }();
    Font.styles = "normal|italic|oblique|inherit",
    Font.variants = "normal|small-caps|inherit",
    Font.weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";
    var BoundingBox = function() {
        function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Number.NaN
              , r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.NaN
              , a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Number.NaN
              , n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Number.NaN;
            classCallCheck(this, e),
            this.x1 = t,
            this.y1 = r,
            this.x2 = a,
            this.y2 = n,
            this.addPoint(t, r),
            this.addPoint(a, n)
        }
        return createClass$1(e, [{
            key: "addPoint",
            value: function(e, t) {
                void 0 !== e && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = e,
                this.x2 = e),
                e < this.x1 && (this.x1 = e),
                e > this.x2 && (this.x2 = e)),
                void 0 !== t && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = t,
                this.y2 = t),
                t < this.y1 && (this.y1 = t),
                t > this.y2 && (this.y2 = t))
            }
        }, {
            key: "addX",
            value: function(e) {
                this.addPoint(e, null)
            }
        }, {
            key: "addY",
            value: function(e) {
                this.addPoint(null, e)
            }
        }, {
            key: "addBoundingBox",
            value: function(e) {
                if (e) {
                    var t = e.x1
                      , r = e.y1
                      , a = e.x2
                      , n = e.y2;
                    this.addPoint(t, r),
                    this.addPoint(a, n)
                }
            }
        }, {
            key: "sumCubic",
            value: function(e, t, r, a, n) {
                return Math.pow(1 - e, 3) * t + 3 * Math.pow(1 - e, 2) * e * r + 3 * (1 - e) * Math.pow(e, 2) * a + Math.pow(e, 3) * n
            }
        }, {
            key: "bezierCurveAdd",
            value: function(e, t, r, a, n) {
                var o = 6 * t - 12 * r + 6 * a
                  , l = -3 * t + 9 * r - 9 * a + 3 * n
                  , i = 3 * r - 3 * t;
                if (0 !== l) {
                    var s = Math.pow(o, 2) - 4 * i * l;
                    if (!(s < 0)) {
                        var c = (-o + Math.sqrt(s)) / (2 * l);
                        0 < c && c < 1 && (e ? this.addX(this.sumCubic(c, t, r, a, n)) : this.addY(this.sumCubic(c, t, r, a, n)));
                        var u = (-o - Math.sqrt(s)) / (2 * l);
                        0 < u && u < 1 && (e ? this.addX(this.sumCubic(u, t, r, a, n)) : this.addY(this.sumCubic(u, t, r, a, n)))
                    }
                } else {
                    if (0 === o)
                        return;
                    var h = -i / o;
                    0 < h && h < 1 && (e ? this.addX(this.sumCubic(h, t, r, a, n)) : this.addY(this.sumCubic(h, t, r, a, n)))
                }
            }
        }, {
            key: "addBezierCurve",
            value: function(e, t, r, a, n, o, l, i) {
                this.addPoint(e, t),
                this.addPoint(l, i),
                this.bezierCurveAdd(!0, e, r, n, l),
                this.bezierCurveAdd(!1, t, a, o, i)
            }
        }, {
            key: "addQuadraticCurve",
            value: function(e, t, r, a, n, o) {
                var l = e + 2 / 3 * (r - e)
                  , i = t + 2 / 3 * (a - t)
                  , s = l + 1 / 3 * (n - e)
                  , c = i + 1 / 3 * (o - t);
                this.addBezierCurve(e, t, l, s, i, c, n, o)
            }
        }, {
            key: "isPointInBox",
            value: function(e, t) {
                var r = this.x1
                  , a = this.y1
                  , n = this.x2
                  , o = this.y2;
                return r <= e && e <= n && a <= t && t <= o
            }
        }, {
            key: "x",
            get: function() {
                return this.x1
            }
        }, {
            key: "y",
            get: function() {
                return this.y1
            }
        }, {
            key: "width",
            get: function() {
                return this.x2 - this.x1
            }
        }, {
            key: "height",
            get: function() {
                return this.y2 - this.y1
            }
        }]),
        e
    }();
    function _createSuper$4(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$4()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$4() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var RenderedElement = function(e) {
        inherits(r, e);
        var t = _createSuper$4(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).modifiedEmSizeStack = !1,
            e
        }
        return createClass$1(r, [{
            key: "calculateOpacity",
            value: function() {
                for (var e = 1, t = this; t; ) {
                    var r = t.getStyle("opacity", !1, !0);
                    r.hasValue() && (e *= r.getNumber()),
                    t = t.parent
                }
                return e
            }
        }, {
            key: "setContext",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                if (!t) {
                    var r = this.getStyle("fill")
                      , a = this.getStyle("fill-opacity")
                      , n = this.getStyle("stroke")
                      , o = this.getStyle("stroke-opacity");
                    if (r.isUrlDefinition()) {
                        var l = r.getFillStyleDefinition(this, a);
                        l && (e.fillStyle = l)
                    } else if (r.hasValue()) {
                        "currentColor" === r.getString() && r.setValue(this.getStyle("color").getColor());
                        var i = r.getColor();
                        "inherit" !== i && (e.fillStyle = "none" === i ? "rgba(0,0,0,0)" : i)
                    }
                    if (a.hasValue()) {
                        var s = new Property(this.document,"fill",e.fillStyle).addOpacity(a).getColor();
                        e.fillStyle = s
                    }
                    if (n.isUrlDefinition()) {
                        var c = n.getFillStyleDefinition(this, o);
                        c && (e.strokeStyle = c)
                    } else if (n.hasValue()) {
                        "currentColor" === n.getString() && n.setValue(this.getStyle("color").getColor());
                        var u = n.getString();
                        "inherit" !== u && (e.strokeStyle = "none" === u ? "rgba(0,0,0,0)" : u)
                    }
                    if (o.hasValue()) {
                        var h = new Property(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();
                        e.strokeStyle = h
                    }
                    var d = this.getStyle("stroke-width");
                    if (d.hasValue()) {
                        var f = d.getPixels();
                        e.lineWidth = f || PSEUDO_ZERO
                    }
                    var m = this.getStyle("stroke-linecap")
                      , p = this.getStyle("stroke-linejoin")
                      , g = this.getStyle("stroke-miterlimit")
                      , y = this.getStyle("paint-order")
                      , v = this.getStyle("stroke-dasharray")
                      , A = this.getStyle("stroke-dashoffset");
                    if (m.hasValue() && (e.lineCap = m.getString()),
                    p.hasValue() && (e.lineJoin = p.getString()),
                    g.hasValue() && (e.miterLimit = g.getNumber()),
                    y.hasValue() && (e.paintOrder = y.getValue()),
                    v.hasValue() && "none" !== v.getString()) {
                        var b = toNumbers(v.getString());
                        void 0 !== e.setLineDash ? e.setLineDash(b) : void 0 !== e.webkitLineDash ? e.webkitLineDash = b : void 0 === e.mozDash || 1 === b.length && 0 === b[0] || (e.mozDash = b);
                        var k = A.getPixels();
                        void 0 !== e.lineDashOffset ? e.lineDashOffset = k : void 0 !== e.webkitLineDashOffset ? e.webkitLineDashOffset = k : void 0 !== e.mozDashOffset && (e.mozDashOffset = k)
                    }
                }
                if (this.modifiedEmSizeStack = !1,
                void 0 !== e.font) {
                    var w = this.getStyle("font")
                      , x = this.getStyle("font-style")
                      , S = this.getStyle("font-variant")
                      , _ = this.getStyle("font-weight")
                      , C = this.getStyle("font-size")
                      , T = this.getStyle("font-family")
                      , E = new Font(x.getString(),S.getString(),_.getString(),C.hasValue() ? "".concat(C.getPixels(!0), "px") : "",T.getString(),Font.parse(w.getString(), e.font));
                    x.setValue(E.fontStyle),
                    S.setValue(E.fontVariant),
                    _.setValue(E.fontWeight),
                    C.setValue(E.fontSize),
                    T.setValue(E.fontFamily),
                    e.font = E.toString(),
                    C.isPixels() && (this.document.emSize = C.getPixels(),
                    this.modifiedEmSizeStack = !0)
                }
                t || (this.applyEffects(e),
                e.globalAlpha = this.calculateOpacity())
            }
        }, {
            key: "clearContext",
            value: function(e) {
                get$2(getPrototypeOf(r.prototype), "clearContext", this).call(this, e),
                this.modifiedEmSizeStack && this.document.popEmSize()
            }
        }]),
        r
    }(Element);
    function _createSuper$5(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$5()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$5() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TextElement = function(e) {
        inherits(r, e);
        var t = _createSuper$5(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, (this instanceof r ? this.constructor : void 0) === r || n)).type = "text",
            o.x = 0,
            o.y = 0,
            o.measureCache = -1,
            o
        }
        return createClass$1(r, [{
            key: "setContext",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                get$2(getPrototypeOf(r.prototype), "setContext", this).call(this, e, t);
                var a = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
                a && (e.textBaseline = a)
            }
        }, {
            key: "initializeCoordinates",
            value: function(e) {
                this.x = this.getAttribute("x").getPixels("x"),
                this.y = this.getAttribute("y").getPixels("y");
                var t = this.getAttribute("dx")
                  , r = this.getAttribute("dy");
                t.hasValue() && (this.x += t.getPixels("x")),
                r.hasValue() && (this.y += r.getPixels("y")),
                this.x += this.getAnchorDelta(e, this, 0)
            }
        }, {
            key: "getBoundingBox",
            value: function(e) {
                var t = this;
                if ("text" !== this.type)
                    return this.getTElementBoundingBox(e);
                this.initializeCoordinates(e);
                var r = null;
                return this.children.forEach((function(a, n) {
                    var o = t.getChildBoundingBox(e, t, t, n);
                    r ? r.addBoundingBox(o) : r = o
                }
                )),
                r
            }
        }, {
            key: "getFontSize",
            value: function() {
                var e = this.document
                  , t = this.parent
                  , r = Font.parse(e.ctx.font).fontSize;
                return t.getStyle("font-size").getNumber(r)
            }
        }, {
            key: "getTElementBoundingBox",
            value: function(e) {
                var t = this.getFontSize();
                return new BoundingBox(this.x,this.y - t,this.x + this.measureText(e),this.y)
            }
        }, {
            key: "getGlyph",
            value: function(e, t, r) {
                var a = t[r]
                  , n = null;
                if (e.isArabic) {
                    var o = t.length
                      , l = t[r - 1]
                      , i = t[r + 1]
                      , s = "isolated";
                    (0 === r || " " === l) && r < o - 2 && " " !== i && (s = "terminal"),
                    r > 0 && " " !== l && r < o - 2 && " " !== i && (s = "medial"),
                    r > 0 && " " !== l && (r === o - 1 || " " === i) && (s = "initial"),
                    void 0 !== e.glyphs[a] && ((n = e.glyphs[a][s]) || "glyph" !== e.glyphs[a].type || (n = e.glyphs[a]))
                } else
                    n = e.glyphs[a];
                return n || (n = e.missingGlyph),
                n
            }
        }, {
            key: "getText",
            value: function() {
                return ""
            }
        }, {
            key: "getTextFromNode",
            value: function(e) {
                var t = e || this.node
                  , r = Array.from(t.parentNode.childNodes)
                  , a = r.indexOf(t)
                  , n = r.length - 1
                  , o = compressSpaces(t.value || t.text || t.textContent || "");
                return 0 === a && (o = trimLeft(o)),
                a === n && (o = trimRight(o)),
                o
            }
        }, {
            key: "renderChildren",
            value: function(e) {
                var t = this;
                if ("text" === this.type) {
                    this.initializeCoordinates(e),
                    this.children.forEach((function(r, a) {
                        t.renderChild(e, t, t, a)
                    }
                    ));
                    var r = this.document.screen.mouse;
                    r.isWorking() && r.checkBoundingBox(this, this.getBoundingBox(e))
                } else
                    this.renderTElementChildren(e)
            }
        }, {
            key: "renderTElementChildren",
            value: function(e) {
                var t = this.document
                  , r = this.parent
                  , a = this.getText()
                  , n = r.getStyle("font-family").getDefinition();
                if (n)
                    for (var o = n.fontFace.unitsPerEm, l = Font.parse(t.ctx.font), i = r.getStyle("font-size").getNumber(l.fontSize), s = r.getStyle("font-style").getString(l.fontStyle), c = i / o, u = n.isRTL ? a.split("").reverse().join("") : a, h = toNumbers(r.getAttribute("dx").getString()), d = u.length, f = 0; f < d; f++) {
                        var m = this.getGlyph(n, u, f);
                        e.translate(this.x, this.y),
                        e.scale(c, -c);
                        var p = e.lineWidth;
                        e.lineWidth = e.lineWidth * o / i,
                        "italic" === s && e.transform(1, 0, .4, 1, 0, 0),
                        m.render(e),
                        "italic" === s && e.transform(1, 0, -.4, 1, 0, 0),
                        e.lineWidth = p,
                        e.scale(1 / c, -1 / c),
                        e.translate(-this.x, -this.y),
                        this.x += i * (m.horizAdvX || n.horizAdvX) / o,
                        void 0 === h[f] || isNaN(h[f]) || (this.x += h[f])
                    }
                else {
                    var g = this.x
                      , y = this.y;
                    "stroke" === e.paintOrder ? (e.strokeStyle && e.strokeText(a, g, y),
                    e.fillStyle && e.fillText(a, g, y)) : (e.fillStyle && e.fillText(a, g, y),
                    e.strokeStyle && e.strokeText(a, g, y))
                }
            }
        }, {
            key: "getAnchorDelta",
            value: function(e, t, r) {
                var a = this.getStyle("text-anchor").getString("start");
                if ("start" !== a) {
                    for (var n = t.children, o = n.length, l = null, i = 0, s = r; s < o && (l = n[s],
                    !(s > r && l.getAttribute("x").hasValue() || l.getAttribute("text-anchor").hasValue())); s++)
                        i += l.measureTextRecursive(e);
                    return -1 * ("end" === a ? i : i / 2)
                }
                return 0
            }
        }, {
            key: "adjustChildCoordinates",
            value: function(e, t, r, a) {
                var n = r.children[a];
                if ("function" != typeof n.measureText)
                    return n;
                e.save(),
                n.setContext(e, !0);
                var o = n.getAttribute("x")
                  , l = n.getAttribute("y")
                  , i = n.getAttribute("dx")
                  , s = n.getAttribute("dy")
                  , c = n.getAttribute("text-anchor").getString("start");
                if (0 === a && "textNode" !== n.type && (o.hasValue() || o.setValue(t.getAttribute("x").getValue("0")),
                l.hasValue() || l.setValue(t.getAttribute("y").getValue("0")),
                i.hasValue() || i.setValue(t.getAttribute("dx").getValue("0")),
                s.hasValue() || s.setValue(t.getAttribute("dy").getValue("0"))),
                o.hasValue()) {
                    if (n.x = o.getPixels("x") + t.getAnchorDelta(e, r, a),
                    "start" !== c) {
                        var u = n.measureTextRecursive(e);
                        n.x += -1 * ("end" === c ? u : u / 2)
                    }
                    i.hasValue() && (n.x += i.getPixels("x"))
                } else {
                    if ("start" !== c) {
                        var h = n.measureTextRecursive(e);
                        t.x += -1 * ("end" === c ? h : h / 2)
                    }
                    i.hasValue() && (t.x += i.getPixels("x")),
                    n.x = t.x
                }
                return t.x = n.x + n.measureText(e),
                l.hasValue() ? (n.y = l.getPixels("y"),
                s.hasValue() && (n.y += s.getPixels("y"))) : (s.hasValue() && (t.y += s.getPixels("y")),
                n.y = t.y),
                t.y = n.y,
                n.clearContext(e),
                e.restore(),
                n
            }
        }, {
            key: "getChildBoundingBox",
            value: function(e, t, r, a) {
                var n = this.adjustChildCoordinates(e, t, r, a)
                  , o = n.getBoundingBox(e);
                return o ? (n.children.forEach((function(r, a) {
                    var l = t.getChildBoundingBox(e, t, n, a);
                    o.addBoundingBox(l)
                }
                )),
                o) : null
            }
        }, {
            key: "renderChild",
            value: function(e, t, r, a) {
                var n = this.adjustChildCoordinates(e, t, r, a);
                n.render(e),
                n.children.forEach((function(r, a) {
                    t.renderChild(e, t, n, a)
                }
                ))
            }
        }, {
            key: "measureTextRecursive",
            value: function(e) {
                return this.children.reduce((function(t, r) {
                    return t + r.measureTextRecursive(e)
                }
                ), this.measureText(e))
            }
        }, {
            key: "measureText",
            value: function(e) {
                var t = this.measureCache;
                if (~t)
                    return t;
                var r = this.getText()
                  , a = this.measureTargetText(e, r);
                return this.measureCache = a,
                a
            }
        }, {
            key: "measureTargetText",
            value: function(e, t) {
                if (!t.length)
                    return 0;
                var r = this.parent
                  , a = r.getStyle("font-family").getDefinition();
                if (a) {
                    for (var n = this.getFontSize(), o = a.isRTL ? t.split("").reverse().join("") : t, l = toNumbers(r.getAttribute("dx").getString()), i = o.length, s = 0, c = 0; c < i; c++) {
                        s += (this.getGlyph(a, o, c).horizAdvX || a.horizAdvX) * n / a.fontFace.unitsPerEm,
                        void 0 === l[c] || isNaN(l[c]) || (s += l[c])
                    }
                    return s
                }
                if (!e.measureText)
                    return 10 * t.length;
                e.save(),
                this.setContext(e, !0);
                var u = e.measureText(t).width;
                return this.clearContext(e),
                e.restore(),
                u
            }
        }]),
        r
    }(RenderedElement);
    function _createSuper$6(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$6()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$6() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TSpanElement = function(e) {
        inherits(r, e);
        var t = _createSuper$6(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, (this instanceof r ? this.constructor : void 0) === r || n)).type = "tspan",
            o.text = o.children.length > 0 ? "" : o.getTextFromNode(),
            o
        }
        return createClass$1(r, [{
            key: "getText",
            value: function() {
                return this.text
            }
        }]),
        r
    }(TextElement);
    function _createSuper$7(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$7()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$7() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TextNode = function(e) {
        inherits(r, e);
        var t = _createSuper$7(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "textNode",
            e
        }
        return r
    }(TSpanElement);
    function preparePath(e) {
        return compressSpaces(e.replace(/,/gm, " ").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, "$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, "$1 $2").replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm, "$1 $2").replace(/([0-9])([+\-])/gm, "$1 $2").replace(/(\.[0-9]*)(\.)/gm, "$1 $2").replace(/(\.[0-9]*)(\.)/gm, "$1 $2").replace(/([Aa](?:\s+(?:[0-9]*\.)?[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $2 $3 ")).trim()
    }
    var PathParser = function() {
        function e(t) {
            classCallCheck(this, e),
            this.control = null,
            this.start = null,
            this.current = null,
            this.command = "",
            this.tokens = [],
            this.i = -1,
            this.previousCommand = "",
            this.points = [],
            this.angles = [],
            this.tokens = preparePath(t).split(" ")
        }
        return createClass$1(e, [{
            key: "reset",
            value: function() {
                this.i = -1,
                this.command = "",
                this.previousCommand = "",
                this.start = new Point(0,0),
                this.control = new Point(0,0),
                this.current = new Point(0,0),
                this.points = [],
                this.angles = []
            }
        }, {
            key: "isEnd",
            value: function() {
                return this.i >= this.tokens.length - 1
            }
        }, {
            key: "isCommandOrEnd",
            value: function() {
                if (this.isEnd())
                    return !0;
                var e = this.i
                  , t = this.tokens;
                return /^[A-Za-z]$/.test(t[e + 1])
            }
        }, {
            key: "isRelativeCommand",
            value: function() {
                switch (this.command) {
                case "m":
                case "l":
                case "h":
                case "v":
                case "c":
                case "s":
                case "q":
                case "t":
                case "a":
                case "z":
                    return !0;
                default:
                    return !1
                }
            }
        }, {
            key: "getToken",
            value: function() {
                return this.i++,
                this.tokens[this.i]
            }
        }, {
            key: "getScalar",
            value: function() {
                return parseFloat(this.getToken())
            }
        }, {
            key: "nextCommand",
            value: function() {
                this.previousCommand = this.command,
                this.command = this.getToken()
            }
        }, {
            key: "getPoint",
            value: function() {
                var e = new Point(this.getScalar(),this.getScalar());
                return this.makeAbsolute(e)
            }
        }, {
            key: "getAsControlPoint",
            value: function() {
                var e = this.getPoint();
                return this.control = e,
                e
            }
        }, {
            key: "getAsCurrentPoint",
            value: function() {
                var e = this.getPoint();
                return this.current = e,
                e
            }
        }, {
            key: "getReflectedControlPoint",
            value: function() {
                var e = this.previousCommand.toLowerCase();
                if ("c" !== e && "s" !== e && "q" !== e && "t" !== e)
                    return this.current;
                var t = this.current
                  , r = t.x
                  , a = t.y
                  , n = this.control
                  , o = n.x
                  , l = n.y;
                return new Point(2 * r - o,2 * a - l)
            }
        }, {
            key: "makeAbsolute",
            value: function(e) {
                if (this.isRelativeCommand()) {
                    var t = this.current
                      , r = t.x
                      , a = t.y;
                    e.x += r,
                    e.y += a
                }
                return e
            }
        }, {
            key: "addMarker",
            value: function(e, t, r) {
                var a = this.points
                  , n = this.angles;
                r && n.length > 0 && !n[n.length - 1] && (n[n.length - 1] = a[a.length - 1].angleTo(r)),
                this.addMarkerAngle(e, t ? t.angleTo(e) : null)
            }
        }, {
            key: "addMarkerAngle",
            value: function(e, t) {
                this.points.push(e),
                this.angles.push(t)
            }
        }, {
            key: "getMarkerPoints",
            value: function() {
                return this.points
            }
        }, {
            key: "getMarkerAngles",
            value: function() {
                for (var e = this.angles, t = e.length, r = 0; r < t; r++)
                    if (!e[r])
                        for (var a = r + 1; a < t; a++)
                            if (e[a]) {
                                e[r] = e[a];
                                break
                            }
                return e
            }
        }]),
        e
    }();
    function _createSuper$8(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$8()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$8() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var PathElement = function(e) {
        inherits(r, e);
        var t = _createSuper$8(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "path",
            o.pathParser = null,
            o.pathParser = new PathParser(o.getAttribute("d").getString()),
            o
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = this.pathParser
                  , r = new BoundingBox;
                for (t.reset(),
                e && e.beginPath(); !t.isEnd(); )
                    switch (t.nextCommand(),
                    t.command) {
                    case "M":
                    case "m":
                        this.pathM(e, r);
                        break;
                    case "L":
                    case "l":
                        this.pathL(e, r);
                        break;
                    case "H":
                    case "h":
                        this.pathH(e, r);
                        break;
                    case "V":
                    case "v":
                        this.pathV(e, r);
                        break;
                    case "C":
                    case "c":
                        this.pathC(e, r);
                        break;
                    case "S":
                    case "s":
                        this.pathS(e, r);
                        break;
                    case "Q":
                    case "q":
                        this.pathQ(e, r);
                        break;
                    case "T":
                    case "t":
                        this.pathT(e, r);
                        break;
                    case "A":
                    case "a":
                        this.pathA(e, r);
                        break;
                    case "Z":
                    case "z":
                        this.pathZ(e, r)
                    }
                return r
            }
        }, {
            key: "getBoundingBox",
            value: function(e) {
                return this.path()
            }
        }, {
            key: "getMarkers",
            value: function() {
                var e = this.pathParser
                  , t = e.getMarkerPoints()
                  , r = e.getMarkerAngles();
                return t.map((function(e, t) {
                    return [e, r[t]]
                }
                ))
            }
        }, {
            key: "renderChildren",
            value: function(e) {
                this.path(e),
                this.document.screen.mouse.checkPath(this, e);
                var t = this.getStyle("fill-rule");
                "" !== e.fillStyle && ("inherit" !== t.getString("inherit") ? e.fill(t.getString()) : e.fill()),
                "" !== e.strokeStyle && e.stroke();
                var r = this.getMarkers();
                if (r) {
                    var a = r.length - 1
                      , n = this.getStyle("marker-start")
                      , o = this.getStyle("marker-mid")
                      , l = this.getStyle("marker-end");
                    if (n.isUrlDefinition()) {
                        var i = n.getDefinition()
                          , s = slicedToArray(r[0], 2)
                          , c = s[0]
                          , u = s[1];
                        i.render(e, c, u)
                    }
                    if (o.isUrlDefinition())
                        for (var h = o.getDefinition(), d = 1; d < a; d++) {
                            var f = slicedToArray(r[d], 2)
                              , m = f[0]
                              , p = f[1];
                            h.render(e, m, p)
                        }
                    if (l.isUrlDefinition()) {
                        var g = l.getDefinition()
                          , y = slicedToArray(r[a], 2)
                          , v = y[0]
                          , A = y[1];
                        g.render(e, v, A)
                    }
                }
            }
        }, {
            key: "pathM",
            value: function(e, t) {
                var r = this.pathParser
                  , a = r.getAsCurrentPoint()
                  , n = a.x
                  , o = a.y;
                for (r.addMarker(a),
                t.addPoint(n, o),
                e && e.moveTo(n, o),
                r.start = r.current; !r.isCommandOrEnd(); ) {
                    var l = r.getAsCurrentPoint()
                      , i = l.x
                      , s = l.y;
                    r.addMarker(l, r.start),
                    t.addPoint(i, s),
                    e && e.lineTo(i, s)
                }
            }
        }, {
            key: "pathL",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getAsCurrentPoint()
                      , o = n.x
                      , l = n.y;
                    r.addMarker(n, a),
                    t.addPoint(o, l),
                    e && e.lineTo(o, l)
                }
            }
        }, {
            key: "pathH",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = new Point((r.isRelativeCommand() ? a.x : 0) + r.getScalar(),a.y);
                    r.addMarker(n, a),
                    r.current = n,
                    t.addPoint(n.x, n.y),
                    e && e.lineTo(n.x, n.y)
                }
            }
        }, {
            key: "pathV",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = new Point(a.x,(r.isRelativeCommand() ? a.y : 0) + r.getScalar());
                    r.addMarker(n, a),
                    r.current = n,
                    t.addPoint(n.x, n.y),
                    e && e.lineTo(n.x, n.y)
                }
            }
        }, {
            key: "pathC",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getPoint()
                      , o = r.getAsControlPoint()
                      , l = r.getAsCurrentPoint();
                    r.addMarker(l, o, n),
                    t.addBezierCurve(a.x, a.y, n.x, n.y, o.x, o.y, l.x, l.y),
                    e && e.bezierCurveTo(n.x, n.y, o.x, o.y, l.x, l.y)
                }
            }
        }, {
            key: "pathS",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getReflectedControlPoint()
                      , o = r.getAsControlPoint()
                      , l = r.getAsCurrentPoint();
                    r.addMarker(l, o, n),
                    t.addBezierCurve(a.x, a.y, n.x, n.y, o.x, o.y, l.x, l.y),
                    e && e.bezierCurveTo(n.x, n.y, o.x, o.y, l.x, l.y)
                }
            }
        }, {
            key: "pathQ",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getAsControlPoint()
                      , o = r.getAsCurrentPoint();
                    r.addMarker(o, n, n),
                    t.addQuadraticCurve(a.x, a.y, n.x, n.y, o.x, o.y),
                    e && e.quadraticCurveTo(n.x, n.y, o.x, o.y)
                }
            }
        }, {
            key: "pathT",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getReflectedControlPoint();
                    r.control = n;
                    var o = r.getAsCurrentPoint();
                    r.addMarker(o, n, n),
                    t.addQuadraticCurve(a.x, a.y, n.x, n.y, o.x, o.y),
                    e && e.quadraticCurveTo(n.x, n.y, o.x, o.y)
                }
            }
        }, {
            key: "pathA",
            value: function(e, t) {
                for (var r = this.pathParser; !r.isCommandOrEnd(); ) {
                    var a = r.current
                      , n = r.getScalar()
                      , o = r.getScalar()
                      , l = r.getScalar() * (Math.PI / 180)
                      , i = r.getScalar()
                      , s = r.getScalar()
                      , c = r.getAsCurrentPoint()
                      , u = new Point(Math.cos(l) * (a.x - c.x) / 2 + Math.sin(l) * (a.y - c.y) / 2,-Math.sin(l) * (a.x - c.x) / 2 + Math.cos(l) * (a.y - c.y) / 2)
                      , h = Math.pow(u.x, 2) / Math.pow(n, 2) + Math.pow(u.y, 2) / Math.pow(o, 2);
                    h > 1 && (n *= Math.sqrt(h),
                    o *= Math.sqrt(h));
                    var d = (i === s ? -1 : 1) * Math.sqrt((Math.pow(n, 2) * Math.pow(o, 2) - Math.pow(n, 2) * Math.pow(u.y, 2) - Math.pow(o, 2) * Math.pow(u.x, 2)) / (Math.pow(n, 2) * Math.pow(u.y, 2) + Math.pow(o, 2) * Math.pow(u.x, 2)));
                    isNaN(d) && (d = 0);
                    var f = new Point(d * n * u.y / o,d * -o * u.x / n)
                      , m = new Point((a.x + c.x) / 2 + Math.cos(l) * f.x - Math.sin(l) * f.y,(a.y + c.y) / 2 + Math.sin(l) * f.x + Math.cos(l) * f.y)
                      , p = vectorsAngle([1, 0], [(u.x - f.x) / n, (u.y - f.y) / o])
                      , g = [(u.x - f.x) / n, (u.y - f.y) / o]
                      , y = [(-u.x - f.x) / n, (-u.y - f.y) / o]
                      , v = vectorsAngle(g, y);
                    vectorsRatio(g, y) <= -1 && (v = Math.PI),
                    vectorsRatio(g, y) >= 1 && (v = 0);
                    var A = 1 - s ? 1 : -1
                      , b = p + A * (v / 2)
                      , k = new Point(m.x + n * Math.cos(b),m.y + o * Math.sin(b));
                    if (r.addMarkerAngle(k, b - A * Math.PI / 2),
                    r.addMarkerAngle(c, b - A * Math.PI),
                    t.addPoint(c.x, c.y),
                    e && !isNaN(p) && !isNaN(v)) {
                        var w = n > o ? n : o
                          , x = n > o ? 1 : n / o
                          , S = n > o ? o / n : 1;
                        e.translate(m.x, m.y),
                        e.rotate(l),
                        e.scale(x, S),
                        e.arc(0, 0, w, p, p + v, Boolean(1 - s)),
                        e.scale(1 / x, 1 / S),
                        e.rotate(-l),
                        e.translate(-m.x, -m.y)
                    }
                }
            }
        }, {
            key: "pathZ",
            value: function(e, t) {
                var r = this.pathParser;
                e && t.x1 !== t.x2 && t.y1 !== t.y2 && e.closePath(),
                r.current = r.start
            }
        }]),
        r
    }(RenderedElement);
    function _createSuper$9(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$9()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$9() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var SVGElement = function(e) {
        inherits(r, e);
        var t = _createSuper$9(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "svg",
            e.root = !1,
            e
        }
        return createClass$1(r, [{
            key: "clearContext",
            value: function(e) {
                get$2(getPrototypeOf(r.prototype), "clearContext", this).call(this, e),
                this.document.screen.viewPort.removeCurrent()
            }
        }, {
            key: "setContext",
            value: function(e) {
                var t = this.document
                  , a = t.screen
                  , n = t.window
                  , o = e.canvas;
                if (a.setDefaults(e),
                o.style && void 0 !== e.font && n && void 0 !== n.getComputedStyle) {
                    e.font = n.getComputedStyle(o).getPropertyValue("font");
                    var l = new Property(t,"fontSize",Font.parse(e.font).fontSize);
                    l.hasValue() && (t.rootEmSize = l.getPixels("y"),
                    t.emSize = t.rootEmSize)
                }
                get$2(getPrototypeOf(r.prototype), "setContext", this).call(this, e),
                this.getAttribute("x").hasValue() || this.getAttribute("x", !0).setValue(0),
                this.getAttribute("y").hasValue() || this.getAttribute("y", !0).setValue(0),
                e.translate(this.getAttribute("x").getPixels("x"), this.getAttribute("y").getPixels("y"));
                var i = a.viewPort
                  , s = i.width
                  , c = i.height;
                this.getStyle("width").hasValue() || this.getStyle("width", !0).setValue("100%"),
                this.getStyle("height").hasValue() || this.getStyle("height", !0).setValue("100%"),
                this.getStyle("color").hasValue() || this.getStyle("color", !0).setValue("black");
                var u = this.getAttribute("refX")
                  , h = this.getAttribute("refY")
                  , d = this.getAttribute("viewBox")
                  , f = d.hasValue() ? toNumbers(d.getString()) : null
                  , m = !this.root && "visible" !== this.getAttribute("overflow").getValue("hidden")
                  , p = 0
                  , g = 0
                  , y = 0
                  , v = 0;
                f && (p = f[0],
                g = f[1]),
                this.root || (s = this.getStyle("width").getPixels("x"),
                c = this.getStyle("height").getPixels("y"),
                "marker" === this.type && (y = p,
                v = g,
                p = 0,
                g = 0)),
                a.viewPort.setCurrent(s, c),
                f && (s = f[2],
                c = f[3]),
                t.setViewBox({
                    ctx: e,
                    aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
                    width: a.viewPort.width,
                    desiredWidth: s,
                    height: a.viewPort.height,
                    desiredHeight: c,
                    minX: p,
                    minY: g,
                    refX: u.getValue(),
                    refY: h.getValue(),
                    clip: m,
                    clipX: y,
                    clipY: v
                }),
                f && (a.viewPort.removeCurrent(),
                a.viewPort.setCurrent(s, c))
            }
        }, {
            key: "resize",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e
                  , r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
                  , a = this.getAttribute("width", !0)
                  , n = this.getAttribute("height", !0)
                  , o = this.getAttribute("viewBox")
                  , l = this.getAttribute("style")
                  , i = a.getNumber(0)
                  , s = n.getNumber(0);
                if (r)
                    if ("string" == typeof r)
                        this.getAttribute("preserveAspectRatio", !0).setValue(r);
                    else {
                        var c = this.getAttribute("preserveAspectRatio");
                        c.hasValue() && c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"))
                    }
                if (a.setValue(e),
                n.setValue(t),
                o.hasValue() || o.setValue("0 0 ".concat(i || e, " ").concat(s || t)),
                l.hasValue()) {
                    var u = this.getStyle("width")
                      , h = this.getStyle("height");
                    u.hasValue() && u.setValue("".concat(e, "px")),
                    h.hasValue() && h.setValue("".concat(t, "px"))
                }
            }
        }]),
        r
    }(RenderedElement);
    function _createSuper$a(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$a()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$a() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var RectElement = function(e) {
        inherits(r, e);
        var t = _createSuper$a(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "rect",
            e
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = this.getAttribute("x").getPixels("x")
                  , r = this.getAttribute("y").getPixels("y")
                  , a = this.getStyle("width").getPixels("x")
                  , n = this.getStyle("height").getPixels("y")
                  , o = this.getAttribute("rx")
                  , l = this.getAttribute("ry")
                  , i = o.getPixels("x")
                  , s = l.getPixels("y");
                if (o.hasValue() && !l.hasValue() && (s = i),
                l.hasValue() && !o.hasValue() && (i = s),
                i = Math.min(i, a / 2),
                s = Math.min(s, n / 2),
                e) {
                    var c = (Math.sqrt(2) - 1) / 3 * 4;
                    e.beginPath(),
                    n > 0 && a > 0 && (e.moveTo(t + i, r),
                    e.lineTo(t + a - i, r),
                    e.bezierCurveTo(t + a - i + c * i, r, t + a, r + s - c * s, t + a, r + s),
                    e.lineTo(t + a, r + n - s),
                    e.bezierCurveTo(t + a, r + n - s + c * s, t + a - i + c * i, r + n, t + a - i, r + n),
                    e.lineTo(t + i, r + n),
                    e.bezierCurveTo(t + i - c * i, r + n, t, r + n - s + c * s, t, r + n - s),
                    e.lineTo(t, r + s),
                    e.bezierCurveTo(t, r + s - c * s, t + i - c * i, r, t + i, r),
                    e.closePath())
                }
                return new BoundingBox(t,r,t + a,r + n)
            }
        }, {
            key: "getMarkers",
            value: function() {
                return null
            }
        }]),
        r
    }(PathElement);
    function _createSuper$b(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$b()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$b() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var CircleElement = function(e) {
        inherits(r, e);
        var t = _createSuper$b(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "circle",
            e
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = this.getAttribute("cx").getPixels("x")
                  , r = this.getAttribute("cy").getPixels("y")
                  , a = this.getAttribute("r").getPixels();
                return e && a > 0 && (e.beginPath(),
                e.arc(t, r, a, 0, 2 * Math.PI, !1),
                e.closePath()),
                new BoundingBox(t - a,r - a,t + a,r + a)
            }
        }, {
            key: "getMarkers",
            value: function() {
                return null
            }
        }]),
        r
    }(PathElement);
    function _createSuper$c(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$c()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$c() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var EllipseElement = function(e) {
        inherits(r, e);
        var t = _createSuper$c(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "ellipse",
            e
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = (Math.sqrt(2) - 1) / 3 * 4
                  , r = this.getAttribute("rx").getPixels("x")
                  , a = this.getAttribute("ry").getPixels("y")
                  , n = this.getAttribute("cx").getPixels("x")
                  , o = this.getAttribute("cy").getPixels("y");
                return e && r > 0 && a > 0 && (e.beginPath(),
                e.moveTo(n + r, o),
                e.bezierCurveTo(n + r, o + t * a, n + t * r, o + a, n, o + a),
                e.bezierCurveTo(n - t * r, o + a, n - r, o + t * a, n - r, o),
                e.bezierCurveTo(n - r, o - t * a, n - t * r, o - a, n, o - a),
                e.bezierCurveTo(n + t * r, o - a, n + r, o - t * a, n + r, o),
                e.closePath()),
                new BoundingBox(n - r,o - a,n + r,o + a)
            }
        }, {
            key: "getMarkers",
            value: function() {
                return null
            }
        }]),
        r
    }(PathElement);
    function _createSuper$d(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$d()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$d() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var LineElement = function(e) {
        inherits(r, e);
        var t = _createSuper$d(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "line",
            e
        }
        return createClass$1(r, [{
            key: "getPoints",
            value: function() {
                return [new Point(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")), new Point(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]
            }
        }, {
            key: "path",
            value: function(e) {
                var t = this.getPoints()
                  , r = slicedToArray(t, 2)
                  , a = r[0]
                  , n = a.x
                  , o = a.y
                  , l = r[1]
                  , i = l.x
                  , s = l.y;
                return e && (e.beginPath(),
                e.moveTo(n, o),
                e.lineTo(i, s)),
                new BoundingBox(n,o,i,s)
            }
        }, {
            key: "getMarkers",
            value: function() {
                var e = this.getPoints()
                  , t = slicedToArray(e, 2)
                  , r = t[0]
                  , a = t[1]
                  , n = r.angleTo(a);
                return [[r, n], [a, n]]
            }
        }]),
        r
    }(PathElement);
    function _createSuper$e(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$e()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$e() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var PolylineElement = function(e) {
        inherits(r, e);
        var t = _createSuper$e(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "polyline",
            o.points = [],
            o.points = Point.parsePath(o.getAttribute("points").getString()),
            o
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = this.points
                  , r = slicedToArray(t, 1)[0]
                  , a = r.x
                  , n = r.y
                  , o = new BoundingBox(a,n);
                return e && (e.beginPath(),
                e.moveTo(a, n)),
                t.forEach((function(t) {
                    var r = t.x
                      , a = t.y;
                    o.addPoint(r, a),
                    e && e.lineTo(r, a)
                }
                )),
                o
            }
        }, {
            key: "getMarkers",
            value: function() {
                var e = this.points
                  , t = e.length - 1
                  , r = [];
                return e.forEach((function(a, n) {
                    n !== t && r.push([a, a.angleTo(e[n + 1])])
                }
                )),
                r.length > 0 && r.push([e[e.length - 1], r[r.length - 1][1]]),
                r
            }
        }]),
        r
    }(PathElement);
    function _createSuper$f(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$f()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$f() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var PolygonElement = function(e) {
        inherits(r, e);
        var t = _createSuper$f(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "polygon",
            e
        }
        return createClass$1(r, [{
            key: "path",
            value: function(e) {
                var t = get$2(getPrototypeOf(r.prototype), "path", this).call(this, e)
                  , a = slicedToArray(this.points, 1)[0]
                  , n = a.x
                  , o = a.y;
                return e && (e.lineTo(n, o),
                e.closePath()),
                t
            }
        }]),
        r
    }(PolylineElement);
    function _createSuper$g(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$g()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$g() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var PatternElement = function(e) {
        inherits(r, e);
        var t = _createSuper$g(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "pattern",
            e
        }
        return createClass$1(r, [{
            key: "createPattern",
            value: function(e, t, r) {
                var a = this.getStyle("width").getPixels("x", !0)
                  , n = this.getStyle("height").getPixels("y", !0)
                  , o = new SVGElement(this.document,null);
                o.attributes.viewBox = new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),
                o.attributes.width = new Property(this.document,"width","".concat(a, "px")),
                o.attributes.height = new Property(this.document,"height","".concat(n, "px")),
                o.attributes.transform = new Property(this.document,"transform",this.getAttribute("patternTransform").getValue()),
                o.children = this.children;
                var l = this.document.createCanvas(a, n)
                  , i = l.getContext("2d")
                  , s = this.getAttribute("x")
                  , c = this.getAttribute("y");
                s.hasValue() && c.hasValue() && i.translate(s.getPixels("x", !0), c.getPixels("y", !0)),
                r.hasValue() ? this.styles["fill-opacity"] = r : Reflect.deleteProperty(this.styles, "fill-opacity");
                for (var u = -1; u <= 1; u++)
                    for (var h = -1; h <= 1; h++)
                        i.save(),
                        o.attributes.x = new Property(this.document,"x",u * l.width),
                        o.attributes.y = new Property(this.document,"y",h * l.height),
                        o.render(i),
                        i.restore();
                return e.createPattern(l, "repeat")
            }
        }]),
        r
    }(Element);
    function _createSuper$h(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$h()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$h() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var MarkerElement = function(e) {
        inherits(r, e);
        var t = _createSuper$h(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "marker",
            e
        }
        return createClass$1(r, [{
            key: "render",
            value: function(e, t, r) {
                if (t) {
                    var a = t.x
                      , n = t.y
                      , o = this.getAttribute("orient").getValue("auto")
                      , l = this.getAttribute("markerUnits").getValue("strokeWidth");
                    e.translate(a, n),
                    "auto" === o && e.rotate(r),
                    "strokeWidth" === l && e.scale(e.lineWidth, e.lineWidth),
                    e.save();
                    var i = new SVGElement(this.document,null);
                    i.type = this.type,
                    i.attributes.viewBox = new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),
                    i.attributes.refX = new Property(this.document,"refX",this.getAttribute("refX").getValue()),
                    i.attributes.refY = new Property(this.document,"refY",this.getAttribute("refY").getValue()),
                    i.attributes.width = new Property(this.document,"width",this.getAttribute("markerWidth").getValue()),
                    i.attributes.height = new Property(this.document,"height",this.getAttribute("markerHeight").getValue()),
                    i.attributes.overflow = new Property(this.document,"overflow",this.getAttribute("overflow").getValue()),
                    i.attributes.fill = new Property(this.document,"fill",this.getAttribute("fill").getColor("black")),
                    i.attributes.stroke = new Property(this.document,"stroke",this.getAttribute("stroke").getValue("none")),
                    i.children = this.children,
                    i.render(e),
                    e.restore(),
                    "strokeWidth" === l && e.scale(1 / e.lineWidth, 1 / e.lineWidth),
                    "auto" === o && e.rotate(-r),
                    e.translate(-a, -n)
                }
            }
        }]),
        r
    }(Element);
    function _createSuper$i(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$i()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$i() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var DefsElement = function(e) {
        inherits(r, e);
        var t = _createSuper$i(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "defs",
            e
        }
        return createClass$1(r, [{
            key: "render",
            value: function() {}
        }]),
        r
    }(Element);
    function _createSuper$j(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$j()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$j() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var GElement = function(e) {
        inherits(r, e);
        var t = _createSuper$j(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "g",
            e
        }
        return createClass$1(r, [{
            key: "getBoundingBox",
            value: function(e) {
                var t = new BoundingBox;
                return this.children.forEach((function(r) {
                    t.addBoundingBox(r.getBoundingBox(e))
                }
                )),
                t
            }
        }]),
        r
    }(RenderedElement);
    function _createSuper$k(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$k()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$k() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var GradientElement = function(e) {
        inherits(r, e);
        var t = _createSuper$k(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).attributesToInherit = ["gradientUnits"],
            o.stops = [];
            var l = assertThisInitialized(o)
              , i = l.stops;
            return l.children.forEach((function(e) {
                "stop" === e.type && i.push(e)
            }
            )),
            o
        }
        return createClass$1(r, [{
            key: "getGradientUnits",
            value: function() {
                return this.getAttribute("gradientUnits").getString("objectBoundingBox")
            }
        }, {
            key: "createGradient",
            value: function(e, t, r) {
                var a = this
                  , n = this;
                this.getHrefAttribute().hasValue() && (n = this.getHrefAttribute().getDefinition(),
                this.inheritStopContainer(n));
                var o = n.stops
                  , l = this.getGradient(e, t);
                if (!l)
                    return this.addParentOpacity(r, o[o.length - 1].color);
                if (o.forEach((function(e) {
                    l.addColorStop(e.offset, a.addParentOpacity(r, e.color))
                }
                )),
                this.getAttribute("gradientTransform").hasValue()) {
                    var i = this.document
                      , s = i.screen
                      , c = s.MAX_VIRTUAL_PIXELS
                      , u = s.viewPort
                      , h = slicedToArray(u.viewPorts, 1)[0]
                      , d = new RectElement(i,null);
                    d.attributes.x = new Property(i,"x",-c / 3),
                    d.attributes.y = new Property(i,"y",-c / 3),
                    d.attributes.width = new Property(i,"width",c),
                    d.attributes.height = new Property(i,"height",c);
                    var f = new GElement(i,null);
                    f.attributes.transform = new Property(i,"transform",this.getAttribute("gradientTransform").getValue()),
                    f.children = [d];
                    var m = new SVGElement(i,null);
                    m.attributes.x = new Property(i,"x",0),
                    m.attributes.y = new Property(i,"y",0),
                    m.attributes.width = new Property(i,"width",h.width),
                    m.attributes.height = new Property(i,"height",h.height),
                    m.children = [f];
                    var p = i.createCanvas(h.width, h.height)
                      , g = p.getContext("2d");
                    return g.fillStyle = l,
                    m.render(g),
                    g.createPattern(p, "no-repeat")
                }
                return l
            }
        }, {
            key: "inheritStopContainer",
            value: function(e) {
                var t = this;
                this.attributesToInherit.forEach((function(r) {
                    !t.getAttribute(r).hasValue() && e.getAttribute(r).hasValue() && t.getAttribute(r, !0).setValue(e.getAttribute(r).getValue())
                }
                ))
            }
        }, {
            key: "addParentOpacity",
            value: function(e, t) {
                return e.hasValue() ? new Property(this.document,"color",t).addOpacity(e).getColor() : t
            }
        }]),
        r
    }(Element);
    function _createSuper$l(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$l()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$l() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var LinearGradientElement = function(e) {
        inherits(r, e);
        var t = _createSuper$l(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "linearGradient",
            o.attributesToInherit.push("x1", "y1", "x2", "y2"),
            o
        }
        return createClass$1(r, [{
            key: "getGradient",
            value: function(e, t) {
                var r = "objectBoundingBox" === this.getGradientUnits()
                  , a = r ? t.getBoundingBox(e) : null;
                if (r && !a)
                    return null;
                this.getAttribute("x1").hasValue() || this.getAttribute("y1").hasValue() || this.getAttribute("x2").hasValue() || this.getAttribute("y2").hasValue() || (this.getAttribute("x1", !0).setValue(0),
                this.getAttribute("y1", !0).setValue(0),
                this.getAttribute("x2", !0).setValue(1),
                this.getAttribute("y2", !0).setValue(0));
                var n = r ? a.x + a.width * this.getAttribute("x1").getNumber() : this.getAttribute("x1").getPixels("x")
                  , o = r ? a.y + a.height * this.getAttribute("y1").getNumber() : this.getAttribute("y1").getPixels("y")
                  , l = r ? a.x + a.width * this.getAttribute("x2").getNumber() : this.getAttribute("x2").getPixels("x")
                  , i = r ? a.y + a.height * this.getAttribute("y2").getNumber() : this.getAttribute("y2").getPixels("y");
                return n === l && o === i ? null : e.createLinearGradient(n, o, l, i)
            }
        }]),
        r
    }(GradientElement);
    function _createSuper$m(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$m()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$m() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var RadialGradientElement = function(e) {
        inherits(r, e);
        var t = _createSuper$m(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "radialGradient",
            o.attributesToInherit.push("cx", "cy", "r", "fx", "fy", "fr"),
            o
        }
        return createClass$1(r, [{
            key: "getGradient",
            value: function(e, t) {
                var r = "objectBoundingBox" === this.getGradientUnits()
                  , a = t.getBoundingBox(e);
                if (r && !a)
                    return null;
                this.getAttribute("cx").hasValue() || this.getAttribute("cx", !0).setValue("50%"),
                this.getAttribute("cy").hasValue() || this.getAttribute("cy", !0).setValue("50%"),
                this.getAttribute("r").hasValue() || this.getAttribute("r", !0).setValue("50%");
                var n = r ? a.x + a.width * this.getAttribute("cx").getNumber() : this.getAttribute("cx").getPixels("x")
                  , o = r ? a.y + a.height * this.getAttribute("cy").getNumber() : this.getAttribute("cy").getPixels("y")
                  , l = n
                  , i = o;
                this.getAttribute("fx").hasValue() && (l = r ? a.x + a.width * this.getAttribute("fx").getNumber() : this.getAttribute("fx").getPixels("x")),
                this.getAttribute("fy").hasValue() && (i = r ? a.y + a.height * this.getAttribute("fy").getNumber() : this.getAttribute("fy").getPixels("y"));
                var s = r ? (a.width + a.height) / 2 * this.getAttribute("r").getNumber() : this.getAttribute("r").getPixels()
                  , c = this.getAttribute("fr").getPixels();
                return e.createRadialGradient(l, i, c, n, o, s)
            }
        }]),
        r
    }(GradientElement);
    function _createSuper$n(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$n()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$n() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var StopElement = function(e) {
        inherits(r, e);
        var t = _createSuper$n(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "stop";
            var l = Math.max(0, Math.min(1, o.getAttribute("offset").getNumber()))
              , i = o.getStyle("stop-opacity")
              , s = o.getStyle("stop-color", !0);
            return "" === s.getString() && s.setValue("#000"),
            i.hasValue() && (s = s.addOpacity(i)),
            o.offset = l,
            o.color = s.getColor(),
            o
        }
        return r
    }(Element);
    function _createSuper$o(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$o()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$o() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var AnimateElement = function(e) {
        inherits(r, e);
        var t = _createSuper$o(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "animate",
            o.duration = 0,
            o.initialValue = null,
            o.initialUnits = "",
            o.removed = !1,
            o.frozen = !1,
            e.screen.animations.push(assertThisInitialized(o)),
            o.begin = o.getAttribute("begin").getMilliseconds(),
            o.maxDuration = o.begin + o.getAttribute("dur").getMilliseconds(),
            o.from = o.getAttribute("from"),
            o.to = o.getAttribute("to"),
            o.values = o.getAttribute("values"),
            o.values.hasValue() && o.values.setValue(o.values.getString().split(";")),
            o
        }
        return createClass$1(r, [{
            key: "getProperty",
            value: function() {
                var e = this.getAttribute("attributeType").getString()
                  , t = this.getAttribute("attributeName").getString();
                return "CSS" === e ? this.parent.getStyle(t, !0) : this.parent.getAttribute(t, !0)
            }
        }, {
            key: "calcValue",
            value: function() {
                var e = this.initialUnits
                  , t = this.getProgress()
                  , r = t.progress
                  , a = t.from
                  , n = t.to
                  , o = a.getNumber() + (n.getNumber() - a.getNumber()) * r;
                return "%" === e && (o *= 100),
                "".concat(o).concat(e)
            }
        }, {
            key: "update",
            value: function(e) {
                var t = this.parent
                  , r = this.getProperty();
                if (this.initialValue || (this.initialValue = r.getString(),
                this.initialUnits = r.getUnits()),
                this.duration > this.maxDuration) {
                    var a = this.getAttribute("fill").getString("remove");
                    if ("indefinite" === this.getAttribute("repeatCount").getString() || "indefinite" === this.getAttribute("repeatDur").getString())
                        this.duration = 0;
                    else if ("freeze" !== a || this.frozen) {
                        if ("remove" === a && !this.removed)
                            return this.removed = !0,
                            r.setValue(t.animationFrozen ? t.animationFrozenValue : this.initialValue),
                            !0
                    } else
                        this.frozen = !0,
                        t.animationFrozen = !0,
                        t.animationFrozenValue = r.getString();
                    return !1
                }
                this.duration += e;
                var n = !1;
                if (this.begin < this.duration) {
                    var o = this.calcValue()
                      , l = this.getAttribute("type");
                    if (l.hasValue()) {
                        var i = l.getString();
                        o = "".concat(i, "(").concat(o, ")")
                    }
                    r.setValue(o),
                    n = !0
                }
                return n
            }
        }, {
            key: "getProgress",
            value: function() {
                var e = this.document
                  , t = this.values
                  , r = {
                    progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
                };
                if (t.hasValue()) {
                    var a = r.progress * (t.getValue().length - 1)
                      , n = Math.floor(a)
                      , o = Math.ceil(a);
                    r.from = new Property(e,"from",parseFloat(t.getValue()[n])),
                    r.to = new Property(e,"to",parseFloat(t.getValue()[o])),
                    r.progress = (a - n) / (o - n)
                } else
                    r.from = this.from,
                    r.to = this.to;
                return r
            }
        }]),
        r
    }(Element);
    function _createSuper$p(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$p()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$p() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var AnimateColorElement = function(e) {
        inherits(r, e);
        var t = _createSuper$p(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "animateColor",
            e
        }
        return createClass$1(r, [{
            key: "calcValue",
            value: function() {
                var e = this.getProgress()
                  , t = e.progress
                  , r = e.from
                  , a = e.to
                  , n = new rgbcolor(r.getColor())
                  , o = new rgbcolor(a.getColor());
                if (n.ok && o.ok) {
                    var l = n.r + (o.r - n.r) * t
                      , i = n.g + (o.g - n.g) * t
                      , s = n.b + (o.b - n.b) * t;
                    return "rgb(".concat(parseInt(l, 10), ", ").concat(parseInt(i, 10), ", ").concat(parseInt(s, 10), ")")
                }
                return this.getAttribute("from").getColor()
            }
        }]),
        r
    }(AnimateElement);
    function _createSuper$q(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$q()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$q() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var AnimateTransformElement = function(e) {
        inherits(r, e);
        var t = _createSuper$q(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "animateTransform",
            e
        }
        return createClass$1(r, [{
            key: "calcValue",
            value: function() {
                var e = this.getProgress()
                  , t = e.progress
                  , r = e.from
                  , a = e.to
                  , n = toNumbers(r.getString())
                  , o = toNumbers(a.getString());
                return n.map((function(e, r) {
                    return e + (o[r] - e) * t
                }
                )).join(" ")
            }
        }]),
        r
    }(AnimateElement);
    function _createForOfIteratorHelper$1(e) {
        if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) {
            if (Array.isArray(e) || (e = _unsupportedIterableToArray$2(e))) {
                var t = 0
                  , r = function() {};
                return {
                    s: r,
                    n: function() {
                        return t >= e.length ? {
                            done: !0
                        } : {
                            done: !1,
                            value: e[t++]
                        }
                    },
                    e: function(e) {
                        throw e
                    },
                    f: r
                }
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
        }
        var a, n, o = !0, l = !1;
        return {
            s: function() {
                a = e[Symbol.iterator]()
            },
            n: function() {
                var e = a.next();
                return o = e.done,
                e
            },
            e: function(e) {
                l = !0,
                n = e
            },
            f: function() {
                try {
                    o || null == a.return || a.return()
                } finally {
                    if (l)
                        throw n
                }
            }
        }
    }
    function _unsupportedIterableToArray$2(e, t) {
        if (e) {
            if ("string" == typeof e)
                return _arrayLikeToArray$2(e, t);
            var r = Object.prototype.toString.call(e).slice(8, -1);
            return "Object" === r && e.constructor && (r = e.constructor.name),
            "Map" === r || "Set" === r ? Array.from(r) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray$2(e, t) : void 0
        }
    }
    function _arrayLikeToArray$2(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, a = new Array(t); r < t; r++)
            a[r] = e[r];
        return a
    }
    function _createSuper$r(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$r()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$r() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FontElement = function(e) {
        inherits(r, e);
        var t = _createSuper$r(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "font",
            o.glyphs = {},
            o.horizAdvX = o.getAttribute("horiz-adv-x").getNumber();
            var l, i = e.definitions, s = _createForOfIteratorHelper$1(assertThisInitialized(o).children);
            try {
                for (s.s(); !(l = s.n()).done; ) {
                    var c = l.value;
                    switch (c.type) {
                    case "font-face":
                        o.fontFace = c;
                        var u = c.getStyle("font-family");
                        u.hasValue() && (i[u.getString()] = assertThisInitialized(o));
                        break;
                    case "missing-glyph":
                        o.missingGlyph = c;
                        break;
                    case "glyph":
                        var h = c;
                        h.arabicForm ? (o.isRTL = !0,
                        o.isArabic = !0,
                        void 0 === o.glyphs[h.unicode] && (o.glyphs[h.unicode] = {}),
                        o.glyphs[h.unicode][h.arabicForm] = h) : o.glyphs[h.unicode] = h
                    }
                }
            } catch (e) {
                s.e(e)
            } finally {
                s.f()
            }
            return o
        }
        return createClass$1(r, [{
            key: "render",
            value: function() {}
        }]),
        r
    }(Element);
    function _createSuper$s(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$s()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$s() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FontFaceElement = function(e) {
        inherits(r, e);
        var t = _createSuper$s(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "font-face",
            o.ascent = o.getAttribute("ascent").getNumber(),
            o.descent = o.getAttribute("descent").getNumber(),
            o.unitsPerEm = o.getAttribute("units-per-em").getNumber(),
            o
        }
        return r
    }(Element);
    function _createSuper$t(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$t()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$t() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var MissingGlyphElement = function(e) {
        inherits(r, e);
        var t = _createSuper$t(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "missing-glyph",
            e.horizAdvX = 0,
            e
        }
        return r
    }(PathElement);
    function _createSuper$u(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$u()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$u() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var GlyphElement = function(e) {
        inherits(r, e);
        var t = _createSuper$u(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "glyph",
            o.horizAdvX = o.getAttribute("horiz-adv-x").getNumber(),
            o.unicode = o.getAttribute("unicode").getString(),
            o.arabicForm = o.getAttribute("arabic-form").getString(),
            o
        }
        return r
    }(PathElement);
    function _createSuper$v(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$v()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$v() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TRefElement = function(e) {
        inherits(r, e);
        var t = _createSuper$v(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "tref",
            e
        }
        return createClass$1(r, [{
            key: "getText",
            value: function() {
                var e = this.getHrefAttribute().getDefinition();
                if (e) {
                    var t = e.children[0];
                    if (t)
                        return t.getText()
                }
                return ""
            }
        }]),
        r
    }(TextElement);
    function _createSuper$w(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$w()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$w() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var AElement = function(e) {
        inherits(r, e);
        var t = _createSuper$w(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "a";
            var l = a.childNodes
              , i = l[0]
              , s = l.length > 0 && Array.from(l).every((function(e) {
                return 3 === e.nodeType
            }
            ));
            return o.hasText = s,
            o.text = s ? o.getTextFromNode(i) : "",
            o
        }
        return createClass$1(r, [{
            key: "getText",
            value: function() {
                return this.text
            }
        }, {
            key: "renderChildren",
            value: function(e) {
                if (this.hasText) {
                    get$2(getPrototypeOf(r.prototype), "renderChildren", this).call(this, e);
                    var t = this.document
                      , a = this.x
                      , n = this.y
                      , o = t.screen.mouse
                      , l = new Property(t,"fontSize",Font.parse(t.ctx.font).fontSize);
                    o.isWorking() && o.checkBoundingBox(this, new BoundingBox(a,n - l.getPixels("y"),a + this.measureText(e),n))
                } else if (this.children.length > 0) {
                    var i = new GElement(this.document,null);
                    i.children = this.children,
                    i.parent = this,
                    i.render(e)
                }
            }
        }, {
            key: "onClick",
            value: function() {
                var e = this.document.window;
                e && e.open(this.getHrefAttribute().getString())
            }
        }, {
            key: "onMouseMove",
            value: function() {
                this.document.ctx.canvas.style.cursor = "pointer"
            }
        }]),
        r
    }(TextElement);
    function _createForOfIteratorHelper$1$1(e) {
        if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) {
            if (Array.isArray(e) || (e = _unsupportedIterableToArray$1$1(e))) {
                var t = 0
                  , r = function() {};
                return {
                    s: r,
                    n: function() {
                        return t >= e.length ? {
                            done: !0
                        } : {
                            done: !1,
                            value: e[t++]
                        }
                    },
                    e: function(e) {
                        throw e
                    },
                    f: r
                }
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
        }
        var a, n, o = !0, l = !1;
        return {
            s: function() {
                a = e[Symbol.iterator]()
            },
            n: function() {
                var e = a.next();
                return o = e.done,
                e
            },
            e: function(e) {
                l = !0,
                n = e
            },
            f: function() {
                try {
                    o || null == a.return || a.return()
                } finally {
                    if (l)
                        throw n
                }
            }
        }
    }
    function _unsupportedIterableToArray$1$1(e, t) {
        if (e) {
            if ("string" == typeof e)
                return _arrayLikeToArray$1$1(e, t);
            var r = Object.prototype.toString.call(e).slice(8, -1);
            return "Object" === r && e.constructor && (r = e.constructor.name),
            "Map" === r || "Set" === r ? Array.from(r) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray$1$1(e, t) : void 0
        }
    }
    function _arrayLikeToArray$1$1(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, a = new Array(t); r < t; r++)
            a[r] = e[r];
        return a
    }
    function _createSuper$x(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$x()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$x() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TextPathElement = function(e) {
        inherits(r, e);
        var t = _createSuper$x(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "textPath",
            o.textWidth = 0,
            o.textHeight = 0,
            o.pathLength = -1,
            o.glyphInfo = null,
            o.letterSpacingCache = [],
            o.measuresCache = new Map([["", 0]]);
            var l = o.getHrefAttribute().getDefinition();
            return o.text = o.getTextFromNode(),
            o.dataArray = o.parsePathData(l),
            o
        }
        return createClass$1(r, [{
            key: "getText",
            value: function() {
                return this.text
            }
        }, {
            key: "path",
            value: function(e) {
                var t = this.dataArray;
                e && e.beginPath(),
                t.forEach((function(t) {
                    var r = t.command
                      , a = t.points;
                    switch (r) {
                    case "L":
                        e && e.lineTo(a[0], a[1]);
                        break;
                    case "M":
                        e && e.moveTo(a[0], a[1]);
                        break;
                    case "C":
                        e && e.bezierCurveTo(a[0], a[1], a[2], a[3], a[4], a[5]);
                        break;
                    case "Q":
                        e && e.quadraticCurveTo(a[0], a[1], a[2], a[3]);
                        break;
                    case "A":
                        var n = a[0]
                          , o = a[1]
                          , l = a[2]
                          , i = a[3]
                          , s = a[4]
                          , c = a[5]
                          , u = a[6]
                          , h = a[7]
                          , d = l > i ? l : i
                          , f = l > i ? 1 : l / i
                          , m = l > i ? i / l : 1;
                        e && (e.translate(n, o),
                        e.rotate(u),
                        e.scale(f, m),
                        e.arc(0, 0, d, s, s + c, Boolean(1 - h)),
                        e.scale(1 / f, 1 / m),
                        e.rotate(-u),
                        e.translate(-n, -o));
                        break;
                    case "z":
                        e && e.closePath()
                    }
                }
                ))
            }
        }, {
            key: "renderChildren",
            value: function(e) {
                this.setTextData(e),
                e.save();
                var t = this.parent.getStyle("text-decoration").getString()
                  , r = this.getFontSize()
                  , a = this.glyphInfo
                  , n = e.fillStyle;
                "underline" === t && e.beginPath(),
                a.forEach((function(n, o) {
                    var l = n.p0
                      , i = n.p1
                      , s = n.text;
                    e.save(),
                    e.translate(l.x, l.y),
                    e.rotate(a[o].rotation),
                    e.fillStyle && e.fillText(s, 0, 0),
                    e.strokeStyle && e.strokeText(s, 0, 0),
                    e.restore(),
                    "underline" === t && (0 === o && e.moveTo(l.x, l.y + r / 8),
                    e.lineTo(i.x, i.y + r / 5))
                }
                )),
                "underline" === t && (e.lineWidth = r / 20,
                e.strokeStyle = n,
                e.stroke(),
                e.closePath()),
                e.restore()
            }
        }, {
            key: "getLetterSpacingAt",
            value: function() {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
                return this.letterSpacingCache[e] || 0
            }
        }, {
            key: "findSegmentToFitChar",
            value: function(e, t, r, a, n, o, l, i) {
                var s = o
                  , c = this.measureText(e, l);
                " " === l && "justify" === t && r < a && (c += (a - r) / n),
                i > -1 && (s += this.getLetterSpacingAt(i));
                var u = this.textHeight / 20
                  , h = {
                    p0: this.getEquidistantPointOnPath(s, u),
                    p1: this.getEquidistantPointOnPath(s + c, u)
                };
                return {
                    offset: s += c,
                    segment: h
                }
            }
        }, {
            key: "measureText",
            value: function(e, t) {
                var r = this.measuresCache
                  , a = t || this.getText();
                if (r.has(a))
                    return r.get(a);
                var n = this.measureTargetText(e, a);
                return r.set(a, n),
                n
            }
        }, {
            key: "setTextData",
            value: function(e) {
                var t = this;
                if (!this.glyphInfo) {
                    var r = this.getText()
                      , a = r.split("")
                      , n = r.split(" ").length - 1
                      , o = toNumbers(this.parent.getAttribute("dx").getString("0"))
                      , l = this.parent.getStyle("text-anchor").getString("start")
                      , i = this.getStyle("letter-spacing")
                      , s = this.parent.getStyle("letter-spacing")
                      , c = 0;
                    i.hasValue() && "inherit" !== i.getValue() ? i.hasValue() && "initial" !== i.getValue() && "unset" !== i.getValue() && (c = i.getPixels()) : c = s.getPixels();
                    var u = []
                      , h = r.length;
                    this.letterSpacingCache = u;
                    for (var d = 0; d < h; d++)
                        u.push(void 0 !== o[d] ? o[d] : c);
                    var f = u.reduce((function(e, t) {
                        return e + t || 0
                    }
                    ), 0);
                    this.textWidth = this.measureText(e),
                    this.textHeight = this.getFontSize();
                    var m = Math.max(this.textWidth + f, 0);
                    this.glyphInfo = [];
                    var p = this.getPathLength()
                      , g = this.getStyle("startOffset").getNumber(0) * p
                      , y = 0;
                    "middle" !== l && "center" !== l || (y = -m / 2),
                    "end" !== l && "right" !== l || (y = -m),
                    y += g,
                    a.forEach((function(r, o) {
                        var i = t.findSegmentToFitChar(e, l, m, p, n, y, r, o)
                          , s = i.offset
                          , c = i.segment;
                        if (y = s,
                        c.p0 && c.p1) {
                            var u = t.getLineLength(c.p0.x, c.p0.y, c.p1.x, c.p1.y)
                              , h = t.getPointOnLine(0 + u / 2, c.p0.x, c.p0.y, c.p1.x, c.p1.y)
                              , d = Math.atan2(c.p1.y - c.p0.y, c.p1.x - c.p0.x);
                            t.glyphInfo.push({
                                transposeX: h.x,
                                transposeY: h.y,
                                text: a[o],
                                p0: c.p0,
                                p1: c.p1,
                                rotation: d
                            })
                        }
                    }
                    ))
                }
            }
        }, {
            key: "parsePathData",
            value: function(e) {
                if (this.pathLength = -1,
                !e)
                    return [];
                var t = []
                  , r = e.pathParser;
                for (r.reset(); !r.isEnd(); ) {
                    var a = r.current
                      , n = a ? a.x : 0
                      , o = a ? a.y : 0
                      , l = ""
                      , i = [];
                    r.nextCommand();
                    var s = r.command.toUpperCase();
                    switch (r.command) {
                    case "M":
                    case "m":
                        l = this.pathM(r, i);
                        break;
                    case "L":
                    case "l":
                        l = this.pathL(r, i);
                        break;
                    case "H":
                    case "h":
                        l = this.pathH(r, i);
                        break;
                    case "V":
                    case "v":
                        l = this.pathV(r, i);
                        break;
                    case "C":
                    case "c":
                        this.pathC(r, i);
                        break;
                    case "S":
                    case "s":
                        l = this.pathS(r, i);
                        break;
                    case "Q":
                    case "q":
                        this.pathQ(r, i);
                        break;
                    case "T":
                    case "t":
                        l = this.pathT(r, i);
                        break;
                    case "A":
                    case "a":
                        i = this.pathA(r);
                        break;
                    case "Z":
                    case "z":
                        r.current = r.start
                    }
                    "Z" !== s ? t.push({
                        command: l || s,
                        points: i,
                        start: {
                            x: n,
                            y: o
                        },
                        pathLength: this.calcLength(n, o, l || s, i)
                    }) : t.push({
                        command: "z",
                        points: [],
                        pathLength: 0
                    })
                }
                return t
            }
        }, {
            key: "pathM",
            value: function(e, t) {
                var r = e.getAsCurrentPoint();
                for (t.push(r.x, r.y),
                e.start = e.current; !e.isCommandOrEnd(); ) {
                    var a = e.getAsCurrentPoint();
                    return t.push(a.x, a.y),
                    "L"
                }
            }
        }, {
            key: "pathL",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.getAsCurrentPoint();
                    t.push(r.x, r.y)
                }
                return "L"
            }
        }, {
            key: "pathH",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.current
                      , a = new Point((e.isRelativeCommand() ? r.x : 0) + e.getScalar(),r.y);
                    t.push(a.x, a.y),
                    e.current = a
                }
                return "L"
            }
        }, {
            key: "pathV",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.current
                      , a = new Point(r.x,(e.isRelativeCommand() ? r.y : 0) + e.getScalar());
                    t.push(a.x, a.y),
                    e.current = a
                }
                return "L"
            }
        }, {
            key: "pathC",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.getPoint()
                      , a = e.getAsControlPoint()
                      , n = e.getAsCurrentPoint();
                    t.push(r.x, r.y, a.x, a.y, n.x, n.y)
                }
            }
        }, {
            key: "pathS",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.getReflectedControlPoint()
                      , a = e.getAsControlPoint()
                      , n = e.getAsCurrentPoint();
                    t.push(r.x, r.y, a.x, a.y, n.x, n.y)
                }
                return "C"
            }
        }, {
            key: "pathQ",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.getAsControlPoint()
                      , a = e.getAsCurrentPoint();
                    t.push(r.x, r.y, a.x, a.y)
                }
            }
        }, {
            key: "pathT",
            value: function(e, t) {
                for (; !e.isCommandOrEnd(); ) {
                    var r = e.getReflectedControlPoint();
                    e.control = r;
                    var a = e.getAsCurrentPoint();
                    t.push(r.x, r.y, a.x, a.y)
                }
                return "Q"
            }
        }, {
            key: "pathA",
            value: function(e) {
                for (; !e.isCommandOrEnd(); ) {
                    var t = e.current
                      , r = e.getScalar()
                      , a = e.getScalar()
                      , n = e.getScalar() * (Math.PI / 180)
                      , o = e.getScalar()
                      , l = e.getScalar()
                      , i = e.getAsCurrentPoint()
                      , s = new Point(Math.cos(n) * (t.x - i.x) / 2 + Math.sin(n) * (t.y - i.y) / 2,-Math.sin(n) * (t.x - i.x) / 2 + Math.cos(n) * (t.y - i.y) / 2)
                      , c = Math.pow(s.x, 2) / Math.pow(r, 2) + Math.pow(s.y, 2) / Math.pow(a, 2);
                    c > 1 && (r *= Math.sqrt(c),
                    a *= Math.sqrt(c));
                    var u = (o === l ? -1 : 1) * Math.sqrt((Math.pow(r, 2) * Math.pow(a, 2) - Math.pow(r, 2) * Math.pow(s.y, 2) - Math.pow(a, 2) * Math.pow(s.x, 2)) / (Math.pow(r, 2) * Math.pow(s.y, 2) + Math.pow(a, 2) * Math.pow(s.x, 2)));
                    isNaN(u) && (u = 0);
                    var h = new Point(u * r * s.y / a,u * -a * s.x / r)
                      , d = new Point((t.x + i.x) / 2 + Math.cos(n) * h.x - Math.sin(n) * h.y,(t.y + i.y) / 2 + Math.sin(n) * h.x + Math.cos(n) * h.y)
                      , f = vectorsAngle([1, 0], [(s.x - h.x) / r, (s.y - h.y) / a])
                      , m = [(s.x - h.x) / r, (s.y - h.y) / a]
                      , p = [(-s.x - h.x) / r, (-s.y - h.y) / a]
                      , g = vectorsAngle(m, p);
                    return vectorsRatio(m, p) <= -1 && (g = Math.PI),
                    vectorsRatio(m, p) >= 1 && (g = 0),
                    0 === l && g > 0 && (g -= 2 * Math.PI),
                    1 === l && g < 0 && (g += 2 * Math.PI),
                    [d.x, d.y, r, a, f, g, n, l]
                }
            }
        }, {
            key: "calcLength",
            value: function(e, t, r, a) {
                var n = 0
                  , o = null
                  , l = null
                  , i = 0;
                switch (r) {
                case "L":
                    return this.getLineLength(e, t, a[0], a[1]);
                case "C":
                    for (n = 0,
                    o = this.getPointOnCubicBezier(0, e, t, a[0], a[1], a[2], a[3], a[4], a[5]),
                    i = .01; i <= 1; i += .01)
                        l = this.getPointOnCubicBezier(i, e, t, a[0], a[1], a[2], a[3], a[4], a[5]),
                        n += this.getLineLength(o.x, o.y, l.x, l.y),
                        o = l;
                    return n;
                case "Q":
                    for (n = 0,
                    o = this.getPointOnQuadraticBezier(0, e, t, a[0], a[1], a[2], a[3]),
                    i = .01; i <= 1; i += .01)
                        l = this.getPointOnQuadraticBezier(i, e, t, a[0], a[1], a[2], a[3]),
                        n += this.getLineLength(o.x, o.y, l.x, l.y),
                        o = l;
                    return n;
                case "A":
                    n = 0;
                    var s = a[4]
                      , c = a[5]
                      , u = a[4] + c
                      , h = Math.PI / 180;
                    if (Math.abs(s - u) < h && (h = Math.abs(s - u)),
                    o = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], s, 0),
                    c < 0)
                        for (i = s - h; i > u; i -= h)
                            l = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], i, 0),
                            n += this.getLineLength(o.x, o.y, l.x, l.y),
                            o = l;
                    else
                        for (i = s + h; i < u; i += h)
                            l = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], i, 0),
                            n += this.getLineLength(o.x, o.y, l.x, l.y),
                            o = l;
                    return l = this.getPointOnEllipticalArc(a[0], a[1], a[2], a[3], u, 0),
                    n += this.getLineLength(o.x, o.y, l.x, l.y)
                }
                return 0
            }
        }, {
            key: "getPointOnLine",
            value: function(e, t, r, a, n) {
                var o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : t
                  , l = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : r
                  , i = (n - r) / (a - t + PSEUDO_ZERO)
                  , s = Math.sqrt(e * e / (1 + i * i));
                a < t && (s *= -1);
                var c = i * s
                  , u = null;
                if (a === t)
                    u = {
                        x: o,
                        y: l + c
                    };
                else if ((l - r) / (o - t + PSEUDO_ZERO) === i)
                    u = {
                        x: o + s,
                        y: l + c
                    };
                else {
                    var h = 0
                      , d = 0
                      , f = this.getLineLength(t, r, a, n);
                    if (f < PSEUDO_ZERO)
                        return null;
                    var m = (o - t) * (a - t) + (l - r) * (n - r);
                    h = t + (m /= f * f) * (a - t),
                    d = r + m * (n - r);
                    var p = this.getLineLength(o, l, h, d)
                      , g = Math.sqrt(e * e - p * p);
                    s = Math.sqrt(g * g / (1 + i * i)),
                    a < t && (s *= -1),
                    u = {
                        x: h + s,
                        y: d + (c = i * s)
                    }
                }
                return u
            }
        }, {
            key: "getPointOnPath",
            value: function(e) {
                var t = this.getPathLength()
                  , r = 0
                  , a = null;
                if (e < -5e-5 || e - 5e-5 > t)
                    return null;
                var n, o = _createForOfIteratorHelper$1$1(this.dataArray);
                try {
                    for (o.s(); !(n = o.n()).done; ) {
                        var l = n.value;
                        if (!l || !(l.pathLength < 5e-5 || r + l.pathLength + 5e-5 < e)) {
                            var i = e - r
                              , s = 0;
                            switch (l.command) {
                            case "L":
                                a = this.getPointOnLine(i, l.start.x, l.start.y, l.points[0], l.points[1], l.start.x, l.start.y);
                                break;
                            case "A":
                                var c = l.points[4]
                                  , u = l.points[5]
                                  , h = l.points[4] + u;
                                if (s = c + i / l.pathLength * u,
                                u < 0 && s < h || u >= 0 && s > h)
                                    break;
                                a = this.getPointOnEllipticalArc(l.points[0], l.points[1], l.points[2], l.points[3], s, l.points[6]);
                                break;
                            case "C":
                                (s = i / l.pathLength) > 1 && (s = 1),
                                a = this.getPointOnCubicBezier(s, l.start.x, l.start.y, l.points[0], l.points[1], l.points[2], l.points[3], l.points[4], l.points[5]);
                                break;
                            case "Q":
                                (s = i / l.pathLength) > 1 && (s = 1),
                                a = this.getPointOnQuadraticBezier(s, l.start.x, l.start.y, l.points[0], l.points[1], l.points[2], l.points[3])
                            }
                            if (a)
                                return a;
                            break
                        }
                        r += l.pathLength
                    }
                } catch (e) {
                    o.e(e)
                } finally {
                    o.f()
                }
                return null
            }
        }, {
            key: "getLineLength",
            value: function(e, t, r, a) {
                return Math.sqrt((r - e) * (r - e) + (a - t) * (a - t))
            }
        }, {
            key: "getPathLength",
            value: function() {
                return -1 === this.pathLength && (this.pathLength = this.dataArray.reduce((function(e, t) {
                    return t.pathLength > 0 ? e + t.pathLength : e
                }
                ), 0)),
                this.pathLength
            }
        }, {
            key: "getPointOnCubicBezier",
            value: function(e, t, r, a, n, o, l, i, s) {
                return {
                    x: i * CB1(e) + o * CB2(e) + a * CB3(e) + t * CB4(e),
                    y: s * CB1(e) + l * CB2(e) + n * CB3(e) + r * CB4(e)
                }
            }
        }, {
            key: "getPointOnQuadraticBezier",
            value: function(e, t, r, a, n, o, l) {
                return {
                    x: o * QB1(e) + a * QB2(e) + t * QB3(e),
                    y: l * QB1(e) + n * QB2(e) + r * QB3(e)
                }
            }
        }, {
            key: "getPointOnEllipticalArc",
            value: function(e, t, r, a, n, o) {
                var l = Math.cos(o)
                  , i = Math.sin(o)
                  , s = r * Math.cos(n)
                  , c = a * Math.sin(n);
                return {
                    x: e + (s * l - c * i),
                    y: t + (s * i + c * l)
                }
            }
        }, {
            key: "buildEquidistantCache",
            value: function(e, t) {
                var r = this.getPathLength()
                  , a = t || .25
                  , n = e || r / 100;
                if (!this.equidistantCache || this.equidistantCache.step !== n || this.equidistantCache.precision !== a) {
                    this.equidistantCache = {
                        step: n,
                        precision: a,
                        points: []
                    };
                    for (var o = 0, l = 0; l <= r; l += a) {
                        var i = this.getPointOnPath(l)
                          , s = this.getPointOnPath(l + a);
                        i && s && ((o += this.getLineLength(i.x, i.y, s.x, s.y)) >= n && (this.equidistantCache.points.push({
                            x: i.x,
                            y: i.y,
                            distance: l
                        }),
                        o -= n))
                    }
                }
            }
        }, {
            key: "getEquidistantPointOnPath",
            value: function(e, t, r) {
                if (this.buildEquidistantCache(t, r),
                e < 0 || e - this.getPathLength() > 5e-5)
                    return null;
                var a = Math.round(e / this.getPathLength() * (this.equidistantCache.points.length - 1));
                return this.equidistantCache.points[a] || null
            }
        }]),
        r
    }(TextElement);
    function _createSuper$y(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$y()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$y() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var ImageElement = function(e) {
        inherits(n, e);
        var t, r, a = _createSuper$y(n);
        function n(e, t, r) {
            var o;
            classCallCheck(this, n),
            (o = a.call(this, e, t, r)).type = "image",
            o.loaded = !1;
            var l = o.getHrefAttribute().getString();
            if (!l)
                return possibleConstructorReturn(o);
            var i = /\.svg$/.test(l);
            return e.images.push(assertThisInitialized(o)),
            i ? o.loadSvg(l) : o.loadImage(l),
            o.isSvg = i,
            o
        }
        return createClass$1(n, [{
            key: "loadImage",
            value: (r = asyncToGenerator(regenerator.mark((function e(t) {
                var r;
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            return e.prev = 0,
                            e.next = 3,
                            this.document.createImage(t);
                        case 3:
                            r = e.sent,
                            this.image = r,
                            e.next = 10;
                            break;
                        case 7:
                            e.prev = 7,
                            e.t0 = e.catch(0),
                            console.error('Error while loading image "'.concat(t, '":'), e.t0);
                        case 10:
                            this.loaded = !0;
                        case 11:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this, [[0, 7]])
            }
            ))),
            function(e) {
                return r.apply(this, arguments)
            }
            )
        }, {
            key: "loadSvg",
            value: (t = asyncToGenerator(regenerator.mark((function e(t) {
                var r, a;
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            return e.prev = 0,
                            e.next = 3,
                            this.document.fetch(t);
                        case 3:
                            return r = e.sent,
                            e.next = 6,
                            r.text();
                        case 6:
                            a = e.sent,
                            this.image = a,
                            e.next = 13;
                            break;
                        case 10:
                            e.prev = 10,
                            e.t0 = e.catch(0),
                            console.error('Error while loading image "'.concat(t, '":'), e.t0);
                        case 13:
                            this.loaded = !0;
                        case 14:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this, [[0, 10]])
            }
            ))),
            function(e) {
                return t.apply(this, arguments)
            }
            )
        }, {
            key: "renderChildren",
            value: function(e) {
                var t = this.document
                  , r = this.image
                  , a = this.loaded
                  , n = this.getAttribute("x").getPixels("x")
                  , o = this.getAttribute("y").getPixels("y")
                  , l = this.getStyle("width").getPixels("x")
                  , i = this.getStyle("height").getPixels("y");
                if (a && r && l && i) {
                    if (e.save(),
                    this.isSvg)
                        t.canvg.forkString(e, this.image, {
                            ignoreMouse: !0,
                            ignoreAnimation: !0,
                            ignoreDimensions: !0,
                            ignoreClear: !0,
                            offsetX: n,
                            offsetY: o,
                            scaleWidth: l,
                            scaleHeight: i
                        }).render();
                    else {
                        var s = this.image;
                        e.translate(n, o),
                        t.setViewBox({
                            ctx: e,
                            aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
                            width: l,
                            desiredWidth: s.width,
                            height: i,
                            desiredHeight: s.height
                        }),
                        this.loaded && (void 0 === s.complete || s.complete) && e.drawImage(s, 0, 0)
                    }
                    e.restore()
                }
            }
        }, {
            key: "getBoundingBox",
            value: function() {
                var e = this.getAttribute("x").getPixels("x")
                  , t = this.getAttribute("y").getPixels("y")
                  , r = this.getStyle("width").getPixels("x")
                  , a = this.getStyle("height").getPixels("y");
                return new BoundingBox(e,t,e + r,t + a)
            }
        }]),
        n
    }(RenderedElement);
    function _createSuper$z(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$z()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$z() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var SymbolElement = function(e) {
        inherits(r, e);
        var t = _createSuper$z(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "symbol",
            e
        }
        return createClass$1(r, [{
            key: "render",
            value: function(e) {}
        }]),
        r
    }(RenderedElement)
      , SVGFontLoader = function() {
        function e(t) {
            classCallCheck(this, e),
            this.document = t,
            this.loaded = !1,
            t.fonts.push(this)
        }
        var t;
        return createClass$1(e, [{
            key: "load",
            value: (t = asyncToGenerator(regenerator.mark((function e(t, r) {
                var a, n, o;
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            return e.prev = 0,
                            a = this.document,
                            e.next = 4,
                            a.canvg.parser.load(r);
                        case 4:
                            n = e.sent,
                            o = n.getElementsByTagName("font"),
                            Array.from(o).forEach((function(e) {
                                var r = a.createElement(e);
                                a.definitions[t] = r
                            }
                            )),
                            e.next = 12;
                            break;
                        case 9:
                            e.prev = 9,
                            e.t0 = e.catch(0),
                            console.error('Error while loading font "'.concat(r, '":'), e.t0);
                        case 12:
                            this.loaded = !0;
                        case 13:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this, [[0, 9]])
            }
            ))),
            function(e, r) {
                return t.apply(this, arguments)
            }
            )
        }]),
        e
    }();
    function _createSuper$A(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$A()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$A() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var StyleElement = function(e) {
        inherits(r, e);
        var t = _createSuper$A(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "style",
            compressSpaces(Array.from(a.childNodes).map((function(e) {
                return e.data
            }
            )).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, "").replace(/@import.*;/g, "")).split("}").forEach((function(t) {
                var r = t.trim();
                if (r) {
                    var a = r.split("{")
                      , n = a[0].split(",")
                      , o = a[1].split(";");
                    n.forEach((function(t) {
                        var r = t.trim();
                        if (r) {
                            var a = e.styles[r] || {};
                            if (o.forEach((function(t) {
                                var r = t.indexOf(":")
                                  , n = t.substr(0, r).trim()
                                  , o = t.substr(r + 1, t.length - r).trim();
                                n && o && (a[n] = new Property(e,n,o))
                            }
                            )),
                            e.styles[r] = a,
                            e.stylesSpecificity[r] = getSelectorSpecificity(r),
                            "@font-face" === r) {
                                var n = a["font-family"].getString().replace(/"|'/g, "");
                                a.src.getString().split(",").forEach((function(t) {
                                    if (t.indexOf('format("svg")') > 0) {
                                        var r = parseExternalUrl(t);
                                        r && new SVGFontLoader(e).load(n, r)
                                    }
                                }
                                ))
                            }
                        }
                    }
                    ))
                }
            }
            )),
            o
        }
        return r
    }(Element);
    function _createSuper$B(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$B()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$B() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    StyleElement.parseExternalUrl = parseExternalUrl;
    var UseElement = function(e) {
        inherits(r, e);
        var t = _createSuper$B(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "use",
            e
        }
        return createClass$1(r, [{
            key: "setContext",
            value: function(e) {
                get$2(getPrototypeOf(r.prototype), "setContext", this).call(this, e);
                var t = this.getAttribute("x")
                  , a = this.getAttribute("y");
                t.hasValue() && e.translate(t.getPixels("x"), 0),
                a.hasValue() && e.translate(0, a.getPixels("y"))
            }
        }, {
            key: "path",
            value: function(e) {
                var t = this.element;
                t && t.path(e)
            }
        }, {
            key: "renderChildren",
            value: function(e) {
                var t = this.document
                  , r = this.element;
                if (r) {
                    var a = r;
                    if ("symbol" === r.type && ((a = new SVGElement(t,null)).attributes.viewBox = new Property(t,"viewBox",r.getAttribute("viewBox").getString()),
                    a.attributes.preserveAspectRatio = new Property(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),
                    a.attributes.overflow = new Property(t,"overflow",r.getAttribute("overflow").getString()),
                    a.children = r.children),
                    "svg" === a.type) {
                        var n = this.getStyle("width", !1, !0)
                          , o = this.getStyle("height", !1, !0);
                        n.hasValue() && (a.attributes.width = new Property(t,"width",n.getString())),
                        o.hasValue() && (a.attributes.height = new Property(t,"height",o.getString()))
                    }
                    var l = a.parent;
                    a.parent = this,
                    a.render(e),
                    a.parent = l
                }
            }
        }, {
            key: "getBoundingBox",
            value: function(e) {
                var t = this.element;
                return t ? t.getBoundingBox(e) : null
            }
        }, {
            key: "elementTransform",
            value: function() {
                var e = this.document
                  , t = this.element;
                return Transform.fromElement(e, t)
            }
        }, {
            key: "element",
            get: function() {
                return this._element || (this._element = this.getHrefAttribute().getDefinition()),
                this._element
            }
        }]),
        r
    }(RenderedElement);
    function _createSuper$C(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$C()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$C() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    function imGet(e, t, r, a, n, o) {
        return e[r * a * 4 + 4 * t + o]
    }
    function imSet(e, t, r, a, n, o, l) {
        e[r * a * 4 + 4 * t + o] = l
    }
    function m$1(e, t, r) {
        var a = e[t];
        return a * (a < 0 ? r - 255 : r)
    }
    function c$2(e, t, r, a) {
        return t + Math.cos(e) * r + Math.sin(e) * a
    }
    var FeColorMatrixElement = function(e) {
        inherits(r, e);
        var t = _createSuper$C(r);
        function r(e, a, n) {
            var o;
            classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "feColorMatrix";
            var l = toNumbers(o.getAttribute("values").getString());
            switch (o.getAttribute("type").getString("matrix")) {
            case "saturate":
                var i = l[0];
                l = [.213 + .787 * i, .715 - .715 * i, .072 - .072 * i, 0, 0, .213 - .213 * i, .715 + .285 * i, .072 - .072 * i, 0, 0, .213 - .213 * i, .715 - .715 * i, .072 + .928 * i, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
                break;
            case "hueRotate":
                var s = l[0] * Math.PI / 180;
                l = [c$2(s, .213, .787, -.213), c$2(s, .715, -.715, -.715), c$2(s, .072, -.072, .928), 0, 0, c$2(s, .213, -.213, .143), c$2(s, .715, .285, .14), c$2(s, .072, -.072, -.283), 0, 0, c$2(s, .213, -.213, -.787), c$2(s, .715, -.715, .715), c$2(s, .072, .928, .072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
                break;
            case "luminanceToAlpha":
                l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .2125, .7154, .0721, 0, 0, 0, 0, 0, 0, 1]
            }
            return o.matrix = l,
            o.includeOpacity = o.getAttribute("includeOpacity").hasValue(),
            o
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t, r, a, n) {
                for (var o = this.includeOpacity, l = this.matrix, i = e.getImageData(0, 0, a, n), s = 0; s < n; s++)
                    for (var c = 0; c < a; c++) {
                        var u = imGet(i.data, c, s, a, n, 0)
                          , h = imGet(i.data, c, s, a, n, 1)
                          , d = imGet(i.data, c, s, a, n, 2)
                          , f = imGet(i.data, c, s, a, n, 3)
                          , m = m$1(l, 0, u) + m$1(l, 1, h) + m$1(l, 2, d) + m$1(l, 3, f) + m$1(l, 4, 1)
                          , p = m$1(l, 5, u) + m$1(l, 6, h) + m$1(l, 7, d) + m$1(l, 8, f) + m$1(l, 9, 1)
                          , g = m$1(l, 10, u) + m$1(l, 11, h) + m$1(l, 12, d) + m$1(l, 13, f) + m$1(l, 14, 1)
                          , y = m$1(l, 15, u) + m$1(l, 16, h) + m$1(l, 17, d) + m$1(l, 18, f) + m$1(l, 19, 1);
                        o && (m = p = g = 0,
                        y *= f / 255),
                        imSet(i.data, c, s, a, n, 0, m),
                        imSet(i.data, c, s, a, n, 1, p),
                        imSet(i.data, c, s, a, n, 2, g),
                        imSet(i.data, c, s, a, n, 3, y)
                    }
                e.clearRect(0, 0, a, n),
                e.putImageData(i, 0, 0)
            }
        }]),
        r
    }(Element);
    function _createSuper$D(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$D()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$D() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var MaskElement = function(e) {
        inherits(r, e);
        var t = _createSuper$D(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "mask",
            e
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t) {
                var a = this.document
                  , n = this.getAttribute("x").getPixels("x")
                  , o = this.getAttribute("y").getPixels("y")
                  , l = this.getStyle("width").getPixels("x")
                  , i = this.getStyle("height").getPixels("y");
                if (!l && !i) {
                    var s = new BoundingBox;
                    this.children.forEach((function(t) {
                        s.addBoundingBox(t.getBoundingBox(e))
                    }
                    )),
                    n = Math.floor(s.x1),
                    o = Math.floor(s.y1),
                    l = Math.floor(s.width),
                    i = Math.floor(s.height)
                }
                var c = this.removeStyles(t, r.ignoreStyles)
                  , u = a.createCanvas(n + l, o + i)
                  , h = u.getContext("2d");
                a.screen.setDefaults(h),
                this.renderChildren(h),
                new FeColorMatrixElement(a,{
                    nodeType: 1,
                    childNodes: [],
                    attributes: [{
                        nodeName: "type",
                        value: "luminanceToAlpha"
                    }, {
                        nodeName: "includeOpacity",
                        value: "true"
                    }]
                }).apply(h, 0, 0, n + l, o + i);
                var d = a.createCanvas(n + l, o + i)
                  , f = d.getContext("2d");
                a.screen.setDefaults(f),
                t.render(f),
                f.globalCompositeOperation = "destination-in",
                f.fillStyle = h.createPattern(u, "no-repeat"),
                f.fillRect(0, 0, n + l, o + i),
                e.fillStyle = f.createPattern(d, "no-repeat"),
                e.fillRect(0, 0, n + l, o + i),
                this.restoreStyles(t, c)
            }
        }, {
            key: "render",
            value: function(e) {}
        }]),
        r
    }(Element);
    function _createSuper$E(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$E()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$E() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    MaskElement.ignoreStyles = ["mask", "transform", "clip-path"];
    var noop = function() {}
      , ClipPathElement = function(e) {
        inherits(r, e);
        var t = _createSuper$E(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "clipPath",
            e
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e) {
                var t = this.document
                  , r = Reflect.getPrototypeOf(e)
                  , a = e.beginPath
                  , n = e.closePath;
                r && (r.beginPath = noop,
                r.closePath = noop),
                Reflect.apply(a, e, []),
                this.children.forEach((function(a) {
                    if (void 0 !== a.path) {
                        var o = void 0 !== a.elementTransform ? a.elementTransform() : null;
                        o || (o = Transform.fromElement(t, a)),
                        o && o.apply(e),
                        a.path(e),
                        r && (r.closePath = n),
                        o && o.unapply(e)
                    }
                }
                )),
                Reflect.apply(n, e, []),
                e.clip(),
                r && (r.beginPath = a,
                r.closePath = n)
            }
        }, {
            key: "render",
            value: function(e) {}
        }]),
        r
    }(Element);
    function _createSuper$F(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$F()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$F() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FilterElement = function(e) {
        inherits(r, e);
        var t = _createSuper$F(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "filter",
            e
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t) {
                var a = this.document
                  , n = this.children
                  , o = t.getBoundingBox(e);
                if (o) {
                    var l = 0
                      , i = 0;
                    n.forEach((function(e) {
                        var t = e.extraFilterDistance || 0;
                        l = Math.max(l, t),
                        i = Math.max(i, t)
                    }
                    ));
                    var s = Math.floor(o.width)
                      , c = Math.floor(o.height)
                      , u = s + 2 * l
                      , h = c + 2 * i;
                    if (!(u < 1 || h < 1)) {
                        var d = Math.floor(o.x)
                          , f = Math.floor(o.y)
                          , m = this.removeStyles(t, r.ignoreStyles)
                          , p = a.createCanvas(u, h)
                          , g = p.getContext("2d");
                        a.screen.setDefaults(g),
                        g.translate(-d + l, -f + i),
                        t.render(g),
                        n.forEach((function(e) {
                            "function" == typeof e.apply && e.apply(g, 0, 0, u, h)
                        }
                        )),
                        e.drawImage(p, 0, 0, u, h, d - l, f - i, u, h),
                        this.restoreStyles(t, m)
                    }
                }
            }
        }, {
            key: "render",
            value: function(e) {}
        }]),
        r
    }(Element);
    function _createSuper$G(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$G()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$G() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    FilterElement.ignoreStyles = ["filter", "transform", "clip-path"];
    var FeDropShadowElement = function(e) {
        inherits(r, e);
        var t = _createSuper$G(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "feDropShadow",
            o.addStylesFromStyleDefinition(),
            o
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t, r, a, n) {}
        }]),
        r
    }(Element);
    function _createSuper$H(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$H()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$H() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FeMorphologyElement = function(e) {
        inherits(r, e);
        var t = _createSuper$H(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "feMorphology",
            e
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t, r, a, n) {}
        }]),
        r
    }(Element);
    function _createSuper$I(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$I()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$I() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FeCompositeElement = function(e) {
        inherits(r, e);
        var t = _createSuper$I(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "feComposite",
            e
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t, r, a, n) {}
        }]),
        r
    }(Element);
    function _createSuper$J(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$J()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$J() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var FeGaussianBlurElement = function(e) {
        inherits(r, e);
        var t = _createSuper$J(r);
        function r(e, a, n) {
            var o;
            return classCallCheck(this, r),
            (o = t.call(this, e, a, n)).type = "feGaussianBlur",
            o.blurRadius = Math.floor(o.getAttribute("stdDeviation").getNumber()),
            o.extraFilterDistance = o.blurRadius,
            o
        }
        return createClass$1(r, [{
            key: "apply",
            value: function(e, t, r, a, n) {
                var o = this.document
                  , l = this.blurRadius
                  , i = o.window ? o.window.document.body : null
                  , s = e.canvas;
                s.id = o.getUniqueId(),
                i && (s.style.display = "none",
                i.appendChild(s)),
                processCanvasRGBA(s, t, r, a, n, l),
                i && i.removeChild(s)
            }
        }]),
        r
    }(Element);
    function _createSuper$K(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$K()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$K() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var TitleElement = function(e) {
        inherits(r, e);
        var t = _createSuper$K(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "title",
            e
        }
        return r
    }(Element);
    function _createSuper$L(e) {
        return function() {
            var t, r = getPrototypeOf(e);
            if (_isNativeReflectConstruct$L()) {
                var a = getPrototypeOf(this).constructor;
                t = Reflect.construct(r, arguments, a)
            } else
                t = r.apply(this, arguments);
            return possibleConstructorReturn(this, t)
        }
    }
    function _isNativeReflectConstruct$L() {
        if ("undefined" == typeof Reflect || !Reflect.construct)
            return !1;
        if (Reflect.construct.sham)
            return !1;
        if ("function" == typeof Proxy)
            return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
            ))),
            !0
        } catch (e) {
            return !1
        }
    }
    var DescElement = function(e) {
        inherits(r, e);
        var t = _createSuper$L(r);
        function r() {
            var e;
            return classCallCheck(this, r),
            (e = t.apply(this, arguments)).type = "desc",
            e
        }
        return r
    }(Element)
      , elementTypes = {
        svg: SVGElement,
        rect: RectElement,
        circle: CircleElement,
        ellipse: EllipseElement,
        line: LineElement,
        polyline: PolylineElement,
        polygon: PolygonElement,
        path: PathElement,
        pattern: PatternElement,
        marker: MarkerElement,
        defs: DefsElement,
        linearGradient: LinearGradientElement,
        radialGradient: RadialGradientElement,
        stop: StopElement,
        animate: AnimateElement,
        animateColor: AnimateColorElement,
        animateTransform: AnimateTransformElement,
        font: FontElement,
        "font-face": FontFaceElement,
        "missing-glyph": MissingGlyphElement,
        glyph: GlyphElement,
        text: TextElement,
        tspan: TSpanElement,
        tref: TRefElement,
        a: AElement,
        textPath: TextPathElement,
        image: ImageElement,
        g: GElement,
        symbol: SymbolElement,
        style: StyleElement,
        use: UseElement,
        mask: MaskElement,
        clipPath: ClipPathElement,
        filter: FilterElement,
        feDropShadow: FeDropShadowElement,
        feMorphology: FeMorphologyElement,
        feComposite: FeCompositeElement,
        feColorMatrix: FeColorMatrixElement,
        feGaussianBlur: FeGaussianBlurElement,
        title: TitleElement,
        desc: DescElement
    };
    function ownKeys$2(e, t) {
        var r = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var a = Object.getOwnPropertySymbols(e);
            t && (a = a.filter((function(t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            }
            ))),
            r.push.apply(r, a)
        }
        return r
    }
    function _objectSpread(e) {
        for (var t = 1; t < arguments.length; t++) {
            var r = null != arguments[t] ? arguments[t] : {};
            t % 2 ? ownKeys$2(Object(r), !0).forEach((function(t) {
                defineProperty$a(e, t, r[t])
            }
            )) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys$2(Object(r)).forEach((function(t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
            }
            ))
        }
        return e
    }
    function createCanvas(e, t) {
        var r = document.createElement("canvas");
        return r.width = e,
        r.height = t,
        r
    }
    function createImage(e) {
        return _createImage.apply(this, arguments)
    }
    function _createImage() {
        return (_createImage = asyncToGenerator(regenerator.mark((function e(t) {
            var r, a, n = arguments;
            return regenerator.wrap((function(e) {
                for (; ; )
                    switch (e.prev = e.next) {
                    case 0:
                        return r = n.length > 1 && void 0 !== n[1] && n[1],
                        a = document.createElement("img"),
                        r && (a.crossOrigin = "Anonymous"),
                        e.abrupt("return", new Promise((function(e, r) {
                            a.onload = function() {
                                e(a)
                            }
                            ,
                            a.onerror = function() {
                                r()
                            }
                            ,
                            a.src = t
                        }
                        )));
                    case 4:
                    case "end":
                        return e.stop()
                    }
            }
            ), e)
        }
        )))).apply(this, arguments)
    }
    var Document = function() {
        function e(t) {
            var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
              , a = r.rootEmSize
              , n = void 0 === a ? 12 : a
              , o = r.emSize
              , l = void 0 === o ? 12 : o
              , i = r.createCanvas
              , s = void 0 === i ? e.createCanvas : i
              , c = r.createImage
              , u = void 0 === c ? e.createImage : c
              , h = r.anonymousCrossOrigin;
            classCallCheck(this, e),
            this.canvg = t,
            this.definitions = {},
            this.styles = {},
            this.stylesSpecificity = {},
            this.images = [],
            this.fonts = [],
            this.emSizeStack = [],
            this.uniqueId = 0,
            this.screen = t.screen,
            this.rootEmSize = n,
            this.emSize = l,
            this.createCanvas = s,
            this.createImage = this.bindCreateImage(u, h),
            this.screen.wait(this.isImagesLoaded.bind(this)),
            this.screen.wait(this.isFontsLoaded.bind(this))
        }
        return createClass$1(e, [{
            key: "bindCreateImage",
            value: function(e, t) {
                return "boolean" == typeof t ? function(r, a) {
                    return e(r, "boolean" == typeof a ? a : t)
                }
                : e
            }
        }, {
            key: "popEmSize",
            value: function() {
                this.emSizeStack.pop()
            }
        }, {
            key: "getUniqueId",
            value: function() {
                return "canvg".concat(++this.uniqueId)
            }
        }, {
            key: "isImagesLoaded",
            value: function() {
                return this.images.every((function(e) {
                    return e.loaded
                }
                ))
            }
        }, {
            key: "isFontsLoaded",
            value: function() {
                return this.fonts.every((function(e) {
                    return e.loaded
                }
                ))
            }
        }, {
            key: "createDocumentElement",
            value: function(e) {
                var t = this.createElement(e.documentElement);
                return t.root = !0,
                t.addStylesFromStyleDefinition(),
                this.documentElement = t,
                t
            }
        }, {
            key: "createElement",
            value: function(t) {
                var r = t.nodeName.replace(/^[^:]+:/, "")
                  , a = e.elementTypes[r];
                return void 0 !== a ? new a(this,t) : new UnknownElement(this,t)
            }
        }, {
            key: "createTextNode",
            value: function(e) {
                return new TextNode(this,e)
            }
        }, {
            key: "setViewBox",
            value: function(e) {
                this.screen.setViewBox(_objectSpread({
                    document: this
                }, e))
            }
        }, {
            key: "window",
            get: function() {
                return this.screen.window
            }
        }, {
            key: "fetch",
            get: function() {
                return this.screen.fetch
            }
        }, {
            key: "ctx",
            get: function() {
                return this.screen.ctx
            }
        }, {
            key: "emSize",
            get: function() {
                var e = this.emSizeStack;
                return e[e.length - 1]
            },
            set: function(e) {
                this.emSizeStack.push(e)
            }
        }]),
        e
    }();
    function ownKeys$1$1(e, t) {
        var r = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var a = Object.getOwnPropertySymbols(e);
            t && (a = a.filter((function(t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            }
            ))),
            r.push.apply(r, a)
        }
        return r
    }
    function _objectSpread$1(e) {
        for (var t = 1; t < arguments.length; t++) {
            var r = null != arguments[t] ? arguments[t] : {};
            t % 2 ? ownKeys$1$1(Object(r), !0).forEach((function(t) {
                defineProperty$a(e, t, r[t])
            }
            )) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys$1$1(Object(r)).forEach((function(t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
            }
            ))
        }
        return e
    }
    Document.createCanvas = createCanvas,
    Document.createImage = createImage,
    Document.elementTypes = elementTypes;
    var Canvg = function() {
        function e(t, r) {
            var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
            classCallCheck(this, e),
            this.parser = new Parser$1(a),
            this.screen = new Screen(t,a),
            this.options = a;
            var n = new Document(this,a)
              , o = n.createDocumentElement(r);
            this.document = n,
            this.documentElement = o
        }
        var t, r;
        return createClass$1(e, [{
            key: "fork",
            value: function(t, r) {
                var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
                return e.from(t, r, _objectSpread$1({}, this.options, {}, a))
            }
        }, {
            key: "forkString",
            value: function(t, r) {
                var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
                return e.fromString(t, r, _objectSpread$1({}, this.options, {}, a))
            }
        }, {
            key: "ready",
            value: function() {
                return this.screen.ready()
            }
        }, {
            key: "isReady",
            value: function() {
                return this.screen.isReady()
            }
        }, {
            key: "render",
            value: (r = asyncToGenerator(regenerator.mark((function e() {
                var t, r = arguments;
                return regenerator.wrap((function(e) {
                    for (; ; )
                        switch (e.prev = e.next) {
                        case 0:
                            return t = r.length > 0 && void 0 !== r[0] ? r[0] : {},
                            this.start(_objectSpread$1({
                                enableRedraw: !0,
                                ignoreAnimation: !0,
                                ignoreMouse: !0
                            }, t)),
                            e.next = 4,
                            this.ready();
                        case 4:
                            this.stop();
                        case 5:
                        case "end":
                            return e.stop()
                        }
                }
                ), e, this)
            }
            ))),
            function() {
                return r.apply(this, arguments)
            }
            )
        }, {
            key: "start",
            value: function() {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
                  , t = this.documentElement
                  , r = this.screen
                  , a = this.options;
                r.start(t, _objectSpread$1({
                    enableRedraw: !0
                }, a, {}, e))
            }
        }, {
            key: "stop",
            value: function() {
                this.screen.stop()
            }
        }, {
            key: "resize",
            value: function(e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e
                  , r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
                this.documentElement.resize(e, t, r)
            }
        }], [{
            key: "from",
            value: (t = asyncToGenerator(regenerator.mark((function t(r, a) {
                var n, o, l, i = arguments;
                return regenerator.wrap((function(t) {
                    for (; ; )
                        switch (t.prev = t.next) {
                        case 0:
                            return n = i.length > 2 && void 0 !== i[2] ? i[2] : {},
                            o = new Parser$1(n),
                            t.next = 4,
                            o.parse(a);
                        case 4:
                            return l = t.sent,
                            t.abrupt("return", new e(r,l,n));
                        case 6:
                        case "end":
                            return t.stop()
                        }
                }
                ), t)
            }
            ))),
            function(e, r) {
                return t.apply(this, arguments)
            }
            )
        }, {
            key: "fromString",
            value: function(t, r) {
                var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
                  , n = new Parser$1(a)
                  , o = n.parseFromString(r);
                return new e(t,o,a)
            }
        }]),
        e
    }();
    function offscreen() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
          , t = e.DOMParser
          , r = {
            window: null,
            ignoreAnimation: !0,
            ignoreMouse: !0,
            DOMParser: t,
            createCanvas: function(e, t) {
                return new OffscreenCanvas(e,t)
            },
            createImage: function(e) {
                return asyncToGenerator(regenerator.mark((function t() {
                    var r, a, n;
                    return regenerator.wrap((function(t) {
                        for (; ; )
                            switch (t.prev = t.next) {
                            case 0:
                                return t.next = 2,
                                fetch(e);
                            case 2:
                                return r = t.sent,
                                t.next = 5,
                                r.blob();
                            case 5:
                                return a = t.sent,
                                t.next = 8,
                                createImageBitmap(a);
                            case 8:
                                return n = t.sent,
                                t.abrupt("return", n);
                            case 10:
                            case "end":
                                return t.stop()
                            }
                    }
                    ), t)
                }
                )))()
            }
        };
        return "undefined" == typeof DOMParser && void 0 !== t || Reflect.deleteProperty(r, "DOMParser"),
        r
    }
    function node$1(e) {
        var t = e.DOMParser
          , r = e.canvas;
        return {
            window: null,
            ignoreAnimation: !0,
            ignoreMouse: !0,
            DOMParser: t,
            fetch: e.fetch,
            createCanvas: r.createCanvas,
            createImage: r.loadImage
        }
    }
    var index$1 = Object.freeze({
        __proto__: null,
        offscreen: offscreen,
        node: node$1
    })
      , index_es = Object.freeze({
        __proto__: null,
        default: Canvg,
        AElement: AElement,
        AnimateColorElement: AnimateColorElement,
        AnimateElement: AnimateElement,
        AnimateTransformElement: AnimateTransformElement,
        BoundingBox: BoundingBox,
        CB1: CB1,
        CB2: CB2,
        CB3: CB3,
        CB4: CB4,
        Canvg: Canvg,
        CircleElement: CircleElement,
        ClipPathElement: ClipPathElement,
        DefsElement: DefsElement,
        DescElement: DescElement,
        Document: Document,
        Element: Element,
        EllipseElement: EllipseElement,
        FeColorMatrixElement: FeColorMatrixElement,
        FeCompositeElement: FeCompositeElement,
        FeDropShadowElement: FeDropShadowElement,
        FeGaussianBlurElement: FeGaussianBlurElement,
        FeMorphologyElement: FeMorphologyElement,
        FilterElement: FilterElement,
        Font: Font,
        FontElement: FontElement,
        FontFaceElement: FontFaceElement,
        GElement: GElement,
        GlyphElement: GlyphElement,
        GradientElement: GradientElement,
        ImageElement: ImageElement,
        LineElement: LineElement,
        LinearGradientElement: LinearGradientElement,
        MarkerElement: MarkerElement,
        MaskElement: MaskElement,
        Matrix: Matrix,
        MissingGlyphElement: MissingGlyphElement,
        Mouse: Mouse,
        PSEUDO_ZERO: PSEUDO_ZERO,
        Parser: Parser$1,
        PathElement: PathElement,
        PathParser: PathParser,
        PatternElement: PatternElement,
        Point: Point,
        PolygonElement: PolygonElement,
        PolylineElement: PolylineElement,
        Property: Property,
        QB1: QB1,
        QB2: QB2,
        QB3: QB3,
        RadialGradientElement: RadialGradientElement,
        RectElement: RectElement,
        RenderedElement: RenderedElement,
        Rotate: Rotate,
        SVGElement: SVGElement,
        SVGFontLoader: SVGFontLoader,
        Scale: Scale,
        Screen: Screen,
        Skew: Skew,
        SkewX: SkewX,
        SkewY: SkewY,
        StopElement: StopElement,
        StyleElement: StyleElement,
        SymbolElement: SymbolElement,
        TRefElement: TRefElement,
        TSpanElement: TSpanElement,
        TextElement: TextElement,
        TextPathElement: TextPathElement,
        TitleElement: TitleElement,
        Transform: Transform,
        Translate: Translate,
        UnknownElement: UnknownElement,
        UseElement: UseElement,
        ViewPort: ViewPort,
        compressSpaces: compressSpaces,
        getSelectorSpecificity: getSelectorSpecificity,
        normalizeAttributeName: normalizeAttributeName,
        normalizeColor: normalizeColor,
        parseExternalUrl: parseExternalUrl,
        presets: index$1,
        toNumbers: toNumbers,
        trimLeft: trimLeft,
        trimRight: trimRight,
        vectorMagnitude: vectorMagnitude,
        vectorsAngle: vectorsAngle,
        vectorsRatio: vectorsRatio
    });
    return luckysheet$2
}

));
//# sourceMappingURL=luckysheet.umd.js.map
