gridjs-spreadsheet 23.1.2 → 23.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +2 -2
- package/xspreadsheet.js +1 -1
package/xspreadsheet.js
CHANGED
|
@@ -9,4 +9,4 @@ var n,r,o,a,s,l,c,h,u,f,d,v,g,p,m,y,b,w,x,C,k,_,S=S||{version:"4.6.0"};if(e.fabr
|
|
|
9
9
|
*/
|
|
10
10
|
var n=i(29),r=i(30),o=i(31);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}return c(this,t,e,i)}function c(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=f(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,i),r=(t=s(t,n)).write(e,i);r!==n&&(t=t.slice(0,r));return t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|d(e.length);return 0===(t=s(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e){if(h(e),t=s(t,e<0?0:0|d(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function f(t,e){var i=e.length<0?0:0|d(e.length);t=s(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function v(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,i);case"utf8":case"utf-8":return T(this,e,i);case"ascii":return O(this,e,i);case"latin1":case"binary":return E(this,e,i);case"base64":return S(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function m(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,i,n,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):y(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,n,r){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,i/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var h=-1;for(o=i;o<s;o++)if(c(t,o)===c(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*a}else-1!==h&&(o-=o-h),h=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var u=!0,f=0;f<l;f++)if(c(t,o+f)!==c(e,f)){u=!1;break}if(u)return o}return-1}function b(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[i+a]=s}return a}function w(t,e,i,n){return W(H(e,t.length-i),t,i,n)}function x(t,e,i,n){return W(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function C(t,e,i,n){return x(t,e,i,n)}function k(t,e,i,n){return W(N(e),t,i,n)}function _(t,e,i,n){return W(function(t,e){for(var i,n,r,o=[],a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}(e,t.length-i),t,i,n)}function S(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function T(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,a,s,l,c=t[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[r+1]))&&(l=(31&c)<<6|63&o)>127&&(h=l);break;case 3:o=t[r+1],a=t[r+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+1],a=t[r+2],s=t[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return c(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return function(t,e,i,n){return h(e),e<=0?s(t,e):void 0!==i?"string"==typeof n?s(t,e).fill(i,n):s(t,e).fill(i):s(t,e)}(null,t,e,i)},l.allocUnsafe=function(t){return u(null,t)},l.allocUnsafeSlow=function(t){return u(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var a=t[i];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,r),r+=a.length}return n},l.byteLength=v,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?T(this,0,t):g.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,r),h=t.slice(e,i),u=0;u<s;++u)if(c[u]!==h[u]){o=c[u],a=h[u];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return w(this,t,e,i);case"ascii":return x(this,t,e,i);case"latin1":case"binary":return C(this,t,e,i);case"base64":return k(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function E(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function R(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=z(t[o]);return r}function A(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function I(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,i,n,r,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function D(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function F(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function M(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function j(t,e,i,n,o){return o||M(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function L(t,e,i,n,o){return o||M(t,0,i,8),r.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var r=e-t;i=new l(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i},l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},l.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||P(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||P(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);P(this,t,e,i,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o<i&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);P(this,t,e,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return j(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return j(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return L(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return L(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var a=l.isBuffer(t)?t:H(new l(t,n).toString()),s=a.length;for(o=0;o<i-e;++o)this[o+e]=a[o%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],a=0;a<n;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(28))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";e.byteLength=function(t){var e=c(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n=c(t),a=n[0],s=n[1],l=new o(function(t,e,i){return 3*(e+i)/4-i}(0,a,s)),h=0,u=s>0?a-4:a;for(i=0;i<u;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===s&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,l[h++]=255&e);1===s&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],a=0,s=i-r;a<s;a+=16383)o.push(h(t,a,a+16383>s?s:a+16383));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function h(t,e,i){for(var r,o,a=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){
|
|
11
11
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
12
|
-
e.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=t[e+u];for(u+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+u],u+=f,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+u],u+=f,h-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var a,s,l,c=8*o-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,v=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=h?(s=0,a=h):a+u>=1?(s=(e*l-1)*Math.pow(2,r),a+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;t[i+d]=255&s,d+=v,s/=256,r-=8);for(a=a<<r|s,c+=r;c>0;t[i+d]=255&a,d+=v,a/=256,c-=8);t[i+d-v]|=128*g}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e){},function(t,e){},function(t,e){},function(t,e,i){},function(t,e,i){"use strict";(function(t){var e=i(13),n=i.n(e);!function(){function e(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function i(t,i){var n=function(t,i){var n=e(t)*e(i);if(0===n)return 0;var r=function(t,e){return t.x*e.x+t.y*e.y}(t,i)/n;return r>1&&(r=1),Math.acos(r)}(t,i);return function(t,e){return t.x*e.y-e.x*t.y}(t,i)>0&&(n*=-1),180*n/Math.PI}var r=function(t){this.handlers=[],this.el=t};function o(t,e){var i=new r(t);return i.add(e),i}r.prototype.add=function(t){this.handlers.push(t)},r.prototype.del=function(t){t||(this.handlers=[]);for(var e=this.handlers.length;e>=0;e--)this.handlers[e]===t&&this.handlers.splice(e,1)},r.prototype.dispatch=function(){for(var t=0,e=this.handlers.length;t<e;t++){var i=this.handlers[t];"function"==typeof i&&i.apply(this.el,arguments)}};var a=function(t,e){this.element="string"==typeof t?document.querySelector(t):t,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=o(this.element,e.rotate||i),this.touchStart=o(this.element,e.touchStart||i),this.multipointStart=o(this.element,e.multipointStart||i),this.multipointEnd=o(this.element,e.multipointEnd||i),this.pinch=o(this.element,e.pinch||i),this.swipe=o(this.element,e.swipe||i),this.tap=o(this.element,e.tap||i),this.doubleTap=o(this.element,e.doubleTap||i),this.longTap=o(this.element,e.longTap||i),this.singleTap=o(this.element,e.singleTap||i),this.pressMove=o(this.element,e.pressMove||i),this.twoFingerPressMove=o(this.element,e.twoFingerPressMove||i),this.touchMove=o(this.element,e.touchMove||i),this.touchEnd=o(this.element,e.touchEnd||i),this.touchCancel=o(this.element,e.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}};a.prototype={start:function(t){if(t.touches){this.now=Date.now(),this.x1=t.touches[0].pageX,this.y1=t.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(t,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var i=this.preV;if(t.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:t.touches[1].pageX-this.x1,y:t.touches[1].pageY-this.y1};i.x=n.x,i.y=n.y,this.pinchStartLen=e(i),this.multipointStart.dispatch(t,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(t,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(t){if(t.touches){var n=this.preV,r=t.touches.length,o=t.touches[0].pageX,a=t.touches[0].pageY;if(this.isDoubleTap=!1,r>1){var s=t.touches[1].pageX,l=t.touches[1].pageY,c={x:t.touches[1].pageX-o,y:t.touches[1].pageY-a};null!==n.x&&(this.pinchStartLen>0&&(t.zoom=e(c)/this.pinchStartLen,this.pinch.dispatch(t,this.element),this._preventTap=!0,this._inZoom=!0),t.angle=i(c,n),this.rotate.dispatch(t,this.element)),n.x=c.x,n.y=c.y,null!==this.x2&&null!==this.sx2?(t.deltaX=(o-this.x2+s-this.sx2)/2,t.deltaY=(a-this.y2+l-this.sy2)/2):(t.deltaX=0,t.deltaY=0),this.twoFingerPressMove.dispatch(t,this.element),this.sx2=s,this.sy2=l}else{if(null!==this.x2){t.deltaX=o-this.x2,t.deltaY=a-this.y2;var h=Math.abs(this.x1-this.x2),u=Math.abs(this.y1-this.y2);(h>10||u>10)&&(this._preventTap=!0)}else t.deltaX=0,t.deltaY=0;this.pressMove.dispatch(t,this.element)}this.touchMove.dispatch(t,this.element),this._cancelLongTap(),this.x2=o,this.y2=a,r>1&&t.preventDefault()}},end:function(t){if(t.changedTouches){this._cancelLongTap();var e=this;t.touches.length<2&&(this.multipointEnd.dispatch(t,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(t.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){e.swipe.dispatch(t,e.element)}),0)):(this.tapTimeout=setTimeout((function(){e._preventTap||e.tap.dispatch(t,e.element),e.isDoubleTap&&(e.doubleTap.dispatch(t,e.element),e.isDoubleTap=!1)}),0),e.isDoubleTap||e._preventTap||(e.singleTapTimeout=setTimeout((function(){e.singleTap.dispatch(t,e.element)}),250))),this.touchEnd.dispatch(t,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(t){this.cancelAll(),this.touchCancel.dispatch(t,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(t,e,i,n){return Math.abs(t-e)>=Math.abs(i-n)?t-e>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(t,e){this[t]&&this[t].add(e)},off:function(t,e){this[t]&&this[t].del(e)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}},"object"===("undefined"==typeof exports?"undefined":n()(exports))?t.exports=a:window.AlloyFinger=a}()}).call(this,i(37)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,i){"use strict";i.r(e),i.d(e,"spreadsheet",(function(){return Za}));var n=i(5),r=i.n(n),o=i(2),a=i.n(o),s=i(0),l=i.n(s),c=i(14),h=i.n(c),u=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,t),"string"==typeof e?(this.el=document.createElement(e),this.el.className=i):this.el=e,this.data={}}return a()(t,[{key:"data",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:"on",value:function(t,e){var i=t.split("."),n=h()(i),r=n[0],o=n.slice(1),a=r;return"mousewheel"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a="DOMMouseScroll"),this.el.addEventListener(a,(function(t){e(t);for(var i=0;i<o.length;i+=1){var n=o[i];if("left"===n&&0!==t.button)return;if("right"===n&&2!==t.button)return;"stop"===n&&t.stopPropagation()}})),this}},{key:"offset",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach((function(i){e.css(i,"".concat(t[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new t(this.el.parentNode)}},{key:"children",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(e){return t.child(e)})),this)}},{key:"removeChild",value:function(t){this.el.removeChild(t)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;return"string"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(t){return this.el.contains(t)}},{key:"className",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:"addClass",value:function(t){return this.el.classList.add(t),this}},{key:"hasClass",value:function(t){return this.el.classList.contains(t)}},{key:"removeClass",value:function(t){return this.el&&this.el.classList.remove(t),this}},{key:"toggle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(t)}},{key:"toggleClass",value:function(t){return this.el.classList.toggle(t)}},{key:"active",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return t?this.addClass(e):this.removeClass(e),this}},{key:"checked",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,"checked"),this}},{key:"disabled",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(t,e){var i=this;if(void 0!==e)this.el.setAttribute(t,e);else{if("string"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach((function(e){i.el.setAttribute(e,t[e])}))}return this}},{key:"removeAttr",value:function(t){return this.el.removeAttribute(t),this}},{key:"sanitizeHTML",value:function(t){var e=document.createElement("div");return e.textContent=t,e.innerHTML}},{key:"html",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==t?(this.el.innerHTML=e?i?this.sanitizeHTML(t).replace(/\n/g,"<br>"):this.sanitizeHTML(t):t,this):this.el.innerHTML}},{key:"val",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach((function(e){return t.el.style.removeProperty(e)})),this}},{key:"css",value:function(t,e){var i=this;return void 0===e&&"string"!=typeof t?(Object.keys(t).forEach((function(e){i.el.style[e]=t[e]})),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),t}(),f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(t,e)},d=i(6),v=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function p(t){for(var e="",i=t;i>=g.length;)i/=g.length,i-=1,e+=g[parseInt(i,10)%g.length];return e+=g[t%g.length]}function m(t){for(var e=0,i=0;i<t.length-1;i+=1){var n=t.charCodeAt(i)-65,r=t.length-1-i;e+=Math.pow(g.length,r)+g.length*n}return e+=t.charCodeAt(t.length-1)-65}function y(t){for(var e="",i="",n=0;n<t.length;n+=1)t.charAt(n)>="0"&&t.charAt(n)<="9"?i+=t.charAt(n):e+=t.charAt(n);return[m(e),parseInt(i,10)-1]}function b(t,e){return"".concat(p(t)).concat(e+1)}function w(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===i)return t;var o=y(t),a=r()(o,2),s=a[0],l=a[1];return n(s,l)?b(s+e,l+i):t}var x=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,t),this.sri=e,this.sci=i,this.eri=n,this.eci=r,this.w=o,this.h=a}return a()(t,[{key:"set",value:function(t,e,i,n){this.sri=t,this.sci=e,this.eri=i,this.eci=n}},{key:"setToOther",value:function(t){this.sri=t.sri,this.sci=t.sci,this.eri=t.eri,this.eci=t.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var t=0,e=0,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];if(1===n.length){var a=y(n[0]),s=r()(a,2);e=s[0],t=s[1]}else 2===n.length&&(t=n[0],e=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=t&&t<=h&&c<=e&&e<=u}},{key:"each",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=i;a<=r;a+=1)if(e(a))for(var s=n;s<=o;s+=1)t(a,s)}},{key:"emptyFirst",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,o=this.eri,a=this.eci,s=n;s<=o;s+=1)if(e(s)){for(var l=[],c=[],h=r;h<=a;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)t(s,l[u]);for(var f=0;f<c.length;f++)t(s,c[f])}}},{key:"contains",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:"within",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:"disjoint",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:"intersects",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:"union",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci;return new t(e.sri<i?e.sri:i,e.sci<n?e.sci:n,e.eri>r?e.eri:r,e.eci>o?e.eci:o)}},{key:"extendRange",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=e.eri-e.sri+1,s=e.eci-e.sci+1,l=r-i+1,c=o-n+1;return new t(i,n,i+(l<a?a:l-l%a)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(e){var i=[],n=function(e,n,r,o){i.push(new t(e,n,r,o))},r=this.sri,o=this.sci,a=this.eri,s=this.eci,l=e.sri-r,c=e.sci-o,h=a-e.eri,u=s-e.eci;return l>0?(n(r,o,e.sri-1,s),h>0?(n(e.eri+1,o,a,s),c>0?(n(e.sri,o,e.eri,e.sci-1),u>0&&n(e.sri,e.eci+1,e.eri,s)):u>0&&n(e.sri,e.eci+1,e.eri,s)):c>0&&(n(e.sri,o,a,e.sci-1),u>0&&n(e.sri,e.eci+1,a,s))):h>0?(n(e.eri+1,o,a,s),c>0?(n(r,o,e.eri,e.sci-1),u>0&&n(r,e.eci+1,e.eri,s)):u>0&&n(r,e.eci+1,e.eri,s)):c>0?(n(r,o,a,e.sci-1),u>0&&n(r,e.eci+1,a,s)):u>0&&n(r,e.eci+1,a,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var t=this.sri,e=this.sci,i=this.eri,n=this.eci,r=b(e,t);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}],[{key:"valueOf",value:function(e){var i=e.split(":"),n=y(i[0]),o=r()(n,2),a=o[0],s=o[1],l=s,c=a;if(i.length>1){var h=y(i[1]),u=r()(h,2);c=u[0],l=u[1]}return new t(s,a,l,c)}}]),t}(),C=x,k=function(){function t(){l()(this,t),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return a()(t,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(t,e){this.ri=t,this.ci=e}},{key:"size",value:function(){return this.range.size()}}]),t}(),_=function t(){l()(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},S=function(){function t(){l()(this,t),this.undoItems=[],this.redoItems=[]}return a()(t,[{key:"add",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(t(r))),e(r)}}},{key:"redo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(t(r))),e(r)}}}]),t}(),T=function(){function t(){l()(this,t),this.range=null,this.state="clear",this.textdata=null}return a()(t,[{key:"copy",value:function(t,e){this.range=t,this.state="copy";for(var i=t.sri,n=t.sci,r=t.eri,o=t.eci,a="",s=i;s<=r;s+=1){if(e._[s])for(var l=n;l<=o;l+=1){if(e._[s].cells&&e._[s].cells[l]){var c=e._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),a+=c)}a+="\t"}a+="\n"}return this.setData(a),this}},{key:"cut",value:function(t){return this.range=t,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(t){this.textdata=t,this.copyTextToClipboard(t)}},{key:"fallbackCopyTextToClipboard",value:function(t){var e=document.createElement("textarea");e.value=t,e.style.top="0",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}},{key:"copyTextToClipboard",value:function(t){navigator.clipboard?navigator.clipboard.writeText(t).then((function(){}),(function(t){})):this.fallbackCopyTextToClipboard(t)}}]),t}(),O=function(){function t(e,i,n){l()(this,t),this.ci=e,this.operator=i,this.value=n}return a()(t,[{key:"set",value:function(t,e){this.operator=t,this.value=e}},{key:"includes",value:function(t){var e=this.operator,i=this.value;return"all"===e||"in"===e&&i.includes(t)}},{key:"vlength",value:function(){var t=this.operator,e=this.value;return"in"===t?e.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),E=function(){function t(e,i){l()(this,t),this.ci=e,this.order=i}return a()(t,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),t}(),R=function(){function t(){l()(this,t),this.ref=null,this.filters=[],this.sort=null}return a()(t,[{key:"setData",value:function(t){var e=t.ref,i=t.filters,n=t.sort;null!=e&&(this.ref=e,this.filters=i.map((function(t){return new O(t.ci,t.operator,t.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var t=this.ref,e=this.filters,i=this.sort;return{ref:t,filters:e.map((function(t){return t.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(t,e,i){var n=this.getFilter(t);null==n?this.filters.push(new O(t,e,i)):n.set(e,i)}},{key:"setSort",value:function(t,e){this.sort=e?new E(t,e):null}},{key:"includes",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:"getSort",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:"getFilter",value:function(t){for(var e=this.filters,i=0;i<e.length;i+=1)if(e[i].ci===t)return e[i];return null}},{key:"filteredRows",value:function(t){var e=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=this.filters,s=r+1;s<=o;s+=1)for(var l=0;l<a.length;l+=1){var c=a[l],h=t(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){e.add(s);break}i.add(s)}return{rset:e,fset:i}}},{key:"items",value:function(t,e){var i={};if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=r+1;a<=o;a+=1){var s=e(a,t);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),t}(),A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,t),this._=e}return a()(t,[{key:"forEach",value:function(t){this._.forEach(t)}},{key:"deleteWithin",value:function(t){this._=this._.filter((function(e){return!e.within(t)}))}},{key:"getFirstIncludes",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"filterIntersects",value:function(e){return new t(this._.filter((function(t){return t.intersects(e)})))}},{key:"intersects",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:"equals",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].equals(t))return!0}return!1}},{key:"union",value:function(t){var e=t;return this._.forEach((function(t){t.intersects(e)&&(e=t.union(e))})),e}},{key:"add",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:"shift",value:function(t,e,i,n){this._.forEach((function(r){var o=r.sri,a=r.sci,s=r.eri,l=r.eci,c=r;"row"===t?o>=e?(c.sri+=i,c.eri+=i):o<e&&e<=s&&(c.eri+=i,n(o,a,i,0)):"column"===t&&(a>=e?(c.sci+=i,c.eci+=i):a<e&&e<=l&&(c.eci+=i,n(o,a,0,i)))}))}},{key:"move",value:function(t,e,i){this._.forEach((function(n){var r=n;r.within(t)&&(r.eri+=e,r.sri+=e,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(t){return this._=t.map((function(t){return x.valueOf(t)})),this}},{key:"getData",value:function(){return this._.map((function(t){return t.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(t){return t.multiple()}))}}]),t}();var I=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?e[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(e[n]=e[n]||{},t(e[n],r)):e[n]=r}))})),e};function P(t){for(var e="".concat(t),i=0,n=!1,r=0;r<e.length;r+=1)!0===n&&(i+=1),"."===e.charAt(r)&&(n=!0);return i}function D(t,e,i){if(Number.isNaN(e)||Number.isNaN(i))return e+t+i;var n=P(e),r=P(i),o=Number(e),a=Number(i),s=0;return"-"===t?s=o-a:"+"===t?s=o+a:"*"===t?s=o*a:"/"===t&&(s=o/a),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return I.apply(void 0,[{}].concat(e))},equals:function t(e,i){var n=Object.keys(e);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var o=n[r],a=e[o],s=i[o];if(void 0===s)return!1;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a){if(a!==s)return!1}else if(Array.isArray(a)){if(a.length!==s.length)return!1;for(var l=0;l<a.length;l+=1)if(!t(a[l],s[l]))return!1}else if("function"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,s))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(t[i]!==e[i])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},i=0,n=0;return Object.keys(t).forEach((function(r){i+=e(t[r],r),n+=1})),[i,n]},rangeEach:function(t,e,i){for(var n=t;n<e;n+=1)i(n)},rangeSum:function(t,e,i){for(var n=0,r=t;r<e;r+=1)n+=i(r);return n},rangeReduceIf:function(t,e,i,n,r,o){for(var a=i,s=n,l=t;l<e&&!(a>r);l+=1)a+=s=o(l);return[l,a-s,s]},deleteProperty:function(t,e){var i=t["".concat(e)];return delete t["".concat(e)],i},numberCalc:D},M=function(){function t(e){var i=e.len,n=e.height;l()(this,t),this._={},this.len=i,this.height=n}return a()(t,[{key:"getHeight",value:function(t,e){if(this.isHide(t))return 0;if(e&&e.has(t))return 0;var i=this.get(t);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(t,e){this.getOrNew(t).height=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this.get(t);return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumHeight",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(t,e,(function(t){return n&&n.has(t)?0:i.getHeight(t)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(t){return this._[t]}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:"getCell",value:function(t,e){var i=this.get(t);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[e]?i.cells[e]:null}},{key:"getCellMerge",value:function(t,e){var i=this.getCell(t,e);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(t,e){var i=this.getOrNew(t);return i.cells[e]=i.cells[e]||{},i.cells[e]}},{key:"setCell",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(t);"all"===n?r.cells[e]=i:"text"===n?(r.cells[e]=r.cells[e]||{},r.cells[e].text=i.text):"format"===n&&(r.cells[e]=r.cells[e]||{},r.cells[e].style=i.style,i.merge&&(r.cells[e].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(t,e,i,n){t.text=e,n?t.f=n:delete t.f,i?t.ufv=i:delete t.ufv,t.html&&e.startsWith("<font style=")&&e.endsWith("</font>")&&(t.html=e)}},{key:"setCellText",value:function(t,e,i,n,r){var o=this.getCellOrNew(t,e);this.setCellTextBasicAct(o,i,n,r)}},{key:"setCellTextAndGetRet",value:function(t){var e=this.getCellOrNew(t.ri,t.ci);return this.setCellTextBasicAct(e,t.text,t.ufv,t.f),e.rtxt=t.rtxt,e.html=t.html,delete e.bigfontsize,e}},{key:"updateOneCell",value:function(t){return this.setCellTextAndGetRet(t)}},{key:"copyPaste",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=new Array,u=new Array,f=e.sri>=0?e.sri:0,d=e.sci>=0?e.sci:0,v=e.eri,g=e.eci,p=t.size(),m=r()(p,2),y=m[0],b=m[1],x=e.size(),C=r()(x,2),k=C[0],_=C[1],S=!0,T=0;(v<a||g<s)&&(S=!1,T=v<a?k:_);for(var O=a;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=v;R+=y)for(var A=d;A<=g;A+=b){var I=R+(O-a),P=A+(E-s);if(I!==O||P!==E){var D=this._[O]&&this._[O].cells&&this._[O].cells[E],M=D?F.cloneDeep(this._[O].cells[E]):{};if(I!==O||P!==E){n&&M&&M.text&&M.text.length>0&&function(){var t=M.text,e=A-d+(R-f)+2;if(S||(e-=T+1),"="===t[0])M.text=t.replace(/\w{1,3}\d/g,(function(t){var i=0,n=0;return a===f?i=e-1:n=e-1,/^\d+$/.test(t)?t:w(t,i,n)}));else if(y<=1&&b>1&&(f>l||v<a)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(t);if(null!==i){var n=Number(i[0])+e-1;M.text=t.substring(0,i.index)+n}}}();var j={ri:I,ci:P,text:M.f?M.f:M.text},L={ri:I,ci:P,ncell:M};n&&(M.f||M.ufv)||h.push(j),u.push(L)}}}for(var B=0;B<u.length;B++)this.setCell(u[B].ri,u[B].ci,u[B].ncell,i),o(u[B].ri,u[B].ci,u[B].ncell);return h}},{key:"cutPaste",value:function(t,e){var i=this,n={};this.each((function(r){i.eachCells(r,(function(o){var a=parseInt(r,10),s=parseInt(o,10);t.includes(r,o)&&(a=e.sri+(a-t.sri),s=e.sci+(s-t.sci)),n[a]=n[a]||{cells:{}},n[a].cells[s]=i._[r].cells[o],n[a].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(t,e){var i=this,n=new Array;if(!(t.length<=0)){var r=e.sri,o=e.sci;return t.forEach((function(t,e){var a=r+e;t.forEach((function(t,e){var r=o+e;if(r<=1e3){i.setCellText(a,r,t);var s={ri:a,ci:r,text:t};n.push(s)}}))})),n}}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,o){var a=parseInt(r,10);a>=t&&(a+=i,e.eachCells(r,(function(e,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,i,(function(e,i){return i>=t}))})))}))),n[a]=o})),this._=n,this.len+=i,t>=1&&this.copyrow(t-1,i)}},{key:"copyrow",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[t];if(void 0!==r)for(var o=function(i){var o=e.getOrNew(t+i);o.height=r.height,e.eachCells(t,(function(t,e){o.cells[t]={},n(o.cells[t],e)}))},a=1;a<=i;a++)o(a)}},{key:"copyCellStyle",value:function(t,e){t.style=e.style,e.isautoalign&&(t.isautoalign=e.isautoalign)}},{key:"delete",value:function(t,e){var i=this,n=e-t+1,r={};this.each((function(o,a){var s=parseInt(o,10);s<t?r[s]=a:o>e&&(r[s-n]=a,i.eachCells(o,(function(t,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,-n,(function(t,i){return i>e}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,o){var a={};if(e.eachCells(r,(function(e,n){var r=parseInt(e,10);r>=t&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,i,0,(function(e){return e>=t}))})))),a[r]=n})),t>=1)for(var s=1;s<=i;s++)void 0!==a[t-1]&&(a[t-1+s]={},n(a[t-1+s],a[t-1]));o.cells=a}))}},{key:"deleteColumn",value:function(t,e){var i=this,n=e-t+1;this.each((function(r,o){var a={};i.eachCells(r,(function(i,r){var o=parseInt(i,10);o<t?a[o]=r:o>e&&(a[o-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(t){return w(t,-n,0,(function(t){return t>e}))}))))})),o.cells=a}))}},{key:"deleteCells",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";t.each((function(t,n){e.deleteCell(t,n,i)}))}},{key:"deleteCell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(t);if(null!==n){var r=this.getCell(t,e);null!==r&&("all"===i?delete n.cells[e]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var t=Object.keys(this._),e=t[t.length-1],i=this._[e];if(i){var n=i.cells,r=Object.keys(n),o=r[r.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:"each",value:function(t){Object.entries(this._).forEach((function(e){var i=r()(e,2),n=i[0],o=i[1];t(n,o)}))}},{key:"eachCells",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach((function(t){var i=r()(t,2),n=i[0],o=i[1];e(n,o)}))}},{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),void 0!==t.height&&(this.height=t.height,delete t.height),this._=t}},{key:"setRangeData",value:function(t,e){for(var i=e.sri;i<=e.eri;i++)void 0!==t[i]&&(this._[i]=t[i]),null===t[i]&&delete this._[i]}},{key:"getData",value:function(){var t=this.len,e=this.height;return Object.assign({len:t,height:e},this._)}},{key:"getRangeData",value:function(t){for(var e={},i=t.sri;i<=t.eri;i++)void 0!==this._[i]?e[i]=this._[i]:e[i]=null;return e}},{key:"getDataForRowsSet",value:function(t){var e=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,t.forEach((function(t){void 0!==e._[t]&&(r[t]=e._[t])})),r}},{key:"getHeightForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e.getHeight(t))})),i}}]),t}(),j=function(){function t(e){var i=e.len,n=e.width,r=e.indexWidth,o=e.minWidth;l()(this,t),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=o}return a()(t,[{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:"getData",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:"getDataForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e._[t])})),i}},{key:"getWidth",value:function(t){if(this.isHide(t))return 0;var e=this._[t];return e&&e.width?e.width:this.width}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:"setWidth",value:function(t,e){this.getOrNew(t).width=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this._[t];return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumWidth",value:function(t,e){var i=this;return F.rangeSum(t,e,(function(t){return i.getWidth(t)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),t}();function L(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var z=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",sort:"Sortieren nach",search:"Suche",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokalen",menuInsert:"einfügen",menuComment:"Anmerkungen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Herausgeber",menuFile:"Dokumente"},contextmenu:{copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",pasteValue:"Nur Werte einfügen",pasteFormat:"Nur Format einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Link",removeLink:"Link entfernen",editLink:"bearbeiten Link",openLink:"Link öffnen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zellentext löschen",insertURL:"Bildadresse eingeben",deleteImage:"Bild löschen"},format:{normal:"Regulär",text:"Text",number:"Nummer",percent:"Prozent",rmb:"RMB",usd:"USD",date:"Datum",time:"Termin",datetime:"Datum Termin",duration:"Dauer"},formula:{sum:"Berechnen Sie die Summe einer Reihe von Werten",average:"Berechnen Sie das arithmetische Mittel aller Parameter",max:"Berechnen Sie den Maximalwert in einer Reihe von Zahlen",min:"Berechnen Sie den kleinsten Wert in einer Reihe von Zahlen",concat:"Verbinden Sie Text oder Daten mit mehreren Zeichen in Zellen miteinander",_if:"Entsprechend dem wahren oder falschen Ergebnis der logischen Beurteilung der angegebenen Bedingung wird das durch die entsprechende Bedingung ausgelöste Berechnungsergebnis zurückgegeben",and:'Nur wenn die Ergebnisse der Parameter alle logisch "true" sind, wird logisch "true" zurückgegeben, andernfalls wird logisch "false" zurückgegeben.',or:"Nur wenn alle Parameterwerte logisch „false“ sind, wird das Ergebnis als logisch „false“ zurückgegeben, ansonsten wird es als logisch „true“ zurückgegeben"},dataSort:{ci:"Gebiet",criteria:"Ordnung",casesense:"Groß-/Kleinschreibung",sortby:"Sortiert nach",header:"Meine Daten haben Header",msg:"Bitte wählen Sie verschiedene Spalten für die Sortierung nach Feldern",msg2:"Der Auswahlbereich hat Merge-Bereiche, wir unterstützen keine Sortierung auf Merge-Bereichen",order:{asc:"aufsteigend",desc:"absteigend"}},dataSearch:{label:"Finde was",lkinlb:"Umfang der Suche",matchwhole:"Passen Sie das Ganze",lookin:{values:"Wert",formulas:"Formel",comments:"Kommentar"}},dataComment:{label:"Kommentti"}},nl:{toolbar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam",fontSize:"Lettergrootte",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding invoegen"},menubar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam:",fontSize:"Lettertypegrootte:",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",download_HTML:"Downloaden als HTML",download_PDF:"Download als PDF",download_Original:"Origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan naar Google Drive",download_DROPBOX:"Opslaan naar Dropbox",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",insertSheet:"Blad",insertRow:"Rij",insertColumn:"Kolom",link:"Koppeling",insertComment:"Commentaar",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding",fromURL:"Van URL",fromLocal:"Van lokaal",menuInsert:"Invoegen",menuComment:"Herziening",menuText:"Opmaak",menuFont:"Lettertype",menuEdit:"Home",menuFile:"Bestand"},contextmenu:{copy:"Kopiëren",cut:"Snijden",paste:"Plakken",pasteValue:"Alleen waarden plakken",pasteFormat:"Alleen formaat plakken",hide:"Verbergen",insertRow:"Rij invoegen",insertColumn:"Kolom invoegen",deleteSheet:"Verwijderen",deleteRow:"Rij verwijderen",deleteColumn:"Kolom verwijderen",deleteCell:"Cel verwijderen",deleteCellText:"Celtekst verwijderen",validation:"Gegevensvalidaties",sort:"Sorteren",link:"Koppeling",removeLink:"Koppeling verwijderen",editLink:"Koppeling bewerken",openLink:"Koppeling openen",download:"Download",cellprintable:"Exporteren inschakelen",cellnonprintable:"Exporteren uitschakelen",celleditable:"Bewerken inschakelen",cellnoneditable:"Bewerken uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"Afbeelding verwijderen",copyImage:"Afbeelding kopiëren",pasteImage:"Afbeelding plakken",merge:"Samenvoegen",unmerge:"Ontsamenvoegen",edit:"Bewerken",clear:"Clear"},link:{emailAddress:"E-mailadres",emailSubject:"Onderwerp",sheetPage:"Documentplaats",sheetCell:"Celverwijzing",linkTypes:{web:"Webpagina",sheet:"Dit document",email:"E-mailadres"},webUrl:"Adres",linkType:"Link naar"},download:{fileName:"Bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"Origineel",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Papierformaat",orientation:"Pagina-oriëntatie",orientations:['Landschap", "Portret']},format:{normal:"Normaal",text:"Gewone tekst",number:"Aantal",percent:"Percentage",rmb:"RMB",usd:"USD",eur:"EUR",date:"Datum",time:"Tijd",datetime:"Datum tijd",duration:"Duur"},formula:{sum:"Bereken de som van een reeks waarden",average:"Bereken het rekenkundig gemiddelde van alle parameters",max:"Bereken de maximale waarde in een reeks getallen",min:"Bereken de kleinste waarde in een reeks getallen",_if:"Volgens het ware of valse resultaat van de logische beoordeling van de gespecificeerde voorwaarde, wordt het berekeningsresultaat veroorzaakt door de overeenkomstige voorwaarde geretourneerd",and:'Alleen wanneer de resultaten van de parameters logisch "true" zijn, geeft het logisch "true" terug, anders geeft het logisch "false" terug.',or:'Alleen wanneer alle parameterwaarden logisch "false" zijn, wordt het resultaat als logisch "false" geretourneerd, anders wordt het als logisch "true" geretourneerd.',concat:"Meerdere tekentekst of gegevens in cellen met elkaar verbinden"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregel",between:"Het is tussen {} en {}",notBetween:"Het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"minder dan {}",lessThanEqual:"minder dan of gelijk aan {}",greaterThan:"Het is groter dan {}",greaterThanEqual:"het groter dan of gelijk aan {}",downloadImageFail:"download afbeelding mislukt"},error:{pasteForMergedCell:"Kan dit niet doen voor samengevoegde cellen"},calendar:{weeks:["Zon","Mo","Tue","Wed","Thu","Fr","Sat"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},button:{add:"Toevoegen",del:"Verwijderen",next:"Volgende",cancel:"Annuleren",remove:"Verwijderen",save:"Opslaan",ok:"OK",previous:"Vorige",close:"Sluiten"},sort:{desc:"Sorteren Z -> A",asc:"Sorteren A -> Z"},filter:{empty:"leeg"},dataValidation:{mode:"Mode",range:"Celbereik",criteria:"Criteria",modeType:{cell:"Cel",column:"Kolom",row:"Rij"},type:{list:"Lijst",number:"Aantal",date:"Datum",phone:"Telefoon",email:"E-mail"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"kleiner dan of gelijk aan",gt:"groter dan",gte:"groter dan of gelijk aan",eq:"gelijk aan",neq:"niet gelijk aan"}},dataSort:{ci:"Bereik",criteria:"Orde",casesense:"Hoofdlettergevoelig",sortby:"Sorteren op",header:"Mijn gegevens hebben koppen",msg:"Selecteer verschillende kolommen om op velden te sorteren",msg2:"Het geselecteerde bereik heeft samenvoegen gebieden, we ondersteunen niet sorteren op samenvoegen gebieden",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Zoek wat",lkinlb:"Kijk binnen",matchwhole:"Volledige inhoud overeenkomen",lookin:{values:"Waarden",formulas:"Formules",comments:"Opmerkingen"}},dataComment:{label:"Commentaar"}},zh:{toolbar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",download:"下载",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片"},menubar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",sort:"排序",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"原格式下载",download_XLSX:"下载为XLSX",download_GOOGLE:"保存到谷歌drive",download_DROPBOX:"保存到Dropbox",search:"搜索",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"插入",menuComment:"批注",menuText:"格式化",menuFont:"字体",menuEdit:"编辑",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"粘贴数据",pasteFormat:"粘贴格式",hide:"隐藏",download:"下载",insertRow:"插入行",insertColumn:"插入列",link:"链接",removeLink:"删除链接",editLink:"编辑链接",openLink:"打开链接",deleteSheet:"删除",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除",deleteCellText:"删除数据",validation:"数据验证",cellprintable:"可打印",cellnonprintable:"不可打印",celleditable:"可编辑",cellnoneditable:"不可编辑",insertURL:"输入图片地址",deleteImage:"删除图片"},download:{fileName:"文件名称",saveType:"文件另存为",saveTypes:{Original:"原格式",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},link:{emailAddress:"电子邮箱地址",emailSubject:"主题",sheetPage:"文档位置",sheetCell:"单元格引用",linkTypes:{web:"网页",sheet:"文档",email:"电子邮箱"},webUrl:"地址",linkType:"链接到"},print:{size:"纸张大小",orientation:"方向",orientations:["横向","纵向"]},format:{normal:"正常",text:"文本",number:"数值",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"短日期",time:"时间",datetime:"长日期",duration:"持续时间"},formula:{sum:"计算出一组数值的和",average:"计算出所有参数的算术平均值",max:"计算出一组数中的最大值",min:"计算出一组数中的最小值",concat:"将多个字符文本或单元格中的数据连接在一起",_if:"根据对指定条件的逻辑判断的真假结果,返回相对应条件触发的计算结果",and:"仅当有参数的结果均为逻辑 “真(TRUE)” 时返回逻辑 “真(TRUE)”,反之返回逻辑 “假(FALSE)",or:"仅当所有参数值均为逻辑 “假(FALSE)” 时返回结果逻辑 “假(FALSE)”,否则都返回逻辑 “真(TRUE)"},validation:{required:"此值必填",notMatch:"此值不匹配验证规则",between:"此值应在 {} 和 {} 之间",notBetween:"此值不应在 {} 和 {} 之间",notIn:"此值不在列表中",equal:"此值应该等于 {}",notEqual:"此值不应该等于 {}",lessThan:"此值应该小于 {}",lessThanEqual:"此值应该小于等于 {}",greaterThan:"此值应该大于 {}",greaterThanEqual:"此值应该大于等于 {}",downloadImageFail:"下载图片失败"},error:{pasteForMergedCell:"无法对合并的单元格执行此操作"},calendar:{weeks:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},button:{next:"下一步",cancel:"取消",remove:"删除",save:"保存",ok:"确认",previous:"上一步",close:"关闭"},sort:{desc:"降序",asc:"升序"},filter:{empty:"空白"},dataValidation:{mode:"模式",range:"单元区间",criteria:"条件",modeType:{cell:"单元格",column:"列模式",row:"行模式"},type:{list:"列表",number:"数字",date:"日期",phone:"手机号",email:"电子邮件"},operator:{be:"在区间",nbe:"不在区间",lt:"小于",lte:"小于等于",gt:"大于",gte:"大于等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"区域",criteria:"顺序",casesense:"区分大小写",sortby:"排序按照",header:"我的数据有标题",msg:"请选择不同的列作为排序参照",msg2:"当前选择的区域有合并区域,不支持对合并区域进行排序",order:{asc:"升序",desc:"降序"}},dataSearch:{label:"关键词",lkinlb:"查找范围",matchwhole:"匹配整个",lookin:{values:"值",formulas:"公式",comments:"注释"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"название шрифта",fontSize:"размер шрифта",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"Вставить изображение"},menubar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"имя шрифта:",fontSize:"размер шрифта:",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",download_HTML:"Загрузка в HTML",download_PDF:"Загрузка в PDF",download_Original:"Загрузить оригинал",download_XLSX:"загрузка XLISX",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",insertSheet:"простыня",insertRow:"строка",insertColumn:"столбец",link:"ссылка",insertComment:"рассуждение",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"образ",fromURL:"URL",fromLocal:"из",menuInsert:"Вставить",menuComment:"оглядываться",menuText:"Общие положения",menuFont:"шрифт",menuEdit:"жилище",menuFile:"Документация"},contextmenu:{copy:"копировать",cut:"резать",paste:"Вставить",pasteValue:"только вставить значение",pasteFormat:"только вставить формат",hide:"Скрыть",insertRow:"Вставить строки",insertColumn:"Вставить столбцы",deleteSheet:"Исключить",deleteRow:"Удалить строки",deleteColumn:"Удалить столбец",deleteCell:"Удалить ячейку",deleteCellText:"Удалить текст ячейки",validation:"проверка данных",sort:"классификация",link:"ссылка",removeLink:"Удалить ссылку",editLink:"Изменить ссылку",openLink:"Открыть ссылку",download:"загрузка",cellprintable:"Включить экспорт",cellnonprintable:"Отключить экспорт",celleditable:"Включить редактор",cellnoneditable:"Отключить правку",insertURL:"Введите адрес изображения",deleteImage:"Удалить изображение",copyImage:"Копировать изображение",pasteImage:"Вставить изображение",merge:"объединить",unmerge:"отменить объединение",edit:"редактор",clear:"Очистить"},link:{emailAddress:"адрес электронной почты",emailSubject:"тема",sheetPage:"расположение документа",sheetCell:"ссылка на ячейку",linkTypes:{web:"страница",sheet:"Настоящий документ",email:"адрес электронной почты"},webUrl:"адрес",linkType:"ссылка на"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"начальный",XLSX:"XLISX",PDF:"формат PDF",HTML:"HTML"}},print:{size:"размер бумаги",orientation:"направление страницы",orientations:["продольный, поперечный"]},format:{normal:"типичный",text:"чистый текст",number:"цифра",percent:"процент",rmb:"юань",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата",duration:"период"},formula:{sum:"вычислить сумму значений группы",average:"вычислить среднее арифметическое по всем параметрам",max:"вычислить максимальное значение в группе чисел",min:"вычислить минимальное значение в группе чисел",_if:"возвращает результат вычисления, срабатывающий при выполнении соответствующих условий",and:'возвращает логическое "true" только в том случае, если результат логически "true", иначе возвращается логическое "false"',or:'только когда все значения параметра логически равны "false", результат возвращается к логическому "false", иначе возвращается к логическому "true"',concat:"соединять текст или данные в ячейке"},validation:{required:"Это должно быть необходимо",notMatch:"не совпадает с правилами проверки",between:"между {и {и}",notBetween:"не между {и {и}",notIn:"Его нет в списке",equal:"равно {равно}",notEqual:"не равно {равно}",lessThan:"меньше чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"Это больше",greaterThanEqual:"больше или равно {}",downloadImageFail:"Ошибка загрузки образа"},error:{pasteForMergedCell:"Не удаётся выполнить эту операцию в сводной ячейке"},calendar:{weeks:["Воскресенье","понедельник","вторник","среда","четверг","Пятница","суббота"],months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},button:{add:"Добавить",del:"Исключить",next:"След.",cancel:"отмена",remove:"удаление",save:"спасти",ok:"OK",previous:"предыдущий",close:"Гуань"},sort:{desc:"сортировка Z - > A",asc:"сортировка A - > Z"},filter:{empty:"пустой"},dataValidation:{mode:"режим",range:"диапазон ячеек",criteria:"стандарт",modeType:{cell:"одиночная камера",column:"столбец",row:"строка"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше",lte:"меньше или равно",gt:"больше чем",gte:"больше или равно",eq:"равно",neq:"не равно"}},dataSort:{ci:"Сфера применения",criteria:"порядок",casesense:"различать размер",sortby:"сортировка",header:"мои данные имеют заголовки",msg:'Выберите другую колонку для поля "база сортировки"',msg2:"Выберите диапазон, в котором будут объединены области, которые мы не поддерживаем.",order:{asc:"ASC Corporation",desc:"описание"}},dataSearch:{label:"искать что",lkinlb:"посетить",matchwhole:"согласовать всё содержимое",lookin:{values:"ценность",formulas:"формула",comments:"Замечания"}},dataComment:{label:"рассуждение"}},es:{toolbar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la fuente",fontSize:"Tamaño de la fuente",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la Fuente:",fontSize:"Tamaño de la Fuente:",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar el original",download_XLSX:"Descargar como xlsx",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en Dropbox",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",insertSheet:"Sábanas",insertRow:"Una línea",insertColumn:"Columna",link:"Enlace",insertComment:"Comentario",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Imagen",fromURL:"De URL",fromLocal:"Local",menuInsert:"Insertar",menuComment:"Examen",menuText:"Disposiciones generales",menuFont:"Tipo de letra",menuEdit:"Hogar",menuFile:"Documentación"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Pegar",pasteValue:"Pegar sólo valores",pasteFormat:"Pegar sólo formato",hide:"Ocultar",insertRow:"Insertar fila",insertColumn:"Insertar columna",deleteSheet:"Tachar",deleteRow:"Eliminar fila",deleteColumn:"Eliminar columnas",deleteCell:"Eliminar celdas",deleteCellText:"Borrar texto de celda",validation:"Validación de datos",sort:"Clasificación",link:"Enlace",removeLink:"Eliminar enlace",editLink:"Editar enlace",openLink:"Abrir enlace",download:"Descargar",cellprintable:"Activar exportación",cellnonprintable:"Desactivar exportación",celleditable:"Habilitar edición",cellnoneditable:"Desactivar edición",insertURL:"Introduzca la dirección de la imagen",deleteImage:"Borrar imagen",copyImage:"Copiar imagen",pasteImage:"Pegar imagen",merge:"Fusión",unmerge:"Cancelar fusión",edit:"Editar",clear:"Claro"},link:{emailAddress:"Dirección de correo electrónico",emailSubject:"Tema",sheetPage:"Ubicación del documento",sheetCell:"Referencia de celda",linkTypes:{web:"Página web",sheet:"Este documento",email:"Dirección de correo electrónico"},webUrl:"Dirección",linkType:"Enlace a"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"Original",XLSX:"Xlsx",PDF:"PDF",HTML:"Html"}},print:{size:"Tamaño del papel",orientation:"Orientación de la página",orientations:['Transversal "," longitudinal']},format:{normal:"Típico",text:"Texto plano",number:"Número",percent:"Porcentaje",rmb:"RMB Yuan",usd:"Dólar estadounidense",eur:"Euro",date:"Fecha",time:"Tiempo",datetime:"Fecha y hora",duration:"Período"},formula:{sum:"Calcular la suma de un conjunto de valores",average:"Calcular la media aritmética de todos los parámetros",max:"Calcular el valor máximo de un conjunto de números",min:"Calcular el valor mínimo de un conjunto de números",_if:"Devuelve el resultado del cálculo desencadenado por la condición correspondiente de acuerdo con el juicio lógico de la condición especificada.",and:'Devuelve la lógica "true" sólo cuando el resultado de todos los parámetros es "true" lógico, de lo contrario devuelve la lógica "False".',or:'El resultado sólo se devuelve como "falso" lógico cuando todos los valores de los parámetros son lógicamente "falso", de lo contrario se devuelve como "verdadero" lógico.',concat:"Unir texto o datos de múltiples caracteres en una celda"},validation:{required:"Debe ser necesario",notMatch:"No coincide con las reglas de validación",between:"Está entre {} y {}",notBetween:"No está entre {} y {}",notIn:"No está en la lista",equal:"Igual a {}",notEqual:"No es igual a {}",lessThan:"Menos de {}",lessThanEqual:"Es menor o igual a {}",greaterThan:"Es mayor que {}",greaterThanEqual:"Es mayor o igual a {}",downloadImageFail:"Falló la descarga de la imagen"},error:{pasteForMergedCell:"No se puede hacer esto en celdas fusionadas"},calendar:{weeks:["Domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},button:{add:"Añadir",del:"Tachar",next:"Siguiente",cancel:"Cancelar",remove:"Eliminación",save:"Salvación",ok:"Muy bien.",previous:"Anterior",close:"Cerrar"},sort:{desc:"Ordenar z - > a",asc:"Ordenar a - > Z"},filter:{empty:"Vacío"},dataValidation:{mode:"Patrón",range:"Rango de celdas",criteria:"Normas",modeType:{cell:"Celda individual",column:"Columna",row:"Una línea"},type:{list:"Lista",number:"Número",date:"Fecha",phone:"Teléfono",email:"Correo electrónico"},operator:{be:"Entre",nbe:"No entre los dos",lt:"Menos",lte:"Inferior o igual a",gt:"Mayor que",gte:"Mayor o igual a",eq:"Igual a",neq:"No es igual a"}},dataSort:{ci:"Ámbito de aplicación",criteria:"Orden",casesense:"Sensible a mayúsculas",sortby:"Ordenar por",header:"Mis datos tienen un título",msg:"Seleccione una column a diferente para el campo ordenar por",msg2:"Los rangos de selección tienen regiones fusionadas, no soportamos ordenar en regiones fusionadas",order:{asc:"ASC",desc:"Descripción"}},dataSearch:{label:"Encontrar qué",lkinlb:"Visita",matchwhole:"Coincide con todo el contenido",lookin:{values:"Valores",formulas:"Fórmula",comments:"Comentario"}},dataComment:{label:"Comentario"}},pt:{toolbar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do Tipo de Letra",fontSize:"Tamanho do tipo de letra",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Inserir imagem"},menubar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do tipo de letra:",fontSize:"Tamanho do tipo de letra:",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",download_HTML:"Transferir Como HTML",download_PDF:"Transferir Como PDF",download_Original:"Obter Original",download_XLSX:"Obter Como XLSX",download_GOOGLE:"Gravar para Google Drive",download_DROPBOX:"Gravar para Dropbox",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",insertSheet:"Folha",insertRow:"Linha",insertColumn:"Coluna",link:"Ligação",insertComment:"Comentário",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Imagem",fromURL:"Do URL",fromLocal:"Do Local",menuInsert:"Inserir",menuComment:"Revisão",menuText:"Formato",menuFont:"Tipo de Letra",menuEdit:"Casa",menuFile:"Ficheiro"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Colar",pasteValue:"Colar apenas valores",pasteFormat:"Colar apenas o formato",hide:"Esconder",insertRow:"Inserir linha",insertColumn:"Inserir coluna",deleteSheet:"Apagar",deleteRow:"Apagar a linha",deleteColumn:"Apagar a coluna",deleteCell:"Apagar a célula",deleteCellText:"Apagar o texto da célula",validation:"Validações dos dados",sort:"Ordenar",link:"Ligação",removeLink:"Remover a Ligação",editLink:"Editar a Ligação",openLink:"Abrir Ligação",download:"Transferir",cellprintable:"Activar a exportação",cellnonprintable:"Desactivar a exportação",celleditable:"Activar a edição",cellnoneditable:"Desactivar a edição",insertURL:"Indique o endereço da imagem",deleteImage:"Apagar a imagem",copyImage:"Copiar a imagem",pasteImage:"Colar a imagem",merge:"Juntar",unmerge:"Desmesclar",edit:"Editar",clear:"Limpar"},link:{emailAddress:"Endereço de E- mail",emailSubject:"Assunto",sheetPage:"Local do Documento",sheetCell:"Referência da Célula",linkTypes:{web:"Página Web",sheet:"Este Documento",email:"Endereço de E- mail"},webUrl:"Endereço",linkType:"Ligar para"},download:{fileName:"Nome do Ficheiro",saveType:"Gravar Como",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Tamanho do papel",orientation:"Orientação da página",orientations:['Paisagem", "Retrato']},format:{normal:"Normal",text:"Texto Simples",number:"Número",percent:"Percentagem",rmb:"RMB",usd:"USD",eur:"EUR",date:"Data",time:"Tempo",datetime:"Data e hora",duration:"Duração"},formula:{sum:"Calcular a soma de um conjunto de valores",average:"Calcular a média aritmética de todos os parâmetros",max:"Calcular o valor máximo em um conjunto de números",min:"Calcular o menor valor em um conjunto de números",_if:"De acordo com o resultado verdadeiro ou falso do julgamento lógico da condição especificada, o resultado do cálculo desencadeado pela condição correspondente é retornado",and:'Somente quando os resultados dos parâmetros são todos lógicos "true", retorna lógico "true", caso contrário retorna lógico "false"',or:'Somente quando todos os valores dos parâmetros são logicamente "false", o resultado é retornado como lógico "false", caso contrário é retornado como lógico "true"',concat:"Conecte texto de vários caracteres ou dados em células juntos"},validation:{required:"deve ser exigido",notMatch:"não corresponde à sua regra de validação",between:"é entre {} e {}",notBetween:"não é entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"menos que {}",lessThanEqual:"menor ou igual a {}",greaterThan:"maior que {}",greaterThanEqual:"maior ou igual a {}",downloadImageFail:"falha na transferência da imagem"},error:{pasteForMergedCell:"Não é possível fazer isto para células fundidas"},calendar:{weeks:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},button:{add:"Adicionar",del:"Apagar",next:"Próximo",cancel:"Cancelar",remove:"Remover",save:"Gravar",ok:"OK",previous:"Anterior",close:"Fechar"},sort:{desc:"Ordenar Z -> A",asc:"Ordenar A -> Z"},filter:{empty:"vazio"},dataValidation:{mode:"Modo",range:"Intervalo de Células",criteria:"Critérios",modeType:{cell:"Célula",column:"Coluna",row:"Linha"},type:{list:"Lista",number:"Número",date:"Data",phone:"Telefone",email:"E- mail"},operator:{be:"entre",nbe:"não entre",lt:"menos de",lte:"inferior ou igual a",gt:"maior que",gte:"maior ou igual a",eq:"igual a",neq:"não igual a"}},dataSort:{ci:"Intervalo",criteria:"Ordem",casesense:"Sensível à maiúscula",sortby:"Ordenar por",header:"Os meus dados têm cabeçalhos",msg:"Seleccione por favor colunas diferentes para ordenar por campos",msg2:"O intervalo de seleção tem áreas de mesclagem, não suportamos classificação em áreas de mesclagem",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Encontrar o quê",lkinlb:"Olhe para dentro",matchwhole:"Corresponder ao conteúdo inteiro",lookin:{values:"Valores",formulas:"Fórmulas",comments:"Observações"}},dataComment:{label:"Comentário"}}};function N(t,e){if(e){var i,n=L(z);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!e[r])break;for(var o=e[r],a=t.match(/(?:\\.|[^.])+/g),s=0;s<a.length;s+=1){var l=o[a[s]];if(!l)break;if(s===a.length-1)return l;o=l}}}catch(t){n.e(t)}finally{n.f()}}}function W(t){var e=N(t,H);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=N(t,window.x_spreadsheet.$messages)),e||""}function U(t){return function(){return W(t)}}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?z=[t]:z.unshift(t),e&&(H[t]=e)}function Y(t){H[t]||(t="en"),z[0]=t}var V={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function G(t,e){var i="";if(!t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i=W.apply(void 0,["validation.".concat(e)].concat(r))}return[t,i]}var q=function(){function t(e,i,n,r){l()(this,t),this.required=i,this.value=n,this.type=e,this.operator=r,this.message=""}return a()(t,[{key:"parseValue",value:function(t){var e=this.type;return"date"===e?new Date(t):"number"===e?Number(t):t}},{key:"equals",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?F.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(t){var e=this.required,i=this.operator,n=this.value,o=this.type;if(e&&/^\s*$/.test(t))return G(!1,"required");if(/^\s*$/.test(t))return[!0];if(V[o]&&!V[o].test(t))return G(!1,"notMatch");if("list"===o)return G(this.values().includes(t),"notIn");if(i){var a=this.parseValue(t);if("be"===i){var s=r()(n,2),l=s[0],c=s[1];return G(a>=this.parseValue(l)&&a<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=r()(n,2),u=h[0],f=h[1];return G(a<this.parseValue(u)||a>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return G(a===this.parseValue(n),"equal",n);if("neq"===i)return G(a!==this.parseValue(n),"notEqual",n);if("lt"===i)return G(a<this.parseValue(n),"lessThan",n);if("lte"===i)return G(a<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return G(a>this.parseValue(n),"greaterThan",n);if("gte"===i)return G(a>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),t}(),K=function(){function t(e,i,n){l()(this,t),this.refs=i,this.mode=e,this.validator=n}return a()(t,[{key:"includes",value:function(t,e){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(t,e))return!0}return!1}},{key:"addRef",value:function(t){this.remove(x.valueOf(t)),this.refs.push(t)}},{key:"remove",value:function(t){var e=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(t)?n.difference(t).forEach((function(t){return e.push(t.toString())})):e.push(i)})),this.refs=e}},{key:"getData",value:function(){var t=this.refs,e=this.mode,i=this.validator;return{refs:t,mode:e,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(e){var i=e.refs,n=e.mode,r=e.type,o=e.required,a=e.operator,s=e.value;return new t(n,i,new q(r,o,s,a))}}]),t}(),Z=function(){function t(){l()(this,t),this._=[],this.errors=new Map}return a()(t,[{key:"getError",value:function(t,e){return this.errors.get("".concat(t,"_").concat(e))}},{key:"validate",value:function(t,e,i){var n=this.get(t,e),o="".concat(t,"_").concat(e),a=this.errors;if(null!==n){var s=n.validator.validate(i),l=r()(s,2),c=l[0],h=l[1];c?a.delete(o):a.set(o,h)}else a.delete(o);return!0}},{key:"add",value:function(t,e,i){var n=i.type,r=i.required,o=i.value,a=i.operator,s=new q(n,r,o,a),l=this.getByValidator(s);null!==l?l.addRef(e):this._.push(new K(t,[e],s))}},{key:"getByValidator",value:function(t){for(var e=0;e<this._.length;e+=1){var i=this._[e];if(i.validator.equals(t))return i}return null}},{key:"get",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"remove",value:function(t){var e="".concat(t.sri,"_").concat(t.sci);this.errors.has(e)&&this.errors.delete(e),this.each((function(e){e.remove(t)}))}},{key:"each",value:function(t){this._.forEach((function(e){return t(e)}))}},{key:"getData",value:function(){return this._.filter((function(t){return t.refs.length>0})).map((function(t){return t.getData()}))}},{key:"setData",value:function(t){this._=t.map((function(t){return K.valueOf(t)}))}}]),t}(),J=function t(){l()(this,t),this.keywords="",this.current=1,this.result=[]},Q=i(3),tt=i.n(Q),et=i(4),it=i.n(et),nt=i(1),rt=i.n(nt),ot="x-spreadsheet";window.devicePixelRatio;function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var st=function(t){tt()(i,t);var e=at(i);function i(t){var n;return l()(this,i),(n=e.call(this,"div","".concat(ot,"-icon"))).iconNameEl=f("div","".concat(ot,"-icon-img ").concat(t)),n.child(n.iconNameEl),n}return a()(i,[{key:"setName",value:function(t){this.iconNameEl.className("".concat(ot,"-icon-img ").concat(t))}}]),i}(u);function lt(t,e,i){var n=f("div","".concat(ot,"-toast")),r=f("div","".concat(ot,"-dimmer active"));n.children(f("div","".concat(ot,"-toast-header")).children(new st("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),t),f("div","".concat(ot,"-toast-content")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var o=n.box(),a=o.width,s=o.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-a)/2,top:(c-s)/3})}var ct={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function ht(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,o=e.clone(),a=t.size(),s=r()(a,2),l=s[0],c=s[1],h=e.size(),u=r()(h,2),f=u[0],d=u[1];return l>f&&(o.eri=e.sri+l-1),c>d&&(o.eci=e.sci+c-1),this.getRangeLocked(o)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(o)?(i(W("error.pasteForMergedCell")),!1):t.equals(o)?(i("The selection area is same "),!1):!t.intersects(o)||!(f>l&&Math.abs(e.sri-t.sri)%l!=0||d>c&&Math.abs(e.sci-t.sci)%c!=0)||(i("Invalid selection area"),!1)}function ut(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.rows,a=this.merges,s=this.name,l=o.copyPaste(t,e,i,n,(function(t,e,i){if(i&&i.merge){var n=r()(i.merge,2),o=n[0],s=n[1];if(o<=0&&s<=0)return;a.add(new x(t,e,t+o,e+s))}}));n?this.updateBatchCellsOpr(s,l,t,e,i):this.copyPasteRangeOpr(s,t,e,i)}function ft(t,e){var i=this.clipboard,n=this.rows,r=this.merges,o=this.name;n.cutPaste(t,e),r.move(t,e.sri-t.sri,e.sci-t.sci),i.clear(),this.cutPasteRangeOpr(o,t,e)}function dt(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),o=F.merge(o,{border:i}),r.style=this.addStyle(o)}function vt(t){var e=this,i=t.mode,n=t.style,o=t.color,a=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,v=!this.isSignleSelected();if(v||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||v){if("none"===i)s.range.each((function(t,i){var n=l.getCell(t,i);if(n&&void 0!==n.style){var r=F.cloneDeep(a[n.style]);delete r.border,n.style=e.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var t=[],a=h;a<=f;a+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<t.length;g+=1){var p=r()(t[g],4),m=p[0],y=p[1],b=p[2],w=p[3];if(a===m+b+1&&c.push(g),m<=a&&a<=m+b&&s===y){s+=w+1;break}}if(c.forEach((function(e){return t.splice(e,1)})),s>d)break;var x=l.getCell(a,s),C=0,k=0;if(x&&x.merge){var _=r()(x.merge,2);C=_[0],k=_[1],t.push([a,s,C,k])}var S=C>0&&a+C===f,T=k>0&&s+k===d,O={};"all"===i?O={bottom:[n,o],top:[n,o],left:[n,o],right:[n,o]}:"inside"===i?(!T&&s<d&&(O.right=[n,o]),!S&&a<f&&(O.bottom=[n,o])):"horizontal"===i?!S&&a<f&&(O.bottom=[n,o]):"vertical"===i?!T&&s<d&&(O.right=[n,o]):"outside"===i&&v&&(h===a&&(O.top=[n,o]),(S||f===a)&&(O.bottom=[n,o]),u===s&&(O.left=[n,o]),(T||d===s)&&(O.right=[n,o])),Object.keys(O).length>0&&dt.call(e,a,s,O),s+=k}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(dt.call(this,h,g,{top:[n,o]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(dt.call(this,f,g,{bottom:[n,o]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var p=h;p<=f;p+=1)"left"===i&&(dt.call(this,p,u,{left:[n,o]}),p+=l.getCellMerge(p,u)[0]),"right"===i&&(dt.call(this,p,d,{right:[n,o]}),p+=l.getCellMerge(p,d)[0])}else dt.call(this,h,u,{top:[n,o],bottom:[n,o],left:[n,o],right:[n,o]})}function gt(t,e){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),o=this.settings.row.height,a=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=o+r,l=t>s?n.riact:0;0===l&&(s=o);for(var c=0;l<i.len&&!(s>t);l+=1)a.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function pt(t,e){var i=this.cols,n=this.displayRight2Left,o=this.freezeTotalWidth(),a=i.indexWidth;if(n){var s=this.viewWidth();o+i.indexWidth<s-t&&(a-=e);var l=F.rangeReduceIf(0,i.len,a,i.indexWidth,s-t,(function(t){return i.getWidth(t)})),c=r()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}o+i.indexWidth<t&&(a-=e);var d=F.rangeReduceIf(0,i.len,a,i.indexWidth,t,(function(t){return i.getWidth(t)})),v=r()(d,3),g=v[0],p=v[1],m=v[2];return p<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:p,width:m}}var mt=function(){function t(e,i){l()(this,t),this.settings=F.merge(ct,i||{}),this.name=e||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new M(this.settings.row),this.cols=new j(this.settings.col),this.validations=new Z,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new k,this.scroll=new _,this.history=new S,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return a()(t,[{key:"addValidation",value:function(t,e,i){var n=this;this.changeData((function(){n.validations.add(t,e,i)}))}},{key:"removeValidation",value:function(){var t=this,e=this.selector.range;this.changeData((function(){t.validations.remove(e)}))}},{key:"getHighlightCellTxt",value:function(t,e){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===t&&r.col===e&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=this.validations.get(e,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=t.range,r=this.validations.get(e,i),o={ref:n.toString()};return null!==r&&(o.mode=r.mode,o.validator=r.validator),o}},{key:"getSelectedSort",value:function(){var t=this.selector,e=t.ci,i=t.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var o=[],a=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=a&&u.eri<=s&&u.sci>=l&&u.eci<=c)return lt("error","".concat(W("dataSort.msg2"))),null}for(var f=a+1;f<=s;f+=1){var d=this.getCell(f,e);null===d||/^\s*$/.test(d.text)||o.push(d.text)}n.m=o;for(var v=new Map,g=new Map,m=0,y=l;y<=c;y++,m++){var b=this.getCell(a,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+p(y)+")":b.text,v.set(m,w),g.set(m,"(Column "+p(y)+")")}return n.mcols=v,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var t=this;this.history.undo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"redo",value:function(){var t=this;this.history.redo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!ht.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ut.call(t,n.range,i,e):n.isCut()&&ft.call(t,n.range,i)})),!0))}},{key:"pasteFromText",value:function(t){var e=this,i=this.name,n=t.split("\r\n").map((function(t){return t.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,o=this.selector;this.changeData((function(){var t=r.paste(n,o.range);e.updateBatchCellsOpr(i,t)}))}}},{key:"autofill",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==t.sci&&(t.sci=0),-1==t.sri&&(t.sri=0),!!ht.call(this,r,t,n)&&(this.changeData((function(){ut.call(i,r,t,e,!0)}),!0,t),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges,a=i.range,s=a.sri,l=a.sci,c=a.eri,h=a.eci,u=i.ri,f=i.ci,d=t,v=e;return t<0&&(d=n.len-1),e<0&&(v=r.len-1),d>u?(s=u,c=d):(s=d,c=u),v>f?(l=f,h=v):(l=v,h=f),i.range=o.union(new x(s,l,c,h)),i.range=o.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new x(t,e,t,e),-1===t&&(o.sri=0,o.eri=n.len-1),-1===e&&(o.sci=0,o.eci=r.len-1)),i.range=o,o}},{key:"setSelectedCellAttr",value:function(t,e){var i=this;this.changeData((function(){var n=i.selector,o=i.styles,a=i.rows,s=i.name;if("merge"===t)e?i.merge():i.unmerge();else if("border"===t)vt.call(i,e);else if("formula"===t){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=r()(u,2),d=f[0],v=f[1],g=h.sri,p=h.sci,m=h.eri,y=h.eci;if(d>1)for(var w=p;w<=y;w+=1){a.getCellOrNew(m+1,w).text="=".concat(e,"(").concat(b(w,g),":").concat(b(w,m),")")}else if(v>1){a.getCellOrNew(l,y+1).text="=".concat(e,"(").concat(b(p,l),":").concat(b(y,l),")")}}else{a.getCellOrNew(l,c).text="=".concat(e,"()")}}else n.range.each((function(n,r){var l=a.getCellOrNew(n,r),c={};if(void 0!==l.style&&(c=F.cloneDeep(o[l.style])),"format"===t)c.format=e,"normal"===e?(delete c.number,delete c.custom):"text"===e?(c.number=49,delete c.custom):"number"===e?(c.custom="#,##0.00_",delete c.number):"percent"===e?(c.number=10,delete c.custom):"rmb"===e?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===e?(c.custom="$#,##0.00",delete c.number):"eur"===e?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===e?(c.custom="mm/dd/yyyy",delete c.number):"time"===e?(c.number=21,delete c.custom):"datetime"===e?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===e&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,r,c);else if("font-bold"===t||"font-italic"===t||"font-name"===t||"font-size"===t){var h={};h[t.split("-")[1]]=e,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===t||"textwrap"===t||"underline"===t||"align"===t||"valign"===t||"color"===t||"bgcolor"===t||"pbgcolor"===t||"pattern"===t?(c[t]=e,l.style=i.addStyle(c),"align"===t&&delete l.isautoalign):l[t]=e}))}))}},{key:"setHyperlinkStyle",value:function(t,e,i){var n=this.rows,r=this.styles,o=n.getCellOrNew(t,e),a={};void 0!==o.style&&(a=F.cloneDeep(r[o.style])),a.underline=i,a.color=i?"#0000ff":"Black",o.style=this.addStyle(a)}},{key:"setSelectedCellText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,o=n.ri,a=n.ci,s=o;this.unsortedRowMap.has(o)&&(s=this.unsortedRowMap.get(o));var l=r.getCell(s,a),c=l?l.text:"";if(this.setCellText(s,a,t,e),i.active()){var h=i.getFilter(a);if(h){var u=h.value.findIndex((function(t){return t===c}));u>=0&&h.value.splice(u,1,t)}}}},{key:"getSelectedCell",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=e;return this.unsortedRowMap.has(e)&&(n=this.unsortedRowMap.get(e)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(t,e){if(!this.sprotected)return!0;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(t){for(var e=t.sci;e<=t.eci;e+=1){var i=this.getCell(t.sri,e);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellLocked(e,i)}},{key:"getCellLocked",value:function(t,e){if(!this.sprotected)return!1;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(t){for(var e=t.sri;e<=t.eri;e+=1)for(var i=t.sci;i<=t.eci;i+=1)if(this.getCellLocked(e,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(t,e){var i=this.getSelectedRect(),n=i.left,r=i.top,o=i.width,a=i.height,s=this.settings.row.height,l=t-this.cols.indexWidth,c=e-s;return l>n&&l<n+o&&c>r&&c<r+a}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var t=this.selector.range.clone();if(this.freezeIsActive()){if(t.sri>=this.freeze[0]&&t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri>=this.freeze[0]&&t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}else{if(t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}return this.getRect(t)}},{key:"getClipboardRect",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:"getRect",value:function(t){var e=this.scroll,i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=t.sri,h=t.sci,u=t.eri,f=t.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:e};var d=r()(s,2)[1],v=a?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,o),p=i.sumHeight(c,u+1,o)*l,m=n.sumWidth(h,f+1)*l,y=a?d>0&&f>=d||0===d?v+e.x:v:v-e.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(e.riact,c,o)+b;return w>0&&w>v&&!a&&(y=v),b>0&&b>g&&(x=g),{l:v*l,t:g*l,left:y*l,top:x*l,height:p,width:m,scroll:e}}},{key:"getCellRectByXY",value:function(t,e){var i=this.scroll,n=this.merges,r=this.rows,o=this.cols,a=this.zoomlevel,s=gt.call(this,e,i.y),l=s.ri,c=s.top,h=s.height,u=pt.call(this,t,i.x),f=u.ci,d=u.left,v=u.width;if(-1===f&&(v=o.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var p=this.cellRectWithOutTransfer(l,f);d=p.left,c=p.top,v=p.width,h=p.height}}return{ri:l,ci:f,left:d*a,top:c*a,width:v*a,height:h*a}}},{key:"isSignleSelected",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!1}},{key:"merge",value:function(){var t=this.selector,e=this.rows;if(!this.isSignleSelected()){var i=t.size(),n=r()(i,2),o=n[0],a=n[1];if(o>1||a>1){var s=t.range,l=s.sri,c=s.sci,h=e.getCellOrNew(l,c);h.merge=[o-1,a-1],this.merges.add(t.range),this.rows.deleteCells(t.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var t=this.selector;if(this.isSignleSelected()){var e=t.range,i=e.sri,n=e.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(t.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var t=this,e=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!e.active())for(var r=0,o=n.length;r<o;r++){var a=n[r],s=x.valueOf(a.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void lt("Warning","there is already table autofilter in the selected range")}this.changeData((function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var t=this.autoFilter,e=this.selector;this.changeData((function(){t.filters=[],t.ref=e.range.toString()}))}},{key:"sortByRowIdArray",value:function(t,e){for(var i=this.rows,n=t.sri,r=t.eri,o=t.sci,a=t.eci,s=[],l=0,c=e.length;l<c;l++){for(var h=i._[e[l]].cells,u=[],f=o;f<=a;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,v=n;v<=r;v++)if(e[d++]!==v){for(var g=i._[v].cells,p=o;p<=a;p++)delete g[p];for(var m=s[d-1],y=0,b=m.length;y<b;y++){var w=m[y];g[w.id]=w.v}}}},{key:"doSort",value:function(t,e,i){var n=this.name,r=this.selector.range,o=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:t,order:e,isheader:i,op:"sort"});this.updateCellServer(o)}},{key:"setAutoFilter",value:function(t,e,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(t,i,n),r.setSort(t,e),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var t=this,e=this.currentAutoFilter,i=this.rows,n=e;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,o=n.filteredRows((function(t,e){return i.getCell(t,e)})),a=o.rset,s=o.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(t,e){if("desc"===r.order){var n=t;t=e,e=n}var o=i.getCell(t,r.ci),a=i.getCell(e,r.ci);if(null!=o&&""===o.text&&(o=null),null!=a&&""===a.text&&(a=null),null==o&&null==a)return t-e;if(null==o)return"asc"===r.order?1:-1;if(null==a)return"asc"===r.order?-1:1;o=o.text,a=a.text;var s=isNaN(Number(o)),l=isNaN(Number(a));return s&&l?o.localeCompare(a):s&&!l?1:!s&&l?-1:Number(o)-Number(a)})),this.exceptRowSet=a,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(e,i){t.sortedRowMap.set(c[i],e),t.unsortedRowMap.set(e,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var t=this.exceptRowSet,e=this.rows;t.forEach((function(t){e.get(t)&&(e.get(t).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(t){var e=this.conditionimg,i=(this.rows,this.styles,this);t&&t.forEach((function(t){if(e){var n=e.find((function(e){return e.row===t.row&&e.col===t.col}));n?n.image.src="data:image/png;base64,"+t.data:i.insertConditionImage(t)}}))}},{key:"createConditionImage",value:function(t,e){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+t.data;var r=this.cols.sumWidth(0,t.col),o=this.rows.sumHeight(0,t.row);if(0===t.type){n.style.zIndex=e+1;var a=this.getCellStyle(t.row,t.col);null!=a&&"bottom"===a.valign&&(o+=this.rows.getHeight(t.row)-16)}else n.style.zIndex=e,n.style.opacity=.88;if((this.rows.isHide(t.row)||this.cols.isHide(t.col)||this.exceptRowSet.has(t.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=o+"px",n.style.position="absolute",void 0===t.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);t.ol=l,t.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var t=this.exceptRowSet,e=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){e.isHide(n.row)||i.isHide(n.col)||t.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var t=this.displayRight2Left,e=this.cols,i=this.zoomlevel,n=this.viewWidth()-e.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=t?(n-r.ol-e.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var t=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(e){if(e.ow||(e.ow=e.image.width,e.oh=e.image.height),e.image.style.left=e.ol*t+"px",e.image.style.top=e.ot*t+"px",e.ow){e.image.height;e.image.width=e.ow*t,1===e.type&&(e.image.height=e.oh*t)}}))}},{key:"updateConditionImagePositionForCol",value:function(t,e,i){var n=this.displayRight2Left,r=this.cols,o=this.zoomlevel;if(this.conditionimg){var a=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>t)s.ol+=e,s.image.style.left=n?(a-s.ol-r.getWidth(s.col))*o+"px":s.ol*o+"px";else if(s.col===t){if(1===s.type){var l=s.image.height;s.image.width=i*o,s.ow=i,s.image.height=l}n&&(s.image.style.left=(a-s.ol-r.getWidth(s.col))*o+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(t,e,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>t)r.ot+=e,r.image.style.top=r.ot*n+"px";else if(r.row===t&&1===r.type){var o=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=o}}))}},{key:"updateConditionImageForColInsert",value:function(t,e){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,o=this.zoomlevel;if(i){var a=this.viewWidth()-n.indexWidth,s=n.sumWidth(t,e+1),l=e-t+1;i.forEach((function(e){e.col>=t&&(e.ol+=s,e.image.style.left=r?(a-e.ol-n.getWidth(e.col))*o+"px":e.ol*o+"px",l&&(e.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(t,e){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var o=n.sumHeight(t,e+1),a=e-t+1;i.forEach((function(e){e.row>=t&&(e.ot+=o,e.image.style.top=e.ot*r+"px",a&&(e.row+=a))}))}}},{key:"updateConditionImageForRowDelete",value:function(t,e,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var o=e-t+1,a=n.length-1;a>=0;a--){var s=n[a];s.row>=t&&s.row<=e?(s.image.remove(),n.splice(a,1)):s.row>e&&(s.ot+=i,s.image.style.top=s.ot*r+"px",o&&(s.row-=o))}}},{key:"updateConditionImageForColDelete",value:function(t,e,i){var n=this.conditionimg,r=this.cols,o=this.displayRight2Left,a=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=t&&c.col<=e)c.image.remove(),n.splice(l,1);else if(c.col>e){c.ol+=i,c.image.style.left=o?(s-c.ol-r.getWidth(c.col))*a+"px":c.ol*a+"px";var h=e-t+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){t.rows.deleteCells(i.range,e),"all"!==e&&"format"!==e||t.merges.deleteWithin(i.range),t.delCellOpr(n,i.range,e)}))}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=e.selector.range,r=n.sri,o=n.sci,a=e.rows,s=e.merges,l=e.cols,c=e.name,h=r;if("row"===t){a.insert(r,i),e.updateConditionImageForRowInsert(r,r+i-1);var u=a.getHeight(r-1);e.insertRowOpr(c,r,i,u)}else if("column"===t){a.insertColumn(o,i),h=o,l.len+=i;for(var f=l.getWidth(o-1),d=l.len,v=0;v<i;v++)l._[d-1-v]={};for(var g=d-1;g>=o;g--)l._[g].width=g>=i?l._[g-i].width:l.width;e.insertColumnOpr(c,o,i,f),e.updateConditionImageForColInsert(o,o+i-1)}s.shift(t,h,i,(function(t,e,i,n){var r=a.getCell(t,e);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(t){var e=this,i=this.selector.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci;n<0&&(n=0),o<n||(r<0&&(r=0),a<r||this.changeData((function(){var i=e.rows,n=e.merges,r=e.selector,o=e.cols,a=e.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,v=0;if("row"===t){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){v=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),e.deleteRowOpr(a,c,u),e.updateConditionImageForRowDelete(c,u,g)}}else if("column"===t){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var p=-o.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,v=f-h+1,o.len-=v;for(var m=h;m<o.len-v;m++)o._[m].width=o._[m+v].width;for(var y=o.len;y<o.len+v;y++)delete o._[y];e.deleteColumnOpr(a,h,f),e.updateConditionImageForColDelete(h,f,p)}}n.shift(t,d,-v,(function(t,e,n,r){var o=i.getCell(t,e);o.merge[0]+=n,o.merge[1]+=r,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1))}},{key:"deletelocalonly",value:function(t,e,i){var n=this;this.changeData((function(){var r=n.rows,o=n.merges;n.cols;"row"===t?r.delete(e,e+i-1):"column"===t&&r.deleteColumn(e,e+i-1),o.shift(t,e,-i,(function(t,e,i,n){var o=r.getCell(t,e);o.merge[0]+=i,o.merge[1]+=n,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1)}},{key:"updateRevertOpr",value:function(t){"insertrow"===t.op?this.deletelocalonly("row",t.ri,t.n):"insertcol"===t.op&&this.deletelocalonly("column",t.ci,t.n)}},{key:"scrollx",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.cols;this.displayRight2Left&&(t=-t);var a=r()(n,2)[1],s=F.rangeReduceIf(a,o.len,0,0,t,(function(t){return o.getWidth(t)})),l=r()(s,3),c=l[0],h=l[1],u=l[2],f=h;t>0&&(f+=u),i.x!==f&&(i.ci=t>0?c:0,i.x=f,e())}},{key:"scrolly",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.rows,a=this.exceptRowSet,s=r()(n,1)[0],l=F.rangeReduceIf(s,o.len,0,0,t,(function(t){return o.getHeight(t,a)})),c=r()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(t>0&&(d+=f),i.y!==d){for(i.ri=t>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=o.getHeight(i.riact,a),i.riact++;e()}}},{key:"isInvisibleRow",value:function(t){var e=this.exceptRowSet;return this.rows.isHide(t)||e.has(t)}},{key:"cellRect",value:function(t,e){var i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,t,o),c=i.getCell(t,e),h=n.getWidth(e),u=i.getHeight(t);if(null!==c&&c.merge){var f=r()(c.merge,2),d=f[0],v=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(t+g);if(v>0)for(var p=1;p<=v;p+=1)h+=n.getWidth(e+p)}var m=a?this.viewWidth()-n.sumWidth(0,e)-h+2*s.x:n.sumWidth(0,e);if(a){var y=r()(this.freeze,2),b=(y[0],y[1]);b>0&&e<b&&(m-=2*s.x)}return{left:m,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(t,e){var i=this.cellRect(t,e),n=this.displayRight2Left,o=this.cols,a=this.scroll,s=this.zoomlevel,l=o.indexWidth,c=this.settings.row.height;i.top+=c;var h=r()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,e>u&&(i.left-=a.x)):(i.left+=l,e>u&&(i.left-=a.x)),t>u&&(i.top-=a.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(t,e){return this.rows.getCell(t,e)}},{key:"getCellTextOrDefault",value:function(t,e){var i=this.getCell(t,e);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(t,e){var i=this.getCell(t,e);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(t,e){var i=this.getCell(t,e);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(t,e){var i=this.styles,n=this.rows,r=this.displayRight2Left,o=n.getCell(t,e),a=o&&void 0!==o.style?i[o.style]:{},s=F.merge(this.defaultStyle(),a);if(void 0!==a.bgcolor&&(s.hasbgcolor=!0),o&&void 0!==o.merge){if(0!=o.merge[1]){var l=n.getCell(t,e+o.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===a.border&&(a.border={}),a.border.right=c.border.right)}if(0!=o.merge[0]){var h=n.getCell(t+o.merge[0],e),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===a.border&&(a.border={}),a.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellStyleOrDefault(e,i)}},{key:"setCellText",value:function(t,e,i,n){var r=this.rows,o=this.history,a=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(t,e,""),o.add(this.getData()),r.setCellText(t,e,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,t,e,i)):r.setCellText(t,e,i),a.validate(t,e,i)}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"isDate",value:function(t){return isNaN(t)&&!isNaN(Date.parse(t))}},{key:"setCellAutoAlignment",value:function(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===o.align)&&(o.align=i,r.style=this.addStyle(o),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(t,e,i){var n={name:t,src:e,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(t,e,i,n,r){var o={name:t,cells:e,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(o)}},{key:"updateCellStyleOpr",value:function(t,e,i,n){var r={name:t,ri:e,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(t,e,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",o={name:t,ri:e,ci:i,text:n,op:r};this.updateCellServer(o)}},{key:"delCellOpr",value:function(t,e,i){var n={name:t,range:e,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(t){var e={name:t,op:"add"};this.updateCellServer(e)}},{key:"delSheetOpr",value:function(t){var e={name:t,op:"del"};this.updateCellServer(e)}},{key:"renameSheetOpr",value:function(t,e){var i={oldname:t,name:e,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(t,e,i,n){var r={name:t,ri:e,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(t,e,i,n){var r={name:t,ci:e,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(t,e,i){var n={name:t,sri:e,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(t,e,i){var n={name:t,sci:e,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(t){t.ufv||this.isNumber(t.text)||this.isDate(t.text)?this.setCellAutoAlignment(t.ri,t.ci,"right"):this.setCellAutoAlignment(t.ri,t.ci,"left")}},{key:"updateMyCells",value:function(t){var e=this,i=this.styles,n=this.rows,r=this.search,o=this;t.forEach((function(t,r,a){var s=n.updateOneCell(t);if(t.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=t.bgcolor,s.style=o.addStyle(l)}e.setAutoAlignForCell(t)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(t,e){var i=this.shapes;null!=i&&null!=t&&t.forEach((function(t,n,r){for(var o=0,a=i.length;o<a;o++)if(i[o].id===t.id){var s={};s.id="s_"+t.id+"_"+i[o].tick,s.name=t.id+"."+t.tick,s.it=i[o],e.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(t,e,i,n){if(n.length>0){var r=this;$.get(e+"?uid="+t+"&id="+i,(function(t){r.fillImageOnebyOne(t,n)}))}}},{key:"validateFormula",value:function(t){for(var e=0,i=0;i<t.length;i++)"("===t[i]?e++:")"===t[i]&&e--;return 0===e}},{key:"freezeIsActive",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return e>0||i>0}},{key:"resetScroll",value:function(){var t=this.scroll;t.riact=0,t.ri=0,t.y=0,t.yact=0,t.x=0,t.ci=0}},{key:"setFreeze",value:function(t,e){var i=this;0===t&&this.resetScroll(),this.changeData((function(){i.freeze=[t,e]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(t,e){var i=this;this.changeData((function(){i.rows.setHeight(t,e)}))}},{key:"setColWidth",value:function(t,e){var i=this;this.changeData((function(){i.cols.setWidth(t,e)}))}},{key:"viewHeight",value:function(){var t=this.settings,e=t.view,i=t.showToolbar,n=t.showFileName,r=e.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return new x(0,0,e-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var t=this.rows,e=this.cols,i=t.maxCell(),n=r()(i,2),o=n[0],a=n[1],s=t.sumHeight(0,o+1),l=e.sumWidth(0,a+1);return new x(0,0,o,a,l,s)}},{key:"exceptRowTotalHeight",value:function(t,e){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),o=0;return r.forEach((function(i){if(i<t||i>e){var r=n.getHeight(i);o+=r}})),o}},{key:"viewRange",value:function(){var t=this.scroll,e=this.rows,i=this.cols,n=this.freeze,o=this.exceptRowSet,a=t.ri,s=t.ci;a<=0&&(a=r()(n,1)[0]);s<=0&&(s=r()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[e.len,i.len],f=u[0],d=u[1],v=a;v<e.len&&(o.has(v)||(h+=e.getHeight(v),f=v),!(h>this.viewHeight()/this.zoomlevel));v+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var p=new x(a,s,f,d,c,h);return this.viewRangeCache=p,p}},{key:"eachMergesInView",value:function(t,e){this.merges.filterIntersects(t).forEach((function(t){return e(t)}))}},{key:"hideRowsOrCols",value:function(){var t=this.rows,e=this.cols,i=this.selector,n=i.size(),o=r()(n,2),a=o[0],s=o[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(a===t.len)for(var d=h;d<=f;d+=1)e.setHide(d,!0);else if(s===e.len)for(var v=c;v<=u;v+=1)t.setHide(v,!0)}},{key:"unhideRowsOrCols",value:function(t,e){this["".concat(t,"s")].unhide(e)}},{key:"rowEach",value:function(t,e,i){for(var n=0,r=this.rows,o=this.exceptRowSet,a=(v()(o),0),s=t+a;s<=e;s+=1)if(o.has(s))a+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(t,e,i){for(var n=0,r=this.cols,o=t;o<=e;o+=1){var a=r.getWidth(o);if(a>0){if(i(o,n,a),n+=a,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(t,e,i){var n=new Array;null!=t&&t.forEach((function(t){if(null==t.src){var e={};e.id="p_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),null!=e&&e.forEach((function(t){if(null==t.src){var e={};e.id="s_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(t){for(var e=this.styles,i=0;i<e.length;i+=1){var n=e[i];if(F.equals(n,t))return i}return e.push(t),e.length-1}},{key:"changeData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),t(),this.change(this.getData()),e)for(var r=n.sri,o=(n.sci,n.eri),a=(n.eci,r);a<=o;a++)this.updateRows.add(a)}},{key:"setRangeData",value:function(t){this.rows.setRangeData(t.rows,t.range),this.merges.setData(t.merges)}},{key:"setData",value:function(t){var e=this;return Object.keys(t).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)e[i].setData(t[i]);else if("freeze"===i){var n=y(t[i]),o=r()(n,2),a=o[0],s=o[1];e.freeze=[s,a]}else if("autofilter"===i)e.autoFilter.setData(t[i]);else if("lautofilters"===i){var l=t[i],c=e;l.forEach((function(t){var e=new R;e.setData(t),c.TableAutoFilters.push(e)}))}else void 0!==t[i]&&(e[i]=t[i])})),this}},{key:"getData",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:t,freeze:b(e[1],e[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:o.getData(),validations:a.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(t){c.TableAutoFilters.push(t.getData())})),c}},{key:"getRangeData",value:function(t){var e=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(t),merges:e.getData(),range:t}}},{key:"getDataForSave",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,v=this.canselectunlocked,g=this.showGrid,p=this.comments,m=this.images,y=this.shapes;return{name:t,freeze:b(e[1],e[0]),styles:i,comments:p,canselectlocked:f,sprotected:d,canselectunlocked:v,showGrid:g,merges:n.getDataForSave(),settings:l,cols:o.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:a.getData(),autofilter:s.getData(),images:null!=m?m.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[],shapes:null!=y?y.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[]}}}]),t}(),yt=i(12),bt=i.n(yt),wt=i(7),xt=i.n(wt),Ct=i(11),kt=i.n(Ct),_t=i(13),St=i.n(_t);function Tt(t,e,i){t.addEventListener(e,i)}function Ot(t,e,i){t.removeEventListener(e,i)}function Et(t){t.xclickoutside&&(Ot(window.document.body,"click",t.xclickoutside),delete t.xclickoutside)}function Rt(t,e){t.xclickoutside=function(i){2===i.detail||t.contains(i.target)||(e?e(t):(t.hide(),Et(t)))},Tt(window.document.body,"click",t.xclickoutside)}function At(t,e,i){Tt(t,"mousemove",e),t.xEvtUp=function(n){Ot(t,"mousemove",e),Ot(t,"mouseup",t.xEvtUp),i(n)},Tt(t,"mouseup",t.xEvtUp)}var It=null;function Pt(){clearInterval(It),It=null}function Dt(t,e){(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];It||(It=setInterval((function(){t.apply(void 0,i)}),400))})((function(){t.selectMoveDown(),t.canvas.publishEvent("object:scroll",t.data)}))}function Ft(t,e){var i="object"===("undefined"==typeof window?"undefined":St()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&e(i):t(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(t){e(t)})),window.addEventListener("focusout",(function(e){t(e)})))}var Mt=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,t),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ot,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ot,"-resizer-hover")).on("dblclick.stop",(function(t){return e.mousedblclickHandler(t)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ot,"-resizer-hover")).on("mousedown.stop",(function(t){return e.mousedownHandler(t)})),this.lineEl=f("div","".concat(ot,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return a()(t,[{key:"showUnhide",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(t,e,i){var n=this.moving,r=this.vertical,o=this.hoverEl,a=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=t;var c=t.left,h=t.top,u=t.width,f=t.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),o.offset({width:r?5:u,height:r?f:5}),a.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(t){var e=this,i=t,n=this.el,r=this.lineEl,o=this.cRect,a=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=a?o.width:o.height;u=Math.round(u),r.show(),At(window,(function(t){e.moving=!0,null!==i&&1===t.buttons&&(a?(l?u-=t.movementX:u+=t.movementX,u>s&&u<h&&(l?n.css("left","".concat(o.left-u,"px")):n.css("left","".concat(o.left+u,"px")))):(u+=t.movementY)>s&&u<c&&n.css("top","".concat(o.top+u,"px")),i=t)}),(function(){i=null,r.hide(),e.moving=!1,e.hide(),e.finishedFn&&(u<s&&(u=s),a?u>h&&(u=h):u>c&&(u=c),e.finishedFn(o,u))}))}}]),t}(),jt=function(){function t(e){var i=this;l()(this,t),this.vertical=e,this.moveFn=null,this.el=f("div","".concat(ot,"-scrollbar ").concat(e?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(t){var e=t.target,n=e.scrollTop,r=e.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,t)}))}return a()(t,[{key:"move",value:function(t){return this.el.scroll(t),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(t,e){var i=t-1;if(e>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(e,"px"))}else this.el.hide();return this}}]),t}(),Lt=10,Bt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,t),this.isreadonly=e,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ot,"-selector-corner")),this.areaEl=f("div","".concat(ot,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ot,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ot,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ot,"-selector-autofill")).hide(),this.el=f("div","".concat(ot,"-selector")).css("z-index","".concat(Lt)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),Lt+=1}return a()(t,[{key:"setOffset",value:function(t){return this.el.offset(t).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height,o={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:e-.8,top:i-.8};this.areaEl.offset(o).show()}},{key:"setClipboardOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.clipboardEl.offset({left:e,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.autofillEl.offset({width:n-3,height:r-3,left:e,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),t}();function zt(t){var e=this.data,i=t.left,n=t.top,r=t.width,o=t.height,a=t.scroll,s=t.l,l=t.t,c=e.freezeTotalWidth(),h=e.freezeTotalHeight(),u=e.displayRight2Left?0===c?i:i-(e.viewWidth()-e.cols.indexWidth-c):i-c,f=r;void 0!==a&&(e.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=a.x)):c>s&&(u-=a.x));var d=n-h;return void 0!==a&&h>l&&(d-=a.y),{left:u,top:d,width:f,height:o}}function Ht(t){var e=this.data,i=t.left,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=e.freezeTotalWidth(),c=e.displayRight2Left?0===l?i:i-(e.viewWidth()-e.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(e.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>o&&(c-=s.x)),{left:c,top:a,width:h,height:r}}function Nt(t){var e=this.data,i=t.top,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=t.left,c=e.freezeTotalHeight(),h=i-c;return c>a&&(h-=s.y),e.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:o,top:h,width:n,height:r}}function Wt(t){this.br.setAreaOffset(zt.call(this,t))}function Ut(t){this.tl.setAreaOffset(t)}function Xt(t){this.t.setAreaOffset(Ht.call(this,t))}function Yt(t){this.l.setAreaOffset(Nt.call(this,t))}function Vt(t){this.l.setClipboardOffset(Nt.call(this,t))}function Gt(t){this.br.setClipboardOffset(zt.call(this,t))}function qt(t){this.tl.setClipboardOffset(t)}function Kt(t){this.t.setClipboardOffset(Ht.call(this,t))}function Zt(t){Wt.call(this,t),Ut.call(this,t),Xt.call(this,t),Yt.call(this,t)}function Jt(t){Gt.call(this,t),qt.call(this,t),Kt.call(this,t),Vt.call(this,t)}var $t=function(){function t(e){var i=this;l()(this,t),this.inputChange=function(){},this.data=e;var n="edit"!==e.settings.mode;this.br=new Bt(n,!0),this.t=new Bt(n),this.l=new Bt(n),this.tl=new Bt(n),this.br.inputChange=function(t){i.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ot,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,Lt+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return a()(t,[{key:"getObj",value:function(){if(null===this.objId)return null;var t=this.objId.split("_");return"s"===t[0]?this.data.shapes.filter((function(e){return Number(e.id)===Number(t[1])}))[0]:this.data.images.filter((function(e){return Number(e.id)===Number(t[1])}))[0]}},{key:"setObjId",value:function(t){this.objId=t}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(t){this.data=t,this.range=t.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var t=this.data,e=this.tl,i=this.t,n=this.l,r=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();if(o>0||a>0)if(this.data.displayRight2Left){var s=t.viewWidth()-t.cols.indexWidth;e.setOffset({width:s-a,height:o}),i.setOffset({left:s-a,height:o}),n.setOffset({width:s-a,top:o}),r.setOffset({left:s-a,top:o})}else e.setOffset({width:a,height:o}),i.setOffset({left:a,height:o}),n.setOffset({width:a,top:o}),r.setOffset({left:a,top:o});else e.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Zt.call(this,t),Jt.call(this,e),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Wt.call(this,t):(Yt.call(this,t),Ut.call(this,t),Vt.call(this,e),qt.call(this,e)):(Wt.call(this,t),Xt.call(this,t),Gt.call(this,e),Kt.call(this,e)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Wt.call(this,t),Yt.call(this,t),Gt.call(this,e),Vt.call(this,e),this.resetOffset()}},{key:"set",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(t,e),o=r.sri,a=r.sci;if(i){var s=t,l=e;t<0&&(s=0),e<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[o,a],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,o=this.lastci;if(i){if(t===r&&e===o)return;this.lastri=t,this.lastci=e}this.moveIndexes=[t,e],this.range=n.calSelectedRangeByEnd(t,e),Zt.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(t,e){Zt.call(this,{width:this.mobilestartOffset.width+t,height:this.mobilestartOffset.height+e,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(t,e){var i=this.mobilestartRange,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=0,l=0,c=o,h=a;if(e>0){for(var u=o+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}}else{e=-e;for(u=o;u>=n;u--)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}c===n-1&&(c=n)}if(t>0){for(var f=a+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}}else{t=-t;for(f=a;f>=r;f--)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(t,e){var i=this.getMobileMultipleSelect(t,e),n=r()(i,2),o=n[0],a=n[1];this.setEnd(o,a,!1)}},{key:"setMobile",value:function(t,e,i,n){var r=this.range,o=r.eri,a=r.eci;this.set(t,e),this.lastri=this.lastci=0,this.setEnd(o,a);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Zt.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var t=this.data.selector.range,e=t.eri,i=t.eci;this.setEnd(e,i)}},{key:"showAutofill",value:function(t,e){if(-1!==t||-1!==e){var i=this.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=t,l=e,c=n-t,h=o-t,u=a-e;if(r-e>0)this.arange=new x(n,l,o,r-1);else if(c>0)this.arange=new x(s,r,n-1,a);else if(u<0)this.arange=new x(n,a+1,o,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(o+1,r,s,a)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,v=this.l,g=this.t,p=this.tl;d.showAutofill(zt.call(this,f)),v.showAutofill(Nt.call(this,f)),g.showAutofill(Ht.call(this,f)),p.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideAutofill()}))}},{key:"showClipboard",value:function(){var t=this,e=this.data.getClipboardRect();Jt.call(this,e),["br","l","t","tl"].forEach((function(e){t[e].showClipboard()}))}},{key:"hideClipboard",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideClipboard()}))}}]),t}();function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var te=function(t){tt()(i,t);var e=Qt(i);function i(t){var n;return l()(this,i),(n=e.call(this,"dialog")).show(),n.setContent(t),n}return a()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(t){var e=f("p");e.child(t),this.child(e)}}],[{key:"findDialog",value:function(t){for(var e=[],i=0;i<t.children().length;i++)"dialog"===t.children()[i].localName&&e.push(i);return e}}]),i}(u);function ee(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ie(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ne(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}function re(t,e){e.focusing=!0;var i=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),i){case 37:t.stopPropagation();break;case 38:ee.call(this,t);break;case 39:t.stopPropagation();break;case 40:ie.call(this,t);break;case 13:case 9:ne.call(this,t);break;default:t.stopPropagation()}}var oe=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,t),this.filterItems=[],this.items=e,this.el=f("div","".concat(ot,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return a()(t,[{key:"setOffset",value:function(t){this.el.cssRemoveKeys("top","bottom").offset(t)}},{key:"hide",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide();for(var e=te.findDialog(t.parent()),i=0;i<e.length;i++)t.parent().removeChild(t.parent().children()[e[i]]);Et(this.el.parent())}},{key:"setItems",value:function(t){this.items=t}},{key:"search",value:function(t){var e,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(t)||(r=r.filter((function(e){return(e.key||e).startsWith(t.toUpperCase())}))),r=r.map((function(t){var e=t.title;e?"function"==typeof e&&(e=e()):e=t;var r=f("div","".concat(ot,"-item")).child("f"===n?t.key:e).on("click.stop",(function(){i.itemClick(t),i.hide()}));return t.label&&r.child(f("div","label").html(t.label)),"f"===n&&(r.el.help=new te(t.title())),r.el.showHelp=function(){var t=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,e=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(t,"px"),left:"".concat(e,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Rt(r,(function(t){for(var e=te.findDialog(i.el.parent()),n=0;n<e.length;n++)i.el.parent().removeChild(i.el.parent().children()[e[n]]);Et(t)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Et(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var o=this.el;if((e=o.html("")).children.apply(e,v()(r)).show(),"f"===n){for(var a=te.findDialog(o.parent()),s=0;s<a.length;s++)o.parent().removeChild(o.parent().children()[a[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Rt(o.parent(),(function(){i.hide(),i.filterItems.forEach((function(t){return t.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(t,e){var i=this;t.on("keydown",(function(t){return re.call(i,t,e)}))}}]),t}();function ae(t,e){t.setMonth(t.getMonth()+e)}function se(t,e){var i=new Date(t);return i.setDate(e-t.getDay()+1),i}var le=function(){function t(e){var i,n=this;l()(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new st("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new st("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,v()(W("calendar.weeks").map((function(t){return f("th","cell").child(t)}))))),this.bodyEl)),this.selectChange=function(){}}return a()(t,[{key:"setValue",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:"prev",value:function(){ae(this.value,-1),this.buildAll()}},{key:"next",value:function(){ae(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var t=this.value;this.headerLeftEl.html("".concat(W("calendar.months")[t.getMonth()]," ").concat(t.getFullYear()))}},{key:"buildBody",value:function(){var t,e=this,i=this.value,n=this.cvalue,r=this.bodyEl,o=function(t,e,i){for(var n=new Date(t,e,1,23,59,59),r=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var s=se(n,7*o+a),l=s.getMonth()!==e,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[o][a]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(t){var i,n=t.map((function(t){var i="cell";return t.disabled&&(i+=" disabled"),t.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){e.selectChange(t.d)})).child(t.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,v()(n))}));(t=r.html("")).children.apply(t,v()(o))}}]),t}(),ce=function(){function t(){l()(this,t),this.calendar=new le(new Date),this.el=f("div","".concat(ot,"-datepicker")).child(this.calendar.el).hide()}return a()(t,[{key:"setValue",value:function(t){var e=this.calendar;return"string"==typeof t?/^\d{4}-\d{1,2}-\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp("-","g"),"/"))):t instanceof Date&&e.setValue(t),this}},{key:"change",value:function(t){var e=this;this.calendar.selectChange=function(i){t(i),e.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),t}(),he=[{key:"SUM",title:U("formula.sum"),render:function(t){return t.reduce((function(t,e){return D("+",t,e)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:U("formula.average"),render:function(t){return t.reduce((function(t,e){return Number(t)+Number(e)}),0)/t.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:U("formula.max"),render:function(t){return Math.max.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:U("formula.min"),render:function(t){return Math.min.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:U("formula._if"),render:function(t){var e=r()(t,3),i=e[0],n=e[1],o=e[2];return i?n:o},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:U("formula.and"),render:function(t){return t.every((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:U("formula.or"),render:function(t){return t.some((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:U("formula.concat"),render:function(t){return t.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}}],ue=he,fe={};function de(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return ve(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ve(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}he.forEach((function(t){fe[t.key]=t}));var ge=function(){function t(){l()(this,t),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return a()(t,[{key:"tipContent",value:function(t,e){if(void 0===t)return"";var i=t.tipInfo.args.slice(),n="";t.tipInfo.repeat&&(n=i[i.length-1].name,i.pop());var r=[];if(""!==n){for(var o=1;i.length!==e+2;){var a=n+o;o++,i.push({name:a,required:!1})}i.push({name:"...",required:!0})}for(var s=0;s<i.length;s++){var l=i[s].required||0===s?i[s].name:"[".concat(i[s].name,"]");r.push(l)}return r[e]="<strong>".concat(r[e],"</strong>"),"".concat(t.key.toUpperCase(),"(").concat(r.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(t){if(-1!==t.startsWith("=")){var e,i="",n=[],r=[],o=de(t.substring(1));try{for(o.s();!(e=o.n()).done;){var a=e.value;switch(a){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=a}}}catch(t){o.e(t)}finally{o.f()}var s=he.find((function(t){return void 0!==n[0]&&t.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Rt(this.el)}}}]),t}();function pe(){var t=this.inputText;if(!/^\s*$/.test(t)){var e=this.textlineEl,i=this.textEl,n=this.areaOffset,r=t.split("\n"),o=Math.max.apply(Math,v()(r.map((function(t){return t.length})))),a=e.offset().width/t.length,s=(o+1)*a+5,l=this.viewFn().width-n.left-a,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function me(t){var e=t.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=e.innerText,this.inputHtml=e.innerHTML,pe.call(this)}}function ye(t){var e=t.keyCode,i=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&i&&(me.call(this,t),t.stopPropagation()),13!==e||i||t.preventDefault()}function be(t){var e=t.target.innerText,i=t.target.innerHTML,n=this.suggest,r=this.textlineEl,o=this.validator,a=this.cell;if(null!==a)if("editable"in a&&!0===a.editable||void 0===a.editable){if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var s=e.lastIndexOf("=");-1!==s?(n.search(e.substring(s+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(i),pe.call(this),this.change("input",e)}else t.target.innerText="";else{if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var l=e.lastIndexOf("=");-1!==l?(n.search(e.substring(l+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(e),pe.call(this),this.change("input",e)}}function we(t,e){var i=this.textEl.el;setTimeout((function(){if(e){var t=window.getSelection(),n=document.createRange();t.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),t.addRange(n),i.focus()}}),1)}function xe(t,e,i,n){var r=this.textEl,o=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var a=!1;t.length>0?(a=!0,r.html(t)):r.html(e,!0,!0),a?o.html(t):o.html(e,!0,!0),we.call(this,i,n)}function Ce(t,e){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=t,r=this.inputText.length;else{var o=i.lastIndexOf("="),a=i.substring(0,o+1),s=i.substring(o+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(a+t.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}xe.call(this,this.inputText,r,e)}function ke(){this.suggest.setItems(this.formulas)}var _e=function(){function t(e,i,n,r){var o=this;l()(this,t),this.viewFn=i,this.rowHeight=n,this.formulas=e,this.formalaTip=new ge,this.suggest=new oe(e,(function(t){Ce.call(o,t,!0)})),this.datepicker=new ce,this.datepicker.change((function(t){o.setText(function(t){var e=t.getMonth()+1,i=t.getDate();return e<10&&(e="0".concat(e)),i<10&&(i="0".concat(i)),"".concat(t.getFullYear(),"-").concat(e,"-").concat(i)}(t)),o.clear()})),this.areaEl=f("div","".concat(ot,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(t){return be.call(o,t)})).on("paste.stop",(function(){})).on("keydown",(function(t){return ye.call(o,t)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ot,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.change=function(){}}return a()(t,[{key:"setFreezeLengths",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:"insertTextNewLine",value:function(t){me.call(this,t)}},{key:"clear",value:function(){""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textlineEl.html(""),ke.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var s=t.left,l=t.top,c=t.width,h=t.height,u=t.l,f=t.t,d={left:0,top:0};o.w>u&&o.h>f||(o.w<u&&o.h<f?(d.left=o.w,d.top=o.h):o.w>u?d.top=o.h:o.h>f&&(d.left=o.w)),a.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var v={left:0};v[e]=h,r.setOffset(v),r.hide()}}},{key:"setCell",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,o=this.suggest,a=this.textEl;a.attr("contenteditable","true"),n.show(),this.cell=t;var s=t&&t.text||"",l=t&&t.html||"";if(t&&(t.f?s=t.f:t.ufv&&(s=t.ufv)),this.ishtml=t&&t.html,this.setTextAndHtml(l,s,i),this.validator=e,e){var c=e.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(o.setItems(e.values()),o.search(""))}}},{key:"setTextAndHtml",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=e,this.inputHtml=t,xe.call(this,t,e,e.length,i),pe.call(this)}},{key:"setText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=t,xe.call(this,"",t,t.length,e),pe.call(this)}}]),t}();function Se(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Te=function(t){tt()(i,t);var e=Se(i);function i(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=e.call(this,"div","".concat(ot,"-button ").concat(r))).child(W("button.".concat(t))),n}return i}(u);function Oe(){return window.devicePixelRatio||1}function Ee(){return Oe()-.5}function Re(t){return parseInt(t*Oe(),10)}function Ae(t){var e=Math.ceil(t/Oe());return Re(e)===t?e:e-1}function Ie(t){var e=Re(t);return e>0?e-.5:.5}var Pe=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,t),this.x=e,this.y=i,this.width=n,this.height=r,this.padding=o,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return a()(t,[{key:"setBorders",value:function(t){var e=t.top,i=t.bottom,n=t.left,r=t.right;e&&(this.borderTop=e),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPattern",value:function(t){t&&(this.pattern=t)}},{key:"resize",value:function(t,e){this.width=t,this.height=e}},{key:"innerWidth",value:function(){return this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(t){var e=this.width,i=this.padding,n=this.x;return"left"===t?n+=i:"center"===t?n+=e/2:"right"===t&&(n+=e-i),n}},{key:"texty",value:function(t,e){var i=this.height,n=this.padding,r=this.y;return"top"===t?r+=n:"middle"===t?r+=i/2-e/2:"bottom"===t&&(r+=i-n-e),r}},{key:"topxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:"rightxys",value:function(){var t=this.x,e=this.y,i=this.width;return[[t+i,e],[t+i,e+this.height]]}},{key:"bottomxys",value:function(){var t=this.x,e=this.y,i=this.width,n=this.height;return[[t,e+n],[t+i,e+n]]}},{key:"leftxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function De(t,e,i,n,r,o,a){var s={x:0,y:0};"underline"===t?s.y="bottom"===r?0:"top"===r?-(o+2):-o/2:"strike"===t&&("bottom"===r?s.y=o/2:"top"===r&&(s.y=-(o/2+2))),"center"===n?s.x=a/2:"right"===n&&(s.x=a),this.line([e-s.x,i-s.y],[e-s.x+a,i-s.y])}function Fe(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}function Me(t,e,i,n,r,o){for(var a=e;a<n;a+=o)t.moveTo(a,i),t.lineTo(a,r)}function je(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(s,r),t.lineTo(a,i),a+=o}function Le(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(a,r),t.lineTo(s,i),a+=o}function Be(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}var ze=function(){function t(e,i,n){l()(this,t),this.width=i,this.height=n,this.ctx=e,this.ctx.scale(Oe(),Oe())}return a()(t,[{key:"setel",value:function(t){var e=this.width,i=this.height;this.el=t,this.ctx=t.getContext("2d"),this.resize(e,i),this.ctx.scale(Oe(),Oe())}},{key:"resize",value:function(t,e){this.width=t,this.height=e,this.el.style.width="".concat(t,"px"),this.el.style.height="".concat(e,"px"),this.el.width=Re(t),this.el.height=Re(e)}},{key:"clear",value:function(){var t=this.width,e=this.height;return this.ctx.clearRect(0,0,Re(t),Re(e)),this}},{key:"attr",value:function(t){return Object.assign(this.ctx,t),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(t,e){return this.ctx.translate(Re(t),Re(e)),this}},{key:"scale",value:function(t,e){return this.ctx.scale(t,e),this}},{key:"scaledpr",value:function(t){this.scale(t,t)}},{key:"clearRect",value:function(t,e,i,n){return this.ctx.clearRect(t,e,i,n),this}},{key:"fillRectWithColor",value:function(t,e,i,n,r){var o=this.ctx;this.save(),void 0!==t&&(o.fillStyle=t),this.fillRect(e,i,n,r),this.restore()}},{key:"fillRect",value:function(t,e,i,n){return this.ctx.fillRect(Re(t)-.5,Re(e)-.5,Re(i),Re(n)),this}},{key:"fillText",value:function(t,e,i){return this.ctx.fillText(t,Re(e),Re(i)),this}},{key:"richtext",value:function(t,e,i,n){var r=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=t.bigfontsize,c=t.rtxt,h=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth(),u=e.textx(i);s.save(),s.beginPath();var f=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var d=[],v=[],g=c.length;if(o)for(var p=function(t){var e=c[t],i=[],n=0,r=0,o=0;e.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name)});var e=s.measureText(t.txt).width;if(r=n,(n+=e)>Re(h)){for(var a={w:r,len:0,start:0},l=0;l<t.txt.length;)if(a.w+=s.measureText(t.txt[l]).width+1,a.w>=Re(h)){if(a.len>a.start){var c={};c.font=t.font,c.txt=t.txt.substr(a.start,a.len),i.push(c),t.font.size>o&&(o=t.font.size)}d.push(i),v.push(o),a={w:0,len:l,start:l},n=0,i=[],o=0}else a.len+=1,l++;if(a.len>a.start){var u={};u.font=t.font,u.txt=t.txt.substr(a.start,a.len),i.push(u),t.font.size>o&&(o=t.font.size),n=a.w}}else i.push(t),t.font.size>o&&(o=t.font.size)})),d.push(i),v.push(o)},m=0;m<g;m++)p(m);else d=c,v=l;for(var y=v.length,b=0,w=0;w<y;w++)b+=v[w]+8;var x=[],C=[];if("center"===i||"right"===i)for(var k=0;k<y;k++){var _=d[k],S=0;_.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name),fillStyle:t.font.color,strokeStyle:t.font.color}),S+=Ae(s.measureText(t.txt).width)})),C.push(S)}if(0==a.length&&a.push(null),a.forEach((function(t){for(var o=e.texty(n,b),a=0,l=!1,c=!1,h=function(e){var n=d[e],h=0,g=u,p=g,m=g,y=v[e]+8,b=C.length>0?C[e]:0;"center"===i?p=g-b/2:"right"===i&&(p=g-b);var w=p;o+=y,n.forEach((function(e){f.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Re(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color});var n=Ae(s.measureText(e.txt).width);if(m=w+n,null!==t){if(a<=t.start&&t.start<a+e.txt.length){l=!0;var u=e.txt.substr(0,t.start-a),d=Ae(s.measureText(u).width);p=w+d}if(a<t.end&&t.end<=a+e.txt.length){var v=e.txt.substr(0,t.end-a),C=Ae(s.measureText(v).width);m=w+C,l=!1,x.push({x:p,y:o-y,w:m-p,h:y})}}h+=n;var k=0;"center"===i?k=b/2-h:"right"===i&&(k=b-h),c||r.fillText(e.txt,g-k,o),"center"===i&&(k+=n/2),!c&&e.font.strike&&De.call(r,"strike",g-k,o,i,"bottom",e.font.size,n),!c&&e.font.underline&&De.call(r,"underline",g-k,o,i,"bottom",e.font.size,n),"left"===i&&(g+=n),w+=n,a+=e.txt.length})),null!==t&&l&&x.push({x:p,y:o-y,w:m-p,h:y}),a++},g=0;g<y;g++)h(g);c||(c=!0)})),s.restore(),null!=a[0]){s.save(),this.attr({fillStyle:a[0].color});for(var T=0,O=x.length;T<O;T++){var E=x[T];this.fillRect(E.x,E.y,E.w,E.h)}s.restore()}return this}},{key:"text",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,a=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=e.textx(s);a.save(),a.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Re(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var v="".concat(t).split("\n"),g=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth(),p=[];v.forEach((function(t){var e=a.measureText(t).width;if(r&&e>Re(g)){for(var i={w:0,len:0,start:0},n=0;n<t.length;n+=1)i.w>=Re(g)&&(p.push(t.substr(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=a.measureText(t[n]).width+1;i.len>0&&p.push(t.substr(i.start,i.len))}else p.push(t)}));var m=(p.length-1)*(c.size+2),y=!1,b=[];if(0==o.length&&o.push(null),o.forEach((function(t){var n=e.texty(l,m),r=0,o=!1;p.forEach((function(e){var h=a.measureText(e).width,v=d,g=d+Ae(h);if(null!==t){if(r<=t.start&&t.start<r+e.length){o=!0;var p=e.substr(0,t.start-r),m=Ae(a.measureText(p).width);v+=m,Ae(h)-m}if(r<t.end&&t.end<r+e.length){var w=e.substr(0,t.end-r),x=Ae(a.measureText(w).width);g=d+x}if(r>t.end&&(o=!1),o){var C={x:0,y:0};C.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?C.x=Ae(h/2):"right"===s&&(C.x=Ae(h)),b.push({x:v-C.x,y:n-C.y,w:g-v,h:c.size+2})}}y||(i.fillText(e,d,n),u&&De.call(i,"strike",d,n,s,l,c.size,Ae(h)),f&&De.call(i,"underline",d,n,s,l,c.size,Ae(h))),n+=c.size+2,r+=e.length+1})),y||(y=!0)})),a.restore(),null!==o[0]){a.save(),this.attr({fillStyle:o[0].color});for(var w=0,x=b.length;w<x;w++){var C=b[w];this.fillRect(C.x,C.y,C.w,C.h)}a.restore()}return this}},{key:"border",value:function(t,e){var i=this.ctx;return i.lineWidth=Ee,i.strokeStyle=e,"medium"===t?i.lineWidth=Re(2)-.5:"thick"===t?i.lineWidth=Re(3):"dashed"===t?i.setLineDash([Re(3),Re(2)]):"dotted"===t?i.setLineDash([Re(1),Re(1)]):"double"===t&&i.setLineDash([Re(2),0]),this}},{key:"line",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(Ie(n),Ie(o));for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(Ie(c),Ie(h))}t.stroke()}return this}},{key:"strokeBorders",value:function(t){var e=this.ctx;e.save();var i=t.borderTop,n=t.borderRight,r=t.borderBottom,o=t.borderLeft;i&&(this.border.apply(this,v()(i)),this.line.apply(this,v()(t.topxys()))),n&&(this.border.apply(this,v()(n)),this.line.apply(this,v()(t.rightxys()))),r&&(this.border.apply(this,v()(r)),this.line.apply(this,v()(t.bottomxys()))),o&&(this.border.apply(this,v()(o)),this.line.apply(this,v()(t.leftxys()))),e.restore()}},{key:"strokePattern",value:function(t){var e=this.ctx;e.save();var i=t.x,n=t.y,r=t.width,o=t.height,a=t.pattern;if(a){e.beginPath();var s=Ie(i),l=s+Re(r),c=Ie(n),h=c+Re(o);switch(a){case"None":case"Solid":break;case"HorizontalStripe":e.lineWidth=2,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"ThinHorizontalStripe":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"Gray75":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3);break;case"VerticalStripe":e.lineWidth=2,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"ThinVerticalStripe":e.lineWidth=1,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"Gray50":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4);break;case"Gray25":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4);break;case"DiagonalStripe":e.lineWidth=2,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"ThinDiagonalStripe":e.lineWidth=1,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"Gray12":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4.5);break;case"DiagonalCrosshatch":e.lineWidth=1.5,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4),Me(e,s,c,l,h,4);break;case"Gray6":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4)}e.closePath(),e.stroke()}e.restore()}},{key:"dropdown",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-15,o=n+t.height-15;e.save(),e.beginPath(),e.moveTo(Re(r),Re(o)),e.lineTo(Re(r+8),Re(o)),e.lineTo(Re(r+4),Re(o+6)),e.closePath(),e.fillStyle="rgba(0, 0, 0, .45)",e.fill(),e.restore()}},{key:"error",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=n+o-1;i.save(),i.beginPath(),e?(i.moveTo(Re(a-o+8),Re(r-1)),i.lineTo(Re(a-o),Re(r-1)),i.lineTo(Re(a-o),Re(r+8))):(i.moveTo(Re(a-8),Re(r-1)),i.lineTo(Re(a),Re(r-1)),i.lineTo(Re(a),Re(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-1;e.save(),e.beginPath(),e.moveTo(Re(r-8),Re(n-1)),e.lineTo(Re(r),Re(n-1)),e.lineTo(Re(r),Re(n+8)),e.closePath(),e.fillStyle="rgba(0, 255, 0, .85)",e.fill(),e.restore()}},{key:"line2",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(n,o);for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(c,h)}t.stroke()}return this}},{key:"rect2",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,o-2,a-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,o+u+f-2,a-2),i.clip(),e(),i.restore()}else e(),i.restore()}},{key:"rect",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(Ie(n+1),Ie(r+1),Re(o-2),Re(a-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(Ie(n+1-f),Ie(r+1),Re(o+u+f-2),Re(a-2)),i.clip(),e(),i.restore()}else e(),i.restore()}}]),t}(),He=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],Ne=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function We(t){for(var e=0;e<Ne.length;e+=1){var i=Ne[e];if(i.pt===t)return i.px}return t}var Ue=function(t){for(var e=[],i=[],n=[],o=0,a="",s=1,l="",c=0;c<t.length;c+=1){var h=t.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==t.charAt(c);)n.push(t.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=e.pop();if(2===o)try{for(var f=y(i.pop()),d=r()(f,2),v=d[0],g=d[1],p=y(i.pop()),m=r()(p,2),w=m[0],x=m[1],C=0,k=w;k<=v;k+=1)for(var _=x;_<=g;_+=1)i.push(b(k,_)),C+=1;i.push([u,C])}catch(t){}else if(1===o||3===o)3===o&&i.push(a),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(e.length<=0));)u=e.pop();o=0}else if("="===h||">"===h||"<"===h){var S=t.charAt(c+1);a=h,"="!==S&&"-"!==S||(a+=S,c+=1),o=3}else if(":"===h)o=2;else if(","===h)3===o&&i.push(a),o=1,s+=1;else if("("===h&&n.length>0)e.push(n.join(""));else{if(e.length>0&&("+"===h||"-"===h)){var T=e[e.length-1];if("("!==T&&i.push(e.pop()),"*"===T||"/"===T)for(;e.length>0&&"("!==(T=e[e.length-1]);)i.push(e.pop())}e.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));e.length>0;)i.push(e.pop());return i},Xe=function(t,e){var i=r()(t,1)[0],n=t;if('"'===i)return t.substring(1);var o=1;if("-"===i&&(n=t.substring(1),o=-1),n[0]>="0"&&n[0]<="9")return o*Number(n);var a=y(n),s=r()(a,2);return o*e(s[0],s[1])},Ye=function(t,e,i,n){for(var o=[],a=0;a<t.length;a+=1){var s=t[a],l=s[0];if("+"===s){var c=o.pop();o.push(D("+",o.pop(),c))}else if("-"===s)if(1===o.length){var h=o.pop();o.push(D("*",h,-1))}else{var u=o.pop();o.push(D("-",o.pop(),u))}else if("*"===s)o.push(D("*",o.pop(),o.pop()));else if("/"===s){var f=o.pop();o.push(D("/",o.pop(),f))}else if("="===l||">"===l||"<"===l){var d=o.pop();Number.isNaN(d)||(d=Number(d));var v=o.pop();Number.isNaN(v)||(v=Number(v));var g=!1;"="===l?g=v===d:">"===s?g=v>d:">="===s?g=v>=d:"<"===s?g=v<d:"<="===s&&(g=v<=d),o.push(g)}else if(Array.isArray(s)){for(var p=r()(s,2),m=p[0],y=p[1],b=[],w=0;w<y;w+=1)b.push(o.pop());o.push(e[m].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),o.push(Xe(s,i)),n.pop()}}return o[0]},Ve=function t(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===e[0]){var o=Ue(e.substring(1));return o.length<=0?e:Ye(o,i,(function(e,o){return t(n(e,o),i,n,r)}),r)}return e},Ge=function(t){return t},qe=function(t){if(/^(-?\d*.?\d*)$/.test(t)){var e=Number(t).toFixed(2).toString().split("\\."),i=h()(e),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(v()(r))}return t},Ke=[{key:"normal",title:U("format.normal"),type:"string",render:Ge},{key:"text",title:U("format.text"),type:"string",render:Ge},{key:"number",title:U("format.number"),type:"number",label:"1,000.12",render:qe},{key:"percent",title:U("format.percent"),type:"number",label:"10.12%",render:function(t){return"".concat(t,"%")}},{key:"rmb",title:U("format.rmb"),type:"number",label:"¥10.00",render:function(t){return"¥".concat(qe(t))}},{key:"usd",title:U("format.usd"),type:"number",label:"$10.00",render:function(t){return"$".concat(qe(t))}},{key:"eur",title:U("format.eur"),type:"number",label:"€10.00",render:function(t){return"€".concat(qe(t))}},{key:"date",title:U("format.date"),type:"date",label:"26/09/2008",render:Ge},{key:"time",title:U("format.time"),type:"date",label:"15:59:00",render:Ge},{key:"datetime",title:U("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:Ge},{key:"duration",title:U("format.duration"),type:"date",label:"24:01:00",render:Ge}],Ze={};function Je(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return $e(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return $e(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function $e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}Ke.forEach((function(t){Ze[t.key]=t}));var Qe={fillStyle:"#f4f5f8"},ti={fillStyle:"#fff",lineWidth:Ee,strokeStyle:"#e6e6e6"};function ei(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.cellRect(e,i),o=r.left,a=r.top,s=r.width,l=r.height;return new Pe(o,a+n,s,l,3)}function ii(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.cellRect(e.sri,e.sci),r=n.left,o=n.top,a=t.cols.sumWidth(e.sci,e.eci+1),s=t.rows.sumHeight(e.sri,e.eri+1);return new Pe(r,o+i,a,s,3)}function ni(t,e,i,n,r,o,a){var s=t.cols,l=t.viewRangeCache;if(!a.textwrap&&o.text&&o.text.length>0){var c=0,h=0;if(void 0===a.align||"center"===a.align||"left"===a.align)for(var u=r+1;u<=l.eci;u++){var f=t.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(a.align&&("center"===a.align||"right"===a.align))for(var d=r-1;d>=l.sci;d--){var v=t.getCell(i,d);if(null!==v&&void 0!==v.text&&v.text.length>0)break;h+=s.getWidth(d)}c>0&&(e.exttxtwidthR=c),h>0&&(e.exttxtwidthL=h)}}function ri(t){var e=[],i=[],n=[],r=0;if(void 0!==t.rtxt&&void 0===t.bigfontsize){for(var o=t.rtxt.length,a=0;a<o;a++){var s=t.rtxt[a].txt.split("\n"),l=s.length,c=t.rtxt[a].font.size;if(1===l)n.push(t.rtxt[a]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=t.rtxt[a].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),e.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=t.rtxt[a].font,f.txt=s[u],n.push(f),e.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=t.rtxt[a].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),e.push(n)),t.rtxt=e,t.bigfontsize=i}}function oi(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=e.sortedRowMap,s=e.rows,l=e.cols;e.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;a.has(i)&&(c=a.get(i));var h=e.getCell(c,n);if(null!==h&&(!h.merge||o)){ri(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=e.getCellStyleOrDefault(c,n),d=ei(e,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var v=d,g=!1,p=!1;f.hasbgcolor&&!o&&((e.bgcolor||void 0===f.border||void 0===f.border.right)&&(v.width+=3,g=!0),(e.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(v.height+=3,p=!0)),ni(e,d,c,0,n,h,f);var m=e.getHighlightCellTxt(i,n);t.rect(v,(function(){var i="";i=e.settings.evalPaused||"server"===e.settings.updateMode?h.text||"":Ve(h.text||"",fe,(function(t,i){return e.getCellTextOrDefault(i,t)})),f.format&&"server"!==e.settings.updateMode&&(i=Ze[f.format].render(i));var r=Object.assign({},f.font);r.size=We(r.size),void 0===h.rtxt?""!==i&&t.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,m):t.richtext(h,d,f.align,f.valign,f.textwrap,m),e.validations.getError(c,n)&&t.error(d),u&&t.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),t.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),p&&(d.height-=3),d.setBorders(f.border),t.strokeBorders(d))}}}function ai(t){var e=this.data,i=this.draw;if(t){var n=e.autoFilter,r=e.TableAutoFilters;si(e,t,i,n),r.forEach((function(n){si(e,t,i,n)}))}}function si(t,e,i,n){if(n.active()){var r=n.hrange();e.intersects(r)&&r.each((function(e,n){var r=ei(t,e,n);i.dropdown(r)}))}}function li(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r),a.comments.forEach((function(e){if(t.sri<=e.row&&t.eri>=e.row&&t.sci<=e.col&&t.eci>=e.col){var i=ei(a,e.row,e.col);o.error(i,a.displayRight2Left)}})),o.restore()}function ci(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r);var s=a.exceptRowSet;o.save(),o.translate(0,-0),t.emptyFirst((function(t,e){oi(o,a,t,e)}),(function(t){return function(t){return!s.has(t)}(t)}),(function(t,e){return a.isEmpty(t,e)})),o.restore();var l=new Set;o.save(),o.translate(0,-0),a.eachMergesInView(t,(function(t){var e=t.sri,i=t.sci,n=t.eri;if(s.has(e)){if(!l.has(e)){l.add(e);var r=a.rows.sumHeight(e,n+1);o.translate(0,-r)}}else oi(o,a,e,i,0,!0)})),o.restore(),ai.call(this,t),o.restore()}function hi(t,e,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(t,e,i,n),r.restore()}function ui(t,e,i,n,r,o){var a=this,s=this.draw,l=this.data,c=e.h,h=e.w,u=o+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,v=l.displayRight2Left?d-i:0;if(s.save(),s.attr(Qe),"all"!==t&&"left"!==t||s.fillRect(v,u,i,c),"all"===t||"top"===t)if(l.displayRight2Left){var g=e.lineStartx?e.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var m=l.selector.range,y=m.sri,b=m.sci,w=m.eri,x=m.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Re(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Ee(),strokeStyle:"#e6e6e6"}),"all"===t||"left"===t){var C=v;l.rowEach(e.sri,e.eri,(function(t,e,n){var r=u+e,o=t;s.line([C,r],[C+i,r]),y<=o&&o<w+1&&hi.call(a,C,r,i,n),s.fillText(o+1,C+i/2,r+n/2),t>0&&l.rows.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([C+5,r+5],[C+i-5,r+5]),s.restore())})),s.line([C,c+u],[C+i,c+u]),s.line([C+i,u],[C+i,c+u])}"all"!==t&&"top"!==t||(l.colEach(e.sci,e.eci,(function(t,e,i){var r=l.displayRight2Left?d-(f+e+i):f+e,o=t;s.line([r,0],[r,n]),b<=o&&o<x+1&&hi.call(a,r,0,i,n),s.fillText(p(o),r+i/2,n/2),t>0&&l.cols.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function fi(t,e){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,t,e),i.restore()}function di(t,e,i,n,o){var a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=t.w,u=t.h,f=t.clearStartx,d=void 0===f?0:f,v=t.lineStartx,g=void 0===v?0:v,p=this.draw,m=this.data,y=(m.settings,m.displayRight2Left),b=m.scroll;if(p.save(),y?p.attr(ti).translate(-(e+n),i+o):p.attr(ti).translate(e+n,i+o),p.clearRect(d,0,h,u),m.bgcolor&&p.fillRectWithColor(m.bgcolor,d,0,h,u),m.showGrid&&!m.bgcolor){if(y){h+=e+n;var w=r()(m.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=m.viewWidth()),m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([g,e],[g+h,e]),t===l&&p.line([g,e+i],[g+h,e+i])}))}else m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([0,e],[h,e]),t===l&&p.line([0,e+i],[h,e+i])}));if(y){var C=m.viewWidth();m.colEach(s,c,(function(t,e,i){p.line([C-e-i,0],[C-e-i,u]),t===s&&p.line([C-e,0],[C-e,u])}))}else m.colEach(s,c,(function(t,e,i){t!==s&&p.line([e,0],[e,u]),t===c&&p.line([e+i,0],[e+i,u])}));p.restore()}else p.restore()}function vi(t,e,i,n){var r=this.draw,o=this.data,a=o.viewWidth(),s=(a-t)/this.zoomlevel,l=(o.viewHeight()-e)/this.zoomlevel;o.displayRight2Left?r.save().translate(-t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),o.displayRight2Left?(r.line([0,n],[a,n]),r.line([a-i,0],[a-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var gi=function(){function t(e,i){l()(this,t),this.el=e,this.draw=new ze(e.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(e),this.data=i,this.zoomlevel=1}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.render()}},{key:"clearSelectRender",value:function(){var t=this.data,e=this.draw,i=this.zoomlevel,n=t.selector,r=n.ri,o=n.ci,a=r;t.sortedRowMap.has(r)&&(a=sortedRowMap.get(r));var s=t.getCell(a,o);if(null!==s){var l=t.getCellStyleOrDefault(a,o),c=ei(t,r,o,0);ni(t,c,a,0,o,s,l);var h=t.cols.indexWidth,u=t.settings.row.height,f=t.freezeTotalWidth(),d=t.scroll,v=d.x,g=d.y;e.save(),e.scaledpr(i),t.displayRight2Left?e.attr(ti).translate(-(h+f),u+0):e.attr(ti).translate(h+f,u+0);var p=void 0===c.exttxtwidthR?0:c.exttxtwidthR,m=void 0===c.exttxtwidthL?0:c.exttxtwidthL;e.fillRect(c.x+1-m-v,c.y+1-g,c.width+p+m-2,c.height-2),e.restore()}}},{key:"render",value:function(){var t=this.data,e=this.zoomlevel;if(!t.isupdating){var i=t.rows,n=t.cols;if(0!==Object.keys(i._).length){var o=n.indexWidth,a=t.settings.row.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.draw.scaledpr(e),this.clear();var s=t.viewRange(),l=t.freezeTotalWidth(),c=t.freezeTotalHeight(),h=t.scroll,u=h.x,f=h.y;di.call(this,s,o,a,l,c),ci.call(this,s,o,a,-u,-f),li.call(this,s,o,a,-u,-f),ui.call(this,"all",s,o,a,l,c),fi.call(this,o,a);var d=r()(t.freeze,2),v=d[0],g=d[1];if(v>0||g>0){if(v>0){var p=s.clone();p.sri=0,p.eri=v-1,p.h=c,di.call(this,p,o,a,l,0),ci.call(this,p,o,a,-u,0),li.call(this,p,o,a,-u,0),ui.call(this,"top",p,o,a,l,0)}if(g>0){var m=s.clone();m.sci=0,m.eci=g-1,m.w=l,m.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,m.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,di.call(this,m,o,a,0,c),ui.call(this,"left",m,o,a,0,c),ci.call(this,m,o,a,0,-f),li.call(this,m,o,a,0,-f)}var y=t.freezeViewRange();y.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,di.call(this,y,o,a,0,0),ui.call(this,"all",y,o,a,0,0),ci.call(this,y,o,a,0,0),li.call(this,y,o,a,0,0),vi.call(this,o,a,l,c)}this.highlightRanges(s,o,a,u,f)}}}},{key:"highlightRanges",value:function(t,e,i,n,r){var o=this.draw,a=this.data;if(a.showhighlight){if(o.save(),a.displayRight2Left?o.translate(-e,i).translate(-n,-r):o.translate(e,i).translate(-n,-r),a.highlightall){var s=ii(a,t);s.bgcolor=a.highlightstyle.color,o.rect(s,(function(){}))}else if(a.highlightIR){var l,c=Je(t.difference(a.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=ii(a,l.value);h.bgcolor=a.highlightstyle.color,o.rect(h,(function(){}))}}catch(t){c.e(t)}finally{c.f()}}else{var u,f=Je(a.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(t.intersects(d)){var v=d.clone();v.sri<t.sri&&(v.sri=t.sri),v.eri>t.eri&&(v.eri=t.eri),v.sci<t.sci&&(v.sci=t.sci),v.eci>t.eci&&(v.eci=t.eci);var g=ii(a,v);g.bgcolor=a.highlightstyle.color,o.rect(g,(function(){}))}}}catch(t){f.e(t)}finally{f.f()}}o.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),t}(),pi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],mi=["landscape","portrait"];function yi(t){return parseInt(96*t,10)}function bi(t){"cancel"===t?this.el.hide():this.toPrint()}function wi(t){var e=this.paper,i=t.target.value,n=pi[i];e.w=yi(n[1]),e.h=yi(n[2]),this.preview()}function xi(t){var e=this.paper,i=t.target.value,n=mi[i];e.orientation=n,this.preview()}var Ci=function(){function t(e,i){var n,r;l()(this,t),this.paper={w:yi(pi[0][1]),h:yi(pi[0][2]),padding:50,orientation:mi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=e,this.imageCanvas=i,this.el=f("div","".concat(ot,"-print")).children(f("div","".concat(ot,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ot,"-buttons")).children(new Te("cancel").on("click",bi.bind(this,"cancel")),new Te("next","primary").on("click",bi.bind(this,"next"))))),f("div","".concat(ot,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(W("print.size"))),(n=f("select","")).children.apply(n,v()(pi.map((function(t,e){return f("option","").attr("value",e).child("".concat(t[0]," ( ").concat(t[1],"''x").concat(t[2],"'' )"))})))).on("change",wi.bind(this))),f("fieldset","").children(f("label","").child("".concat(W("print.orientation"))),(r=f("select","")).children.apply(r,v()(mi.map((function(t,e){return f("option","").attr("value",e).child("".concat(W("print.orientations")[e]))})))).on("change",xi.bind(this))))))).hide()}return a()(t,[{key:"resetData",value:function(t){this.data=t}},{key:"preview",value:function(){var t=this,e=this.data,i=this.paper,n=i.width,r=i.height,o=i.padding,a=n-2*o,s=r-2*o,l=e.contentRange(),c=parseInt(l.h/s,10)+1,h=a/l.w,u=o,d=o;h>1&&(u+=(a-l.w)/2);var v=0,g=0;this.contentEl.html(""),this.canvases=[];for(var p={sri:0,sci:0,eri:0,eci:0},m=function(i){var o=0,a=0,c=f("div","".concat(ot,"-canvas-card")),m=f("canvas","".concat(ot,"-canvas"));t.canvases.push(m.el);var y=new ze(m.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);v<=l.eri;v+=1){var b=e.rows.getHeight(v);if(!((o+=b)<s)){a=-(o-b);break}for(var w=0;w<=l.eci;w+=1)oi(y,e,v,w,g),p.eci=w}p.eri=v,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;e.eachMergesInView(p,(function(t){var i=t.sri,n=t.sci;oi(y,e,i,n,x)})),y.restore(),p.sri=p.eri,p.sci=p.eci,g+=a;var C=t.imageCanvas.el.getContext("2d");C.width=n,C.height=r,C.translate(u,d),h<1&&C.scale(h,h),m.el.getContext("2d").drawImage(t.imageCanvas.el,u-t.imageCanvas.tOffset.left,t.imageCanvas.tOffset.top),t.contentEl.child(f("div","".concat(ot,"-canvas-card-wraper")).child(c.child(m)))},y=0;y<c;y+=1)m()}},{key:"toPrint",value:function(){this.el.hide();var t=this.paper,e=f("iframe","").hide().el;window.document.body.appendChild(e);var i=e.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(t.width,"px ").concat(t.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(t){var e=t.cloneNode(!1);e.getContext("2d").drawImage(t,0,0),n.body.appendChild(e)})),i.print()}}]),t}(),ki=[{key:"copy",title:U("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:U("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:U("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:U("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:U("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:U("contextmenu.insertRow")},{key:"insert-column",title:U("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:U("contextmenu.deleteRow")},{key:"delete-column",title:U("contextmenu.deleteColumn")},{key:"delete-cell-text",title:U("contextmenu.deleteCellText")},{key:"hide",title:U("contextmenu.hide")},{key:"divider"},{key:"link",title:U("contextmenu.link")},{key:"openLink",title:U("contextmenu.openLink")},{key:"removeLink",title:U("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:U("contextmenu.validation")},{key:"cell-editable",title:U("contextmenu.celleditable")},{key:"cell-non-editable",title:U("contextmenu.cellnoneditable")}];function _i(t,e){var i=this,n=null;return(n="divider"===t.key?f("div","".concat(ot,"-item divider")):f("div","".concat(ot,"-item")).on("click",(function(){t.callback?t.callback(e,e.selector.getObj()):i.itemClick(t.key),i.hide()})).children(t.text?t.text:t.title(),f("div","label").child(t.label||"").attr("k",t.key))).key=t.key,n}function Si(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ki,i=arguments.length>1?arguments[1]:void 0;return e.map((function(e){return _i.call(t,e,i)}))}function Ti(t,e){return t.find((function(t){return t.key===e}))}var Oi=function(){function t(e,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;if(l()(this,t),window.mobileAndTabletCheck()){var a={key:"merge",title:U("contextmenu.merge"),label:""},s={key:"unmerge",title:U("contextmenu.unmerge"),label:""},c={key:"edit",title:U("contextmenu.edit"),label:""};ki.forEach((function(t){t.label=void 0,"delete-cell-text"===t.key&&(t.title=U("contextmenu.clear"))})),ki.push(a),ki.push(s),ki.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:U("contextmenu.deleteImage"),label:"Del"}],this.customsetting=o&&!o.usedefault,this.customItems=this.customsetting?o.customItems:[],this.menuItems=this.customsetting?Si.call(this,o.customItems,i):Si.call(this),this.el=(n=f("div","".concat(ot,"-contextmenu"))).children.apply(n,v()(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return a()(t,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t.key}));i>=0&&e.splice(i,1)})),e.push.apply(e,t)}},{key:"delImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t}));i>=0&&e.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(t){this.addImageContextMenuItems([t])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var o=Si.call(this,t,n);t.forEach((function(t,i){"divider"!==t.key&&Ti(e,t.key)||(e.push(t),r.push(o[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n&&("divider"===t.key||!Ti(i,t.key))){var a=_i.call(this,t,r);i.splice(e,0,t),o.splice(e,0,a),this.rebuildMenuItems(o)}}},{key:"updateCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n){var a=i.findIndex((function(e){return e.key==t}));if(-1!==a){e.text&&(i[a].text=e.text),e.callback&&(i[a].callback=e.callback);var s=_i.call(this,i[a],r);o[a]=s,this.rebuildMenuItems(o)}}}},{key:"rebuildMenuItems",value:function(t){var e,i=this.sheet;(i.el.removeChild(this.el.el),t.length>0)?this.el=(e=f("div","".concat(ot,"-contextmenu"))).children.apply(e,v()(t)).hide():this.el=f("div","".concat(ot,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(t.forEach((function(t){var n=e.findIndex((function(e){return e.key===t}));n>=0&&(e.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(t){if(!this.customsetting){var e=this.menuItems[12];"row-col"===t?e.show():e.hide()}}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setPosition",value:function(t,e){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),o=r.width,a=r.height,s=this.viewFn(),l=t;s.width-t<=o&&(l-=o),i.css("left","".concat(l,"px"));var c=e;a+e>s.height&&(c-=a+e-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Rt(i)}}},{key:"showImageDeleteItem",value:function(t,e){var i=this,n=this.customMenuItemsForImage;n.forEach((function(e){t.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===e.key&&t.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=e.canvas.fabric.getActiveObject();if(null!=r){"OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:U("contextmenu.download"),callback:function(){e.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]);var o=Si.call(this,n,e);o.unshift.apply(o,v()(Si([{key:"divider"}]))),o.forEach((function(t){return i.el.child(t,!0)})),e.selector.hide(),e.selector.setObjId(r.id)}}}]),t}(),Ei=i(9),Ri=i.n(Ei);var Ai=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,t),this.tip=W("toolbar.".concat(e.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),this.activeTip=null===i?null:W("toolbar.".concat(i.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return a()(t,[{key:"element",value:function(){var t=this.tip,e=this.activeTip;return f("div","".concat(ot,"-toolbar-btn")).on("mouseenter",(function(i){""!==t&&function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.classList.contains("active")||null!==i){var n=e.getBoundingClientRect(),r=n.left,o=n.top,a=n.width,s=n.height,l=e.classList.contains("active")?i:t,c=f("div","".concat(ot,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+a/2-h.width/2,"px")).css("top","".concat(o+s+2,"px")),Tt(e,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Tt(e,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(t,i.target,e)})).attr("data-tooltip",t)}},{key:"setState",value:function(){}}]),t}();function Ii(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Pi=function(t){tt()(i,t);var e=Ii(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(t){return t}},{key:"element",value:function(){var t=this,e=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return t.change(e,t.getValue(i))},Ri()(rt()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}]),i}(Ai);function Di(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Fi=function(t){tt()(i,t);var e=Di(i);function i(t,n,r,o){var a,s;l()(this,i),(s=e.call(this,"div","".concat(ot,"-dropdown ").concat(o))).title=t,s.change=function(){},s.headerClick=function(){},"string"==typeof t?s.title=f("div","".concat(ot,"-dropdown-title")).child(t):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ot,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(t){return t.tag})),(a=s).setContentChildren.apply(a,h),s.headerEl=f("div","".concat(ot,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var t=s.menuDiv.el,e=s.menuDiv.el.offsetParent;t.offsetParent&&"BODY"!==t.offsetParent.nodeName;)t=t.offsetParent;s.contentEl.el.clientWidth-t.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=e.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ot,"-icon arrow-right")).child(f("div","".concat(ot,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return a()(i,[{key:"setContentChildren",value:function(){var t;(this.contentEl.html(""),arguments.length>0)&&(t=this.contentEl).children.apply(t,arguments)}},{key:"showExplain",value:function(t){var e=this;if(this.contentEl.children().length===t.length)for(var i=function(i){Tt(e.contentEl.children()[i],"mouseover",(function(){var n=new te(t[i].title()),r=te.findDialog(e.contentEl),o={top:"".concat(e.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var a=0;a<r.length;a++)e.contentEl.removeChild(e.contentEl.children()[r[a]]);n.css(o),e.contentEl.child(n)})),Tt(e.contentEl.children()[i],"mouseout",(function(){var t=te.findDialog(e.contentEl);if(0!==t.length)for(var i=0;i<t.length;i++)e.contentEl.removeChild(e.contentEl.children()[t[i]])}))},n=0;n<t.length;n++)i(n)}},{key:"setTitle",value:function(t){this.title.html(t),this.hide()}},{key:"show",value:function(){var t=this;this.contentEl.show(),this.parent().active(),Rt(this.parent(),(function(){t.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Et(this.parent())}}]),i}(u);function Mi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ji=function(t){tt()(i,t);var e=Mi(i);function i(t,n){var r;l()(this,i);var o=new st("align-".concat(n)),a=t.map((function(t){return(e="align-".concat(t),f("div","".concat(ot,"-item")).child(new st(e))).on("click",(function(){r.setTitle(t),r.change(t)}));var e}));return r=e.call.apply(e,[this,o,"auto",!0,"bottom-left"].concat(v()(a)))}return a()(i,[{key:"setTitle",value:function(t){this.title.setName("align-".concat(t)),this.hide()}}]),i}(Fi);function Li(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Bi=function(t){tt()(i,t);var e=Li(i);function i(t){return l()(this,i),e.call(this,"align",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new ji(["left","center","right"],t)}}]),i}(Pi);function zi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Hi=function(t){tt()(i,t);var e=zi(i);function i(t){return l()(this,i),e.call(this,"valign",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new ji(["top","middle","bottom"],t)}}]),i}(Pi);function Ni(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Wi=function(t){tt()(i,t);var e=Ni(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this,e=this.tag;return Ri()(rt()(i.prototype),"element",this).call(this).child(new st(e)).on("click",(function(){return t.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(t){this.el.active(t)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ai);function Ui(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Xi=function(t){tt()(i,t);var e=Ui(i);function i(){return l()(this,i),e.call(this,"autofilter")}return a()(i,[{key:"setState",value:function(){}}]),i}(Wi);function Yi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Vi=function(t){tt()(i,t);var e=Yi(i);function i(){return l()(this,i),e.call(this,"font-bold",null,"Ctrl+B")}return i}(Wi);function Gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qi=function(t){tt()(i,t);var e=Gi(i);function i(){return l()(this,i),e.call(this,"font-italic",null,"Ctrl+I")}return i}(Wi);function Ki(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Zi=function(t){tt()(i,t);var e=Ki(i);function i(){return l()(this,i),e.call(this,"strike")}return i}(Wi);function Ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var $i=function(t){tt()(i,t);var e=Ji(i);function i(){return l()(this,i),e.call(this,"underline",null,"Ctrl+U")}return i}(Wi),Qi=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],tn=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],en=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function nn(t){var e=this;return f("td","").child(f("div","".concat(ot,"-color-palette-cell")).on("click.stop",(function(){return e.change(t)})).css("background-color",t))}var rn=function t(){var e,i,n,r=this;l()(this,t),this.el=f("div","".concat(ot,"-color-palette")),this.change=function(){};var o=f("table","").children((e=f("tbody","")).children.apply(e,[(i=f("tr","".concat(ot,"-theme-color-placeholders"))).children.apply(i,v()(Qi.map((function(t){return nn.call(r,t)}))))].concat(v()(tn.map((function(t){var e;return(e=f("tr","".concat(ot,"-theme-colors"))).children.apply(e,v()(t.map((function(t){return nn.call(r,t)}))))}))),[(n=f("tr","".concat(ot,"-standard-colors"))).children.apply(n,v()(en.map((function(t){return nn.call(r,t)}))))])));this.el.child(o)};function on(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var an=function(t){tt()(i,t);var e=on(i);function i(t,n){var r;l()(this,i);var o=new st(t).css("height","16px").css("border-bottom","3px solid ".concat(n)),a=new rn;return a.change=function(t){r.setTitle(t),r.change(t)},r=e.call(this,o,"max-content",!1,"bottom-left",a.el)}return a()(i,[{key:"setTitle",value:function(t){this.title.css("border-color",t),this.hide()}}]),i}(Fi);function sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ln=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],cn=function(t){tt()(i,t);var e=sn(i);function i(t){var n;l()(this,i);var r=new st("line-type"),o=0,a=ln.map((function(e,i){return f("div","".concat(ot,"-item state ").concat(t===e[0]?"checked":"")).on("click",(function(){a[o].toggle("checked"),a[i].toggle("checked"),o=i,n.hide(),n.change(e)})).child(f("div","".concat(ot,"-line-type")).html(e[1]))}));return n=e.call.apply(e,[this,r,"max-content",!1,"bottom-left"].concat(v()(a)))}return i}(Fi);function hn(){var t;return f("table","").child((t=f("tbody","")).children.apply(t,arguments))}function un(t){var e=this;return f("td","").child(f("div","".concat(ot,"-border-palette-cell")).child(new st("border-".concat(t))).on("click",(function(){e.mode=t;var i=e.mode,n=e.style,r=e.color;e.change({mode:i,style:n,color:r})})))}var fn=function t(){var e,i,n=this;l()(this,t),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new an("line-color",this.color),this.ddColor.change=function(t){n.color=t},this.ddType=new cn(this.style),this.ddType.change=function(t){var e=r()(t,1)[0];n.style=e},this.el=f("div","".concat(ot,"-border-palette"));var o=hn(f("tr","").children(f("td","".concat(ot,"-border-palette-left")).child(hn((e=f("tr","")).children.apply(e,v()(["all","inside","horizontal","vertical","outside"].map((function(t){return un.call(n,t)})))),(i=f("tr","")).children.apply(i,v()(["left","top","right","bottom","none"].map((function(t){return un.call(n,t)})))))),f("td","".concat(ot,"-border-palette-right")).children(f("div","".concat(ot,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ot,"-toolbar-btn")).child(this.ddType.el))));this.el.child(o)};function dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var vn=function(t){tt()(i,t);var e=dn(i);function i(){var t;l()(this,i);var n=new st("border-all"),r=new fn;return r.change=function(e){t.change(e),t.hide()},t=e.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Fi);function gn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var pn=function(t){tt()(i,t);var e=gn(i);function i(){return l()(this,i),e.call(this,"border")}return a()(i,[{key:"dropdown",value:function(){return new vn}}]),i}(Pi);function mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var yn=function(t){tt()(i,t);var e=mn(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this;return this.icon=new st(this.tag),Ri()(rt()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return t.change(t.tag)}))}},{key:"setState",value:function(t){this.el.disabled(t)}},{key:"setIcon",value:function(t){this.icon.setName(t)}}]),i}(Ai);function bn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var wn=function(t){tt()(i,t);var e=bn(i);function i(){return l()(this,i),e.call(this,"clearformat")}return i}(yn);function xn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Cn=function(t){tt()(i,t);var e=xn(i);function i(){return l()(this,i),e.call(this,"paintformat")}return a()(i,[{key:"setState",value:function(){}}]),i}(Wi);function kn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var _n=function(t){tt()(i,t);var e=kn(i);function i(t){return l()(this,i),e.call(this,"color",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new an(t,e)}}]),i}(Pi);function Sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Tn=function(t){tt()(i,t);var e=Sn(i);function i(t){return l()(this,i),e.call(this,"bgcolor",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new an(t,e)}}]),i}(Pi);function On(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var En=function(t){tt()(i,t);var e=On(i);function i(){var t;l()(this,i);var n=Ne.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.pt)),t.change(e)})).child("".concat(e.pt))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Fi);function Rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var An=function(t){tt()(i,t);var e=Rn(i);function i(){return l()(this,i),e.call(this,"font-size")}return a()(i,[{key:"getValue",value:function(t){return t.pt}},{key:"dropdown",value:function(){return new En}}]),i}(Pi);function In(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Pn=function(t){tt()(i,t);var e=In(i);function i(){var t;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.text)),t.change(e)})).child("".concat(e.text))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Fi);function Dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Fn=function(t){tt()(i,t);var e=Dn(i);function i(){return l()(this,i),e.call(this,"zoom-size")}return a()(i,[{key:"getValue",value:function(t){return t}},{key:"setState",value:function(t){"string"!=typeof t&&(t=100*t+"%"),Ri()(rt()(i.prototype),"setState",this).call(this,t)}},{key:"dropdown",value:function(){return new Pn}}]),i}(Pi);function Mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var jn=function(t){tt()(i,t);var e=Mn(i);function i(){var t;l()(this,i);var n=He.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle(e.title),t.change(e)})).child(e.title)}));return t=e.call.apply(e,[this,He[0].title,"max-content",!0,"bottom-left"].concat(v()(n)))}return i}(Fi);function Ln(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Bn=function(t){tt()(i,t);var e=Ln(i);function i(){return l()(this,i),e.call(this,"font-name")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new jn}}]),i}(Pi);function zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Hn=function(t){tt()(i,t);var e=zn(i);function i(){var t;l()(this,i);var n=Ke.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(e){var i=f("div","".concat(ot,"-item"));return"divider"===e.key?i.addClass("divider"):(i.child(e.title()).on("click",(function(){t.setTitle(e.title()),t.change(e)})),e.label&&i.child(f("div","label").html(e.label))),i})),t=e.call.apply(e,[this,"Normal","220px",!0,"bottom-left"].concat(v()(n)))}return a()(i,[{key:"setTitle",value:function(t){for(var e=0;e<Ke.length;e+=1)Ke[e].key===t&&this.title.html(Ke[e].title());this.hide()}}]),i}(Fi);function Nn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Wn=function(t){tt()(i,t);var e=Nn(i);function i(){return l()(this,i),e.call(this,"format")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Hn}}]),i}(Pi),Un=i(8),Xn=i.n(Un);function Yn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Vn=function(t){tt()(i,t);var e=Yn(i);function i(){var t,n;l()(this,i);var r=he.map((function(t){return f("div","".concat(ot,"-item")).on("click",(function(){n.hide(),n.change(t)})).child(t.key)}));return n=e.call.apply(e,[this,new st("formula"),"max-content",!0,"bottom-left"].concat(v()(r))),Ri()((t=Xn()(n),rt()(i.prototype)),"showExplain",t).call(t,he),n}return i}(Fi);function Gn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qn=function(t){tt()(i,t);var e=Gn(i);function i(){return l()(this,i),e.call(this,"formula")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Vn}}]),i}(Pi);function Kn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Zn=function(t){tt()(i,t);var e=Kn(i);function i(){return l()(this,i),e.call(this,"freeze")}return i}(Wi);function Jn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var $n=function(t){tt()(i,t);var e=Jn(i);function i(){return l()(this,i),e.call(this,"merge","unmerge")}return a()(i,[{key:"setState",value:function(t,e){this.el.active(t).disabled(e)}}]),i}(Wi);function Qn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var tr=function(t){tt()(i,t);var e=Qn(i);function i(){return l()(this,i),e.call(this,"print","Ctrl+P")}return i}(yn);function er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ir=function(t){tt()(i,t);var e=er(i);function i(){return l()(this,i),e.call(this,"textwrap")}return i}(Wi);function nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var rr=function(t){tt()(i,t);var e=nr(i);function i(){var t;l()(this,i);var n=new st("ellipsis"),r=f("div","".concat(ot,"-toolbar-more"));return(t=e.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?t.contentEl.css("max-width","200px"):t.contentEl.css("max-width","420px"),t}return i}(Fi),or=function(t){tt()(i,t);var e=nr(i);function i(){var t;return l()(this,i),(t=e.call(this,"more")).el.hide(),t}return a()(i,[{key:"dropdown",value:function(){return new rr}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Pi);function ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var sr=function(t){tt()(i,t);var e=ar(i);function i(){return l()(this,i),e.call(this,"sort")}return i}(yn);function lr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var cr=function(t){tt()(i,t);var e=lr(i);function i(){return l()(this,i),e.call(this,"search")}return i}(yn);function hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ur=function(t){tt()(i,t);var e=hr(i);function i(){return l()(this,i),e.call(this,"commentEdit")}return i}(yn);function fr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var dr=function(t){tt()(i,t);var e=fr(i);function i(){return l()(this,i),e.call(this,"commentRemove")}return i}(yn);function vr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var gr=function(t){tt()(i,t);var e=vr(i);function i(){return l()(this,i),e.call(this,"commentPrevious")}return i}(yn);function pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var mr=function(t){tt()(i,t);var e=pr(i);function i(){return l()(this,i),e.call(this,"commentNext")}return i}(yn);function yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var br=function(t){tt()(i,t);var e=yr(i);function i(){var t;l()(this,i);var n=new st("".concat(ot,"-icon-img insert-image")),r=f("div","".concat(ot,"-item")),o=f("input");o.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var a=f("label");a.attr("for","upload-image"),a.child(new st("".concat(ot,"-icon-img insert-image-local"))),a.child(" "+W("menubar.".concat(r.tag))),r.child(o),r.child(a),r.on("click",(function(){t.change("local")}));var s,c=(s="".concat(ot,"-icon-img insert-image-url"),f("div","".concat(ot,"-item")).child(new st(s)));return c.tag="fromURL",c.child(" "+W("menubar.".concat(c.tag))),c.on("click",(function(){t.change("url")})),t=e.call.apply(e,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Fi);function wr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var xr=function(t){tt()(i,t);var e=wr(i);function i(t){return l()(this,i),e.call(this,"insert-image",null,"",t)}return a()(i,[{key:"dropdown",value:function(){return new br}}]),i}(Pi);function Cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var kr=function(t){tt()(i,t);var e=Cr(i);function i(){var t;return l()(this,i),(t=e.call(this,"menu-display-hide","")).state="up",t}return a()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(yn);function _r(){return f("div","".concat(ot,"-toolbar-divider"))}function Sr(){var t=this;this.btns2=[],this.items.forEach((function(e){if(Array.isArray(e))e.forEach((function(e){var i=e.el,n=i.box(),r=i.computedStyle(),o=r.marginLeft,a=r.marginRight;t.btns2.push([i,n.width+parseInt(o,10)+parseInt(a,10)])}));else{var i=e.box(),n=e.computedStyle(),r=n.marginLeft,o=n.marginRight;t.btns2.push([e,i.width+parseInt(r,10)+parseInt(o,10)])}}))}function Tr(){var t,e,i=this.el,n=this.btns,o=this.moreEl,a=this.btns2,s=o.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],v=[];a.forEach((function(t,e){var i=r()(t,2),n=i[0],o=i[1];u+=o,e===a.length-1||u<h.width?d.push(n):(f+=o,v.push(n))})),(t=n.html("")).children.apply(t,d),(e=l.html("")).children.apply(e,v),c.css("width","".concat(f,"px")),v.length>0?o.show():o.hide()}var Or=function(){function t(e,i,n,r){var o=this;l()(this,t),this.data=e,this.change=function(){},this.widthFn=i,this.isHide=n;var a=e.defaultStyle();this.items=[[new tr,this.paintformatEl=new Cn,this.clearformatEl=new wn],_r(),[this.formatEl=new Wn],_r(),[this.fontEl=new Bn,this.fontSizeEl=new An],_r(),[this.zoomSizeEl=new Fn,this.boldEl=new Vi,this.italicEl=new qi,this.underlineEl=new $i,this.strikeEl=new Zi,this.textColorEl=new _n(a.color)],_r(),[this.fillColorEl=new Tn(a.bgcolor),this.borderEl=new pn,this.mergeEl=new $n],_r(),[this.alignEl=new Bi(a.align),this.valignEl=new Hi(a.valign),this.textwrapEl=new ir],_r(),[this.freezeEl=new Zn,this.autofilterEl=new Xi,this.formulaEl=new qn,this.sortEl=new sr,this.insertImageEL=new xr,this.searchEl=new cr],_r(),[this.commentEditEl=new ur,this.commentRemoveEl=new dr,this.commentPreviousEl=new gr,this.commentNextEl=new mr],_r(),[this.moreEl=new or]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new tr,this.moreEl=new or,this.sortEl=new sr,this.searchEl=new cr]]),this.el=f("div","".concat(ot,"-toolbar")),this.btns=f("div","".concat(ot,"-toolbar-btns")),this.items.forEach((function(t){Array.isArray(t)?t.forEach((function(t){o.btns.child(t.el),t.change=function(){o.change.apply(o,arguments)}})):o.btns.child(t.el)}));var s=this.menuDisplay=new kr;s.change=function(){o.change.apply(o,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Sr.call(o),Tr.call(o)}),0),Tt(window,"resize",(function(){Tr.call(o)})))}return a()(t,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(t){this["".concat(t,"El")].click()}},{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle();this.mergeEl.setState(t.canUnmerge(),!1),this.autofilterEl.setState(!t.canAutofilter());var i=e.font,n=e.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(t.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive())}}}]),t}(),Er=function(){function t(e,i){var n,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,t),this.moving=!1,this.drag=s,this.title=e;var c=parseInt(o);screen.width<500&&c>300&&(o="300px"),this.el=f("div","".concat(ot,"-modal")).css("width",o).css("position","absolute").children(f("div","".concat(ot,"-modal-header")).children(new st("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ot,"-modal-content"))).children.apply(n,v()(i))).hide(),this.showDimmer=a,this.drag&&this.el.on("mousedown.stop",(function(t){return r.mousedownHandler(t)}))}return a()(t,[{key:"show",value:function(){var t=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ot,"-dimmer active")),document.body.appendChild(this.dimmer.el));var e=this.el.show().box(),i=e.width,n=e.height,r=document.documentElement,o=r.clientHeight,a=r.clientWidth;this.el.offset({left:(a-i)/2,top:(o-n)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},Tt(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Ot(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(t){var e=this,i=t;At(window,(function(t){if(e.moving=!0,null!==i){var n=e.el.offset(void 0);e.el.offset({left:n.left+t.movementX,top:n.top+t.movementY}),i=t}}),(function(){i=null,e.moving=!1}))}}]),t}(),Rr=function(){function t(e,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,t),this.vchange=function(){},this.el=f("div","".concat(ot,"-form-input")),this.input=f("input","").css("width",e).on("input",(function(t){return n.vchange(t)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return a()(t,[{key:"focus",value:function(){var t=this;setTimeout((function(){t.input.el.focus()}),10)}},{key:"hint",value:function(t){this.input.attr("placeholder",t)}},{key:"setReadonly",value:function(t){t?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(t){return this.input.val(t)}}]),t}();function Ar(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Ir(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ir(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Pr=function(){function t(e,i,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,t),this.key=e,this.getTitle=o,this.change=a,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ot,"-form-select")),this.suggest=new oe(i.map((function(t){return{key:t,title:r.getTitle(t)}})),(function(t){r.itemClick(t.key),a(t.key),r.vchange(t.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(e)),this.suggest.el).on("click",(function(){return r.show()}))}return a()(t,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(t){this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t))}},{key:"setItemsMap",value:function(t){var e=this;this.itemsmap=t;var i,n=[],o=Ar(t);try{for(o.s();!(i=o.n()).done;){var a=r()(i.value,2),s=a[0],l=a[1];n.push({key:s,title:l})}}catch(t){o.e(t)}finally{o.f()}this.suggest=new oe(n,(function(t){e.itemClick(t.key),e.change(t.key),e.vchange(t.key)}),this.width,this.el),t.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(t){return void 0!==t?(this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t)),this):this.key}}]),t}(),Dr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Fr=function(){function t(e,i,n,r){var o=this;l()(this,t),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=f("div","".concat(ot,"-form-field")).children(this.label,e.el,this.tip)}return a()(t,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(t){return this.input.val(t)}},{key:"hint",value:function(t){this.input.hint(t)}},{key:"validate",value:function(){var t=this.input,e=this.rule,i=this.tip,n=this.el,r=t.val();if(e.required&&/^\s*$/.test(r))return i.html(W("validation.required")),n.addClass("error"),!1;if((e.type||e.pattern)&&!(e.pattern||Dr[e.type]).test(r))return i.html(W("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(t){var e=this.el,i=this.tip;e.addClass("error"),i.html(t),i.show()}},{key:"validateClear",value:function(){var t=this.el,e=this.tip;t.removeClass("error"),e.html(""),e.hide()}}]),t}();function Mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var jr=function(t){tt()(i,t);var e=Mr(i);function i(){var t;l()(this,i);var n=new Fr(new Pr("cell",["cell"],"100%",(function(t){return W("dataValidation.modeType.".concat(t))})),{required:!0},"".concat(W("dataValidation.range"),":"),100),r=new Fr(new Rr("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),o=new Fr(new Pr("list",["list","number","date","phone","email"],"100%",(function(t){return W("dataValidation.type.".concat(t))}),(function(e){return t.criteriaSelected(e)})),{required:!0},"".concat(W("dataValidation.criteria"),":"),100),a=new Fr(new Pr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(t){return W("dataValidation.operator.".concat(t))}),(function(e){return t.criteriaOperatorSelected(e)})),{required:!0}).hide(),s=new Fr(new Rr("70px","10"),{required:!0}).hide(),c=new Fr(new Rr("70px","100"),{required:!0,type:"number"}).hide(),h=new Fr(new Rr("120px","a,b,c"),{required:!0}),u=new Fr(new Rr("70px","10"),{required:!0,type:"number"}).hide();return(t=e.call(this,W("contextmenu.validation"),[f("div","".concat(ot,"-form-fields")).children(n.el,r.el),f("div","".concat(ot,"-form-fields")).children(o.el,a.el,s.el,c.el,u.el,h.el),f("div","".concat(ot,"-buttons")).children(new Te("cancel").on("click",(function(){return t.btnClick("cancel")})),new Te("remove").on("click",(function(){return t.btnClick("remove")})),new Te("save","primary").on("click",(function(){return t.btnClick("save")})))])).mf=n,t.rf=r,t.cf=o,t.of=a,t.minvf=s,t.maxvf=c,t.vf=u,t.svf=h,t.change=function(){},t}return a()(i,[{key:"showVf",value:function(t){var e="date"===t?"2018-11-12":"10",i=this.vf;i.input.hint(e),i.show()}},{key:"criteriaSelected",value:function(t){var e=this.of,i=this.minvf,n=this.maxvf,r=this.vf,o=this.svf;"date"===t||"number"===t?(e.show(),i.rule.type=t,n.rule.type=t,"date"===t?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),o.hide()):("list"===t?o.show():o.hide(),r.hide(),e.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(t){if(t){var e=this.minvf,i=this.maxvf,n=this.vf;if("be"===t||"nbe"===t)e.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),e.hide(),i.hide()}}}},{key:"btnClick",value:function(t){if("cancel"===t)this.hide();else if("remove"===t)this.change("remove"),this.hide();else if("save"===t){for(var e=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<e.length;i+=1){var n=this[e[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),o=this.rf.val(),a=this.cf.val(),s="phone"===a||"email"===a?"":this.of.val(),l=this.svf.val();"number"!==a&&"date"!==a||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,o,{type:a,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(t){if(t){var e=this.mf,i=this.rf,n=this.cf,r=this.of,o=this.svf,a=this.vf,s=this.minvf,l=this.maxvf,c=t.mode,h=t.ref,u=t.validator||{type:"list"},f=u.type,d=u.operator,v=u.value;e.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(v)?(s.val(v[0]),l.val(v[1])):(o.val(v||""),a.val(v||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Er),Lr=function(){function t(e,i){l()(this,t),this.el=f("input","".concat(ot,"-form-checkbox")).css("width",e).attr("type","Checkbox")}return a()(t,[{key:"hint",value:function(t){this.el.attr("placeholder",t)}},{key:"val",value:function(t){if(void 0===t)return this.el.el.checked;this.el.el.checked=t}}]),t}();function Br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zr=function(t){tt()(i,t);var e=Br(i);function i(){var t;l()(this,i);var n=new Fr(new Rr("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(W("dataSort.ci"),":"),60),r=new Fr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),o=new Fr(new Pr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),a=new Fr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),s=new Fr(new Pr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),c=new Fr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),h=new Fr(new Pr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new Lr("60px","");u.el.on("click",(function(){return t.myHeaderClick()})),u.val(!0);var d=new Te("del","formbt").on("click",(function(){return t.btnClick("del",1)})),v=f("div","".concat(ot,"-form-fields")).children(a.el,s.el,f("div","".concat(ot,"-buttons")).children(new Te("add","formbt").on("click",(function(){return t.btnClick("add",2)})),d)),g=f("div","".concat(ot,"-form-fields")).children(c.el,h.el,new Te("del","formbt").on("click",(function(){return t.btnClick("del",2)})));return(t=e.call(this,W("contextmenu.sort"),[f("div","".concat(ot,"-form-fields")).children(n.el,new Fr(u,{required:!1},"".concat(W("dataSort.header"),":"),120).el),f("div","".concat(ot,"-form-fields")).children(r.el,o.el,new Te("add","formbt").on("click",(function(){return t.btnClick("add",1)}))),v,g,f("div","".concat(ot,"-buttons")).children(new Te("ok","primary").on("click",(function(){return t.btnClick("ok")})),new Te("cancel").on("click",(function(){return t.btnClick("cancel")})))])).cf=n,t.of1=o,t.sortby1=r,t.of2=s,t.sortby2=a,t.of3=h,t.sortby3=c,t.ci1=null,t.ci2=null,t.ci3=null,t.values=[],t.mcols=null,t.mcolsheader=null,t.cicount=1,t.div2=v,t.div3=g,t.but2=d,t.sc=1,t.myheader=u,v.hide(),g.hide(),t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t,e){if("ok"===t){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void lt("error","".concat(W("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===t?1===e?(this.div2.css("display",""),this.sc=2):2===e&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===t?1===e?(this.div2.hide(),this.sc=1):2===e&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===t&&this.hide()}},{key:"myHeaderClick",value:function(){var t=this.mcols,e=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,o=this.sortby3,a=i.val()?t:e;n.input.setItemsMap(a),n.val(0),r.input.setItemsMap(a),r.val(1),o.input.setItemsMap(a),o.val(2)}},{key:"setValue",value:function(t){if(null!=t){if(t){var e=this.cf,i=this.of1,n=this.sortby1,r=this.of2,o=this.sortby2,a=this.of3,s=this.sortby3,l=t.ref,c=t.sort,h=t.ci,u=t.m,f=t.mcols,d=t.mcolsheader,v=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,p=(c[2]||{order:"asc"}).order3;e.val(l),i.val(v),r.val(g),a.val(p),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var m=[],y=0;y<f.length;y++)m.push(y);n.input.setItemsMap(f),n.val(0),o.input.setItemsMap(f),o.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Er);function Hr(t){return f("div","".concat(ot,"-item ").concat(t))}function Nr(t){var e=this;return Hr("state").child(W("sort.".concat(t))).on("click.stop",(function(){return e.itemClick(t)}))}function Wr(t){var e=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(t).forEach((function(r,o){var a=t[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ot,"-item state ").concat(s)).on("click.stop",(function(){return e.filterClick(o,r)})).children(""===r?W("filter.empty"):r,f("div","label").html("(".concat(a,")"))))}))}function Ur(){var t=this.filterhEl,e=this.filterValues,i=this.values;t.html("".concat(e.length," / ").concat(i.length)),t.checked(e.length===i.length)}var Xr=function(){function t(){var e=this;l()(this,t),this.filterbEl=f("div","".concat(ot,"-body")),this.filterhEl=f("div","".concat(ot,"-header state")).on("click.stop",(function(){return e.filterClick(0,"all")})),this.el=f("div","".concat(ot,"-sort-filter")).children(this.sortAscEl=Nr.call(this,"asc"),this.sortDescEl=Nr.call(this,"desc"),Hr("divider"),f("div","".concat(ot,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ot,"-buttons")).children(new Te("cancel").on("click",(function(){return e.btnClick("cancel")})),new Te("ok","primary").on("click",(function(){return e.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return a()(t,[{key:"btnClick",value:function(t){if("ok"===t){var e=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(e,i,"in",n)}this.hide()}},{key:"itemClick",value:function(t){this.sort=t;var e=this.sortAscEl,i=this.sortDescEl;e.checked("asc"===t),i.checked("desc"===t)}},{key:"filterClick",value:function(t,e){var i=this.filterbEl,n=this.filterValues,r=this.values,o=i.children();"all"===e?o.length===n.length?(this.filterValues=[],o.forEach((function(t){return f(t).checked(!1)}))):(this.filterValues=Array.from(r),o.forEach((function(t){return f(t).checked(!0)}))):f(o[t]).toggle("checked")?n.push(e):n.splice(n.findIndex((function(t){return t===e})),1);Ur.call(this)}},{key:"set",value:function(t,e,i,n){this.ci=t;var r=this.sortAscEl,o=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),o.checked(n.desc())):(this.sortDesc=null,r.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=i?Array.from(i.value):Object.keys(e),Wr.call(this,e,i),Ur.call(this)}},{key:"setOffset",value:function(t){var e=this;this.el.offset(t).show();var i=1;Rt(this.el,(function(){i<=0&&(e.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(t,e,i){var n=this;this.el.show();var r=this.el.offset(),o=r.width,a=r.height;t.top+a>i&&(t.top=i-a),t.left+o>e&&(t.left=e-o),this.el.offset(t);var s=1;Rt(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Et(this.el)}}]),t}(),Yr=function(){function t(){l()(this,t),xt()(this,"onEdit",!1),this.el=f("div","".concat(ot,"-comment-tip")).hide()}return a()(t,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(t,e,i){if(!0!==this.onEdit){var n=this.el,r=i?e.left-e.width-1:e.left+e.width,o=e.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(o,"px")),n.html(t).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),t}();function Vr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Gr=function(t){tt()(i,t);var e=Vr(i);function i(){var t;l()(this,i);var n=new Fr(new Rr("80px",""),{required:!0},"".concat(W("dataSearch.label"),":"),100),r=new Fr(new Lr("80px",""),{required:!1},"".concat(W("dataSort.casesense"),":"),100),o=new Fr(new Lr("30px",""),{required:!1},"".concat(W("dataSearch.matchwhole"),":"),150),a=new Fr(new Pr("values",["values","formulas","comments"],"120px",(function(t){return W("dataSearch.lookin.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSearch.lkinlb"),":"),100);return(t=e.call(this,W("toolbar.search"),[f("div","".concat(ot,"-form-fields")).children(r.el,o.el),f("div","".concat(ot,"-form-fields")).child(n.el),f("div","".concat(ot,"-form-fields")).child(a.el),f("div","".concat(ot,"-buttons")).children(new Te("previous").on("click",(function(){return t.btnClick("previous")})),new Te("next").on("click",(function(){return t.btnClick("next")})),new Te("close","primary").on("click",(function(){return t.btnClick("close")})))],"500px",!1,!0)).formField=n,t.casesense=r,t.lookin=a,t.matchwhole=o,t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){if("close"!==t){if(!this.formField.validate())return;var e=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(t){case"previous":this.change("previous",r,e,i,n);break;case"next":this.change("next",r,e,i,n)}}else this.hide()}},{key:"show",value:function(){Ri()(rt()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Er),qr=function(){function t(e,i){var n=this;l()(this,t),this.data=e,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ot,"-formula-bar")),this.barLabel=f("div","".concat(ot,"-bar-label")),this.formulaInput=f("div","".concat(ot,"-formula-input")).on("input",(function(t){n.inputChange(n.ishtml?t.target.innerHTML:t.target.innerText)})).on("focus",(function(t){n.focuson()})).on("keydown",(function(t){var e=t.keyCode||t.which;13===e?(t.altKey||n.formulaInput.el.blur(),n.enter(t,n.ishtml)):9===e&&(n.formulaInput.el.blur(),n.tab(t))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){var t=this.data,e=t.selector,i=p(e.ci)+""+(e.ri+1),n=t.getSelectedCell(),r="",o=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,o=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,o)}}]),t}();function Kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Zr=function(t){tt()(i,t);var e=Kr(i);function i(){var t;return l()(this,i),t=e.call(this),xt()(Xn()(t),"col",void 0),xt()(Xn()(t),"row",void 0),t.el.attr("contentEditable","true"),t.el.attr("placeholder","".concat(W("toolbar.commentDefault"))),t.el.attr("id","commentEdit"),t}return a()(i,[{key:"saveAndHide",value:function(t){var e=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<t.data.comments.length;n++)if(t.data.comments[n].col===this.col&&t.data.comments[n].row===this.row){i=n;break}-1===i?t.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):t.data.comments[i].note=this.el.html()}t.data.comments=t.data.comments.filter((function(t){return!e.checkEmptyContent(t.note)})),this.hide(),t.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(t){var e=document.createElement("div");return e.innerHTML=t,""===e.innerText}},{key:"setPosition",value:function(t,e,n){Ri()(rt()(i.prototype),"setPosition",this).call(this,t,e,n),this.el.focus()}}]),i}(Yr),Jr=i(10),$r=function(){function t(){l()(this,t),xt()(this,"name",void 0)}return a()(t,[{key:"execute",value:function(t){}}]),t}();function Qr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function to(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function eo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?to(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):to(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function no(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ro(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?no(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):no(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function oo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ao=[function(t){tt()(i,t);var e=Qr(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Xn()(t),"name","delete"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas,i=t.data,n=e.fabric,r=n.getActiveObject(),o=e.findObjByData(r.id,i);if(o)if(o.op="del",i.canvasFreeze){var a=i.canvasFreeze;[a.br,a.bl,a.tr,a.tl].forEach((function(t){t.remove(e.findObjInCanvas(t,r.id)),e.saveCanvasData(i,t),t.renderAll()}))}else n.remove(r),n.renderAll(),e.saveCanvasData(i,n)}}]),i}($r),function(t){tt()(r,t);var e,i,n=io(r);function r(){var t;l()(this,r);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=n.call.apply(n,[this].concat(i)),xt()(Xn()(t),"name","paste"),xt()(Xn()(t),"canvas",void 0),xt()(Xn()(t),"sheet",void 0),xt()(Xn()(t),"inFreeze",void 0),t}return a()(r,[{key:"execute",value:(i=bt()(kt.a.mark((function t(e){var i,n,r,o,a;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:e.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:e,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:e.canvas.inFreeze,a=this,o){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,o.clonedObj.clone(function(){var t=bt()(kt.a.mark((function t(i){var n;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=fabric.util.object.clone(i),a.setImagePosition(n),e.canvas.setLoading(e,{left:n.left,top:n.top}),t.next=6,a.addImageToData(n);case 6:a.setImageEventAndLayout(n),a.addImageToCanvas(n)?a.reactiveObj(n):a.rollback(a.sheet,n),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),lt(t.t0);case 14:return t.prev=14,e.canvas.removeLoading(e),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,10,14,17]])})));return function(e){return t.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"rollback",value:function(t,e){var i=t.data,n=t.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(t){return t.id===e.id}))]),n.saveCanvasData(t.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(e.id),n.removeImageInData(i,e.id))}},{key:"setImagePosition",value:function(t){var e=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!t)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var o=this.canvas.getActiveObject();n=o.left+20,r=o.top+20}else{var a=e.getSelectedRect();if(!a)throw"get selected rect value is null";n=a.left+i.left,r=a.top+i.top}t.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(t)}},{key:"addImageToCanvas",value:function(t){var e=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(t),r=e.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else t.setCoords(),i.add(t);return!0}},{key:"addImageToData",value:(e=bt()(kt.a.mark((function t(e){var i,n,r,o,a,s,l,c,h,u;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,o=eo({},r),a=this.sheet.getTableOffset(),s={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:o.id,srcname:i.canvas.clipboard.sheetName,isshape:"Picture"!==o.type},(l=new FormData).set("p",JSON.stringify(s)),l.set("uid",i.uniqueid),t.next=11,fetch(i.imageCopyUrl,{method:"POST",body:l});case 11:if((c=t.sent).ok){t.next=14;break}throw"upload copy image fail";case 14:return t.next=16,c.json();case 16:if(h=t.sent,h=JSON.parse(h)){t.next=20;break}throw"upload copy image return null ";case 20:if(!h.Error){t.next=22;break}throw h.Error;case 22:delete h.width,delete h.height,n.images||(n.images=[]),Object.assign(o,h),o.left=e-a.left,o.top=e-a.top,n.images.push(o),u=h.type,delete h.type,Object.assign(e,h),e.id=i.canvas.picId(h.id,h.tick),e.imgType=u,e.strid=h.strid,e.zorder=i.data.topOrder++,e.changed=!0;case 37:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(t){"Chart"===t.imgType&&t.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(t),this.sheet.canvas.eventsOn(t,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(t){var e=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,o=r.br,a=r.bl,s=r.tr,l=r.tl;[o,a,s,l].forEach((function(e){e.discardActiveObject(),e.setActiveObject(e.getObjects().find((function(e){return e.id===t.id}))),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else e.discardActiveObject(),e.setActiveObject(t),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(e)}}]),r}($r),function(t){tt()(i,t);var e=oo(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Xn()(t),"name","copy"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas.fabric;if(e.getActiveObject()){var i=e;t.data.canvasFreeze&&(i=t.data.canvasFreeze.tl),i.getActiveObject().clone((function(e){t.canvas.clipboard={clonedObj:e,newData:ro({},t.canvas.findObjByData(e.id,t.data)),sheetName:t.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}($r)],so=function(){function t(e){var i=this;l()(this,t),xt()(this,"freezeXY",void 0),xt()(this,"imageCanvas",void 0),xt()(this,"freezeEvents",{"object:rotating":function(t){return function(e){i.imageCanvas.pubSub.publish("object:rotating",e,t)}},"object:moving":function(t){return function(e){i.imageCanvas.pubSub.publish("object:moving",e,t)}},"object:scaling":function(t){return function(e){i.imageCanvas.pubSub.publish("object:scaling",e,t)}},"selection:created":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:created",e,t)}},"selection:cleared":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:cleared",e,t)}},"selection:updated":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:updated",e,t)}}}),this.imageCanvas=e;var n=e.sheet.getTableOffset(),r=e.sheet.data,o=e.sheet;if(!r.displayRight2Left){var a=r.freezeTotalWidth()+n.left/o.table.zoomlevel,s=r.freezeTotalHeight()+n.top/o.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=a,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){e.pubSub=e.initPubSub();var c=e.fabric;c.off("object:moving",e.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(o.overlayerEl,"bl",a,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(o.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(o.overlayerEl,"tl",a,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return a()(t,[{key:"getFreezeCanvasClipPath",value:function(t,e,i){var n=this.freezeXY,r=this.imageCanvas.sheet,o=this.imageCanvas.tOffset;o.left/=r.data.zoomlevel,o.top/=r.data.zoomlevel;var a=new Jr.fabric.Rect({width:n.x,height:e.height-n.y,top:n.y,left:o.left}),s=new Jr.fabric.Rect({width:n.x,height:n.y,left:o.left,top:o.top}),l=new Jr.fabric.Rect({width:t.width-n.x,height:n.y,left:n.x,top:o.top}),c=new Jr.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(t){var e;switch(t){case"tr":e=l;break;case"bl":e=a;break;case"tl":e=s;break;default:e=c}return e}}},{key:"getOffsetsBetweenCanvases",value:function(t,e){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y,a={offsetX:0,offsetY:0};switch(t+e){case"tlbl":case"trbr":a={offsetX:0,offsetY:-o};break;case"bltl":case"brtr":a={offsetX:0,offsetY:o};break;case"tltr":case"blbr":a={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":a={offsetX:r,offsetY:0};break;case"trbl":a={offsetX:r,offsetY:-o};break;case"tlbr":a={offsetX:-r,offsetY:-o};break;case"bltr":a={offsetX:-r,offsetY:o};break;case"brtl":a={offsetX:r,offsetY:o}}return a}},{key:"setIndividualCanvasesToMoveInSync",value:function(t,e,i,n){var r=this.imageCanvas.findObjInCanvas(t,e.target.id);if(r){var o=this.getOffsetsBetweenCanvases(n,t.canvasName);r.set({left:e.target.left-o.offsetX,top:e.target.top-o.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,t.canvasName),r.dirty=!0,t.renderAll()}}},{key:"setEventAndClipPath",value:function(t,e,i,n){var r=this;[t,e,i,n].forEach((function(t){var e=Object.keys(r.freezeEvents).map((function(e){return[e,r.freezeEvents[e](t.canvasName)]}));e=Object.fromEntries(e),r.imageCanvas.eventsOn(t,e)}));var o=this.getFreezeCanvasClipPath(e,i,t);this.freezeClipPath=o,[t,e,i,n].forEach((function(t){t.clipPath=o(t.canvasName),r.subscribeObjectEvent(t),r.subscribeSelectionEvent(t),r.subscribeCustomEvent(t,o)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(t,e){t.getObjects().forEach(e),t.renderAll()}},{key:"subscribeObjectEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===t.canvasName?{left:i.target.left,top:i.target.top}:{};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};e.setIndividualCanvasesToMoveInSync(t,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(t){var e,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y;switch(t){case"tr":e={x:r,y:0};break;case"bl":e={x:0,y:o};break;case"br":e={x:r,y:o};break;default:e={x:0,y:0}}return e}},{key:"subscribeCustomEvent",value:function(t,e){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var e=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);i.updateCanvasAllObjectAndRenderAll(t,(function(t){t.set({left:t.left-e.x,top:t.top-e.y}),t.setCoords(),t.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(e){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);if(n){var o=JSON.parse(n);t.getObjects().forEach((function(t){var e=o.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+r.x,top:e.top+r.y}),t.setCoords()})),t.renderAll()}}))}},{key:"clearFreeze",value:function(t){if(t.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var e=t.canvasFreeze.tr,i=t.canvasFreeze.tl,n=t.canvasFreeze.bl;e.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new Jr.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),t.canvasFreeze=void 0}}},{key:"setZoom",value:function(t){var e=this.imageCanvas,i=e.data,n=(e.fabric,e.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(e){e.setZoom(t),e.renderAll()})),this.foreachFreezeCanvas((function(e){e.setWidth(n[e.canvasName].width*t),e.setHeight(n[e.canvasName].height*t)}),"br")}},{key:"resize",value:function(){var t=this.imageCanvas,e=t.data,i=(t.fabric,e.canvasFreeze),n=(i.tl,i.bl),r=i.tr,o=i.br,a=this.getFreezeCanvasClipPath(r,n,o);this.foreachFreezeCanvas((function(t){t.clipPath=a(t.canvasName),t.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==t.canvasName){e.imageCanvas.checkHyperlink(e.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&e.imageCanvas.openLink(e.imageCanvas.data);var r=e.imageCanvas.findObjInCanvas(t,i.target.id);t._setActiveObject(r),t.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(e,i){i!==t.canvasName&&(t._discardActiveObject(),t.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==t.canvasName){var o=e.imageCanvas.findObjInCanvas(t,i.target.id);(null===(r=t.getActiveObject())||void 0===r?void 0:r.id)!==o.id&&(t._setActiveObject(o),t.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(t,e){var i=this;++t.topOrder,Object.keys(t.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(t.canvasFreeze[n],e.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(t.canvasFreeze[n],r),e.zorder=r.zorder=t.topOrder,t.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(t){var e=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(e,t),this.imageCanvas.saveOriginalAngleInfoOfImage(e.canvasFreeze.br),this.imageCanvas.saveCanvasData(e,e.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var t=this.imageCanvas.data;if(t.canvasFreeze){var e=t.canvasFreeze,i=e.tl,n=e.bl,r=e.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(t,e,i,n,r){var o=document.createElement("canvas");o.width=i,o.height=n,o.setAttribute("id",e),t.children(o),window.mobileAndTabletCheck()&&(Jr.fabric.Object.prototype.selectable=!1);var a=new Jr.fabric.Canvas(e);return a.selection=!1,a.set("canvasName",e),this.imageCanvas.eventsOn(a,this.imageCanvas.canvasEvents),a}},{key:"removeImage",value:function(t){this.foreachFreezeCanvas((function(e){e.remove(e.getObjects()[e.getObjects().findIndex((function(e){return e.id===t}))])}),"br")}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(t){null!=t&&t.getObjects().find((function(t){return!t.zorder}))||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}))}},{key:"saveCanvasData",value:function(){var t=this,e=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){t.imageCanvas.saveCanvasData(e,i)}))}},{key:"setCursor",value:function(t){this.foreachFreezeCanvas((function(e){e.defaultCursor=t}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(t){t.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var o=r.canvasFreeze,a=o.tl,s=o.bl,l=o.tr,c=o.br;[a,s,l,c].forEach((function(e){i.includes(e.canvasName)||t(e)}))}}}]),t}();function lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var co=function(){function t(){l()(this,t),this.subscribers=[]}return a()(t,[{key:"subscribe",value:function(t,e){var i=this.subscribers[t];i?i.push(e):this.subscribers[t]=[e]}},{key:"publish",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.subscribers[t]||[];r.forEach((function(t){return t.apply(void 0,i)}))}}]),t}(),ho=function(t){this.visible=t,this.fabobj.visible=t,this.fabobj.canvas.requestRenderAll()},uo=function(t){tt()(i,t);var e=lo(i);function i(){var t;return l()(this,i),t=e.call(this,"canvas"),xt()(Xn()(t),"imgEvents",{mouseup:function(e){var i=Xn()(t).sheet,n=i.data,r=e.target;if(!window.mobileAndTabletCheck()){var o=r.canvas;o||(o=t.fabric),n.canvasFreeze?t.inFreeze.setOrderAndSaveData(r):(r.changed=!0,t.sendImageToFont(o,r),r.zorder=++n.topOrder,t.findObjInCanvas(o,r.id).zorder=r.zorder,t.saveOriginalAngleInfoOfImage(o),t.saveCanvasData(n,o)),i.selector.setObjId(r.id)}},mousedown:function(e){window.mobileAndTabletCheck()||(t.sheet.selector.hide(),t.sheet.editor.clear(),null==e||e.e.stopPropagation())},mousedblclick:function(e){if(!window.mobileAndTabletCheck()){var i=e.target,n=Xn()(t).sheet;"OleObject"===i.imgType&&n.getOle(i.strid)}},mousemove:function(e){t.findObjByData(e.target.id,t.data).hyperlink?t.fabric.hoverCursor="pointer":t.fabric.hoverCursor="move"}}),xt()(Xn()(t),"pausePanning",!1),xt()(Xn()(t),"canvasEvents",{"mouse:move:before":function(){t.sheet.data.canvasFreeze&&t.sheet.data.canvasFreeze.tl.getObjects().length!==t.sheet.data.canvasFreeze.br.getObjects().length&&t.inFreeze.loadFreezeImage()},"object:moving":function(e){t.edgeCollision(e.target,"canvas")},"selection:created":function(e){t.checkHyperlink(t.fabric)&&!e.e.ctrlKey&&t.openLink(t.data)}}),xt()(Xn()(t),"customEvents",{"object:scroll":function(){var e=t.data,i=e.scroll,n=e.displayRight2Left,r=e.canvasData,o=n?i.x:-i.x,a=-i.y;if(r){var s=JSON.parse(r);t.fabric.getObjects().forEach((function(t){var e=s.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+o,top:e.top+a}),t.setCoords()})),t.fabric.renderAll()}}}),xt()(Xn()(t),"tOffset",void 0),xt()(Xn()(t),"data",void 0),xt()(Xn()(t),"fabric",void 0),xt()(Xn()(t),"freeze",void 0),xt()(Xn()(t),"freezeXY",{x:0,y:0}),xt()(Xn()(t),"pubSub",void 0),xt()(Xn()(t),"sheet",void 0),xt()(Xn()(t),"basicZorder",void 0),xt()(Xn()(t),"canvasId","canvas_".concat((new Date).getTime())),xt()(Xn()(t),"imageOperationList",{}),t.attr("id",t.canvasId),t.pubSub=t.initPubSub(),ao.forEach((function(e){var i=new e;t.imageOperationList[i.name]=i})),Tt(window,"resize",(function(e){window.mobileAndTabletCheck()||t.resize(e)})),t}return a()(i,[{key:"publishEvent",value:function(t,e){this.pubSub.publish(t,e)}},{key:"initPubSub",value:function(){return new co}},{key:"setCursor",value:function(t){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(t):this.fabric.defaultCursor=t}},{key:"doNewSheetPage",value:function(t){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doSwitchSheetPage",value:function(t){var e=this;this.sheet.selector.el.show();setTimeout((function t(){var i,n,r,o;e.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=e.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(o=e.sheet.data.shapes)||void 0===o?void 0:o.length)&&void 0!==r?r:0)?e.doEndSwitchSheetPage():setTimeout(t,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doEndSwitchSheetPage",value:function(){var t;this.setOrder(this.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new so(this)}},{key:"rerenderCanvasBySavedJson",value:function(t,e,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,o){o.set({left:r.left+e.x,top:r.top+e.y}),"Chart"===o.imgType&&o.setControlsVisibility({mtr:!1}),n.setSelectionLayout(o),n.eventsOn(o,n.imgEvents),n.findObjByData(r.id,n.data)&&(t.clipPath=i)}),t)}}},{key:"findObjInCanvas",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"recordCanvasData",value:function(t,e){var i,n,r=t.aCoords,o=this.tOffset,a=this.findObjByData(t.id,e);if(a){var s=r.tl.x+(r.tr.x-r.tl.x)/2-o.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-o.top;a.centerX||(a.centerX=s),a.centerY||(a.centerY=l),a.currentCenterX=s,a.currentCenterY=l;var c=e.getCellRectByXY(r.tl.x,r.tl.y);a.width=a.originWidth*t.scaleX,a.height=a.originHeight*t.scaleY,a.scaleX=t.scaleX,a.scaleY=t.scaleY,a.top=t.top-o.top/e.zoomlevel+e.scroll.y,a.left=t.left-o.left/e.zoomlevel+e.scroll.x,a.row=null==c?void 0:c.ri,a.col=null==c?void 0:c.ci,a.changed=null!==(i=t.changed)&&void 0!==i&&i,a.zorder=null!==(n=t.zorder)&&void 0!==n?n:e.topOrder}}},{key:"edgeCollision",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,o=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(e)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(e)&&(o-=i.scroll.x),t.setCoords();var a=t.getBoundingRect().top/i.zoomlevel,s=t.getBoundingRect().left/i.zoomlevel;(a<r||s<o)&&(t.top=Math.max(t.top,t.top-a+r),t.left=Math.max(t.left,t.left-s+o))}},{key:"init",value:function(t){var e=this;this.tOffset=t.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=t,window.mobileAndTabletCheck()&&(Jr.fabric.Object.prototype.selectable=!1),this.fabric=new Jr.fabric.Canvas(this.canvasId),this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel});var n=0,r=setInterval((function(){(t.data.isImageOk||50===n)&&(e.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var t;this.setOrder(this.sheet.canvas.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"resetFreeze",value:function(t){var e=r()(t.freeze,2),i=e[0],n=e[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(t):this.initFreeze()}},{key:"reset",value:function(t){this.data=t,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(t){0===t&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(t){var e=this,i={};t.getObjects().forEach((function(t){i[t.id]=t.angle,e.rotateObject(t,0)})),t.renderAll(),t.getObjects().forEach((function(t){e.recordCanvasData(t,e.sheet.data),e.setDataAngle(t,i[t.id],e.sheet.data),e.rotateObject(t,i[t.id])})),t.renderAll()}},{key:"setDataAngle",value:function(t,e,i){var n=this.findObjByData(t.id,i);n&&(n.angle=e)}},{key:"clipPath",value:function(t){this.fabric.clipPath=new Jr.fabric.Rect(t)}},{key:"eventsOn",value:function(t,e){for(var i in e)t.on(i,e[i])}},{key:"eventsOff",value:function(t,e){for(var i in e)t.off(i,e[i])}},{key:"saveCanvasData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(e){var n=e.toDatalessJSON(["id","tick","imgType","zorder","strid"]);n.objects.forEach((function(t){t.left+=i.data.scroll.x,t.top+=i.data.scroll.y})),t.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;t?n.loadFromJSON(t,(function(){i.setOrder(n),n.renderAll()}),e):n.clear()}},{key:"findObjByData",value:function(t,e){var i=this.findImage(t,e);return null!=i?i:this.findShape(t,e)}},{key:"setZoom",value:function(t){var e=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),e.canvasFreeze?this.inFreeze.setZoom(t):(this.fabric.clipPath=new Jr.fabric.Rect({width:this.fabric.width/e.zoomlevel,height:this.fabric.height/e.zoomlevel,left:this.tOffset.left/e.zoomlevel,top:this.tOffset.top/e.zoomlevel}),this.fabric.setZoom(t),this.fabric.renderAll())}},{key:"picId",value:function(t,e){return"p_".concat(t,"_").concat(e)}},{key:"shapeId",value:function(t,e){return"s_".concat(t,"_").concat(e)}},{key:"findImage",value:function(t,e){var i,n=this;return null===(i=e.images)||void 0===i?void 0:i.find((function(e){return t===n.picId(e.id,e.tick)}))}},{key:"findShape",value:function(t,e){var i,n=this;return null===(i=e.shapes)||void 0===i?void 0:i.find((function(e){return t===n.shapeId(e.id,e.tick)}))}},{key:"resize",value:function(t){var e=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(t.target.outerWidth+n.left),i.setHeight(t.target.outerHeight+n.top),i.clipPath=new Jr.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel}),i.renderAll(),e.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(t){t.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setTextBox",value:function(t,e,i){var n=t.canvas,r=this,o=new Jr.fabric.Rect;i.width?i.fromOutside&&(delete i.width,delete i.height):(o.width=i.width,o.height=i.height),o.set(i),n.setSelectionLayout(o),n.eventsOn(o,n.imgEvents),n.eventsOn(n,r.canvasEvents),n.fabric.add(o),n.rotateObject(o,i.rotate);var a=new Pe(0,0,i.width,i.height,10);a.isfirst=!0,e.fabobj=o,e.setVisible=ho,t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),o.on("modified",(function(t){var e=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=e,this.height=i;var n=r.findObjByData(this.id,r.sheet.data);n.originWidth=e,n.originHeight=i})),o.drawObject=function(t,e){var n=this.width,o=this.height;t.save(),t.translate(-n/2,-o/2),a.isfirst?a.isfirst=!1:a.resize(n,o);var s=r.findObjByData(this.id,r.sheet.data),l=new ze(t,n,o),c=1/Oe();l.scale(c,c),l.scale(c,c),l.richtext(i,a,i.align,i.valign,i.wrap,s.getHighlight()),t.restore()},e.getHighlight=function(){return this.showhighlight?v()(this.highlighttxts):[]},e.addHighlight=function(t,e){var i={start:t,end:e};this.highlighttxts.find((function(i){if(i.start===t&&i.end===e)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.fabobj.set("dirty",!0))},e.removeHighlight=function(t,e){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===t&&i.end===e}));-1!==i&&(this.highlighttxts.splice(i,1),this.fabobj.set("dirty",!0))}},e.setHighlight=function(t,e){this.showhighlight=t,t&&!this.highlighttxts&&(this.highlighttxts=[]),e&&(this.hstyle=e),this.fabobj.set("dirty",!0)},n.fabric.renderAll(),n.saveCanvasData(t.data)}},{key:"setImage",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=t.canvas,o=this;e.setVisible=ho,Jr.fabric.Image.fromURL(n,(function(n){var a;if(e.fabobj=n,i.id.includes("loading"))return n.set(i),r.fabric.add(n),t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.fabric.requestRenderAll(),void(null===(a=o.inFreeze)||void 0===a||a.loadFreezeImage());try{var s,l=r.findObjByData(i.id,t.data);if(!l)return;var c=r.findObjInCanvas(r.fabric,i.id);c&&r.fabric.remove(c),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),l.fromOutside=!0,l.scaleX=n.scaleX,l.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,o.canvasEvents),r.fabric.add(n),t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.rotateObject(n,i.rotate),r.fabric.renderAll(),r.saveCanvasData(t.data),null===(s=o.inFreeze)||void 0===s||s.loadFreezeImage()}catch(t){console.error(t),lt(t)}finally{r.removeLoading(t)}}))}},{key:"setLoading",value:function(t,e){var i=this.tOffset,n=t.data,r=n.displayRight2Left,o=n.cols,a=r?t.data.viewWidth()-o.indexWidth:0,s=r?a-e.left:e.left;e.top+=i.top,e.left=s+i.left,e.id="loading"+(new Date).getTime(),e.selectable=!1,this.setImage(t,e),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(e.id)}},{key:"removeLoading",value:function(t){var e=t.canvas;if(this.loadingStack){var i=this.loadingStack.shift();e.fabric.remove(e.fabric.getObjects()[e.fabric.getObjects().findIndex((function(t){return t.id===i}))]),e.saveCanvasData(t.data,e.fabric),e.inFreeze&&(e.inFreeze.removeImage(i),e.inFreeze.saveCanvasData(),e.inFreeze.renderAll(),e.fabric.renderAll())}}},{key:"rotateObject",value:function(t,e){t&&(t._setOriginToCenter(),t.set("angle",e).setCoords(),t._resetOrigin())}},{key:"doInsertURLImage",value:function(t,e){this.doInsertImage(t,e,!0)}},{key:"doInsertImage",value:function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.data.getSelectedRect(),a=this.tOffset,s=e.data,l=s.displayRight2Left,c=s.cols,h=l?e.data.viewWidth()-c.indexWidth:0,u=l?h-o.left/e.table.zoomlevel-t.width:o.left/e.table.zoomlevel,f=t.url,d={angle:0,col:this.data.selector.ci,height:t.height,id:t.id,left:o.left/e.table.zoomlevel,originAngle:0,originHeight:t.height,originLeft:o.left,originTop:o.top,originWidth:t.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:f,strid:t.strid,tick:t.tick,top:o.top/e.table.zoomlevel,type:t.type,width:t.width,zorder:null!==(i=e.data.topOrder)&&void 0!==i?i:0};this.findObjByData(d.id,e.data)||(e.data.images||(e.data.images=[]),e.data.images.push(d)),r?this.setImage(e,{id:this.picId(d.id,d.tick),tick:d.tick,scaleToWidth:t.width,scaleToHeight:t.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src):this.setImage(e,{id:this.picId(d.id,d.tick),tick:d.tick,scaleToWidth:d.width,scaleToHeight:d.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src),this.fabric.renderAll(),this.saveCanvasData(e.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(t){var e=this.getActiveObjInData(this.data);e&&(e.hyperlink=t)}},{key:"getActiveObjInData",value:function(t){var e=this.fabric.getActiveObject();if(e)return this.findObjByData(e.id,t)}},{key:"link",value:function(t){var e,i=this.getActiveObjInData(t);i&&this.sheet.modalLink.setValue(xs.datas.map((function(t){return t.name})),null!==(e=i.hyperlink)&&void 0!==e?e:{})}},{key:"removeLink",value:function(t){var e=this.getActiveObjInData(t);e&&(e.hyperlink=null)}},{key:"openLink",value:function(t){var e=this.getActiveObjInData(t);e&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(e.hyperlink))}},{key:"sendImageToFont",value:function(t,e){t&&e&&t.bringToFront(e)}},{key:"doOperation",value:function(t){Object.keys(this.imageOperationList).includes(t)&&!window.mobileAndTabletCheck()&&this.imageOperationList[t].execute(this.sheet)}},{key:"removeImageInData",value:function(t,e){if(!e.includes("_")&&e.split("_").length-1!=2)throw new Error("not correct id");var i=e.split("_"),n=r()(i,3),o=n[0],a=n[1],s=n[2],l="s"===o?t.shapes:t.images;null==l||l.splice(l.findIndex((function(t){return t.id===a&&t.tick===s})),1)}},{key:"checkHyperlink",value:function(t){var e=t.getActiveObject();if(e)return!!this.findObjByData(e.id,this.data).hyperlink}},{key:"validType",value:function(t,e,i){var n=t.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[e]===i}},{key:"setOrder",value:function(t){null==t||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}}]),i}(u);function fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var vo=function(t){tt()(i,t);var e=fo(i);function i(){var t;l()(this,i);var n=new Fr(new Rr("100%",W("contextmenu.insertURL")),{required:!0},"",100);return(t=e.call(this,">",[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-buttons")).children(new Te("ok","primary").on("click",(function(){return t.btnClick("ok")})))])).url=n,t.values=[],t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){"ok"===t?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(t,e){"success"===e?(this.change("ok",t),this.hide()):this.url.validateFail(W("validation.downloadImageFail"))}},{key:"show",value:function(){Ri()(rt()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ri()(rt()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(t,e,i){var n,r=!1,o=this,a=new Image;a.onerror=a.onabort=function(){r||(clearTimeout(n),e.call(o,t,"error"))},a.onload=function(){r||(clearTimeout(n),e.call(o,t,"success"))},a.src=t,n=setTimeout((function(){r=!0,a.src="//!!!!/test.jpg",e.call(o,t,"timeout")}),i)}}]),i}(Er);function go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function po(t){t.dd&&(t.dd.title.removeClass("arrow-left"),2===t.dd.headerEl.children().length&&t.dd.headerEl.removeChild(t.dd.headerEl.children()[1]))}function mo(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+W("menubar.".concat(t.tag.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()}))));t.dd?t.dd.headerEl.child(i,e):t.el.child(i)}function yo(t){var e=f("div","".concat(ot,"-item")).child(t.el);return t.dd&&(t.dd.contentEl.addClass("".concat(ot,"-menubar-dropdown-content")),e=f("div","".concat(ot,"-menubar-btn")).child(t.dd.el)),e}function bo(t,e){t.el.addEventListener("click",(function(i){e.dd?e.dd.menuDiv=t:(e.click?e.click():e.change(e.tag),i.stopPropagation())}),!0),t.el.addEventListener("mouseenter",(function(t){t.stopPropagation()}),!0)}var wo=function(t){tt()(i,t);var e=go(i);function i(t,n){var r;l()(this,i);for(var o,a=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(o=n[c]).tip="",o.el.attr("style","margin:0"),o.el.attr("class",""),po(n[c]);var h=s.includes(n[c].tag);mo(n[c],h);var u=yo(n[c]);bo(u,n[c]),a.push(u)}return(r=e.call.apply(e,[this,t,"max-content",!1,"bottom-left"].concat(a))).headerEl.on("mouseenter",(function(t){if(!window.mobileAndTabletCheck()){var e=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});t.target.dispatchEvent(e)}})),r}return i}(Fi);function xo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Co=function(t){tt()(i,t);var e=xo(i);function i(t,n){return l()(this,i),e.call(this,t,null,"",n)}return a()(i,[{key:"dropdown",value:function(){return new wo(this.tag,this.value)}}]),i}(Pi);function ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var _o=function(t){tt()(i,t);var e=ko(i);function i(t){var n;l()(this,i);var r="download";return null!=t&&t&&(r+="_".concat(t)),n=e.call(this,r),"GOOGLE"===t||"DROPBOX"===t?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(yn);function So(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var To=function(t){tt()(i,t);var e=So(i);function i(){return l()(this,i),e.call(this,"link")}return i}(yn);function Oo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Eo=function(t){tt()(i,t);var e=Oo(i);function i(){return l()(this,i),e.call(this,"insertColumn")}return i}(yn);function Ro(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ao=function(t){tt()(i,t);var e=Ro(i);function i(){return l()(this,i),e.call(this,"insertRow")}return i}(yn);function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Po=function(t){tt()(i,t);var e=Io(i);function i(){return l()(this,i),e.call(this,"insertSheet")}return i}(yn);var Do=function(){function t(e,i,n,r,o){var a=this;l()(this,t),this.data=e;var s=e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=W("menubar.menuEdit"),h=W("menubar.menuComment"),u=W("menubar.menuInsert"),d=W("menubar.menuText"),v=W("menubar.menuFile");this.items={},this.items[v]=[new tr,new _o("Original"),new _o("XLSX"),new _o("PDF"),new _o("HTML")],"ru"!==o&&"zh"!==o&&(this.items[v].push(new _o("GOOGLE")),this.items[v].push(new _o("DROPBOX"))),this.items[c]=[this.borderEl=new pn,this.mergeEl=new $n,this.freezeEl=new Zn,this.autofilterEl=new Xi,this.sortEl=new sr,this.searchEl=new cr,this.paintformatEl=new Cn,this.clearformatEl=new wn,this.fillColorEl=new Tn(s.bgcolor)],this.items[u]=[this.insertColumn=new Eo,this.insertRow=new Ao,this.insertSheet=new Po,this.insertImageEL=new xr,this.formulaEl=new qn,this.insertLink=new To,this.insetCommentEl=new ur],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new Bn,this.fontSizeEl=new An,this.boldEl=new Vi,this.italicEl=new qi,this.underlineEl=new $i,this.strikeEl=new Zi,this.alignEl=new Bi(s.align),this.valignEl=new Hi(s.valign),this.textwrapEl=new ir,this.textColorEl=new _n(s.color)],this.items[h]=[this.commentEditEl=new ur,this.commentRemoveEl=new dr,this.commentPreviousEl=new gr,this.commentNextEl=new mr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ot,"-toolbar ").concat(ot,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(t){var e=new Co(t,a.items[t]);a.dropdowns.push(e),a.el.child(e.el),a.items[t].map((function(t){t.change=function(){a.change.apply(a,arguments)}}))})))}return a()(t,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(t){return t.dd.hide()}))}}]),t}(),Fo=function(){function t(){l()(this,t),xt()(this,"setActiveSheetBySheetName",(function(){})),xt()(this,"setActiveCell",(function(){})),xt()(this,"linkPositions",[])}return a()(t,[{key:"checkAndAccess",value:function(t,e,i){var n=this.find(t,e,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(t){var e=this,i=t.data;this.linkPositions=[];t.getTableOffset();i.hyperlinks.forEach((function(t){var n={},r=C.valueOf(t.area),o=i.scroll.ci,a=i.scroll.ri;o=o>0&&r.sci<o?0:o,a=a>0&&r.sri<a?0:a,n.x=[i.cols.sumWidth(o,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(o,r.eci+1)],n.y=[i.rows.sumHeight(a,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(a,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||e.linkPositions.push(n)}))}},{key:"find",value:function(t,e,i){var n=t.hyperlinks;if(0!==n.length)return n.find((function(t){return t.area?C.valueOf(t.area).includes(e,i):null}))}},{key:"findByArea",value:function(t,e){var i=t.hyperlinks;if(0!==i.length)return i.find((function(t){return t.area?C.valueOf(t.area).contains(C.valueOf(e)):null}))}},{key:"check",value:function(t,e,i){return!!this.find(t,e,i)}},{key:"remove",value:function(t,e){var i=e.hyperlinks.findIndex((function(e){return e.area===t.area}));e.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(t,e){var i=this.findByRange(t,e.data);this.remove(i,e.data),this.setHyperlinkStyleByArea(i.area,e,!1)}},{key:"findByRange",value:function(t,e){var i=this.getSelectArea(t);return this.findByArea(e,i)}},{key:"getSelectArea",value:function(t){var e=b(t.sci,t.sri),i=b(t.eci,t.eri);return"".concat(e,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(t,e,i){for(var n=C.valueOf(t),r=n.sri;r<=n.eri;r++)for(var o=n.sci;o<=n.eci;o++)e.data.setHyperlinkStyle(r,o,i);e.table.render()}},{key:"accessByRange",value:function(t,e){var i=this.getSelectArea(t),n=this.findByArea(e,i);this.access(n)}},{key:"access",value:function(t){if("number"==typeof t.type&&t.address){switch(t.type){case 0:case 2:window.open(t.address,"_blank");break;case 1:break;case 3:if(!t.address.includes("!"))break;var e=t.address.split("!"),i=r()(e,2),n=i[0],o=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var a=y(o),s=r()(a,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),t}();function Mo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return jo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return jo(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function jo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Lo=function(){function t(e){l()(this,t),this.sheet=e}return a()(t,[{key:"setCustomHighlightImgFunc",value:function(t){this.highlightImgFunc=t}},{key:"showHighlights",value:function(t){var e=this.sheet.data;e.showhighlight=!0,e.highlightstyle=t,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var t=this.sheet,e=t.data,i=t.canvas;if(e.highlightall){var n=i.fabric;this.highlightAllImg(e.showhighlight,n)}else this.showHighlightImageShapesAuto(e.showhighlight)}},{key:"hideHighlights",value:function(){var t=this.sheet,e=t.data,i=t.table;e.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(t,e,i,n){var r=this.sheet.data,o={row:t,col:e,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===t&&r.col===e&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(o)}},{key:"removeHighlightText",value:function(t,e,i,n){for(var r=this.sheet.data,o=0;o<r.highlighttxts.length;o++){var a=Number.isInteger(i)?i:r.highlighttxts[o].start,s=Number.isInteger(n)?n:r.highlighttxts[o].end;r.highlighttxts[o].row===t&&r.highlighttxts[o].col===e&&r.highlighttxts[o].start===a&&r.highlighttxts[o].end===s&&r.highlighttxts.splice(o,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)if(r.highlightrg[a].contains(o))return;r.highlightrg.push(o)}},{key:"removeHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)r.highlightrg[a].equals(o)&&r.highlightrg.splice(a,1)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.sheet.data.highlightIR=new C(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"highlightAllImg",value:function(t,e){var i,n=this.sheet,r=n.data,o=n.canvas,a=Mo(e.getObjects());try{for(a.s();!(i=a.n()).done;){var s=i.value;if(this.highlightImgFunc)this.highlightImgFunc(t,s);else if("TextBox"===s.imgType)o.findShape(s.id,r).setHighlight(t,r.highlightstyle);else s.filters[0]=!!t&&new fabric.Image.filters.Invert,s.applyFilters()}}catch(t){a.e(t)}finally{a.f()}e.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(t){var e,i=this,n=this.sheet,r=n.data,o=n.canvas,a=o.fabric,s=Mo(r.highlighshapes);try{var l=function(){var n=e.value,s=r.shapes.find((function(t){return t.id===n}));s&&i.highlightImg(t,a,o.shapeId(s.id,s.tick))};for(s.s();!(e=s.n()).done;)l()}catch(t){s.e(t)}finally{s.f()}var c,h=Mo(r.highlighimgs);try{var u=function(){var e=c.value,n=r.images.find((function(t){return t.id===e}));n&&i.highlightImg(t,a,o.picId(n.id,n.tick))};for(h.s();!(c=h.n()).done;)u()}catch(t){h.e(t)}finally{h.f()}a.requestRenderAll()}},{key:"highlightImg",value:function(t,e,i){var n=this.sheet,r=n.data,o=n.canvas,a=this.getCanvasImgByid(e,i);a&&(this.highlightImgFunc?this.highlightImgFunc(t,a):"TextBox"===a.imgType?o.findShape(a.id,r).setHighlight(t,r.highlightstyle):(a.filters[0]=!!t&&new fabric.Image.filters.Invert,a.applyFilters()))}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighshapes.indexOf(t)){var r=i.shapes.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighshapes.push(t),i.showhighlight&&(this.highlightImg(!0,o,n.shapeId(r.id,r.tick)),o.requestRenderAll())}}}},{key:"removeHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas,r=n.fabric,o=i.highlighshapes.indexOf(t);if(o>-1){i.highlighshapes.splice(o,1);var a=i.shapes.find((function(e){return e.id===t}));a&&(this.highlightImg(!1,r,n.shapeId(a.id,a.tick)),r.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighimgs.indexOf(t)){var r=i.images.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighimgs.push(t),i.showhighlight&&(this.highlightImg(!0,o,n.picId(r.id,r.tick)),o.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas,r=n.fabric,o=i.highlighimgs.indexOf(t);if(o>-1){i.highlighimgs.splice(o,1);var a=i.images.find((function(e){return e.id===t}));a&&(this.highlightImg(!1,r,n.picId(a.id,a.tick)),r.requestRenderAll())}}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,o=i.table;if(n.showhighlight){var a=r.fabric;n.highlightall=t,this.highlightAllImg(t,a),t||this.showHighlightImageShapesAuto(!0)}e&&o.render()}}]),t}();function Bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zo=function(t){tt()(i,t);var e=Bo(i);function i(){var t;l()(this,i);var n=new Fr(new Rr("400px",""),{required:!0},"".concat(W("download.fileName"),":"),100),r=new Fr(new Pr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(t){return W("download.saveTypes.".concat(t))}),(function(e){var i=t.fileNameField.val();t.fileNameField.val(t.setSuffix(i,e)),t.fileNameField.validate()})),{required:!0},"".concat(W("download.saveType"),":"),100);return t=e.call(this,W("contextmenu.download"),[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el),f("div","".concat(ot,"-buttons")).children(new Te("ok","primary").on("click",(function(){return t.btnClick("ok")})),new Te("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Xn()(t),"defaultSuffix","xlsx"),t.fileNameField=n,t.saveTypeField=r,t.ci=null,t.values=[],t.change=function(){},t}return a()(i,[{key:"setSuffix",value:function(t,e){var i;return"Original"===e&&(e=this.originalType),t=(t=""===(null!==(i=t)&&void 0!==i?i:"")?this.originalFileName:t).includes(".")?t:t+"."+this.defaultSuffix,"".concat(t.substr(0,t.lastIndexOf(".")),".").concat(e.toLowerCase())}},{key:"btnClick",value:function(t){if("ok"===t){if(!this.fileNameField.validate())return;var e=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,e),this.change("ok",i,e)}this.hide()}},{key:"setValue",value:function(t){this.originalFileName=""===(null!=t?t:"")?"worksheet.xlsx":t,this.originalType=t.split(".").length>=2?t.substr(t.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Er);function Ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var No=function(t){tt()(i,t);var e=Ho(i);function i(){var t;l()(this,i);var n=new Fr(new Rr("100%",""),{required:!0},"".concat(W("link.emailAddress"),":"),100),r=new Fr(new Rr("100%",""),{required:!0},"".concat(W("link.emailSubject"),":"),100),o=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el));o.hide();var a=new Fr(new Rr("100%",""),{required:!0},"".concat(W("link.sheetCell"),":"),100),s=new Fr(new Pr("",[""],"max-content",(function(t){return t}),(function(t){})),{required:!0},"".concat(W("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(a.el),f("div","".concat(ot,"-form-fields")).children(s.el));c.hide();var h=new Fr(new Rr("100%",""),{required:!0},"".concat(W("link.webUrl"),":"),100),u=f("div","".concat(ot,"-form-fields")).children(h.el);u.hide();var d=new Fr(new Pr("web",["web","sheet","email"],"max-content",(function(t){return W("link.linkTypes.".concat(t))}),(function(e){switch(u.hide(),c.hide(),o.hide(),e){case"web":u.show(),t.active="web";break;case"sheet":c.show(),t.active="sheet";break;case"email":o.show(),t.active="email"}})),{required:!0},"".concat(W("link.linkType"),":"),100);return t=e.call(this,W("contextmenu.link"),[f("div","".concat(ot,"-form-fields")).children(d.el),f("div","".concat(ot,"-form-fields")).children(o.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ot,"-buttons")).children(new Te("ok","primary").on("click",(function(){return t.btnClick("ok")})),new Te("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Xn()(t),"active",void 0),t.ci=null,t.values=[],t.sheetPageField=s,t.sheetField=c,t.webField=u,t.emailField=o,t.sheetCellField=a,t.webUrlField=h,t.emailAddressField=n,t.emailSubjectField=r,t.linkTypeField=d,t.change=function(){},t.el.on("click",(function(t){t.preventDefault()})),t}return a()(i,[{key:"btnClick",value:function(t){var e=this.link,i=this.type;if("ok"===t){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");e.type=0,e.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;e.type=3,e.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":e.type=2,e.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",e,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(t){var e;try{e=new URL(t)}catch(t){return!1}return"http:"===e.protocol||"https:"===e.protocol}},{key:"setValue",value:function(t,e,i){var n;if(this.type=i,this.sheets=t,this.link=e,this.clear(),this.sheetPageField.input.suggest.setItems(t.map((function(t){return{key:t,title:t}}))),""!==(null!==(n=null==e?void 0:e.type)&&void 0!==n?n:""))switch(e.type){case 1:case 0:this.webUrlField.input.val(e.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(e.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var o=e.address.split("!");if(2!==o.length)break;this.sheetPageField.val(o[0]),this.sheetCellField.val(o[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Er),Wo=function(){function t(e){l()(this,t),this.el=f("div","".concat(ot,e?"-banner-icon-s":"-banner-icon"))}return a()(t,[{key:"setHomeIcon",value:function(t,e){this.el.css({"background-image":"url(".concat(t,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",e),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),t}(),Uo=function(){function t(e){var i=this;l()(this,t),this.el=f("div","".concat(ot,"-banner-filename")),this.filename=f("div","".concat(ot,"-banner-filename-name")),this.filename.on("blur",(function(t){t.target.innerHTML=t.target.innerHTML.replace(/<[^>]+>/gi,"");var n=t.target.innerText;n=n.replace(/\r?\n|\r/g,""),e.filename=n+i.suffixStr,setTimeout((function(){e.selector.el.show()}),100)})),this.filename.on("focus",(function(t){window.mobileEditOnCell=!1,e.editor.el.hide()})),this.filename.on("keyup",(function(t){13===t.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return a()(t,[{key:"setValue",value:function(t){if(t.includes(".")){var e=t.substring(0,t.lastIndexOf(".")),i=this.suffixStr=t.substring(t.lastIndexOf("."));this.filename.html(e),this.suffix.html(i)}}}]),t}(),Xo=function(){function t(e,i,n,r,o,a,s){var c=this;l()(this,t),this.data=e;e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new Wo(!o),this.filenamebar=new Uo(a),this.menubar=new Do(e,i,n,r,s),this.el=f("div");var h=f("div","".concat(ot,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ot,o?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),o||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return a()(t,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(t){this.filenamebar.setValue(t)}}]),t}();function Yo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Vo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Yo(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Yo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Go(t,e){var i,n=this;return function(){for(var r=n,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=a;i||(i=setTimeout((function(){i=null,t.apply(r,l)}),e))}}function qo(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRect(),r=n.l,o=n.t,a=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(a)+l>h.width)i.move({left:r+l-h.width});else{var u=t.freezeTotalWidth();a<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)e.move({top:o+c-h.height-1});else{var f=t.freezeTotalHeight();s<f&&e.move({top:o-1-f})}}function Ko(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRectBySearch(),r=n.l,o=n.t;i.move({left:r-1}),e.move({top:o-1})}function Zo(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==i){var o=this.table,a=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===e||-1===i?"row-col":"range"),c.canSelected(e,i)){var u=c.getCell(e,i);t?(a.setEnd(e,i,r),this.trigger("cells-selected",u,a.range)):(a.set(e,i,n),this.trigger("cell-selected",u,e,i)),this.focusing=!0,a.setObjId(null),s.reset(),l.reset(),o.render()}}}function Jo(t,e){var i=this.selector,n=this.data,o=n.rows,a=n.cols,s=r()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(t){var d=r()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===e?c>0&&(c-=1):"right"===e?(f!==c&&(c=f),c<a.len-1&&(c+=1)):"up"===e?l>0&&(l-=1):"down"===e?(u!==l&&(l=u),l<o.len-1&&(l+=1)):"row-first"===e?c=0:"row-last"===e?c=a.len-1:"col-first"===e?l=0:"col-last"===e&&(l=o.len-1),t&&(i.moveIndexes=[l,c]),Zo.call(this,t,l,c),qo.call(this)}function $o(t){if(0===t.buttons&&t.target.className!=="".concat(ot,"-resizer-hover")){var e=t.offsetX,i=t.offsetY,n=this.rowResizer,r=this.colResizer,o=this.tableEl,a=this.data,s=a.rows,l=a.cols,c=a.displayRight2Left,h=a.settings.row.height;if(e>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=o.box(),f=a.getCellRectByXY(t.offsetX/a.zoomlevel,t.offsetY/a.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*a.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*a.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function Qo(t){var e=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=e.scroll().top,o=i.scroll().left,a=n.rows,s=n.cols,l=t.deltaY,c=t.deltaX,h=function(t,e){var i=t,n=0;do{n=e(i),i+=1}while(n<=0);return n},u=function(t){if(t>0){var i=n.scroll.ri+1;if(i<a.len){var o=h(i,(function(t){return a.getHeight(t)}));e.move({top:r+o-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(t){return a.getHeight(t)}));e.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),v=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&Go(u(t.detail),50),v===d&&Go(function(t){if(t>0){var e=n.scroll.ci+1;if(e<s.len){var r=h(e,(function(t){return s.getWidth(t)}));i.move({left:o+r-1})}}else{var a=n.scroll.ci-1;if(a>=0){var l=h(a,(function(t){return s.getWidth(t)}));i.move({left:0===a?0:o-l})}}}(c),50),v===f&&Go(u(l),50)}function ta(){var t=this.data,e=this.verticalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=t.exceptRowTotalHeight(0,-1);e.set(i,(t.rows.totalHeight()-n)*t.zoomlevel)}function ea(){var t=this.data,e=this.horizontalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).width;t&&e.set(i,t.cols.totalWidth()*t.zoomlevel),t.displayRight2Left?e.el.attr("dir","rtl"):e.el.removeAttr("dir")}function ia(){var t=this.selector,e=this.data,i=this.editor,n=this.canvas,o=r()(e.freeze,2),a=o[0],s=o[1];if(a>0||s>0){var l=e.freezeTotalWidth(),c=e.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(e),t.resetAreaOffset()}function na(){var t=this.tableEl,e=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,o=this.formulaBar,a=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(a.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();t.attr(h),e.offset(h);var u=this.data.zoomlevel;i.offset(Vo(Vo({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),ta.call(this),ea.call(this),ia.call(this),n.render(),r.reset(),o.reset(),a.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(a.br.useHideInput=!0)}function ra(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function oa(){var t=this.data,e=this.selector,i=this.canvas;t.copy(),e.showClipboard(),i.clipboard=null}function aa(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function sa(t,e){var i=this.data;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(t,(function(t){return lt("Tip",t)})))na.call(this);else if(e&&null==i.clipboard.range){var n=e.clipboardData.getData("text/plain");n.length>0&&(this.data.pasteFromText(n),na.call(this))}}function la(){this.data.hideRowsOrCols(),na.call(this)}function ca(t,e){this.data.unhideRowsOrCols(t,e),na.call(this)}function ha(){this.data.autofilter(),na.call(this)}function ua(){var t=document.createElement("div");t.id="aspose_mask_bg",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="#777",t.style.opacity=.6,t.style.zIndex=10001,document.body.appendChild(t);var e=document.createElement("div");e.style.position="absolute",e.style.top="33%",e.style.left="40%",e.style.backgroundColor="white",e.style.border="#336699 1px solid",e.style.textAlign="center",e.style.fontSize="medium",e.style.padding="1.5em 4em 1.5em 4em",e.innerText="updating , please wait...",t.appendChild(e)}function fa(){var t=document.getElementById("aspose_mask_bg");null!=t&&t.parentNode.removeChild(t)}function da(t,e){return va.apply(this,arguments)}function va(){return(va=bt()(kt.a.mark((function t(e,i){var n,r,o,a,s,l;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},o={p:JSON.stringify(r),uid:this.uniqueid,file:e,outputType:i},a=this.fileDownloadUrl,s=new FormData,Object.keys(o).forEach((function(t){return s.set(t,o[t])})),ua(),t.next=9,fetch(a,{method:"POST",body:s});case 9:if((l=t.sent).ok){t.next=15;break}fa(),alert("Download failed, please try again"),t.next=22;break;case 15:return t.t0=Ia,t.next=18,l.json();case 18:t.t1=t.sent,t.t2=e,(0,t.t0)(t.t1,t.t2),fa();case 22:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function ga(){var t=this.toolbar;t.paintformatActive()&&(sa.call(this,"format"),ra.call(this),t.paintformatToggle())}function pa(){var t=this.editor,e=this.contextMenu,i=this.commentTip,n=this.commentEditable;t.clear(),e.hide(),i.hide(),n.saveAndHide(this)}function ma(t){var e=this,i=this.selector,n=this.data,o=this.table,a=this.sortFilter,s=this.hyperlink,l=t.offsetX,c=t.offsetY,h=t.target.className==="".concat(ot,"-selector-corner"),u=o.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,v=f.top,g=f.width,p=f.height,m=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,C=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var k=x.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,k,x.getFilter(w),x.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=x)}for(var _=0,S=C.length;_<S;_++){var T=C[_];if(T.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var O=T.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,O,T.getFilter(w),T.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=T)}}if(!t.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(Zo.call(this,!1,b,w),!t.ctrlKey&&2!==t.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],A=r()(R,2);w=A[0],b=A[1]}window.mobileAndTabletCheck()||At(window,(function(t){var r=n.getCellRectByXY(t.offsetX/u,t.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==t.buttons||t.shiftKey||Zo.call(e,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(t){return lt("Tip",t)}))&&o.render(),i.hideAutofill(),ga.call(e))}))}h||1!==t.buttons||t.shiftKey&&Zo.call(this,!0,b,w)}}function ya(){var t=this.editor,e=this.data.getSelectedRect(),i=this.getTableOffset(),n="top";e.top>i.height/2&&(n="bottom"),t.setOffset(e,n)}function ba(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(ya.call(this),e.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),t),ra.call(this)))}function wa(){var t=this.formulaBar,e=this.data;t.resetData(e)}function xa(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrolly(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),ya.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Ca(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrollx(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),ya.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function ka(t,e){var i=t.ri,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.rows.getHeight(i);o.rows.setHeight(i,e),o.updateRowsHeight.add(i),o.updateConditionImagePositionForRow(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ta.call(this),ya.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function _a(t,e){var i=t.ci,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.cols.getWidth(i);o.cols.setWidth(i,e),o.updateCols.add(i),o.updateConditionImagePositionForCol(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ea.call(this),ya.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Sa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(t,e);var r=i.selector,o=r.ri,a=r.ci;if("finished"===e){if("server"===i.settings.updateMode)return;n.render()}else this.trigger("cell-edited",t,o,a)}}function Ta(t){var e=this.data;"insert-row"===t?e.insert("row"):"delete-row"===t?e.delete("row"):"insert-column"===t?e.insert("column"):"delete-column"===t?e.delete("column"):"delete-cell"===t?e.deleteCell():"delete-cell-format"===t?e.deleteCell("format"):"delete-cell-text"===t?e.deleteCell("text"):"cell-printable"===t?e.setSelectedCellAttr("printable",!0):"cell-non-printable"===t?e.setSelectedCellAttr("printable",!1):"cell-editable"===t?e.setSelectedCellAttr("editable",!0):"cell-non-editable"===t&&e.setSelectedCellAttr("editable",!1),ra.call(this),na.call(this)}function Oa(t){for(var e=t,i=0,n=0;null!==e;)i+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return{top:i,left:n}}function Ea(t,e,i){var n=this.data,r=this.modalSort,o=this.modalDownload,a=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==t&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(t.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?da.call(this,i,t):this.fileDownloadCallFunc(i,t,e)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===t)this.undo();else if("redo"===t)this.redo();else if("print"===t)this.print.preview(),this.print.toPrint();else if("paintformat"===t)!0===e?oa.call(this):ra.call(this);else if("clearformat"===t)Ta.call(this,"delete-cell-format");else if("chart"===t);else if("autofilter"===t)ha.call(this);else if("freeze"===t)if(e){var d=n.selector,v=d.ri,g=d.ci;this.freeze(v,g)}else this.freeze(0,0);else if("sort"===t)r.setValue(n.getSelectedSort());else if("download"===t)o.setValue(h);else if("download_HTML"===t)f.call(this,"HTML");else if("download_Original"===t)f.call(this,"Original");else if("download_XLSX"===t)f.call(this,"XLSX");else if("download_PDF"===t)f.call(this,"PDF");else if("download_GOOGLE"===t)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===t)f.call(this,"Original","Dropbox");else if("search"===t)s.show();else if("menu-display-hide"===t)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===t&&"commentEdit"===e||"insertComment"===t||"commentEdit"===t){var p=n.selector,m=p.ri,y=p.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===m&&x.col===y&&(b=x.note)}var C=n.cellRectWithOutTransfer(m,y);l.col=y,l.row=m,l.setPosition(b,C,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===t&&"commentRemove"===e||"commentRemove"===t){var k=n.selector,_=k.ri,S=k.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===S&&n.comments[T].row===_&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===t&&"commentPrevious"===e||"commentPrevious"===t)Ra(this,n,"previous");else if("insertComment"===t&&"commentNext"===e||"commentNext"===t)Ra(this,n,"next");else if("insert-image"===t)"url"===e&&c.show();else if("zoom-size"===t)this.setzoom(e.number);else if("insertSheet"===t)this.addSheet();else if("insertRow"===t)Ta.call(this,"insert-row");else if("insertColumn"===t)Ta.call(this,"insert-column");else if("link"===t){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),A="edit";if(!R){(R={}).area=E;var I=this.data.getCell(O.sri,O.sci);R.text=I?I.text:"",A="add"}a.setValue(xs.datas.map((function(t){return t.name})),R,A)}else n.setSelectedCellAttr(t,e),"formula"!==t||n.selector.multiple()||ba.call(this),na.call(this);i&&i()}function Ra(t,e,i){var n=t.selector,r=t.commentEditable,o=e.selector,a=o.ri,s=o.ci,l=a,c=s,h="";if(void 0!==e.comments){e.comments.sort((function(t,e){return t.row>e.row||t.row===e.row&&t.col>e.col?1:-1}));for(var u=0;u<e.comments.length;u++){var f=e.comments[u];if("previous"===i)(f.row<a||f.row===a&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>a||f.row===a&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=e.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function Aa(t,e,i,n){this.data.setAutoFilter(t,e,i,n),na.call(this),this.data.updateConditionImageVisible()}function Ia(t,e){var i=new XMLHttpRequest;i.open("get",t,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var t=this.response;Pa.call(this,t,e)}else alert("Download failed, please try again")},i.send()}function Pa(t,e){var i=document.createElement("a"),n=t;"string"==typeof t?i.target="_blank":n=window.URL.createObjectURL(t),i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof t&&window.URL.revokeObjectURL(n)}function Da(t){var e=Oa(t.target);return[t.changedTouches[0].pageX-e.left,t.changedTouches[0].pageY-e.top]}function Fa(){var t=this,e=this.selector,i=this.overlayerEl,n=this.rowResizer,o=this.colResizer,a=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,v=this.menubar,g=this.formulaBar,p=this.modalValidation,m=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,k=this.sortFilter,_=this.canvas,S=this.el;function T(t,e){pa.call(t),ma.call(t,e)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(e){$o.call(t,e)})).on("mousedown",(function(e){pa.call(t),2===e.buttons?(t.data.xyInSelectedRect(e.offsetX,e.offsetY)||ma.call(t,e),c.setPosition(e.offsetX,e.offsetY),e.stopPropagation()):2===e.detail?ba.call(t):ma.call(t,e)})).on("mousewheel.stop",(function(e){Qo.call(t,e)})).on("mouseout",(function(t){var e=t.offsetX;t.offsetY<=0&&o.hide(),e<=0&&n.hide()})),u.el.on("input",(function(e){if(1===t.commentEditable.el.el.childNodes.length&&"#text"===t.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(t.commentEditable.el.el.textContent)),t.commentEditable.el.el.replaceChild(i.el,t.commentEditable.el.el.firstChild),e.target.focus();var n=window.getSelection();n.selectAllChildren(e.target),n.collapseToEnd()}})),e.inputChange=function(e){Sa.call(t,e,"input"),ba.call(t),wa.call(t)},g.inputChange=function(e){Sa.call(t,e,"input"),ba.call(t,!1)},g.enter=function(e,i){if(e.altKey){l.insertTextNewLine(e);var n=i?e.target.innerHTML:e.target.innerText;Sa.call(t,n,"input"),ba.call(t,!1)}else l.clear(),Jo.call(t,!1,e.shiftKey?"up":"down"),t.focusing=!0;e.preventDefault()},g.tab=function(e){l.clear(),Jo.call(t,!1,e.shiftKey?"left":"right"),t.focusing=!0,e.preventDefault()},g.focuson=function(){t.focusing=!1},Tt(S.el,"mousemove",(function(e){h.hide();var i=e.offsetX,n=e.offsetY,r=t.data,o=t.table,a=t.hyperlink,s=t.canvas,l=r.comments,c=o.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=a.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});a.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(t){u.ri===t.row&&u.ci===t.col&&h.setPosition(t.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,A=!1,I=function(){return R&&A},P=this.getTableOffset(),D="",F=[0,0],M=[0,0],j=[0,0],L=[0,0],B=!1;E.table.zoomlevel;new AlloyFinger(this.el.el,{tap:function(t){},touchStart:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){!function(t,e){t.target.className.includes("item")||e.contextMenu.hide()}(t,E);var e=function(t,e){var i,n=t.target.className.includes("".concat(ot,"-selector-corner")),r=t.target.className.includes("tl")?"tl":"br",o=[],a=[],s=!1;return n&&(i=Oa(t.target.offsetParent.offsetParent),o[0]=t.changedTouches[0].pageX,o[1]=t.changedTouches[0].pageY,a[0]=e.data.scroll.x,a[1]=e.data.scroll.y,s=!0),[r,i,o,a,s]}(t,E),i=r()(e,5);D=i[0],O=i[1],F=i[2],j=i[3],(R=i[4])&&(B=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+j[0]),j[0]=E.data.scroll.x,j[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&I()){var i=M[0]-F[0]+E.data.scroll.x-j[0],n=M[1]-F[1]+E.data.scroll.y-j[1];e.setMobileMultipleSelect(i,n),function(t,e,i,n){if(e&&i){var r=t.br.areaEl.el.getBoundingClientRect(),o=r.right>window.screen.width?window.screen.width:r.right,a=r.top-i.top+n.top;a=a>window.screen.height?window.screen.height:a,c.setPosition(o,a)}}(e,!0,O,P);var o=(Pt(),[!1,!1,!1]),a=r()(o,3);R=a[0],A=a[1],B=a[2],E.table.render()}},doubleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&"CANVAS"===t.target.nodeName){var e=Da(t),i=r()(e,2);t.offsetX=i[0],t.offsetY=i[1],window.mobileEditOnCell=!0,T(E,t),ba.call(E)}},longTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=Da(t),i=r()(e,2),n=i[0],o=i[1];c.setPosition(n,o)}},singleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable||"CANVAS"!==t.target.nodeName||function(t){return t.target.className.includes("item")}(t))){var i=Da(t),n=r()(i,2);t.offsetX=n[0],t.offsetY=n[1],window.mobileEditOnCell=!0,T(E,t),e.br.useHideInput=!1,window.keyboardShow?(e.br.useHideInput=!0,ba.call(E)):function(t,e){var i=Da(t),n=r()(i,2),o=n[0],a=n[1];if(t.target.className.includes("".concat(ot,"-selector-corner"))){var s=Oa(t.target);o=s.left,a=s.top}var l=o<=e.left&&a>=e.top,h=o>=e.left&&a<=e.top;if(l||h){var u=l?e.left:o,f=h?e.top:a;c.setPosition(u,f)}}(t,P)}},rotate:function(t){},pinch:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){E.editor.el.hide();var e=t.zoom;e>2&&(e=2),e<.5&&(e=.5),E.setzoom(e)}},pressMove:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=E.selector;E.data;if(A=!0,I()){switch(function(t,e,i,n,r){t[0]=n.changedTouches[0].pageX,t[1]=n.changedTouches[0].pageY,e[0]=i.data.scroll.x,e[1]=i.data.scroll.y}(M,L,E,t),D){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];e.setEndMobile(i,n);var o=e.getMobileMultipleSelect(i,n),a=r()(o,2),s=a[0],l=a[1];s>=E.data.viewRange().eri-4&&!B&&(B=!0,e.setEnd(s,l),function(t,e){""!==t?Dt(e):Pt()}("down",E))}}else Math.abs(t.deltaX)>Math.abs(t.deltaY)?Math.abs(t.deltaX)>18&&(E.scrollH(t.deltaX),E.table.render()):Math.abs(t.deltaY)>18&&(E.scrollV(t.deltaY),E.table.render())}},swipe:function(t){}})}d.change=function(e,i){return Ea.call(t,e,i)},v.change=function(e,i){return Ea.call(t,e,i,(function(){return v.hideDropdown()}))},k.ok=function(e,i,n,r){return Aa.call(t,e,i,n,r)},n.finishedFn=function(e,i){ka.call(t,e,i)},o.finishedFn=function(e,i){_a.call(t,e,i)},n.unhideFn=function(e){ca.call(t,"row",e)},o.unhideFn=function(e){ca.call(t,"col",e)},a.moveFn=function(e,i){xa.call(t,e,i)},s.moveFn=function(e,i){Ca.call(t,e,i)},l.change=function(e,i){Sa.call(t,i,e),wa.call(t)},p.change=function(e){if("save"===e){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=t.data).addValidation.apply(i,r)}else t.data.removeValidation()},m.change=function(e,i,n,r){"ok"===e&&t.data.doSort(i,n,r)},y.change=function(e,i,n){"ok"===e&&da.call(t,i,n)},b.change=function(e,i,n){"ok"===e&&(t.canvas.isImageOnSelected()?t.canvas.setHyperlink(i):"add"===n&&(t.data.hyperlinks=t.data.hyperlinks.filter((function(t){return!C.valueOf(i.area).contains(C.valueOf(t.area))})),t.data.hyperlinks.push(i),t.hyperlink.setHyperlinkStyleByArea(i.area,t,!0),t.hyperlink.loadLinkPosition(t)))},w.change=function(e,i){var n=t.canvas,r=t;if("ok"===e){var o=r.data.getSelectedRect();n.setLoading(r,{top:o.top,left:o.left});var a={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name},s={p:JSON.stringify(a),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(t,e,i){(t=JSON.parse(t)).Error?lt("error",t.Error):n.doInsertURLImage(t,r)}})}},$("#upload-image").on("change",(function(e){var i=t.canvas,n=t,r=new FormData;r.append("uid",n.uniqueid);var o={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name};r.append("p",JSON.stringify(o)),r.append("image",e.target.files[0]);var a=n.data.getSelectedRect();i.setLoading(n,{top:a.top,left:a.left}),$.ajax({url:n.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:r,success:function(t,r,o){(t=JSON.parse(t)).Error?lt("error",t.Error):i.doInsertImage(t,n),e.target.value=null}})})),x.change=function(i,n,r,o,a){if("close"!==i){r||(n=n.toUpperCase());var s=t.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===o&&l.matchwhole===a)d=l.result;else{var v=c.len>0?c._:{},g=null;if("comments"===o){for(var p=document.createElement("c"),m=0,y=h.length;m<y;m++)if(p.innerHTML=h[m].note,g=r?p.innerText:p.innerText.toUpperCase(),!a&&-1!==g.indexOf(n)||a&&g===n){var b={ri:h[m].row,ci:h[m].col};b.cmt=h[m],d.push(b)}}else for(var w in v){var x=v[w].cells;for(var C in x)if("values"===o?g=r?x[C].text:x[C].text.toUpperCase():"formulas"===o&&(g=void 0!==x[C].f?r?x[C].f:x[C].f.toUpperCase():null),null!=g&&(a&&g===n||!a&&-1!==g.indexOf(n))){var k={ri:w,ci:C};d.push(k)}}l.keywords=n,l.lookin=o,l.matchwhole=a,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var _=-1,S=Number(e.indexes[0]),T=Number(e.indexes[1]),O=d.length-1;if(1===d.length)_=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===S&&Number(d[E].ci)>T){_=E;break}if(Number(d[E].ri)>S){_=E;break}}-1===_&&(_=0)}else{for(var A=O;A>=0;A--){if(Number(d[A].ri)===S&&Number(d[A].ci)<T){_=A;break}if(Number(d[A].ri)<S){_=A;break}}-1===_&&(_=O)}l.current=_;var I=d[_];if(e.set(I.ri,I.ci),d[_].cmt){var P=I.cmt.note;if(""!==P){var D=s.cellRectWithOutTransfer(I.ri,I.ci);u.col=I.ci,u.row=I.ri,u.onEdit=!1,u.setPosition(P,D)}}Ko.call(t)}},c.showMenuBefore=function(e){var i=r()(t.selector.indexes,2),n=i[0],o=i[1],a=!1;if(e.forEach((function(t){return t.show()})),t.canvas.isImageOnSelected()){if(e.forEach((function(t){-1===["copy","cut","paste","link"].indexOf(t.key)&&t.hide()})),t.canvas.checkHyperlink(t.canvas.fabric))return;t.canvas.validType(t.canvas.fabric,"type","Chart")&&(a=!0)}if(!t.hyperlink.check(t.data,n,o)){var s=null;if(e.forEach((function(t){a&&"link"===t.key&&(s.hide(),t.hide()),"openLink"===t.key&&t.hide(),"removeLink"===t.key&&t.hide(),s=t})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(t){return W("contextmenu.".concat(t))}));e.forEach((function(e){l.includes(e.el.innerText)||e.hide(),e.el.className.includes("divider")&&e.hide(),t.data.merges.equals(t.selector.range)&&e.el.innerText===W("contextmenu.merge")&&e.hide(),t.data.merges.equals(t.selector.range)||e.el.innerText!==W("contextmenu.unmerge")||e.hide()}))}}},c.itemClick=function(e){if("validation"===e)p.setValue(t.data.getSelectedValidation());else if("sort"===e)m.setValue(t.data.getSelectedSort());else if("download"===e)y.setValue(t.filename);else if("link"===e){if(t.canvas.isImageOnSelected())return void t.canvas.link(t.data);var i=t.selector.range,n=t.hyperlink.getSelectArea(i),r=t.hyperlink.findByArea(t.data,n),o="edit";if(!r){(r={}).area=n;var a=t.data.getCell(i.sri,i.sci);r.text=a?a.text:"",o="add"}b.setValue(xs.datas.map((function(t){return t.name})),r,o)}else"removeLink"===e?t.canvas.isImageOnSelected()?t.canvas.removeLink(t.data):t.hyperlink.removeByRange(t.selector.range,t):"openLink"===e?t.canvas.isImageOnSelected()?t.canvas.openLink(t.data):t.hyperlink.accessByRange(t.selector.range,t.data):"copy"===e?(oa.call(t),t.canvas.doOperation("copy")):"cut"===e?(aa.call(t),t.canvas.doOperation("copy"),t.canvas.doOperation("delete")):"paste"===e?_.clipboard?t.canvas.doOperation("paste"):sa.call(t,"all"):"paste-value"===e?sa.call(t,"text"):"paste-format"===e?sa.call(t,"format"):"hide"===e?la.call(t):"delete-image"===e?t.canvas.doOperation("delete"):"merge"===e?(t.data.setSelectedCellAttr(e,!0),t.table.render()):"unmerge"===e?(t.data.setSelectedCellAttr("merge",!1),t.table.render()):"edit"===e?ba.call(t):Ta.call(t,e)},Tt(window,"resize",(function(){window.mobileAndTabletCheck()||t.reload()})),Tt(window,"click",(function(t){})),Tt(window,"paste",(function(e){t.focusing&&"commentEdit"!==e.target.parentElement.id&&(e.target.parentElement.parentElement&&"commentEdit"===e.target.parentElement.parentElement.id||(sa.call(t,"all",e),e.preventDefault()))})),Tt(window,"keydown",(function(e){if(t.focusing&&"commentEdit"!==e.target.id){var i=e.keyCode||e.which,n=e.key,r=e.ctrlKey,o=e.shiftKey,a=e.metaKey;if(r||a)switch(i){case 90:t.undo(),e.preventDefault();break;case 89:t.redo(),e.preventDefault();break;case 67:oa.call(t),_.doOperation("copy"),e.preventDefault();break;case 88:aa.call(t),e.preventDefault();break;case 85:d.trigger("underline"),e.preventDefault();break;case 86:_.clipboard?_.doOperation("paste"):sa.call(t,"all"),e.preventDefault();break;case 37:Jo.call(t,o,"row-first"),e.preventDefault();break;case 38:Jo.call(t,o,"col-first"),e.preventDefault();break;case 39:Jo.call(t,o,"row-last"),e.preventDefault();break;case 40:Jo.call(t,o,"col-last"),e.preventDefault();break;case 32:Zo.call(t,!1,-1,t.data.selector.ci,!1),e.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:o&&Zo.call(t,!1,t.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),ra.call(t);break;case 37:Jo.call(t,o,"left"),e.preventDefault();break;case 38:Jo.call(t,o,"up"),e.preventDefault();break;case 39:Jo.call(t,o,"right"),e.preventDefault();break;case 40:Jo.call(t,o,"down"),e.preventDefault();break;case 9:l.clear(),Jo.call(t,!1,o?"left":"right"),e.preventDefault();break;case 13:l.clear(),Jo.call(t,!1,o?"up":"down"),e.preventDefault();break;case 8:Ta.call(t,"delete-cell-text"),e.preventDefault()}"Delete"===n?(Ta.call(t,"delete-cell-text"),_.doOperation("delete"),e.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===e.key?(Sa.call(t,e.key,"input"),ba.call(t),wa.call(t)):113===i&&ba.call(t)}}}))}var Ma=function(){function t(e,i){var n=this;l()(this,t),this.eventMap=new Map;var r=i.settings,o=r.view,a=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,v=r.local;this.el=f("div","".concat(ot,"-sheet")),this.menubar=new Xo(i,o.width,!a,u,s,this,v),this.toolbar=new Or(i,o.width,!a,u),this.formulaBar=new qr(i,h),this.canvas=new uo,this.print=new Ci(i,this.canvas),this.hyperlink=new Fo,e.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ot,"-table"));var g=i.settings.row.height;this.rowResizer=new Mt(!1,g,this),this.colResizer=new Mt(!0,i.cols.minWidth,this),this.verticalScrollbar=new jt(!0),this.horizontalScrollbar=new jt(!1),this.editor=new _e(ue,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new jr,this.modalSort=new zr,this.modalDownload=new zo,this.modalLink=new No,this.modalSearch=new Gr,this.modalInsertURLImage=new vo,this.contextMenu=new Oi((function(){return n.getRect()}),this,!c,d),this.commentTip=new Yr,this.commentEditable=new Zr,this.selector=new $t(i),this.highlight=new Lo(this),this.overlayerCEl=f("div","".concat(ot,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ot,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new Xr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new gi(this.tableEl.el,i),Fa.call(this),na.call(this),Zo.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var e;return a()(t,[{key:"setReloadUrl",value:function(t){this.reloadUrl=t}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(t,e){return this.eventMap.set(t,e),this}},{key:"preMousedown",value:function(){pa.call(this)}},{key:"trigger",value:function(t){var e=this.eventMap;if(e.has(t)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=e.get(t)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(t){this.editor.clear(),this.data=t,ta.call(this),ea.call(this);var e=this.getTableOffset();this.overlayerCEl.offset(e),t.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(t),this.formulaBar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t),this.canvas.reset(t),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(t){return this.data.setData(t),na.call(this),this}},{key:"scrollV",value:function(t){var e=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:e-t})}},{key:"scrollToRow",value:function(t){var e=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=t>i?-this.data.rows.sumHeight(i,t):this.data.rows.sumHeight(t,i);this.verticalScrollbar.move({top:e-n})}},{key:"scrollH",value:function(t){var e=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:e-t})}},{key:"selectMoveDown",value:function(){Jo.call(this,!0,"down")}},{key:"freeze",value:function(t,e){var i=this.data;return this.canvas.doResetPosition(t,e),i.setFreeze(t,e),na.call(this),this}},{key:"setActiveCell",value:function(t,e){return Zo.call(this,!1,t,e),this.focusing=!0,this}},{key:"undo",value:function(){this.data.undo(),na.call(this)}},{key:"redo",value:function(){this.data.redo(),na.call(this)}},{key:"reload",value:function(){return na.call(this),this}},{key:"setzoom",value:function(t){var e=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=t,e.zoomlevel=t;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/t,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/t,"px")),n.setZoom(t),na.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),e.updateConditionImageZoom()}},{key:"showHighlights",value:function(t){this.highlight.showHighlights(t)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(t,e,i,n){this.highlight.addHighlightText(t,e,i,n)}},{key:"removeHighlightText",value:function(t,e,i,n){this.highlight.removeHighlightText(t,e,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(t,e,i,n){this.highlight.addHighlightRange(t,e,i,n)}},{key:"removeHighlightRange",value:function(t,e,i,n){this.highlight.removeHighlightRange(t,e,i,n)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.highlight.setHighlightInverseRange(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(t){this.highlight.addHighlightShape(t)}},{key:"removeHighlightShape",value:function(t){this.highlight.removeHighlightShape(t)}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(t){this.highlight.addHighlightImage(t)}},{key:"removeHighlightImage",value:function(t){this.highlight.removeHighlightImage(t)}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(t,e)}},{key:"setCustomHighlightImgFunc",value:function(t){this.highlight.setCustomHighlightImgFunc(t)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(t){this.contextMenu.addImageContextMenuItems(t)}},{key:"delImageContextMenuItems",value:function(t){this.contextMenu.delImageContextMenuItems(t)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(t){this.contextMenu.addCutomContextMenuItems(t)}},{key:"insertCustomContextMenuItem",value:function(t,e){this.contextMenu.insertCutomContextMenuItem(t,e)}},{key:"updateCustomContextMenuItem",value:function(t,e){this.contextMenu.updateCutomContextMenuItem(t,e)}},{key:"delCustomContextMenuItems",value:function(t){this.contextMenu.delCutomContextMenuItems(t)}},{key:"getOle",value:(e=bt()(kt.a.mark((function t(e){var i;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.oleDownloadUrl+"?id="+e+"&uid="+this.uniqueid+"&sheet="+this.data.name,Pa.call(this,i);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"getRect",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:"getTableOffset",value:function(){var t=this.data,e=t.rows,i=t.cols,n=t.displayRight2Left,r=this.table.zoomlevel,o=this.data.settings.row.height,a=this.getRect(),s=a.width,l=a.height;return{width:(s-i.indexWidth)*r,height:(l-e.height)*r,left:n?0:i.indexWidth*r,top:o*r}}}]),t}();function ja(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var La=function(t){tt()(i,t);var e=ja(i);function i(t){var n;l()(this,i);var r=new st("ellipsis");return(n=e.call(this,r,"auto",!1,"top-left")).contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}},{key:"setTitle",value:function(){}}]),i}(Fi),Ba=function(t){tt()(i,t);var e=ja(i);function i(t){var n;l()(this,i);var r=new st("pagination");return(n=e.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}}]),i}(Fi),za=[{key:"delete",title:U("contextmenu.deleteSheet")}];function Ha(t){var e=this;return f("div","".concat(ot,"-item")).child(t.title()).on("click",(function(){e.itemClick(t.key),e.hide()}))}function Na(){var t=this;return za.map((function(e){return Ha.call(t,e)}))}var Wa=function(){function t(){var e;l()(this,t),this.el=(e=f("div","".concat(ot,"-contextmenu")).css("width","160px")).children.apply(e,v()(Na.call(this))).hide(),this.itemClick=function(){}}return a()(t,[{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setOffset",value:function(t){var e=this.el;e.offset(t),e.show(),Rt(e)}}]),t}(),Ua=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,t),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=o,this.scrollFunc=a,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new La((function(t){e.clickSwap2(e.items[t])})),this.paginationEl=new Ba((function(t){e.scrollFunc(t)})),this.contextMenu=new Wa,this.contextMenu.itemClick=r,this.el=f("div","".concat(ot,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return a()(t,[{key:"setMenuEl",value:function(){var t=this;return"edit"===this.settings.mode?f("ul","".concat(ot,"-menu")).child(f("li","").children(new st("add").on("click",(function(){t.dataNames.length<10?t.addFunc():lt("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ot,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(t,e,i,n){this.dataNames.push(t);var r=f("li",e?"active":"").child(t);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),e&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(t){for(var e=[],i=1;i<=t;i++){var n=i+"";e.push(n)}this.paginationEl.reset(e)}},{key:"setItemEvent",value:function(t){var e=this;"edit"===this.settings.mode?t.on("click",(function(){e.clickSwap2(t)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,o=n.offsetHeight;e.contextMenu.setOffset({left:r,bottom:o+1}),e.deleteEl=t})).on("dblclick",(function(){if(!(t.el.children.length>0)){var i=t.html(),n=new Rr("auto","",31);n.val(i),n.input.on("blur",(function(t){var r=t.target.value,o=e.dataNames.findIndex((function(t){return t===i}));e.renameItem(o,r,n)})),t.html("").child(n.el),n.focus()}})):t.on("click",(function(){e.clickSwap2(t)}))}},{key:"renameItem",value:function(t,e,i){if(this.dataNames[t]!==e&&0!==e.length)if(e.length>31)lt("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(e)>=0)lt("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<e.length;n++)switch(e[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void lt("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html("").child(e),this.updateFunc(t,e)}else this.items[t].html("").child(e)}},{key:"clear",value:function(){var t=this;this.items.forEach((function(e){t.menuEl.removeChild(e.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"deleteItem",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(t){return t===e}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var n=r()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(t){var e=this.items.findIndex((function(e){return e===t}));this.clickSwap(t),this.activeEl.toggle(),this.swapFunc(e)}},{key:"clickSwap",value:function(t){null!==this.activeEl&&this.activeEl.toggle(),this.activeEl=t}},{key:"setDirection",value:function(t){t?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),t}();i(35),i(36);function Xa(t){var e=[],i=0;this.run=function(t){var n=this;this.startHandler(t,(function(){i--,t.timestm,t.isfinish,e.length>0&&n.run(e.shift())}))},this.startHandler=function(n,r){var o=this;n.isfinish?e.length>0&&this.run(e.shift()):0!==i?setTimeout((function(){return o.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,t(n,r))},this.append=function(t){e.push(t),e.length,t.timestm,1===e.length&&this.run(t)},this.isFinish=function(){return 0===e.length&&0===i}}var Ya=function t(e,i,n,r){l()(this,t),this.item=e,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function Va(t,e){var i=$.ajax({url:t.url,type:"post",dataType:"json",data:t.item});t.timestm,t.isfinish,i.done((function(i){t.timestm,t.callback&&(t.callback(i),t.isfinish=!0),e()})),i.fail((function(i,n,r){t.timestm,t.callbackerror&&(t.callbackerror(i,n,r),t.isfinish=!0),e()}))}function Ga(t){t.scaleX=1,t.scaleY=1,t.originAngle=t.angle;var e=t.originAngle;e<0&&(e+=360),e>90&&e<180?e=180-e:e>=180&&e<270?e-=180:e>=270&&(e=360-e),e>=45&&(e=90-e);Math.sin(.017453293*e),Math.cos(.017453293*e);t.originWidth=t.width,t.originHeight=t.height,t.originLeft=t.left,t.originTop=t.top}function qa(t,e,i,n,r,o){var a,s,l;return{id:t,tick:e.tick,width:e.width,height:e.height,top:e.top+r.top/o,left:n+r.left/o,"z-index":i+e.zorder,originAngle:e.originAngle,rotate:e.angle,imgType:e.type,strid:e.strid,text:e.text,html:e.html,hyperlink:e.hyperlink,zorder:e.zorder,fromOutside:null!==(a=e.fromOutside)&&void 0!==a&&a,scaleX:null!==(s=e.scaleX)&&void 0!==s?s:1,scaleY:null!==(l=e.scaleY)&&void 0!==l?l:1}}var Ka=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t);var r=e;this.options=n,n.local&&Y(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new Xa(Va),"string"==typeof e&&(r=document.querySelector(e)),window.mobileAndTabletCheck=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(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|xda|xiino|android|ipad|playbook|silk/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),e},window.mobileEditOnCell=!1,Ft((function(t){var e=i.sheet;e.data,e.selector,e.canvas,e.editor,e.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(t){window.keyboardShow=!0;var e=i.sheet,n=e.data;e.selector,e.editor,e.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new Ua((function(){if(i.uniqueid.endsWith(".csv"))lt("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))lt("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var t=i.addSheet();t.showGrid=!0,i.sheet.resetData(t)}}),(function(t){var e=i.datas[t];e.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(e),i.bottombar.setDirection(e.displayRight2Left),i.resetPagination(e),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(e.zoomlevel)}),(function(){i.deleteSheet()}),(function(t,e){i.renameSheet(t,e)}),(function(t){var e=t*i.data.settings.row.len,n=i.data.rows.sumHeight(0,e);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var o=f("div","".concat(ot)).on("contextmenu",(function(t){return t.preventDefault()}));r.appendChild(o.el),this.sheet=new Ma(o,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(t){i.setActiveSheetByName(t)},this.sheet.hyperlink.setActiveCell=function(t,e){i.setActiveCell(t,e)},this.sheet.addSheet=this.bottombar.addFunc,o.child(this.bottombar.el)}return a()(t,[{key:"setUniqueId",value:function(t){this.uniqueid=t,this.sheet.uniqueid=t}},{key:"setFileDownloadInfo",value:function(t){this.sheet.fileDownloadUrl=t}},{key:"setOleDownloadInfo",value:function(t){this.sheet.oleDownloadUrl=t}},{key:"setFileName",value:function(t){this.filename=t,this.sheet.filename=t,this.sheet.menubar.setFileName(t)}},{key:"setZoomLevel",value:function(t){this.sheet.setzoom(t)}},{key:"setReloadUrl",value:function(t){this.sheet.setReloadUrl(t)}},{key:"setVisibleFilter",value:function(t){this.sheet.visibleFilter=t}},{key:"setFileDownloadCallFunction",value:function(t){this.sheet.fileDownloadCallFunc=t}},{key:"setImageInfo",value:function(t,e,i,n,r,o,a){return this.imageDiv=t,this.imageUrl=e,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=o,this.updating=a,this}},{key:"setImageForTest",value:function(t,e,i){return this.imageDiv=t,this.imageUrl=e,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(t){var e=this.sheet,i=this.bottombar,n=e.data;if(n.displayRight2Left!==t){n.displayRight2Left=t;var r=e.getTableOffset();e.overlayerCEl.offset(r),e.resetData(n),i.setDirection(t)}}},{key:"getUpdateDatas",value:function(){for(var t=[],e=0,i=this.datas.length;e<i;e++){var n=this.datas[e].getDataForSave();null!=n&&t.push(n)}return t}},{key:"addSheet",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t||"sheet".concat(this.sheetIndex),a=new mt(o,this.options);return a.rows.setCellText(0,0,""),a.change=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["change"].concat(n))},a.updateCellsData=function(t){var i=e.sheet.data,n=i.updateCellError,r=i.updateMyCells,o=e.uniqueid,a=e.imageUrl;t.Error?(t.cell&&(r.call(e.sheet.data,[t.cell]),e.reRender()),t.cells&&(r.call(e.sheet.data,t.cells),e.reRender()),t.p&&(e.sheet.data.updateRevertOpr(t.p),e.reRender()),n(t.Error)):"update"===t.op?(t.data.forEach((function(t,i,n){for(var r=0,s=new Array;r<e.datas.length;r++)if(e.datas[r].name===t.name){e.datas[r].updateMyCells(t.cells),e.datas[r].updateShapes(t.shapes,s),e.datas[r].updateMyConditionImages(t.conditionimg);break}e.sheet.data.updateShapeSrcToRefresh(o,a,t.pickey,s)})),e.reRender()):"sort"===t.op&&t.rowids&&t.rowids.length>0&&(e.sheet.data.sortByRowIdArray(t.r,t.rowids),e.reRender())},a.updateServerError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateServerError"].concat(n))},a.updateCellError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateCellError"].concat(n))},a.updateCellServer=function(t){var i=e.sheet.data,n=i.settings,r=i.updateServerError,o=i.updateCellsData,a=e.uniqueid,s=e.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(t),uid:a,folderName:n.folderName,fileName:n.fileName};s.append(new Ya(l,n.updateUrl,(function(t){o(t)}),(function(t,e,i){r(t,e,i)})))}},a.menubarStatus=function(){return!e.sheet||"up"===e.sheet.toolbar.menuDisplay.state},a.loadImages=function(){var t=e.sheet.data,i=t.images,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=qa(s.canvas.picId(t.id,t.tick),t,a,e,c,s.table.zoomlevel);t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.loadShapes=function(){var t=e.sheet.data,i=t.shapes,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=qa(s.canvas.shapeId(t.id,t.tick),t,a,e,c,s.table.zoomlevel);"TextBox"===t.type?(ri(t),i.rtxt=t.rtxt,i.bigfontsize=t.bigfontsize,i.valign=t.valign,i.align=t.align,i.wrap=t.wrap,s.canvas.setTextBox(s,t,i)):t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.fillImageSrc=function(){var t=e.sheet.data,i=t.images,n=t.shapes,r=t.sheetid,o=t.isImageOk,a=e.uniqueid,s=(e.imageDiv,e.imageUrl);e.basicZorder;if(!o&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=e,c=e.istestforimage?s+"/"+a+"."+r+"_batch.zip":s+"?uid="+a+"&id="+r+"_batch.zip";e.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(t){l.sheet.data.generatePicItems(i,n,t)}))}},a.fillImageOnebyOne=function(t,i){var n=new XMLHttpRequest,r=e.sheet,o=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(o))}),200);n.onreadystatechange=function(){if(4==n.readyState){var t=n.response,e=new Uint8Array(t);JSZip.loadAsync(e).then((function(t){i.forEach((function(e,i,n){t.file(e.name).async("blob").then((function(t){var i=URL.createObjectURL(t),n=r.canvas.fabric.getObjects().find((function(t){return t.id===e.id}));n&&"TextBox"!==n.imgType&&(n.setSrc(i,(function(t){var e;r.canvas.fabric.requestRenderAll(),r.canvas.saveCanvasData(r.data),null===(e=r.canvas.inFreeze)||void 0===e||e.loadFreezeImage()})),e.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",t,!0),n.responseType="arraybuffer",n.send()},a.loadConditionImage=function(){var t=e.sheet.data.conditionimg,i=e.imageDiv,n=e.basicZorder;t&&t.forEach((function(t){if(t.data){var e=a.createConditionImage(t,n);t.data=void 0,t.image=e,i.append(e)}else i.append(t.image)}))},a.insertConditionImage=function(t){var i=e.sheet.data.conditionimg,n=e.imageDiv,r=e.basicZorder;if(i)if(t.data){var o=a.createConditionImage(t,r);t.data=void 0,t.image=o,n.append(o),i.push(t)}else n.append(t.image)},a.reloadImagesShapes=function(){var t=e.imageDiv;null!=t&&(t.empty(),t.css("left",0),t.css("top",0),a.loadImages(),a.loadShapes(),a.loadConditionImage(),a.fillImageSrc())},a.scrollImagesShapes=function(){var t=e.imageDiv,i=e.sheet.canvas,n=e.sheet.data,r=n.scroll,o=n.displayRight2Left,a=n.zoomlevel;i.publishEvent("object:scroll",e.sheet.data),i.initFreeze(),null!=t&&(t.css("left",o?r.x*a:-r.x*a),t.css("top",-r.y*a))},this.datas.push(a),this.bottombar.addItem(o,i,n,r),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(o),a}},{key:"resetPagination",value:function(t){var e=t.rows.len,i=t.settings.row.len,n=e%i==0?e/i:Math.ceil(e/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var t=this.bottombar.deleteItem(),e=r()(t,2),i=e[0],n=e[1];if(i>=0){var o=this.datas[i].name;this.sheet.data.delSheetOpr(o),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(t,e){var i=this.datas[t].name;this.datas[t].name=e,this.sheet.data.renameSheetOpr(i,e)}},{key:"loadData",value:function(t){this.isloading=!0;var e=Array.isArray(t)?t:[t];if(this.bottombar.clear(),this.datas=[],e.length>0)for(var i=0;i<e.length;i+=1){var n,o,a=e[i],s=this.addSheet(a.name,0===i,a.tabcolor,a.fontcolor);if(void 0!==a.merges)for(var l=0,c=a.merges.length;l<c;l++){var h=a.merges[l].split(":"),u=y(h[0]),f=r()(u,2),d=f[0],v=f[1],g=y(h[1]),p=r()(g,2),m=p[0],b=p[1];a.rows[v]&&a.rows[v].cells[d]&&(a.rows[v].cells[d].merge=[b-v,m-d])}null===(n=a.images)||void 0===n||n.forEach((function(t){Ga(t)})),null===(o=a.shapes)||void 0===o||o.forEach((function(t){Ga(t)})),s.setData(a)}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(t){return t.getData()}))}},{key:"cellText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(t,e,i,"finished"),this}},{key:"setActiveCell",value:function(t,e){return this.sheet.setActiveCell(t,e),this}},{key:"setActiveSheet",value:function(t){return this.bottombar.clickSwap2(this.bottombar.items[t]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(t){for(var e=0;e<this.bottombar.dataNames.length;e++)if(this.bottombar.dataNames[e]===t){this.bottombar.clickSwap2(this.bottombar.items[e]);break}return this}},{key:"cell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(t,e)}},{key:"cellStyle",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(t,e)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(t){this.sheet.showHighlights(t)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(t,e){return this.sheet.on(t,e),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(t){return this.sheet.on("change",t),this}},{key:"updateServerError",value:function(t){return this.sheet.on("updateServerError",t),this}},{key:"updateCellError",value:function(t){return this.sheet.on("updateCellError",t),this}}],[{key:"locale",value:function(t,e){X(t,e)}}]),t}(),Za=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ka(t,e)};window&&(window.x_spreadsheet=Za,window.x_spreadsheet.locale=function(t,e){return X(t,e)});e.default=Ka}]);
|
|
12
|
+
e.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=t[e+u];for(u+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+u],u+=f,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+u],u+=f,h-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var a,s,l,c=8*o-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,v=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=h?(s=0,a=h):a+u>=1?(s=(e*l-1)*Math.pow(2,r),a+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;t[i+d]=255&s,d+=v,s/=256,r-=8);for(a=a<<r|s,c+=r;c>0;t[i+d]=255&a,d+=v,a/=256,c-=8);t[i+d-v]|=128*g}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e){},function(t,e){},function(t,e){},function(t,e,i){},function(t,e,i){"use strict";(function(t){var e=i(13),n=i.n(e);!function(){function e(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function i(t,i){var n=function(t,i){var n=e(t)*e(i);if(0===n)return 0;var r=function(t,e){return t.x*e.x+t.y*e.y}(t,i)/n;return r>1&&(r=1),Math.acos(r)}(t,i);return function(t,e){return t.x*e.y-e.x*t.y}(t,i)>0&&(n*=-1),180*n/Math.PI}var r=function(t){this.handlers=[],this.el=t};function o(t,e){var i=new r(t);return i.add(e),i}r.prototype.add=function(t){this.handlers.push(t)},r.prototype.del=function(t){t||(this.handlers=[]);for(var e=this.handlers.length;e>=0;e--)this.handlers[e]===t&&this.handlers.splice(e,1)},r.prototype.dispatch=function(){for(var t=0,e=this.handlers.length;t<e;t++){var i=this.handlers[t];"function"==typeof i&&i.apply(this.el,arguments)}};var a=function(t,e){this.element="string"==typeof t?document.querySelector(t):t,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=o(this.element,e.rotate||i),this.touchStart=o(this.element,e.touchStart||i),this.multipointStart=o(this.element,e.multipointStart||i),this.multipointEnd=o(this.element,e.multipointEnd||i),this.pinch=o(this.element,e.pinch||i),this.swipe=o(this.element,e.swipe||i),this.tap=o(this.element,e.tap||i),this.doubleTap=o(this.element,e.doubleTap||i),this.longTap=o(this.element,e.longTap||i),this.singleTap=o(this.element,e.singleTap||i),this.pressMove=o(this.element,e.pressMove||i),this.twoFingerPressMove=o(this.element,e.twoFingerPressMove||i),this.touchMove=o(this.element,e.touchMove||i),this.touchEnd=o(this.element,e.touchEnd||i),this.touchCancel=o(this.element,e.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}};a.prototype={start:function(t){if(t.touches){this.now=Date.now(),this.x1=t.touches[0].pageX,this.y1=t.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(t,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var i=this.preV;if(t.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:t.touches[1].pageX-this.x1,y:t.touches[1].pageY-this.y1};i.x=n.x,i.y=n.y,this.pinchStartLen=e(i),this.multipointStart.dispatch(t,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(t,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(t){if(t.touches){var n=this.preV,r=t.touches.length,o=t.touches[0].pageX,a=t.touches[0].pageY;if(this.isDoubleTap=!1,r>1){var s=t.touches[1].pageX,l=t.touches[1].pageY,c={x:t.touches[1].pageX-o,y:t.touches[1].pageY-a};null!==n.x&&(this.pinchStartLen>0&&(t.zoom=e(c)/this.pinchStartLen,this.pinch.dispatch(t,this.element),this._preventTap=!0,this._inZoom=!0),t.angle=i(c,n),this.rotate.dispatch(t,this.element)),n.x=c.x,n.y=c.y,null!==this.x2&&null!==this.sx2?(t.deltaX=(o-this.x2+s-this.sx2)/2,t.deltaY=(a-this.y2+l-this.sy2)/2):(t.deltaX=0,t.deltaY=0),this.twoFingerPressMove.dispatch(t,this.element),this.sx2=s,this.sy2=l}else{if(null!==this.x2){t.deltaX=o-this.x2,t.deltaY=a-this.y2;var h=Math.abs(this.x1-this.x2),u=Math.abs(this.y1-this.y2);(h>10||u>10)&&(this._preventTap=!0)}else t.deltaX=0,t.deltaY=0;this.pressMove.dispatch(t,this.element)}this.touchMove.dispatch(t,this.element),this._cancelLongTap(),this.x2=o,this.y2=a,r>1&&t.preventDefault()}},end:function(t){if(t.changedTouches){this._cancelLongTap();var e=this;t.touches.length<2&&(this.multipointEnd.dispatch(t,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(t.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){e.swipe.dispatch(t,e.element)}),0)):(this.tapTimeout=setTimeout((function(){e._preventTap||e.tap.dispatch(t,e.element),e.isDoubleTap&&(e.doubleTap.dispatch(t,e.element),e.isDoubleTap=!1)}),0),e.isDoubleTap||e._preventTap||(e.singleTapTimeout=setTimeout((function(){e.singleTap.dispatch(t,e.element)}),250))),this.touchEnd.dispatch(t,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(t){this.cancelAll(),this.touchCancel.dispatch(t,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(t,e,i,n){return Math.abs(t-e)>=Math.abs(i-n)?t-e>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(t,e){this[t]&&this[t].add(e)},off:function(t,e){this[t]&&this[t].del(e)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}},"object"===("undefined"==typeof exports?"undefined":n()(exports))?t.exports=a:window.AlloyFinger=a}()}).call(this,i(37)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,i){"use strict";i.r(e),i.d(e,"spreadsheet",(function(){return ss}));var n=i(5),r=i.n(n),o=i(2),a=i.n(o),s=i(0),l=i.n(s),c=i(14),h=i.n(c),u=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,t),"string"==typeof e?(this.el=document.createElement(e),this.el.className=i):this.el=e,this.data={}}return a()(t,[{key:"data",value:function(t,e){return void 0!==e?(this.data[t]=e,this):this.data[t]}},{key:"on",value:function(t,e){var i=t.split("."),n=h()(i),r=n[0],o=n.slice(1),a=r;return"mousewheel"===a&&/Firefox/i.test(window.navigator.userAgent)&&(a="DOMMouseScroll"),this.el.addEventListener(a,(function(t){e(t);for(var i=0;i<o.length;i+=1){var n=o[i];if("left"===n&&0!==t.button)return;if("right"===n&&2!==t.button)return;"stop"===n&&t.stopPropagation()}})),this}},{key:"offset",value:function(t){var e=this;if(void 0!==t)return Object.keys(t).forEach((function(i){e.css(i,"".concat(t[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(t){var e=this.el;return void 0!==t&&(void 0!==t.left&&(e.scrollLeft=t.left),void 0!==t.top&&(e.scrollTop=t.top)),{left:e.scrollLeft,top:e.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new t(this.el.parentNode)}},{key:"children",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(e){return t.child(e)})),this)}},{key:"removeChild",value:function(t){this.el.removeChild(t)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;return"string"==typeof e?n=document.createTextNode(e):e instanceof t&&(n=e.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(t){return this.el.contains(t)}},{key:"className",value:function(t){return void 0!==t?(this.el.className=t,this):this.el.className}},{key:"addClass",value:function(t){return this.el.classList.add(t),this}},{key:"hasClass",value:function(t){return this.el.classList.contains(t)}},{key:"removeClass",value:function(t){return this.el&&this.el.classList.remove(t),this}},{key:"toggle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(t)}},{key:"toggleClass",value:function(t){return this.el.classList.toggle(t)}},{key:"active",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return t?this.addClass(e):this.removeClass(e),this}},{key:"checked",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(t,"checked"),this}},{key:"disabled",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(t,e){var i=this;if(void 0!==e)this.el.setAttribute(t,e);else{if("string"==typeof t)return this.el.getAttribute(t);Object.keys(t).forEach((function(e){i.el.setAttribute(e,t[e])}))}return this}},{key:"removeAttr",value:function(t){return this.el.removeAttribute(t),this}},{key:"sanitizeHTML",value:function(t){var e=document.createElement("div");return e.textContent=t,e.innerHTML}},{key:"html",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==t?(this.el.innerHTML=e?i?this.sanitizeHTML(t).replace(/\n/g,"<br>"):this.sanitizeHTML(t):t,this):this.el.innerHTML}},{key:"val",value:function(t){return void 0!==t?(this.el.value=t,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var t=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach((function(e){return t.el.style.removeProperty(e)})),this}},{key:"css",value:function(t,e){var i=this;return void 0===e&&"string"!=typeof t?(Object.keys(t).forEach((function(e){i.el.style[e]=t[e]})),this):void 0!==e?(this.el.style[t]=e,this):this.el.style[t]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),t}(),f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(t,e)},d=i(6),v=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function p(t){for(var e="",i=t;i>=g.length;)i/=g.length,i-=1,e+=g[parseInt(i,10)%g.length];return e+=g[t%g.length]}function m(t){for(var e=0,i=0;i<t.length-1;i+=1){var n=t.charCodeAt(i)-65,r=t.length-1-i;e+=Math.pow(g.length,r)+g.length*n}return e+=t.charCodeAt(t.length-1)-65}function y(t){for(var e="",i="",n=0;n<t.length;n+=1)t.charAt(n)>="0"&&t.charAt(n)<="9"?i+=t.charAt(n):e+=t.charAt(n);return[m(e),parseInt(i,10)-1]}function b(t,e){return"".concat(p(t)).concat(e+1)}function w(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===e&&0===i)return t;var o=y(t),a=r()(o,2),s=a[0],l=a[1];return n(s,l)?b(s+e,l+i):t}var x=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,t),this.sri=e,this.sci=i,this.eri=n,this.eci=r,this.w=o,this.h=a}return a()(t,[{key:"set",value:function(t,e,i,n){this.sri=t,this.sci=e,this.eri=i,this.eci=n}},{key:"setToOther",value:function(t){this.sri=t.sri,this.sci=t.sci,this.eri=t.eri,this.eci=t.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var t=0,e=0,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];if(1===n.length){var a=y(n[0]),s=r()(a,2);e=s[0],t=s[1]}else 2===n.length&&(t=n[0],e=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=t&&t<=h&&c<=e&&e<=u}},{key:"each",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=i;a<=r;a+=1)if(e(a))for(var s=n;s<=o;s+=1)t(a,s)}},{key:"emptyFirst",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,o=this.eri,a=this.eci,s=n;s<=o;s+=1)if(e(s)){for(var l=[],c=[],h=r;h<=a;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)t(s,l[u]);for(var f=0;f<c.length;f++)t(s,c[f])}}},{key:"contains",value:function(t){return this.sri<=t.sri&&this.sci<=t.sci&&this.eri>=t.eri&&this.eci>=t.eci}},{key:"within",value:function(t){return this.sri>=t.sri&&this.sci>=t.sci&&this.eri<=t.eri&&this.eci<=t.eci}},{key:"disjoint",value:function(t){return this.sri>t.eri||this.sci>t.eci||t.sri>this.eri||t.sci>this.eci}},{key:"intersects",value:function(t){return this.sri<=t.eri&&this.sci<=t.eci&&t.sri<=this.eri&&t.sci<=this.eci}},{key:"union",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci;return new t(e.sri<i?e.sri:i,e.sci<n?e.sci:n,e.eri>r?e.eri:r,e.eci>o?e.eci:o)}},{key:"extendRange",value:function(e){var i=this.sri,n=this.sci,r=this.eri,o=this.eci,a=e.eri-e.sri+1,s=e.eci-e.sci+1,l=r-i+1,c=o-n+1;return new t(i,n,i+(l<a?a:l-l%a)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(e){var i=[],n=function(e,n,r,o){i.push(new t(e,n,r,o))},r=this.sri,o=this.sci,a=this.eri,s=this.eci,l=e.sri-r,c=e.sci-o,h=a-e.eri,u=s-e.eci;return this.intersects(e)?l>0?(n(r,o,e.sri-1,s),h>0?(n(e.eri+1,o,a,s),c>0?(n(e.sri,o,e.eri,e.sci-1),u>0&&n(e.sri,e.eci+1,e.eri,s)):u>0&&n(e.sri,e.eci+1,e.eri,s)):c>0?(n(e.sri,o,a,e.sci-1),u>0&&n(e.sri,e.eci+1,a,s)):u>0&&n(e.sri,e.eci+1,a,s)):h>0?(n(e.eri+1,o,a,s),c>0?(n(r,o,e.eri,e.sci-1),u>0&&n(r,e.eci+1,e.eri,s)):u>0&&n(r,e.eci+1,e.eri,s)):c>0?(n(r,o,a,e.sci-1),u>0&&n(r,e.eci+1,a,s)):u>0&&n(r,e.eci+1,a,s):n(r,o,a,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var t=this.sri,e=this.sci,i=this.eri,n=this.eci,r=b(e,t);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new t(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(t){return this.eri===t.eri&&this.eci===t.eci&&this.sri===t.sri&&this.sci===t.sci}}],[{key:"valueOf",value:function(e){var i=e.split(":"),n=y(i[0]),o=r()(n,2),a=o[0],s=o[1],l=s,c=a;if(i.length>1){var h=y(i[1]),u=r()(h,2);c=u[0],l=u[1]}return new t(s,a,l,c)}}]),t}(),C=x,k=function(){function t(){l()(this,t),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return a()(t,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(t,e){this.ri=t,this.ci=e}},{key:"size",value:function(){return this.range.size()}}]),t}(),_=function t(){l()(this,t),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},S=function(){function t(){l()(this,t),this.undoItems=[],this.redoItems=[]}return a()(t,[{key:"add",value:function(t){this.undoItems.push(JSON.stringify(t)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(t(r))),e(r)}}},{key:"redo",value:function(t,e){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(t(r))),e(r)}}}]),t}(),T=function(){function t(){l()(this,t),this.range=null,this.state="clear",this.textdata=null}return a()(t,[{key:"copy",value:function(t,e){this.range=t,this.state="copy";for(var i=t.sri,n=t.sci,r=t.eri,o=t.eci,a="",s=i;s<=r;s+=1){if(e._[s])for(var l=n;l<=o;l+=1){if(e._[s].cells&&e._[s].cells[l]){var c=e._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),a+=c)}a+="\t"}a+="\n"}return this.setData(a),this}},{key:"cut",value:function(t){return this.range=t,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(t){this.textdata=t,this.copyTextToClipboard(t)}},{key:"fallbackCopyTextToClipboard",value:function(t){var e=document.createElement("textarea");e.value=t,e.style.top="0",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}},{key:"copyTextToClipboard",value:function(t){navigator.clipboard?navigator.clipboard.writeText(t).then((function(){}),(function(t){})):this.fallbackCopyTextToClipboard(t)}}]),t}(),O=function(){function t(e,i,n){l()(this,t),this.ci=e,this.operator=i,this.value=n}return a()(t,[{key:"set",value:function(t,e){this.operator=t,this.value=e}},{key:"includes",value:function(t){var e=this.operator,i=this.value;return"all"===e||"in"===e&&i.includes(t)}},{key:"vlength",value:function(){var t=this.operator,e=this.value;return"in"===t?e.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),t}(),E=function(){function t(e,i){l()(this,t),this.ci=e,this.order=i}return a()(t,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),t}(),R=function(){function t(){l()(this,t),this.ref=null,this.filters=[],this.sort=null}return a()(t,[{key:"setData",value:function(t){var e=t.ref,i=t.filters,n=t.sort;null!=e&&(this.ref=e,this.filters=i.map((function(t){return new O(t.ci,t.operator,t.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var t=this.ref,e=this.filters,i=this.sort;return{ref:t,filters:e.map((function(t){return t.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(t,e,i){var n=this.getFilter(t);null==n?this.filters.push(new O(t,e,i)):n.set(e,i)}},{key:"setSort",value:function(t,e){this.sort=e?new E(t,e):null}},{key:"includes",value:function(t,e){return!!this.active()&&this.hrange().includes(t,e)}},{key:"getSort",value:function(t){var e=this.sort;return e&&e.ci===t?e:null}},{key:"getFilter",value:function(t){for(var e=this.filters,i=0;i<e.length;i+=1)if(e[i].ci===t)return e[i];return null}},{key:"filteredRows",value:function(t){var e=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=this.filters,s=r+1;s<=o;s+=1)for(var l=0;l<a.length;l+=1){var c=a[l],h=t(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){e.add(s);break}i.add(s)}return{rset:e,fset:i}}},{key:"items",value:function(t,e){var i={};if(this.active())for(var n=this.range(),r=n.sri,o=n.eri,a=r+1;a<=o;a+=1){var s=e(a,t);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var t=this.range();return t.eri=t.sri,t}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),t}(),A=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,t),this._=e}return a()(t,[{key:"forEach",value:function(t){this._.forEach(t)}},{key:"deleteWithin",value:function(t){this._=this._.filter((function(e){return!e.within(t)}))}},{key:"getFirstIncludes",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"filterIntersects",value:function(e){return new t(this._.filter((function(t){return t.intersects(e)})))}},{key:"intersects",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].intersects(t))return!0}return!1}},{key:"equals",value:function(t){for(var e=0;e<this._.length;e+=1){if(this._[e].equals(t))return!0}return!1}},{key:"union",value:function(t){var e=t;return this._.forEach((function(t){t.intersects(e)&&(e=t.union(e))})),e}},{key:"add",value:function(t){this.deleteWithin(t),this._.push(t)}},{key:"shift",value:function(t,e,i,n){this._.forEach((function(r){var o=r.sri,a=r.sci,s=r.eri,l=r.eci,c=r;"row"===t?o>=e?(c.sri+=i,c.eri+=i):o<e&&e<=s&&(c.eri+=i,n(o,a,i,0)):"column"===t&&(a>=e?(c.sci+=i,c.eci+=i):a<e&&e<=l&&(c.eci+=i,n(o,a,0,i)))}))}},{key:"move",value:function(t,e,i){this._.forEach((function(n){var r=n;r.within(t)&&(r.eri+=e,r.sri+=e,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(t){return this._=t.map((function(t){return x.valueOf(t)})),this}},{key:"getData",value:function(){return this._.map((function(t){return t.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(t){return t.multiple()}))}}]),t}();var I=function t(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?e[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(e[n]=e[n]||{},t(e[n],r)):e[n]=r}))})),e};function P(t){for(var e="".concat(t),i=0,n=!1,r=0;r<e.length;r+=1)!0===n&&(i+=1),"."===e.charAt(r)&&(n=!0);return i}function D(t,e,i){if(Number.isNaN(e)||Number.isNaN(i))return e+t+i;var n=P(e),r=P(i),o=Number(e),a=Number(i),s=0;return"-"===t?s=o-a:"+"===t?s=o+a:"*"===t?s=o*a:"/"===t&&(s=o/a),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return I.apply(void 0,[{}].concat(e))},equals:function t(e,i){var n=Object.keys(e);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var o=n[r],a=e[o],s=i[o];if(void 0===s)return!1;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a){if(a!==s)return!1}else if(Array.isArray(a)){if(a.length!==s.length)return!1;for(var l=0;l<a.length;l+=1)if(!t(a[l],s[l]))return!1}else if("function"!=typeof a&&!Array.isArray(a)&&a instanceof Object&&!t(a,s))return!1}return!0},arrayEquals:function(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(t[i]!==e[i])return!1;return!0},sum:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t},i=0,n=0;return Object.keys(t).forEach((function(r){i+=e(t[r],r),n+=1})),[i,n]},rangeEach:function(t,e,i){for(var n=t;n<e;n+=1)i(n)},rangeSum:function(t,e,i){for(var n=0,r=t;r<e;r+=1)n+=i(r);return n},rangeReduceIf:function(t,e,i,n,r,o){for(var a=i,s=n,l=t;l<e&&!(a>r);l+=1)a+=s=o(l);return[l,a-s,s]},deleteProperty:function(t,e){var i=t["".concat(e)];return delete t["".concat(e)],i},numberCalc:D},M=function(){function t(e){var i=e.len,n=e.height;l()(this,t),this._={},this.len=i,this.height=n}return a()(t,[{key:"getHeight",value:function(t,e){if(this.isHide(t))return 0;if(e&&e.has(t))return 0;var i=this.get(t);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(t,e){this.getOrNew(t).height=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this.get(t);return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumHeight",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(t,e,(function(t){return n&&n.has(t)?0:i.getHeight(t)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(t){return this._[t]}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{cells:{}},this._[t]}},{key:"getCell",value:function(t,e){var i=this.get(t);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[e]?i.cells[e]:null}},{key:"getCellMerge",value:function(t,e){var i=this.getCell(t,e);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(t,e){var i=this.getOrNew(t);return i.cells[e]=i.cells[e]||{},i.cells[e]}},{key:"setCell",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(t);"all"===n?r.cells[e]=i:"text"===n?(r.cells[e]=r.cells[e]||{},r.cells[e].text=i.text):"format"===n&&(r.cells[e]=r.cells[e]||{},r.cells[e].style=i.style,i.merge&&(r.cells[e].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(t,e,i,n){t.text=e,n?t.f=n:delete t.f,i?t.ufv=i:delete t.ufv,t.html&&e.startsWith("<font style=")&&e.endsWith("</font>")&&(t.html=e)}},{key:"setCellText",value:function(t,e,i,n,r){var o=this.getCellOrNew(t,e);this.setCellTextBasicAct(o,i,n,r)}},{key:"setCellTextAndGetRet",value:function(t){var e=this.getCellOrNew(t.ri,t.ci);return this.setCellTextBasicAct(e,t.text,t.ufv,t.f),e.rtxt=t.rtxt,e.html=t.html,delete e.bigfontsize,e}},{key:"updateOneCell",value:function(t){return this.setCellTextAndGetRet(t)}},{key:"copyPaste",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=new Array,u=new Array,f=e.sri>=0?e.sri:0,d=e.sci>=0?e.sci:0,v=e.eri,g=e.eci,p=t.size(),m=r()(p,2),y=m[0],b=m[1],x=e.size(),C=r()(x,2),k=C[0],_=C[1],S=!0,T=0;(v<a||g<s)&&(S=!1,T=v<a?k:_);for(var O=a;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=v;R+=y)for(var A=d;A<=g;A+=b){var I=R+(O-a),P=A+(E-s);if(I!==O||P!==E){var D=this._[O]&&this._[O].cells&&this._[O].cells[E],M=D?F.cloneDeep(this._[O].cells[E]):{};if(I!==O||P!==E){n&&M&&M.text&&M.text.length>0&&function(){var t=M.text,e=A-d+(R-f)+2;if(S||(e-=T+1),"="===t[0])M.text=t.replace(/\w{1,3}\d/g,(function(t){var i=0,n=0;return a===f?i=e-1:n=e-1,/^\d+$/.test(t)?t:w(t,i,n)}));else if(y<=1&&b>1&&(f>l||v<a)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(t);if(null!==i){var n=Number(i[0])+e-1;M.text=t.substring(0,i.index)+n}}}();var j={ri:I,ci:P,text:M.f?M.f:M.text},L={ri:I,ci:P,ncell:M};n&&(M.f||M.ufv)||h.push(j),u.push(L)}}}for(var B=0;B<u.length;B++)this.setCell(u[B].ri,u[B].ci,u[B].ncell,i),o(u[B].ri,u[B].ci,u[B].ncell);return h}},{key:"cutPaste",value:function(t,e){var i=this,n={};this.each((function(r){i.eachCells(r,(function(o){var a=parseInt(r,10),s=parseInt(o,10);t.includes(r,o)&&(a=e.sri+(a-t.sri),s=e.sci+(s-t.sci)),n[a]=n[a]||{cells:{}},n[a].cells[s]=i._[r].cells[o],n[a].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(t,e){var i=this,n=new Array;if(!(t.length<=0)){var r=e.sri,o=e.sci;return t.forEach((function(t,e){var a=r+e;t.forEach((function(t,e){var r=o+e;if(r<=1e3){i.setCellText(a,r,t);var s={ri:a,ci:r,text:t};n.push(s)}}))})),n}}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,o){var a=parseInt(r,10);a>=t&&(a+=i,e.eachCells(r,(function(e,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,i,(function(e,i){return i>=t}))})))}))),n[a]=o})),this._=n,this.len+=i,t>=1&&this.copyrow(t-1,i)}},{key:"copyrow",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[t];if(void 0!==r)for(var o=function(i){var o=e.getOrNew(t+i);o.height=r.height,e.eachCells(t,(function(t,e){o.cells[t]={},n(o.cells[t],e)}))},a=1;a<=i;a++)o(a)}},{key:"copyCellStyle",value:function(t,e){t.style=e.style,e.isautoalign&&(t.isautoalign=e.isautoalign)}},{key:"delete",value:function(t,e){var i=this,n=e-t+1,r={};this.each((function(o,a){var s=parseInt(o,10);s<t?r[s]=a:o>e&&(r[s-n]=a,i.eachCells(o,(function(t,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,-n,(function(t,i){return i>e}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,o){var a={};if(e.eachCells(r,(function(e,n){var r=parseInt(e,10);r>=t&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(e){return w(e,i,0,(function(e){return e>=t}))})))),a[r]=n})),t>=1)for(var s=1;s<=i;s++)void 0!==a[t-1]&&(a[t-1+s]={},n(a[t-1+s],a[t-1]));o.cells=a}))}},{key:"deleteColumn",value:function(t,e){var i=this,n=e-t+1;this.each((function(r,o){var a={};i.eachCells(r,(function(i,r){var o=parseInt(i,10);o<t?a[o]=r:o>e&&(a[o-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(t){return w(t,-n,0,(function(t){return t>e}))}))))})),o.cells=a}))}},{key:"deleteCells",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";t.each((function(t,n){e.deleteCell(t,n,i)}))}},{key:"deleteCell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(t);if(null!==n){var r=this.getCell(t,e);null!==r&&("all"===i?delete n.cells[e]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var t=Object.keys(this._),e=t[t.length-1],i=this._[e];if(i){var n=i.cells,r=Object.keys(n),o=r[r.length-1];return[parseInt(e,10),parseInt(o,10)]}return[0,0]}},{key:"each",value:function(t){Object.entries(this._).forEach((function(e){var i=r()(e,2),n=i[0],o=i[1];t(n,o)}))}},{key:"eachCells",value:function(t,e){this._[t]&&this._[t].cells&&Object.entries(this._[t].cells).forEach((function(t){var i=r()(t,2),n=i[0],o=i[1];e(n,o)}))}},{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),void 0!==t.height&&(this.height=t.height,delete t.height),this._=t}},{key:"setRangeData",value:function(t,e){for(var i=e.sri;i<=e.eri;i++)void 0!==t[i]&&(this._[i]=t[i]),null===t[i]&&delete this._[i]}},{key:"getData",value:function(){var t=this.len,e=this.height;return Object.assign({len:t,height:e},this._)}},{key:"getRangeData",value:function(t){for(var e={},i=t.sri;i<=t.eri;i++)void 0!==this._[i]?e[i]=this._[i]:e[i]=null;return e}},{key:"getDataForRowsSet",value:function(t){var e=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,t.forEach((function(t){void 0!==e._[t]&&(r[t]=e._[t])})),r}},{key:"getHeightForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e.getHeight(t))})),i}}]),t}(),j=function(){function t(e){var i=e.len,n=e.width,r=e.indexWidth,o=e.minWidth;l()(this,t),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=o}return a()(t,[{key:"setData",value:function(t){t.len&&(this.len=t.len,delete t.len),this._=t}},{key:"getData",value:function(){var t=this.len;return Object.assign({len:t},this._)}},{key:"getDataForSave",value:function(t){var e=this,i={};return t.forEach((function(t){void 0!==e._[t]&&(i[t]=e._[t])})),i}},{key:"getWidth",value:function(t){if(this.isHide(t))return 0;var e=this._[t];return e&&e.width?e.width:this.width}},{key:"getOrNew",value:function(t){return this._[t]=this._[t]||{},this._[t]}},{key:"setWidth",value:function(t,e){this.getOrNew(t).width=e}},{key:"unhide",value:function(t){for(var e=t;e>0&&(e-=1,this.isHide(e));)this.setHide(e,!1)}},{key:"isHide",value:function(t){var e=this._[t];return e&&e.hide}},{key:"setHide",value:function(t,e){var i=this.getOrNew(t);!0===e?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(t,e){this.getOrNew(t).style=e}},{key:"sumWidth",value:function(t,e){var i=this;return F.rangeSum(t,e,(function(t){return i.getWidth(t)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),t}();function L(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var z=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"Rückgängig machen",redo:"Wiederherstellen",paintformat:"Format kopieren/einfügen",clearformat:"Format löschen",format:"Format",font:"Schriftart",fontSize:"Schriftgrad",fontBold:"Fett",fontItalic:"Kursiv",underline:"Betonen",strike:"Streichen",textColor:"Text Farbe",fillColor:"Füllung Farbe",border:"Umrandung",merge:"Zellen verbinden",align:"Waagrechte Ausrichtung",valign:"Vertikale uitlijning",textwrap:"Textumbruch",freeze:"Zelle sperren",formula:"Funktionen",sort:"Sortieren nach",search:"Suche",more:"Mehr",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentar bearbeiten",commentRemove:"Kommentar entfernen",commentPrevious:"Vorheriger Kommentar",commentNext:"Nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokalen",menuInsert:"einfügen",menuComment:"Anmerkungen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Herausgeber",menuFile:"Dokumente"},contextmenu:{copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",pasteValue:"Nur Werte einfügen",pasteFormat:"Nur Format einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Link",removeLink:"Link entfernen",editLink:"bearbeiten Link",openLink:"Link öffnen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zellentext löschen",insertURL:"Bildadresse eingeben",deleteImage:"Bild löschen"},format:{normal:"Regulär",text:"Text",number:"Nummer",percent:"Prozent",rmb:"RMB",usd:"USD",date:"Datum",time:"Termin",datetime:"Datum Termin",duration:"Dauer"},formula:{sum:"Berechnen Sie die Summe einer Reihe von Werten",average:"Berechnen Sie das arithmetische Mittel aller Parameter",max:"Berechnen Sie den Maximalwert in einer Reihe von Zahlen",min:"Berechnen Sie den kleinsten Wert in einer Reihe von Zahlen",concat:"Verbinden Sie Text oder Daten mit mehreren Zeichen in Zellen miteinander",_if:"Entsprechend dem wahren oder falschen Ergebnis der logischen Beurteilung der angegebenen Bedingung wird das durch die entsprechende Bedingung ausgelöste Berechnungsergebnis zurückgegeben",and:'Nur wenn die Ergebnisse der Parameter alle logisch "true" sind, wird logisch "true" zurückgegeben, andernfalls wird logisch "false" zurückgegeben.',or:"Nur wenn alle Parameterwerte logisch „false“ sind, wird das Ergebnis als logisch „false“ zurückgegeben, ansonsten wird es als logisch „true“ zurückgegeben"},dataSort:{ci:"Gebiet",criteria:"Ordnung",casesense:"Groß-/Kleinschreibung",sortby:"Sortiert nach",header:"Meine Daten haben Header",msg:"Bitte wählen Sie verschiedene Spalten für die Sortierung nach Feldern",msg2:"Der Auswahlbereich hat Merge-Bereiche, wir unterstützen keine Sortierung auf Merge-Bereichen",order:{asc:"aufsteigend",desc:"absteigend"}},dataSearch:{label:"Finde was",lkinlb:"Umfang der Suche",matchwhole:"Passen Sie das Ganze",lookin:{values:"Wert",formulas:"Formel",comments:"Kommentar"}},dataComment:{label:"Kommentti"}},nl:{toolbar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam",fontSize:"Lettergrootte",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding invoegen"},menubar:{undo:"Ongedaan maken",redo:"Herhalen",print:"Afdrukken",paintformat:"Tekenformaat",clearformat:"Opmaak wissen",format:"Opmaak",fontName:"Lettertypenaam:",fontSize:"Lettertypegrootte:",fontBold:"Lettertype vet",fontItalic:"Lettertype cursief",underline:"Onderstreep",strike:"Strike",color:"Tekstkleur",bgcolor:"Vulkleur",border:"Grenzen",merge:"Cellen samenvoegen",unmerge:"Cellen losmaken",align:"Horizontaal uitlijnen",valign:"Verticaal uitlijnen",textwrap:"Tekst omslaan",freeze:"Cel bevriezen",autofilter:"Filteren",formula:"Functies",more:"Meer",sort:"Sorteren",download:"Download",download_HTML:"Downloaden als HTML",download_PDF:"Download als PDF",download_Original:"Origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan naar Google Drive",download_DROPBOX:"Opslaan naar Dropbox",pagination:"Paginering",search:"Zoeken",commentDefault:"Voer tekst in",insertSheet:"Blad",insertRow:"Rij",insertColumn:"Kolom",link:"Koppeling",insertComment:"Commentaar",commentEdit:"Commentaar bewerken",commentRemove:"Commentaar verwijderen",commentPrevious:"Vorige opmerking",commentNext:"Volgende opmerking",insertImage:"Afbeelding",fromURL:"Van URL",fromLocal:"Van lokaal",menuInsert:"Invoegen",menuComment:"Herziening",menuText:"Opmaak",menuFont:"Lettertype",menuEdit:"Home",menuFile:"Bestand"},contextmenu:{copy:"Kopiëren",cut:"Snijden",paste:"Plakken",pasteValue:"Alleen waarden plakken",pasteFormat:"Alleen formaat plakken",hide:"Verbergen",insertRow:"Rij invoegen",insertColumn:"Kolom invoegen",deleteSheet:"Verwijderen",deleteRow:"Rij verwijderen",deleteColumn:"Kolom verwijderen",deleteCell:"Cel verwijderen",deleteCellText:"Celtekst verwijderen",validation:"Gegevensvalidaties",sort:"Sorteren",link:"Koppeling",removeLink:"Koppeling verwijderen",editLink:"Koppeling bewerken",openLink:"Koppeling openen",download:"Download",cellprintable:"Exporteren inschakelen",cellnonprintable:"Exporteren uitschakelen",celleditable:"Bewerken inschakelen",cellnoneditable:"Bewerken uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"Afbeelding verwijderen",copyImage:"Afbeelding kopiëren",pasteImage:"Afbeelding plakken",merge:"Samenvoegen",unmerge:"Ontsamenvoegen",edit:"Bewerken",clear:"Clear"},link:{emailAddress:"E-mailadres",emailSubject:"Onderwerp",sheetPage:"Documentplaats",sheetCell:"Celverwijzing",linkTypes:{web:"Webpagina",sheet:"Dit document",email:"E-mailadres"},webUrl:"Adres",linkType:"Link naar"},download:{fileName:"Bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"Origineel",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Papierformaat",orientation:"Pagina-oriëntatie",orientations:['Landschap", "Portret']},format:{normal:"Normaal",text:"Gewone tekst",number:"Aantal",percent:"Percentage",rmb:"RMB",usd:"USD",eur:"EUR",date:"Datum",time:"Tijd",datetime:"Datum tijd",duration:"Duur"},formula:{sum:"Bereken de som van een reeks waarden",average:"Bereken het rekenkundig gemiddelde van alle parameters",max:"Bereken de maximale waarde in een reeks getallen",min:"Bereken de kleinste waarde in een reeks getallen",_if:"Volgens het ware of valse resultaat van de logische beoordeling van de gespecificeerde voorwaarde, wordt het berekeningsresultaat veroorzaakt door de overeenkomstige voorwaarde geretourneerd",and:'Alleen wanneer de resultaten van de parameters logisch "true" zijn, geeft het logisch "true" terug, anders geeft het logisch "false" terug.',or:'Alleen wanneer alle parameterwaarden logisch "false" zijn, wordt het resultaat als logisch "false" geretourneerd, anders wordt het als logisch "true" geretourneerd.',concat:"Meerdere tekentekst of gegevens in cellen met elkaar verbinden"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregel",between:"Het is tussen {} en {}",notBetween:"Het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"minder dan {}",lessThanEqual:"minder dan of gelijk aan {}",greaterThan:"Het is groter dan {}",greaterThanEqual:"het groter dan of gelijk aan {}",downloadImageFail:"download afbeelding mislukt"},error:{pasteForMergedCell:"Kan dit niet doen voor samengevoegde cellen"},calendar:{weeks:["Zon","Mo","Tue","Wed","Thu","Fr","Sat"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},button:{add:"Toevoegen",del:"Verwijderen",next:"Volgende",cancel:"Annuleren",remove:"Verwijderen",save:"Opslaan",ok:"OK",previous:"Vorige",close:"Sluiten"},sort:{desc:"Sorteren Z -> A",asc:"Sorteren A -> Z"},filter:{empty:"leeg"},dataValidation:{mode:"Mode",range:"Celbereik",criteria:"Criteria",modeType:{cell:"Cel",column:"Kolom",row:"Rij"},type:{list:"Lijst",number:"Aantal",date:"Datum",phone:"Telefoon",email:"E-mail"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"kleiner dan of gelijk aan",gt:"groter dan",gte:"groter dan of gelijk aan",eq:"gelijk aan",neq:"niet gelijk aan"}},dataSort:{ci:"Bereik",criteria:"Orde",casesense:"Hoofdlettergevoelig",sortby:"Sorteren op",header:"Mijn gegevens hebben koppen",msg:"Selecteer verschillende kolommen om op velden te sorteren",msg2:"Het geselecteerde bereik heeft samenvoegen gebieden, we ondersteunen niet sorteren op samenvoegen gebieden",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Zoek wat",lkinlb:"Kijk binnen",matchwhole:"Volledige inhoud overeenkomen",lookin:{values:"Waarden",formulas:"Formules",comments:"Opmerkingen"}},dataComment:{label:"Commentaar"}},zh:{toolbar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",download:"下载",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片"},menubar:{undo:"撤销",redo:"恢复",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体",fontSize:"字号",fontBold:"加粗",fontItalic:"倾斜",underline:"下划线",strike:"删除线",color:"字体颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"自动换行",freeze:"冻结",sort:"排序",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"原格式下载",download_XLSX:"下载为XLSX",download_GOOGLE:"保存到谷歌drive",download_DROPBOX:"保存到Dropbox",search:"搜索",autofilter:"自动筛选",formula:"函数",more:"更多",commentDefault:"请输入文字",commentEdit:"修改批注",commentRemove:"删除批注",commentPrevious:"上一个批注",commentNext:"下一个批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"插入",menuComment:"批注",menuText:"格式化",menuFont:"字体",menuEdit:"编辑",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"粘贴数据",pasteFormat:"粘贴格式",hide:"隐藏",download:"下载",insertRow:"插入行",insertColumn:"插入列",link:"链接",removeLink:"删除链接",editLink:"编辑链接",openLink:"打开链接",deleteSheet:"删除",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除",deleteCellText:"删除数据",validation:"数据验证",cellprintable:"可打印",cellnonprintable:"不可打印",celleditable:"可编辑",cellnoneditable:"不可编辑",insertURL:"输入图片地址",deleteImage:"删除图片"},download:{fileName:"文件名称",saveType:"文件另存为",saveTypes:{Original:"原格式",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},link:{emailAddress:"电子邮箱地址",emailSubject:"主题",sheetPage:"文档位置",sheetCell:"单元格引用",linkTypes:{web:"网页",sheet:"文档",email:"电子邮箱"},webUrl:"地址",linkType:"链接到"},print:{size:"纸张大小",orientation:"方向",orientations:["横向","纵向"]},format:{normal:"正常",text:"文本",number:"数值",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"短日期",time:"时间",datetime:"长日期",duration:"持续时间"},formula:{sum:"计算出一组数值的和",average:"计算出所有参数的算术平均值",max:"计算出一组数中的最大值",min:"计算出一组数中的最小值",concat:"将多个字符文本或单元格中的数据连接在一起",_if:"根据对指定条件的逻辑判断的真假结果,返回相对应条件触发的计算结果",and:"仅当有参数的结果均为逻辑 “真(TRUE)” 时返回逻辑 “真(TRUE)”,反之返回逻辑 “假(FALSE)",or:"仅当所有参数值均为逻辑 “假(FALSE)” 时返回结果逻辑 “假(FALSE)”,否则都返回逻辑 “真(TRUE)"},validation:{required:"此值必填",notMatch:"此值不匹配验证规则",between:"此值应在 {} 和 {} 之间",notBetween:"此值不应在 {} 和 {} 之间",notIn:"此值不在列表中",equal:"此值应该等于 {}",notEqual:"此值不应该等于 {}",lessThan:"此值应该小于 {}",lessThanEqual:"此值应该小于等于 {}",greaterThan:"此值应该大于 {}",greaterThanEqual:"此值应该大于等于 {}",downloadImageFail:"下载图片失败"},error:{pasteForMergedCell:"无法对合并的单元格执行此操作"},calendar:{weeks:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},button:{next:"下一步",cancel:"取消",remove:"删除",save:"保存",ok:"确认",previous:"上一步",close:"关闭"},sort:{desc:"降序",asc:"升序"},filter:{empty:"空白"},dataValidation:{mode:"模式",range:"单元区间",criteria:"条件",modeType:{cell:"单元格",column:"列模式",row:"行模式"},type:{list:"列表",number:"数字",date:"日期",phone:"手机号",email:"电子邮件"},operator:{be:"在区间",nbe:"不在区间",lt:"小于",lte:"小于等于",gt:"大于",gte:"大于等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"区域",criteria:"顺序",casesense:"区分大小写",sortby:"排序按照",header:"我的数据有标题",msg:"请选择不同的列作为排序参照",msg2:"当前选择的区域有合并区域,不支持对合并区域进行排序",order:{asc:"升序",desc:"降序"}},dataSearch:{label:"关键词",lkinlb:"查找范围",matchwhole:"匹配整个",lookin:{values:"值",formulas:"公式",comments:"注释"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"название шрифта",fontSize:"размер шрифта",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"Вставить изображение"},menubar:{undo:"открыть",redo:"повторить",print:"печать",paintformat:"нарисовать формат",clearformat:"Очистить формат",format:"Общие положения",fontName:"имя шрифта:",fontSize:"размер шрифта:",fontBold:"жирный шрифт",fontItalic:"курсивный шрифт",underline:"подчёркивать",strike:"забастовка",color:"цвет текста",bgcolor:"цвет заполнения",border:"граница",merge:"Объединить ячейки",unmerge:"отменить Объединение ячеек",align:"Выравнивание по горизонтали",valign:"Выравнивание по вертикали",textwrap:"перенос текста",freeze:"замораживать ячейки",autofilter:"фильтр",formula:"функция",more:"больше",sort:"классификация",download:"загрузка",download_HTML:"Загрузка в HTML",download_PDF:"Загрузка в PDF",download_Original:"Загрузить оригинал",download_XLSX:"загрузка XLISX",pagination:"номер страницы",search:"поиск",commentDefault:"Введите текст",insertSheet:"простыня",insertRow:"строка",insertColumn:"столбец",link:"ссылка",insertComment:"рассуждение",commentEdit:"редактировать комментарий",commentRemove:"Удалить комментарий",commentPrevious:"предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"образ",fromURL:"URL",fromLocal:"из",menuInsert:"Вставить",menuComment:"оглядываться",menuText:"Общие положения",menuFont:"шрифт",menuEdit:"жилище",menuFile:"Документация"},contextmenu:{copy:"копировать",cut:"резать",paste:"Вставить",pasteValue:"только вставить значение",pasteFormat:"только вставить формат",hide:"Скрыть",insertRow:"Вставить строки",insertColumn:"Вставить столбцы",deleteSheet:"Исключить",deleteRow:"Удалить строки",deleteColumn:"Удалить столбец",deleteCell:"Удалить ячейку",deleteCellText:"Удалить текст ячейки",validation:"проверка данных",sort:"классификация",link:"ссылка",removeLink:"Удалить ссылку",editLink:"Изменить ссылку",openLink:"Открыть ссылку",download:"загрузка",cellprintable:"Включить экспорт",cellnonprintable:"Отключить экспорт",celleditable:"Включить редактор",cellnoneditable:"Отключить правку",insertURL:"Введите адрес изображения",deleteImage:"Удалить изображение",copyImage:"Копировать изображение",pasteImage:"Вставить изображение",merge:"объединить",unmerge:"отменить объединение",edit:"редактор",clear:"Очистить"},link:{emailAddress:"адрес электронной почты",emailSubject:"тема",sheetPage:"расположение документа",sheetCell:"ссылка на ячейку",linkTypes:{web:"страница",sheet:"Настоящий документ",email:"адрес электронной почты"},webUrl:"адрес",linkType:"ссылка на"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"начальный",XLSX:"XLISX",PDF:"формат PDF",HTML:"HTML"}},print:{size:"размер бумаги",orientation:"направление страницы",orientations:["продольный, поперечный"]},format:{normal:"типичный",text:"чистый текст",number:"цифра",percent:"процент",rmb:"юань",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата",duration:"период"},formula:{sum:"вычислить сумму значений группы",average:"вычислить среднее арифметическое по всем параметрам",max:"вычислить максимальное значение в группе чисел",min:"вычислить минимальное значение в группе чисел",_if:"возвращает результат вычисления, срабатывающий при выполнении соответствующих условий",and:'возвращает логическое "true" только в том случае, если результат логически "true", иначе возвращается логическое "false"',or:'только когда все значения параметра логически равны "false", результат возвращается к логическому "false", иначе возвращается к логическому "true"',concat:"соединять текст или данные в ячейке"},validation:{required:"Это должно быть необходимо",notMatch:"не совпадает с правилами проверки",between:"между {и {и}",notBetween:"не между {и {и}",notIn:"Его нет в списке",equal:"равно {равно}",notEqual:"не равно {равно}",lessThan:"меньше чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"Это больше",greaterThanEqual:"больше или равно {}",downloadImageFail:"Ошибка загрузки образа"},error:{pasteForMergedCell:"Не удаётся выполнить эту операцию в сводной ячейке"},calendar:{weeks:["Воскресенье","понедельник","вторник","среда","четверг","Пятница","суббота"],months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},button:{add:"Добавить",del:"Исключить",next:"След.",cancel:"отмена",remove:"удаление",save:"спасти",ok:"OK",previous:"предыдущий",close:"Гуань"},sort:{desc:"сортировка Z - > A",asc:"сортировка A - > Z"},filter:{empty:"пустой"},dataValidation:{mode:"режим",range:"диапазон ячеек",criteria:"стандарт",modeType:{cell:"одиночная камера",column:"столбец",row:"строка"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше",lte:"меньше или равно",gt:"больше чем",gte:"больше или равно",eq:"равно",neq:"не равно"}},dataSort:{ci:"Сфера применения",criteria:"порядок",casesense:"различать размер",sortby:"сортировка",header:"мои данные имеют заголовки",msg:'Выберите другую колонку для поля "база сортировки"',msg2:"Выберите диапазон, в котором будут объединены области, которые мы не поддерживаем.",order:{asc:"ASC Corporation",desc:"описание"}},dataSearch:{label:"искать что",lkinlb:"посетить",matchwhole:"согласовать всё содержимое",lookin:{values:"ценность",formulas:"формула",comments:"Замечания"}},dataComment:{label:"рассуждение"}},es:{toolbar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la fuente",fontSize:"Tamaño de la fuente",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"Abrir",redo:"Rehacer",print:"Imprimir",paintformat:"Formato de dibujo",clearformat:"Formato claro",format:"Disposiciones generales",fontName:"Nombre de la Fuente:",fontSize:"Tamaño de la Fuente:",fontBold:"Negrita de tipo de letra",fontItalic:"Cursiva",underline:"Enfatizar",strike:"Huelga",color:"Color del texto",bgcolor:"Color de relleno",border:"Límite",merge:"Fusionar celdas",unmerge:"Unmerge Cells",align:"Alineación horizontal",valign:"Alineación vertical",textwrap:"Salto de línea de texto",freeze:"Congelar celdas",autofilter:"Filtro",formula:"Función",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar el original",download_XLSX:"Descargar como xlsx",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en Dropbox",pagination:"Número de página",search:"Buscar",commentDefault:"Por favor, introduzca texto",insertSheet:"Sábanas",insertRow:"Una línea",insertColumn:"Columna",link:"Enlace",insertComment:"Comentario",commentEdit:"Editar Notas",commentRemove:"Eliminar comentarios",commentPrevious:"Comentario anterior",commentNext:"Siguiente comentario",insertImage:"Imagen",fromURL:"De URL",fromLocal:"Local",menuInsert:"Insertar",menuComment:"Examen",menuText:"Disposiciones generales",menuFont:"Tipo de letra",menuEdit:"Hogar",menuFile:"Documentación"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Pegar",pasteValue:"Pegar sólo valores",pasteFormat:"Pegar sólo formato",hide:"Ocultar",insertRow:"Insertar fila",insertColumn:"Insertar columna",deleteSheet:"Tachar",deleteRow:"Eliminar fila",deleteColumn:"Eliminar columnas",deleteCell:"Eliminar celdas",deleteCellText:"Borrar texto de celda",validation:"Validación de datos",sort:"Clasificación",link:"Enlace",removeLink:"Eliminar enlace",editLink:"Editar enlace",openLink:"Abrir enlace",download:"Descargar",cellprintable:"Activar exportación",cellnonprintable:"Desactivar exportación",celleditable:"Habilitar edición",cellnoneditable:"Desactivar edición",insertURL:"Introduzca la dirección de la imagen",deleteImage:"Borrar imagen",copyImage:"Copiar imagen",pasteImage:"Pegar imagen",merge:"Fusión",unmerge:"Cancelar fusión",edit:"Editar",clear:"Claro"},link:{emailAddress:"Dirección de correo electrónico",emailSubject:"Tema",sheetPage:"Ubicación del documento",sheetCell:"Referencia de celda",linkTypes:{web:"Página web",sheet:"Este documento",email:"Dirección de correo electrónico"},webUrl:"Dirección",linkType:"Enlace a"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"Original",XLSX:"Xlsx",PDF:"PDF",HTML:"Html"}},print:{size:"Tamaño del papel",orientation:"Orientación de la página",orientations:['Transversal "," longitudinal']},format:{normal:"Típico",text:"Texto plano",number:"Número",percent:"Porcentaje",rmb:"RMB Yuan",usd:"Dólar estadounidense",eur:"Euro",date:"Fecha",time:"Tiempo",datetime:"Fecha y hora",duration:"Período"},formula:{sum:"Calcular la suma de un conjunto de valores",average:"Calcular la media aritmética de todos los parámetros",max:"Calcular el valor máximo de un conjunto de números",min:"Calcular el valor mínimo de un conjunto de números",_if:"Devuelve el resultado del cálculo desencadenado por la condición correspondiente de acuerdo con el juicio lógico de la condición especificada.",and:'Devuelve la lógica "true" sólo cuando el resultado de todos los parámetros es "true" lógico, de lo contrario devuelve la lógica "False".',or:'El resultado sólo se devuelve como "falso" lógico cuando todos los valores de los parámetros son lógicamente "falso", de lo contrario se devuelve como "verdadero" lógico.',concat:"Unir texto o datos de múltiples caracteres en una celda"},validation:{required:"Debe ser necesario",notMatch:"No coincide con las reglas de validación",between:"Está entre {} y {}",notBetween:"No está entre {} y {}",notIn:"No está en la lista",equal:"Igual a {}",notEqual:"No es igual a {}",lessThan:"Menos de {}",lessThanEqual:"Es menor o igual a {}",greaterThan:"Es mayor que {}",greaterThanEqual:"Es mayor o igual a {}",downloadImageFail:"Falló la descarga de la imagen"},error:{pasteForMergedCell:"No se puede hacer esto en celdas fusionadas"},calendar:{weeks:["Domingo","lunes","martes","miércoles","jueves","viernes","sábado"],months:["Enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},button:{add:"Añadir",del:"Tachar",next:"Siguiente",cancel:"Cancelar",remove:"Eliminación",save:"Salvación",ok:"Muy bien.",previous:"Anterior",close:"Cerrar"},sort:{desc:"Ordenar z - > a",asc:"Ordenar a - > Z"},filter:{empty:"Vacío"},dataValidation:{mode:"Patrón",range:"Rango de celdas",criteria:"Normas",modeType:{cell:"Celda individual",column:"Columna",row:"Una línea"},type:{list:"Lista",number:"Número",date:"Fecha",phone:"Teléfono",email:"Correo electrónico"},operator:{be:"Entre",nbe:"No entre los dos",lt:"Menos",lte:"Inferior o igual a",gt:"Mayor que",gte:"Mayor o igual a",eq:"Igual a",neq:"No es igual a"}},dataSort:{ci:"Ámbito de aplicación",criteria:"Orden",casesense:"Sensible a mayúsculas",sortby:"Ordenar por",header:"Mis datos tienen un título",msg:"Seleccione una column a diferente para el campo ordenar por",msg2:"Los rangos de selección tienen regiones fusionadas, no soportamos ordenar en regiones fusionadas",order:{asc:"ASC",desc:"Descripción"}},dataSearch:{label:"Encontrar qué",lkinlb:"Visita",matchwhole:"Coincide con todo el contenido",lookin:{values:"Valores",formulas:"Fórmula",comments:"Comentario"}},dataComment:{label:"Comentario"}},pt:{toolbar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do Tipo de Letra",fontSize:"Tamanho do tipo de letra",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Inserir imagem"},menubar:{undo:"Desfazer",redo:"Refazer",print:"Imprimir",paintformat:"Formato da pintura",clearformat:"Limpar o formato",format:"Formato",fontName:"Nome do tipo de letra:",fontSize:"Tamanho do tipo de letra:",fontBold:"Tipo de letra negrito",fontItalic:"Tipo de letra itálico",underline:"Sublinhado",strike:"Strike",color:"Cor do texto",bgcolor:"Cor do preenchimento",border:"Bordas",merge:"Juntar as células",unmerge:"Desmesclar as células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"Envolvimento do texto",freeze:"Célula congelada",autofilter:"Filtro",formula:"Funções",more:"Mais",sort:"Ordenar",download:"Transferir",download_HTML:"Transferir Como HTML",download_PDF:"Transferir Como PDF",download_Original:"Obter Original",download_XLSX:"Obter Como XLSX",download_GOOGLE:"Gravar para Google Drive",download_DROPBOX:"Gravar para Dropbox",pagination:"Paginação",search:"Procurar",commentDefault:"Indique por favor o texto",insertSheet:"Folha",insertRow:"Linha",insertColumn:"Coluna",link:"Ligação",insertComment:"Comentário",commentEdit:"Editar comentário",commentRemove:"Remover comentário",commentPrevious:"Comentário anterior",commentNext:"Próximo comentário",insertImage:"Imagem",fromURL:"Do URL",fromLocal:"Do Local",menuInsert:"Inserir",menuComment:"Revisão",menuText:"Formato",menuFont:"Tipo de Letra",menuEdit:"Casa",menuFile:"Ficheiro"},contextmenu:{copy:"Copiar",cut:"Cortar",paste:"Colar",pasteValue:"Colar apenas valores",pasteFormat:"Colar apenas o formato",hide:"Esconder",insertRow:"Inserir linha",insertColumn:"Inserir coluna",deleteSheet:"Apagar",deleteRow:"Apagar a linha",deleteColumn:"Apagar a coluna",deleteCell:"Apagar a célula",deleteCellText:"Apagar o texto da célula",validation:"Validações dos dados",sort:"Ordenar",link:"Ligação",removeLink:"Remover a Ligação",editLink:"Editar a Ligação",openLink:"Abrir Ligação",download:"Transferir",cellprintable:"Activar a exportação",cellnonprintable:"Desactivar a exportação",celleditable:"Activar a edição",cellnoneditable:"Desactivar a edição",insertURL:"Indique o endereço da imagem",deleteImage:"Apagar a imagem",copyImage:"Copiar a imagem",pasteImage:"Colar a imagem",merge:"Juntar",unmerge:"Desmesclar",edit:"Editar",clear:"Limpar"},link:{emailAddress:"Endereço de E- mail",emailSubject:"Assunto",sheetPage:"Local do Documento",sheetCell:"Referência da Célula",linkTypes:{web:"Página Web",sheet:"Este Documento",email:"Endereço de E- mail"},webUrl:"Endereço",linkType:"Ligar para"},download:{fileName:"Nome do Ficheiro",saveType:"Gravar Como",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Tamanho do papel",orientation:"Orientação da página",orientations:['Paisagem", "Retrato']},format:{normal:"Normal",text:"Texto Simples",number:"Número",percent:"Percentagem",rmb:"RMB",usd:"USD",eur:"EUR",date:"Data",time:"Tempo",datetime:"Data e hora",duration:"Duração"},formula:{sum:"Calcular a soma de um conjunto de valores",average:"Calcular a média aritmética de todos os parâmetros",max:"Calcular o valor máximo em um conjunto de números",min:"Calcular o menor valor em um conjunto de números",_if:"De acordo com o resultado verdadeiro ou falso do julgamento lógico da condição especificada, o resultado do cálculo desencadeado pela condição correspondente é retornado",and:'Somente quando os resultados dos parâmetros são todos lógicos "true", retorna lógico "true", caso contrário retorna lógico "false"',or:'Somente quando todos os valores dos parâmetros são logicamente "false", o resultado é retornado como lógico "false", caso contrário é retornado como lógico "true"',concat:"Conecte texto de vários caracteres ou dados em células juntos"},validation:{required:"deve ser exigido",notMatch:"não corresponde à sua regra de validação",between:"é entre {} e {}",notBetween:"não é entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"menos que {}",lessThanEqual:"menor ou igual a {}",greaterThan:"maior que {}",greaterThanEqual:"maior ou igual a {}",downloadImageFail:"falha na transferência da imagem"},error:{pasteForMergedCell:"Não é possível fazer isto para células fundidas"},calendar:{weeks:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},button:{add:"Adicionar",del:"Apagar",next:"Próximo",cancel:"Cancelar",remove:"Remover",save:"Gravar",ok:"OK",previous:"Anterior",close:"Fechar"},sort:{desc:"Ordenar Z -> A",asc:"Ordenar A -> Z"},filter:{empty:"vazio"},dataValidation:{mode:"Modo",range:"Intervalo de Células",criteria:"Critérios",modeType:{cell:"Célula",column:"Coluna",row:"Linha"},type:{list:"Lista",number:"Número",date:"Data",phone:"Telefone",email:"E- mail"},operator:{be:"entre",nbe:"não entre",lt:"menos de",lte:"inferior ou igual a",gt:"maior que",gte:"maior ou igual a",eq:"igual a",neq:"não igual a"}},dataSort:{ci:"Intervalo",criteria:"Ordem",casesense:"Sensível à maiúscula",sortby:"Ordenar por",header:"Os meus dados têm cabeçalhos",msg:"Seleccione por favor colunas diferentes para ordenar por campos",msg2:"O intervalo de seleção tem áreas de mesclagem, não suportamos classificação em áreas de mesclagem",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Encontrar o quê",lkinlb:"Olhe para dentro",matchwhole:"Corresponder ao conteúdo inteiro",lookin:{values:"Valores",formulas:"Fórmulas",comments:"Observações"}},dataComment:{label:"Comentário"}}};function N(t,e){if(e){var i,n=L(z);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!e[r])break;for(var o=e[r],a=t.match(/(?:\\.|[^.])+/g),s=0;s<a.length;s+=1){var l=o[a[s]];if(!l)break;if(s===a.length-1)return l;o=l}}}catch(t){n.e(t)}finally{n.f()}}}function W(t){var e=N(t,H);return!e&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(e=N(t,window.x_spreadsheet.$messages)),e||""}function U(t){return function(){return W(t)}}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?z=[t]:z.unshift(t),e&&(H[t]=e)}function Y(t){H[t]||(t="en"),z[0]=t}var V={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function G(t,e){var i="";if(!t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i=W.apply(void 0,["validation.".concat(e)].concat(r))}return[t,i]}var q=function(){function t(e,i,n,r){l()(this,t),this.required=i,this.value=n,this.type=e,this.operator=r,this.message=""}return a()(t,[{key:"parseValue",value:function(t){var e=this.type;return"date"===e?new Date(t):"number"===e?Number(t):t}},{key:"equals",value:function(t){var e=this.type===t.type&&this.required===t.required&&this.operator===t.operator;return e&&(e=Array.isArray(this.value)?F.arrayEquals(this.value,t.value):this.value===t.value),e}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(t){var e=this.required,i=this.operator,n=this.value,o=this.type;if(e&&/^\s*$/.test(t))return G(!1,"required");if(/^\s*$/.test(t))return[!0];if(V[o]&&!V[o].test(t))return G(!1,"notMatch");if("list"===o)return G(this.values().includes(t),"notIn");if(i){var a=this.parseValue(t);if("be"===i){var s=r()(n,2),l=s[0],c=s[1];return G(a>=this.parseValue(l)&&a<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=r()(n,2),u=h[0],f=h[1];return G(a<this.parseValue(u)||a>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return G(a===this.parseValue(n),"equal",n);if("neq"===i)return G(a!==this.parseValue(n),"notEqual",n);if("lt"===i)return G(a<this.parseValue(n),"lessThan",n);if("lte"===i)return G(a<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return G(a>this.parseValue(n),"greaterThan",n);if("gte"===i)return G(a>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),t}(),K=function(){function t(e,i,n){l()(this,t),this.refs=i,this.mode=e,this.validator=n}return a()(t,[{key:"includes",value:function(t,e){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(t,e))return!0}return!1}},{key:"addRef",value:function(t){this.remove(x.valueOf(t)),this.refs.push(t)}},{key:"remove",value:function(t){var e=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(t)?n.difference(t).forEach((function(t){return e.push(t.toString())})):e.push(i)})),this.refs=e}},{key:"getData",value:function(){var t=this.refs,e=this.mode,i=this.validator;return{refs:t,mode:e,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(e){var i=e.refs,n=e.mode,r=e.type,o=e.required,a=e.operator,s=e.value;return new t(n,i,new q(r,o,s,a))}}]),t}(),Z=function(){function t(){l()(this,t),this._=[],this.errors=new Map}return a()(t,[{key:"getError",value:function(t,e){return this.errors.get("".concat(t,"_").concat(e))}},{key:"validate",value:function(t,e,i){var n=this.get(t,e),o="".concat(t,"_").concat(e),a=this.errors;if(null!==n){var s=n.validator.validate(i),l=r()(s,2),c=l[0],h=l[1];c?a.delete(o):a.set(o,h)}else a.delete(o);return!0}},{key:"add",value:function(t,e,i){var n=i.type,r=i.required,o=i.value,a=i.operator,s=new q(n,r,o,a),l=this.getByValidator(s);null!==l?l.addRef(e):this._.push(new K(t,[e],s))}},{key:"getByValidator",value:function(t){for(var e=0;e<this._.length;e+=1){var i=this._[e];if(i.validator.equals(t))return i}return null}},{key:"get",value:function(t,e){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(t,e))return n}return null}},{key:"remove",value:function(t){var e="".concat(t.sri,"_").concat(t.sci);this.errors.has(e)&&this.errors.delete(e),this.each((function(e){e.remove(t)}))}},{key:"each",value:function(t){this._.forEach((function(e){return t(e)}))}},{key:"getData",value:function(){return this._.filter((function(t){return t.refs.length>0})).map((function(t){return t.getData()}))}},{key:"setData",value:function(t){this._=t.map((function(t){return K.valueOf(t)}))}}]),t}(),J=function t(){l()(this,t),this.keywords="",this.current=1,this.result=[]},Q=i(3),tt=i.n(Q),et=i(4),it=i.n(et),nt=i(1),rt=i.n(nt),ot="x-spreadsheet";window.devicePixelRatio;function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var st=function(t){tt()(i,t);var e=at(i);function i(t){var n;return l()(this,i),(n=e.call(this,"div","".concat(ot,"-icon"))).iconNameEl=f("div","".concat(ot,"-icon-img ").concat(t)),n.child(n.iconNameEl),n}return a()(i,[{key:"setName",value:function(t){this.iconNameEl.className("".concat(ot,"-icon-img ").concat(t))}}]),i}(u);function lt(t,e,i){var n=f("div","".concat(ot,"-toast")),r=f("div","".concat(ot,"-dimmer active"));n.children(f("div","".concat(ot,"-toast-header")).children(new st("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),t),f("div","".concat(ot,"-toast-content")).html(e)),document.body.appendChild(n.el),document.body.appendChild(r.el);var o=n.box(),a=o.width,s=o.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-a)/2,top:(c-s)/3})}var ct={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function ht(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,o=e.clone(),a=t.size(),s=r()(a,2),l=s[0],c=s[1],h=e.size(),u=r()(h,2),f=u[0],d=u[1];return l>f&&(o.eri=e.sri+l-1),c>d&&(o.eci=e.sci+c-1),this.getRangeLocked(o)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(o)?(i(W("error.pasteForMergedCell")),!1):t.equals(o)?(i("The selection area is same "),!1):!t.intersects(o)||!(f>l&&Math.abs(e.sri-t.sri)%l!=0||d>c&&Math.abs(e.sci-t.sci)%c!=0)||(i("Invalid selection area"),!1)}function ut(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.rows,a=this.merges,s=this.name,l=o.copyPaste(t,e,i,n,(function(t,e,i){if(i&&i.merge){var n=r()(i.merge,2),o=n[0],s=n[1];if(o<=0&&s<=0)return;a.add(new x(t,e,t+o,e+s))}}));n?this.updateBatchCellsOpr(s,l,t,e,i):this.copyPasteRangeOpr(s,t,e,i)}function ft(t,e){var i=this.clipboard,n=this.rows,r=this.merges,o=this.name;n.cutPaste(t,e),r.move(t,e.sri-t.sri,e.sci-t.sci),i.clear(),this.cutPasteRangeOpr(o,t,e)}function dt(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),o=F.merge(o,{border:i}),r.style=this.addStyle(o)}function vt(t){var e=this,i=t.mode,n=t.style,o=t.color,a=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,v=!this.isSignleSelected();if(v||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||v){if("none"===i)s.range.each((function(t,i){var n=l.getCell(t,i);if(n&&void 0!==n.style){var r=F.cloneDeep(a[n.style]);delete r.border,n.style=e.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var t=[],a=h;a<=f;a+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<t.length;g+=1){var p=r()(t[g],4),m=p[0],y=p[1],b=p[2],w=p[3];if(a===m+b+1&&c.push(g),m<=a&&a<=m+b&&s===y){s+=w+1;break}}if(c.forEach((function(e){return t.splice(e,1)})),s>d)break;var x=l.getCell(a,s),C=0,k=0;if(x&&x.merge){var _=r()(x.merge,2);C=_[0],k=_[1],t.push([a,s,C,k])}var S=C>0&&a+C===f,T=k>0&&s+k===d,O={};"all"===i?O={bottom:[n,o],top:[n,o],left:[n,o],right:[n,o]}:"inside"===i?(!T&&s<d&&(O.right=[n,o]),!S&&a<f&&(O.bottom=[n,o])):"horizontal"===i?!S&&a<f&&(O.bottom=[n,o]):"vertical"===i?!T&&s<d&&(O.right=[n,o]):"outside"===i&&v&&(h===a&&(O.top=[n,o]),(S||f===a)&&(O.bottom=[n,o]),u===s&&(O.left=[n,o]),(T||d===s)&&(O.right=[n,o])),Object.keys(O).length>0&&dt.call(e,a,s,O),s+=k}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(dt.call(this,h,g,{top:[n,o]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(dt.call(this,f,g,{bottom:[n,o]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var p=h;p<=f;p+=1)"left"===i&&(dt.call(this,p,u,{left:[n,o]}),p+=l.getCellMerge(p,u)[0]),"right"===i&&(dt.call(this,p,d,{right:[n,o]}),p+=l.getCellMerge(p,d)[0])}else dt.call(this,h,u,{top:[n,o],bottom:[n,o],left:[n,o],right:[n,o]})}function gt(t,e){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),o=this.settings.row.height,a=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=o+r,l=t>s?n.riact:0;0===l&&(s=o);for(var c=0;l<i.len&&!(s>t);l+=1)a.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function pt(t,e){var i=this.cols,n=this.displayRight2Left,o=this.freezeTotalWidth(),a=i.indexWidth;if(n){var s=this.viewWidth();o+i.indexWidth<s-t&&(a-=e);var l=F.rangeReduceIf(0,i.len,a,i.indexWidth,s-t,(function(t){return i.getWidth(t)})),c=r()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}o+i.indexWidth<t&&(a-=e);var d=F.rangeReduceIf(0,i.len,a,i.indexWidth,t,(function(t){return i.getWidth(t)})),v=r()(d,3),g=v[0],p=v[1],m=v[2];return p<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:p,width:m}}var mt=function(){function t(e,i){l()(this,t),this.settings=F.merge(ct,i||{}),this.name=e||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new A,this.rows=new M(this.settings.row),this.cols=new j(this.settings.col),this.validations=new Z,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new k,this.scroll=new _,this.history=new S,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return a()(t,[{key:"addValidation",value:function(t,e,i){var n=this;this.changeData((function(){n.validations.add(t,e,i)}))}},{key:"removeValidation",value:function(){var t=this,e=this.selector.range;this.changeData((function(){t.validations.remove(e)}))}},{key:"getHighlightCellTxt",value:function(t,e){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===t&&r.col===e&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=this.validations.get(e,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=t.range,r=this.validations.get(e,i),o={ref:n.toString()};return null!==r&&(o.mode=r.mode,o.validator=r.validator),o}},{key:"getSelectedSort",value:function(){var t=this.selector,e=t.ci,i=t.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var o=[],a=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=a&&u.eri<=s&&u.sci>=l&&u.eci<=c)return lt("error","".concat(W("dataSort.msg2"))),null}for(var f=a+1;f<=s;f+=1){var d=this.getCell(f,e);null===d||/^\s*$/.test(d.text)||o.push(d.text)}n.m=o;for(var v=new Map,g=new Map,m=0,y=l;y<=c;y++,m++){var b=this.getCell(a,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+p(y)+")":b.text,v.set(m,w),g.set(m,"(Column "+p(y)+")")}return n.mcols=v,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var t=this;this.history.undo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"redo",value:function(){var t=this;this.history.redo((function(e){return t.getRangeData(e.range)}),(function(e){t.setRangeData(e)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!ht.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ut.call(t,n.range,i,e):n.isCut()&&ft.call(t,n.range,i)})),!0))}},{key:"pasteFromText",value:function(t){var e=this,i=this.name,n=t.split("\r\n").map((function(t){return t.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,o=this.selector;this.changeData((function(){var t=r.paste(n,o.range);e.updateBatchCellsOpr(i,t)}))}}},{key:"autofill",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==t.sci&&(t.sci=0),-1==t.sri&&(t.sri=0),!!ht.call(this,r,t,n)&&(this.changeData((function(){ut.call(i,r,t,e,!0)}),!0,t),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges,a=i.range,s=a.sri,l=a.sci,c=a.eri,h=a.eci,u=i.ri,f=i.ci,d=t,v=e;return t<0&&(d=n.len-1),e<0&&(v=r.len-1),d>u?(s=u,c=d):(s=d,c=u),v>f?(l=f,h=v):(l=v,h=f),i.range=o.union(new x(s,l,c,h)),i.range=o.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(t,e){var i=this.selector,n=this.rows,r=this.cols,o=this.merges.getFirstIncludes(t,e);return null===o&&(o=new x(t,e,t,e),-1===t&&(o.sri=0,o.eri=n.len-1),-1===e&&(o.sci=0,o.eci=r.len-1)),i.range=o,o}},{key:"setSelectedCellAttr",value:function(t,e){var i=this;this.changeData((function(){var n=i.selector,o=i.styles,a=i.rows,s=i.name;if("merge"===t)e?i.merge():i.unmerge();else if("border"===t)vt.call(i,e);else if("formula"===t){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=r()(u,2),d=f[0],v=f[1],g=h.sri,p=h.sci,m=h.eri,y=h.eci;if(d>1)for(var w=p;w<=y;w+=1){a.getCellOrNew(m+1,w).text="=".concat(e,"(").concat(b(w,g),":").concat(b(w,m),")")}else if(v>1){a.getCellOrNew(l,y+1).text="=".concat(e,"(").concat(b(p,l),":").concat(b(y,l),")")}}else{a.getCellOrNew(l,c).text="=".concat(e,"()")}}else n.range.each((function(n,r){var l=a.getCellOrNew(n,r),c={};if(void 0!==l.style&&(c=F.cloneDeep(o[l.style])),"format"===t)c.format=e,"normal"===e?(delete c.number,delete c.custom):"text"===e?(c.number=49,delete c.custom):"number"===e?(c.custom="#,##0.00_",delete c.number):"percent"===e?(c.number=10,delete c.custom):"rmb"===e?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===e?(c.custom="$#,##0.00",delete c.number):"eur"===e?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===e?(c.custom="mm/dd/yyyy",delete c.number):"time"===e?(c.number=21,delete c.custom):"datetime"===e?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===e&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,r,c);else if("font-bold"===t||"font-italic"===t||"font-name"===t||"font-size"===t){var h={};h[t.split("-")[1]]=e,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===t||"textwrap"===t||"underline"===t||"align"===t||"valign"===t||"color"===t||"bgcolor"===t||"pbgcolor"===t||"pattern"===t?(c[t]=e,l.style=i.addStyle(c),"align"===t&&delete l.isautoalign):l[t]=e}))}))}},{key:"setHyperlinkStyle",value:function(t,e,i){var n=this.rows,r=this.styles,o=n.getCellOrNew(t,e),a={};void 0!==o.style&&(a=F.cloneDeep(r[o.style])),a.underline=i,a.color=i?"#0000ff":"Black",o.style=this.addStyle(a)}},{key:"setSelectedCellText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,o=n.ri,a=n.ci,s=o;this.unsortedRowMap.has(o)&&(s=this.unsortedRowMap.get(o));var l=r.getCell(s,a),c=l?l.text:"";if(this.setCellText(s,a,t,e),i.active()){var h=i.getFilter(a);if(h){var u=h.value.findIndex((function(t){return t===c}));u>=0&&h.value.splice(u,1,t)}}}},{key:"getSelectedCell",value:function(){var t=this.selector,e=t.ri,i=t.ci,n=e;return this.unsortedRowMap.has(e)&&(n=this.unsortedRowMap.get(e)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(t,e){if(!this.sprotected)return!0;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(t){for(var e=t.sci;e<=t.eci;e+=1){var i=this.getCell(t.sri,e);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellLocked(e,i)}},{key:"getCellLocked",value:function(t,e){if(!this.sprotected)return!1;var i=t;this.unsortedRowMap.has(t)&&(i=this.unsortedRowMap.get(t));var n=this.getCellStyle(i,e);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(t){for(var e=t.sri;e<=t.eri;e+=1)for(var i=t.sci;i<=t.eci;i+=1)if(this.getCellLocked(e,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(t,e){var i=this.getSelectedRect(),n=i.left,r=i.top,o=i.width,a=i.height,s=this.settings.row.height,l=t-this.cols.indexWidth,c=e-s;return l>n&&l<n+o&&c>r&&c<r+a}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var t=this.selector.range.clone();if(this.freezeIsActive()){if(t.sri>=this.freeze[0]&&t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri>=this.freeze[0]&&t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}else{if(t.eri<this.scroll.riact)return{left:-99999,top:-99999};t.sri<this.scroll.riact&&(t.sri=this.scroll.riact)}return this.getRect(t)}},{key:"getRectForTextbox",value:function(t){var e=this.scroll,i=(this.rows,this.cols),n=(this.exceptRowSet,this.displayRight2Left),o=this.freeze,a=this.zoomlevel,s=new x(t.row,t.col,t.row,t.col),l=s.sri,c=s.sci,h=(s.eri,s.eci);if(l<0&&c<0)return{left:0,l:0,top:0,t:0,scroll:e};var u=r()(o,2)[1],f=n?t.left+i.indexWidth:t.left,d=t.top,v=t.height,g=t.width,p=n?u>0&&h>=u||0===u?f-e.x:f:f-e.x,m=this.freezeTotalHeight(),y=this.freezeTotalWidth(),b=t.top-e.y;return y>0&&y>f&&!n&&(p=f),m>0&&m>d&&(b=d),{l:f*a,t:d*a,left:p*a,top:b*a,height:v*a,width:g*a,scroll:e}}},{key:"getClipboardRect",value:function(){var t=this.clipboard;return t.isClear()?{left:-100,top:-100}:this.getRect(t.range)}},{key:"getRect",value:function(t){var e=this.scroll,i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=t.sri,h=t.sci,u=t.eri,f=t.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:e};var d=r()(s,2)[1],v=a?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,o),p=i.sumHeight(c,u+1,o)*l,m=n.sumWidth(h,f+1)*l,y=a?d>0&&f>=d||0===d?v+e.x:v:v-e.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(e.riact,c,o)+b;return w>0&&w>v&&!a&&(y=v),b>0&&b>g&&(x=g),{l:v*l,t:g*l,left:y*l,top:x*l,height:p,width:m,scroll:e}}},{key:"getCellRectByXY",value:function(t,e){var i=this.scroll,n=this.merges,r=this.rows,o=this.cols,a=this.zoomlevel,s=gt.call(this,e,i.y),l=s.ri,c=s.top,h=s.height,u=pt.call(this,t,i.x),f=u.ci,d=u.left,v=u.width;if(-1===f&&(v=o.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var p=this.cellRectWithOutTransfer(l,f);d=p.left,c=p.top,v=p.width,h=p.height}}return{ri:l,ci:f,left:d*a,top:c*a,width:v*a,height:h*a}}},{key:"isSignleSelected",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var t=this.selector.range,e=t.sri,i=t.sci,n=t.eri,o=t.eci,a=this.getCell(e,i);if(a&&a.merge){var s=r()(a.merge,2),l=s[0],c=s[1];if(e+l===n&&i+c===o)return!0}return!1}},{key:"merge",value:function(){var t=this.selector,e=this.rows;if(!this.isSignleSelected()){var i=t.size(),n=r()(i,2),o=n[0],a=n[1];if(o>1||a>1){var s=t.range,l=s.sri,c=s.sci,h=e.getCellOrNew(l,c);h.merge=[o-1,a-1],this.merges.add(t.range),this.rows.deleteCells(t.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var t=this.selector;if(this.isSignleSelected()){var e=t.range,i=e.sri,n=e.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(t.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var t=this,e=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!e.active())for(var r=0,o=n.length;r<o;r++){var a=n[r],s=x.valueOf(a.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void lt("Warning","there is already table autofilter in the selected range")}this.changeData((function(){e.active()?(e.clear(),t.exceptRowSet=new Set,t.sortedRowMap=new Map,t.unsortedRowMap=new Map):e.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var t=this.autoFilter,e=this.selector;this.changeData((function(){t.filters=[],t.ref=e.range.toString()}))}},{key:"sortByRowIdArray",value:function(t,e){for(var i=this.rows,n=t.sri,r=t.eri,o=t.sci,a=t.eci,s=[],l=0,c=e.length;l<c;l++){for(var h=i._[e[l]].cells,u=[],f=o;f<=a;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,v=n;v<=r;v++)if(e[d++]!==v){for(var g=i._[v].cells,p=o;p<=a;p++)delete g[p];for(var m=s[d-1],y=0,b=m.length;y<b;y++){var w=m[y];g[w.id]=w.v}}}},{key:"doSort",value:function(t,e,i){var n=this.name,r=this.selector.range,o=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:t,order:e,isheader:i,op:"sort"});this.updateCellServer(o)}},{key:"setAutoFilter",value:function(t,e,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(t,i,n),r.setSort(t,e),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var t=this,e=this.currentAutoFilter,i=this.rows,n=e;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,o=n.filteredRows((function(t,e){return i.getCell(t,e)})),a=o.rset,s=o.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(t,e){if("desc"===r.order){var n=t;t=e,e=n}var o=i.getCell(t,r.ci),a=i.getCell(e,r.ci);if(null!=o&&""===o.text&&(o=null),null!=a&&""===a.text&&(a=null),null==o&&null==a)return t-e;if(null==o)return"asc"===r.order?1:-1;if(null==a)return"asc"===r.order?-1:1;o=o.text,a=a.text;var s=isNaN(Number(o)),l=isNaN(Number(a));return s&&l?o.localeCompare(a):s&&!l?1:!s&&l?-1:Number(o)-Number(a)})),this.exceptRowSet=a,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(e,i){t.sortedRowMap.set(c[i],e),t.unsortedRowMap.set(e,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var t=this.exceptRowSet,e=this.rows;t.forEach((function(t){e.get(t)&&(e.get(t).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(t){var e=this.conditionimg,i=(this.rows,this.styles,this);t&&t.forEach((function(t){if(e){var n=e.find((function(e){return e.row===t.row&&e.col===t.col}));n?n.image.src="data:image/png;base64,"+t.data:i.insertConditionImage(t)}}))}},{key:"createConditionImage",value:function(t,e){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+t.data;var r=this.cols.sumWidth(0,t.col),o=this.rows.sumHeight(0,t.row);if(0===t.type){n.style.zIndex=e+1;var a=this.getCellStyle(t.row,t.col);null!=a&&"bottom"===a.valign&&(o+=this.rows.getHeight(t.row)-16)}else n.style.zIndex=e,n.style.opacity=.88;if((this.rows.isHide(t.row)||this.cols.isHide(t.col)||this.exceptRowSet.has(t.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=o+"px",n.style.position="absolute",void 0===t.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);t.ol=l,t.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var t=this.exceptRowSet,e=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){e.isHide(n.row)||i.isHide(n.col)||t.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var t=this.displayRight2Left,e=this.cols,i=this.zoomlevel,n=this.viewWidth()-e.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=t?(n-r.ol-e.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var t=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(e){if(e.ow||(e.ow=e.image.width,e.oh=e.image.height),e.image.style.left=e.ol*t+"px",e.image.style.top=e.ot*t+"px",e.ow){e.image.height;e.image.width=e.ow*t,1===e.type&&(e.image.height=e.oh*t)}}))}},{key:"updateConditionImagePositionForCol",value:function(t,e,i){var n=this.displayRight2Left,r=this.cols,o=this.zoomlevel;if(this.conditionimg){var a=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>t)s.ol+=e,s.image.style.left=n?(a-s.ol-r.getWidth(s.col))*o+"px":s.ol*o+"px";else if(s.col===t){if(1===s.type){var l=s.image.height;s.image.width=i*o,s.ow=i,s.image.height=l}n&&(s.image.style.left=(a-s.ol-r.getWidth(s.col))*o+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(t,e,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>t)r.ot+=e,r.image.style.top=r.ot*n+"px";else if(r.row===t&&1===r.type){var o=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=o}}))}},{key:"updateConditionImageForColInsert",value:function(t,e){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,o=this.zoomlevel;if(i){var a=this.viewWidth()-n.indexWidth,s=n.sumWidth(t,e+1),l=e-t+1;i.forEach((function(e){e.col>=t&&(e.ol+=s,e.image.style.left=r?(a-e.ol-n.getWidth(e.col))*o+"px":e.ol*o+"px",l&&(e.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(t,e){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var o=n.sumHeight(t,e+1),a=e-t+1;i.forEach((function(e){e.row>=t&&(e.ot+=o,e.image.style.top=e.ot*r+"px",a&&(e.row+=a))}))}}},{key:"updateConditionImageForRowDelete",value:function(t,e,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var o=e-t+1,a=n.length-1;a>=0;a--){var s=n[a];s.row>=t&&s.row<=e?(s.image.remove(),n.splice(a,1)):s.row>e&&(s.ot+=i,s.image.style.top=s.ot*r+"px",o&&(s.row-=o))}}},{key:"updateConditionImageForColDelete",value:function(t,e,i){var n=this.conditionimg,r=this.cols,o=this.displayRight2Left,a=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=t&&c.col<=e)c.image.remove(),n.splice(l,1);else if(c.col>e){c.ol+=i,c.image.style.left=o?(s-c.ol-r.getWidth(c.col))*a+"px":c.ol*a+"px";var h=e-t+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){t.rows.deleteCells(i.range,e),"all"!==e&&"format"!==e||t.merges.deleteWithin(i.range),t.delCellOpr(n,i.range,e)}))}},{key:"insert",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=e.selector.range,r=n.sri,o=n.sci,a=e.rows,s=e.merges,l=e.cols,c=e.name,h=r;if("row"===t){a.insert(r,i),e.updateConditionImageForRowInsert(r,r+i-1);var u=a.getHeight(r-1);e.insertRowOpr(c,r,i,u)}else if("column"===t){a.insertColumn(o,i),h=o,l.len+=i;for(var f=l.getWidth(o-1),d=l.len,v=0;v<i;v++)l._[d-1-v]={};for(var g=d-1;g>=o;g--)l._[g].width=g>=i?l._[g-i].width:l.width;e.insertColumnOpr(c,o,i,f),e.updateConditionImageForColInsert(o,o+i-1)}s.shift(t,h,i,(function(t,e,i,n){var r=a.getCell(t,e);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(t){var e=this,i=this.selector.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci;n<0&&(n=0),o<n||(r<0&&(r=0),a<r||this.changeData((function(){var i=e.rows,n=e.merges,r=e.selector,o=e.cols,a=e.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,v=0;if("row"===t){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){v=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),e.deleteRowOpr(a,c,u),e.updateConditionImageForRowDelete(c,u,g)}}else if("column"===t){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var p=-o.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,v=f-h+1,o.len-=v;for(var m=h;m<o.len-v;m++)o._[m].width=o._[m+v].width;for(var y=o.len;y<o.len+v;y++)delete o._[y];e.deleteColumnOpr(a,h,f),e.updateConditionImageForColDelete(h,f,p)}}n.shift(t,d,-v,(function(t,e,n,r){var o=i.getCell(t,e);o.merge[0]+=n,o.merge[1]+=r,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1))}},{key:"deletelocalonly",value:function(t,e,i){var n=this;this.changeData((function(){var r=n.rows,o=n.merges;n.cols;"row"===t?r.delete(e,e+i-1):"column"===t&&r.deleteColumn(e,e+i-1),o.shift(t,e,-i,(function(t,e,i,n){var o=r.getCell(t,e);o.merge[0]+=i,o.merge[1]+=n,0===o.merge[0]&&0===o.merge[1]&&delete o.merge}))}),!1)}},{key:"updateRevertOpr",value:function(t){"insertrow"===t.op?this.deletelocalonly("row",t.ri,t.n):"insertcol"===t.op&&this.deletelocalonly("column",t.ci,t.n)}},{key:"scrollx",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.cols;this.displayRight2Left&&(t=-t);var a=r()(n,2)[1],s=F.rangeReduceIf(a,o.len,0,0,t,(function(t){return o.getWidth(t)})),l=r()(s,3),c=l[0],h=l[1],u=l[2],f=h;t>0&&(f+=u),i.x!==f&&(i.ci=t>0?c:0,i.x=f,e())}},{key:"scrolly",value:function(t,e){var i=this.scroll,n=this.freeze,o=this.rows,a=this.exceptRowSet,s=r()(n,1)[0],l=F.rangeReduceIf(s,o.len,0,0,t,(function(t){return o.getHeight(t,a)})),c=r()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(t>0&&(d+=f),i.y!==d){for(i.ri=t>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=o.getHeight(i.riact,a),i.riact++;e()}}},{key:"isInvisibleRow",value:function(t){var e=this.exceptRowSet;return this.rows.isHide(t)||e.has(t)}},{key:"cellRect",value:function(t,e){var i=this.rows,n=this.cols,o=this.exceptRowSet,a=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,t,o),c=i.getCell(t,e),h=n.getWidth(e),u=i.getHeight(t);if(null!==c&&c.merge){var f=r()(c.merge,2),d=f[0],v=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(t+g);if(v>0)for(var p=1;p<=v;p+=1)h+=n.getWidth(e+p)}var m=a?this.viewWidth()-n.sumWidth(0,e)-h+2*s.x:n.sumWidth(0,e);if(a){var y=r()(this.freeze,2),b=(y[0],y[1]);b>0&&e<b&&(m-=2*s.x)}return{left:m,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(t,e){var i=this.cellRect(t,e),n=this.displayRight2Left,o=this.cols,a=this.scroll,s=this.zoomlevel,l=o.indexWidth,c=this.settings.row.height;i.top+=c;var h=r()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,e>u&&(i.left-=a.x)):(i.left+=l,e>u&&(i.left-=a.x)),t>u&&(i.top-=a.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(t,e){return this.rows.getCell(t,e)}},{key:"getCellTextOrDefault",value:function(t,e){var i=this.getCell(t,e);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(t,e){var i=this.getCell(t,e);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(t,e){var i=this.getCell(t,e);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(t,e){var i=this.styles,n=this.rows,r=this.displayRight2Left,o=n.getCell(t,e),a=o&&void 0!==o.style?i[o.style]:{},s=F.merge(this.defaultStyle(),a);if(void 0!==a.bgcolor&&(s.hasbgcolor=!0),o&&void 0!==o.merge){if(0!=o.merge[1]){var l=n.getCell(t,e+o.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===a.border&&(a.border={}),a.border.right=c.border.right)}if(0!=o.merge[0]){var h=n.getCell(t+o.merge[0],e),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===a.border&&(a.border={}),a.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var t=this.selector,e=t.ri,i=t.ci;return this.getCellStyleOrDefault(e,i)}},{key:"setCellText",value:function(t,e,i,n){var r=this.rows,o=this.history,a=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(t,e,""),o.add(this.getData()),r.setCellText(t,e,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,t,e,i)):r.setCellText(t,e,i),a.validate(t,e,i)}},{key:"updateTextbox",value:function(t,e){this.settings;var i=this.name;t.ischange&&(t.ischange=!1,this.updateTextboxOpr(i,t,e))}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"isDate",value:function(t){return isNaN(t)&&!isNaN(Date.parse(t))}},{key:"setCellAutoAlignment",value:function(t,e,i){var n=this.styles,r=this.rows.getCellOrNew(t,e),o={};void 0!==r.style&&(o=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===o.align)&&(o.align=i,r.style=this.addStyle(o),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(t,e,i){var n={name:t,src:e,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(t,e,i,n){var r={name:t,src:e,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(t,e,i,n,r){var o={name:t,cells:e,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(o)}},{key:"updateCellStyleOpr",value:function(t,e,i,n){var r={name:t,ri:e,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(t,e,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",o={name:t,ri:e,ci:i,text:n,op:r};this.updateCellServer(o)}},{key:"updateTextboxOpr",value:function(t,e,i){var n={name:t,id:e.strid,text:i,w:e.width,h:e.height,op:"updateTextBox"};this.updateCellServer(n)}},{key:"delCellOpr",value:function(t,e,i){var n={name:t,range:e,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(t){var e={name:t,op:"add"};this.updateCellServer(e)}},{key:"delSheetOpr",value:function(t){var e={name:t,op:"del"};this.updateCellServer(e)}},{key:"renameSheetOpr",value:function(t,e){var i={oldname:t,name:e,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(t,e,i,n){var r={name:t,ri:e,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(t,e,i,n){var r={name:t,ci:e,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(t,e,i){var n={name:t,sri:e,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(t,e,i){var n={name:t,sci:e,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(t){t.ufv||this.isNumber(t.text)||this.isDate(t.text)?this.setCellAutoAlignment(t.ri,t.ci,"right"):this.setCellAutoAlignment(t.ri,t.ci,"left")}},{key:"updateMyCells",value:function(t){var e=this,i=this.styles,n=this.rows,r=this.search,o=this;t.forEach((function(t,r,a){var s=n.updateOneCell(t);if(t.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=t.bgcolor,s.style=o.addStyle(l)}e.setAutoAlignForCell(t)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(t,e){var i=this.shapes;null!=i&&null!=t&&t.forEach((function(t,n,r){for(var o=0,a=i.length;o<a;o++)if(i[o].id===t.id){var s={};s.id="s_"+t.id+"_"+i[o].tick,s.name=t.id+"."+t.tick,s.it=i[o],e.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(t,e,i,n){if(n.length>0){var r=this;$.get(e+"?uid="+t+"&id="+i,(function(t){r.fillImageOnebyOne(t,n)}))}}},{key:"validateFormula",value:function(t){for(var e=0,i=0;i<t.length;i++)"("===t[i]?e++:")"===t[i]&&e--;return 0===e}},{key:"freezeIsActive",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return e>0||i>0}},{key:"resetScroll",value:function(){var t=this.scroll;t.riact=0,t.ri=0,t.y=0,t.yact=0,t.x=0,t.ci=0}},{key:"setFreeze",value:function(t,e){var i=this;0===t&&this.resetScroll(),this.changeData((function(){i.freeze=[t,e]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(t,e){var i=this;this.changeData((function(){i.rows.setHeight(t,e)}))}},{key:"setColWidth",value:function(t,e){var i=this;this.changeData((function(){i.cols.setWidth(t,e)}))}},{key:"viewHeight",value:function(){var t=this.settings,e=t.view,i=t.showToolbar,n=t.showFileName,r=e.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var t=r()(this.freeze,2),e=t[0],i=t[1];return new x(0,0,e-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var t=this.rows,e=this.cols,i=t.maxCell(),n=r()(i,2),o=n[0],a=n[1],s=t.sumHeight(0,o+1),l=e.sumWidth(0,a+1);return new x(0,0,o,a,l,s)}},{key:"exceptRowTotalHeight",value:function(t,e){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),o=0;return r.forEach((function(i){if(i<t||i>e){var r=n.getHeight(i);o+=r}})),o}},{key:"viewRange",value:function(){var t=this.scroll,e=this.rows,i=this.cols,n=this.freeze,o=this.exceptRowSet,a=t.ri,s=t.ci;a<=0&&(a=r()(n,1)[0]);s<=0&&(s=r()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[e.len,i.len],f=u[0],d=u[1],v=a;v<e.len&&(o.has(v)||(h+=e.getHeight(v),f=v),!(h>this.viewHeight()/this.zoomlevel));v+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var p=new x(a,s,f,d,c,h);return this.viewRangeCache=p,p}},{key:"eachMergesInView",value:function(t,e){this.merges.filterIntersects(t).forEach((function(t){return e(t)}))}},{key:"hideRowsOrCols",value:function(){var t=this.rows,e=this.cols,i=this.selector,n=i.size(),o=r()(n,2),a=o[0],s=o[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(a===t.len)for(var d=h;d<=f;d+=1)e.setHide(d,!0);else if(s===e.len)for(var v=c;v<=u;v+=1)t.setHide(v,!0)}},{key:"unhideRowsOrCols",value:function(t,e){this["".concat(t,"s")].unhide(e)}},{key:"rowEach",value:function(t,e,i){for(var n=0,r=this.rows,o=this.exceptRowSet,a=(v()(o),0),s=t+a;s<=e;s+=1)if(o.has(s))a+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(t,e,i){for(var n=0,r=this.cols,o=t;o<=e;o+=1){var a=r.getWidth(o);if(a>0){if(i(o,n,a),n+=a,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(t,e,i){var n=new Array;null!=t&&t.forEach((function(t){if(null==t.src){var e={};e.id="p_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),null!=e&&e.forEach((function(t){if(null==t.src){var e={};e.id="s_"+t.id+"_"+t.tick,void 0===t.refid?e.name=t.id+"."+t.tick:e.name=t.refid+"."+t.tick,e.it=t,n.push(e)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(t){for(var e=this.styles,i=0;i<e.length;i+=1){var n=e[i];if(F.equals(n,t))return i}return e.push(t),e.length-1}},{key:"changeData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),t(),this.change(this.getData()),e)for(var r=n.sri,o=(n.sci,n.eri),a=(n.eci,r);a<=o;a++)this.updateRows.add(a)}},{key:"setRangeData",value:function(t){this.rows.setRangeData(t.rows,t.range),this.merges.setData(t.merges)}},{key:"setData",value:function(t){var e=this;return Object.keys(t).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)e[i].setData(t[i]);else if("freeze"===i){var n=y(t[i]),o=r()(n,2),a=o[0],s=o[1];e.freeze=[s,a]}else if("autofilter"===i)e.autoFilter.setData(t[i]);else if("lautofilters"===i){var l=t[i],c=e;l.forEach((function(t){var e=new R;e.setData(t),c.TableAutoFilters.push(e)}))}else void 0!==t[i]&&(e[i]=t[i])})),this}},{key:"getData",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:t,freeze:b(e[1],e[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:o.getData(),validations:a.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(t){c.TableAutoFilters.push(t.getData())})),c}},{key:"getRangeData",value:function(t){var e=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(t),merges:e.getData(),range:t}}},{key:"getDataForSave",value:function(){var t=this.name,e=this.freeze,i=this.styles,n=this.merges,r=this.rows,o=this.cols,a=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,v=this.canselectunlocked,g=this.showGrid,p=this.comments,m=this.images,y=this.shapes;return{name:t,freeze:b(e[1],e[0]),styles:i,comments:p,canselectlocked:f,sprotected:d,canselectunlocked:v,showGrid:g,merges:n.getDataForSave(),settings:l,cols:o.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:a.getData(),autofilter:s.getData(),images:null!=m?m.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[],shapes:null!=y?y.filter((function(t){return t.changed})).map((function(t){var e={};return e.left=t.left,e.top=t.top,e.originAngle=t.originAngle,e.angle=t.angle,e.zorder=t.zorder,e.width=t.originWidth*t.scaleX,e.height=t.originHeight*t.scaleY,e.op=t.op,e.id=t.id,t.hyperlink&&(e.hyperlink=t.hyperlink),e})):[]}}}]),t}(),yt=i(12),bt=i.n(yt),wt=i(7),xt=i.n(wt),Ct=i(11),kt=i.n(Ct),_t=i(13),St=i.n(_t);function Tt(t,e,i){t.addEventListener(e,i)}function Ot(t,e,i){t.removeEventListener(e,i)}function Et(t){t.xclickoutside&&(Ot(window.document.body,"click",t.xclickoutside),delete t.xclickoutside)}function Rt(t,e){t.xclickoutside=function(i){2===i.detail||t.contains(i.target)||(e?e(t):(t.hide(),Et(t)))},Tt(window.document.body,"click",t.xclickoutside)}function At(t,e,i){Tt(t,"mousemove",e),t.xEvtUp=function(n){Ot(t,"mousemove",e),Ot(t,"mouseup",t.xEvtUp),i(n)},Tt(t,"mouseup",t.xEvtUp)}var It=null;function Pt(){clearInterval(It),It=null}function Dt(t,e){(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];It||(It=setInterval((function(){t.apply(void 0,i)}),400))})((function(){t.selectMoveDown(),t.canvas.publishEvent("object:scroll",t.data)}))}function Ft(t,e){var i="object"===("undefined"==typeof window?"undefined":St()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&e(i):t(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(t){e(t)})),window.addEventListener("focusout",(function(e){t(e)})))}var Mt=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,t),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ot,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ot,"-resizer-hover")).on("dblclick.stop",(function(t){return e.mousedblclickHandler(t)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ot,"-resizer-hover")).on("mousedown.stop",(function(t){return e.mousedownHandler(t)})),this.lineEl=f("div","".concat(ot,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return a()(t,[{key:"showUnhide",value:function(t){this.unhideIndex=t,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(t,e,i){var n=this.moving,r=this.vertical,o=this.hoverEl,a=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=t;var c=t.left,h=t.top,u=t.width,f=t.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),o.offset({width:r?5:u,height:r?f:5}),a.offset({width:r?0:e.width,height:r?e.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(t){var e=this,i=t,n=this.el,r=this.lineEl,o=this.cRect,a=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=a?o.width:o.height;u=Math.round(u),r.show(),At(window,(function(t){e.moving=!0,null!==i&&1===t.buttons&&(a?(l?u-=t.movementX:u+=t.movementX,u>s&&u<h&&(l?n.css("left","".concat(o.left-u,"px")):n.css("left","".concat(o.left+u,"px")))):(u+=t.movementY)>s&&u<c&&n.css("top","".concat(o.top+u,"px")),i=t)}),(function(){i=null,r.hide(),e.moving=!1,e.hide(),e.finishedFn&&(u<s&&(u=s),a?u>h&&(u=h):u>c&&(u=c),e.finishedFn(o,u))}))}}]),t}(),jt=function(){function t(e){var i=this;l()(this,t),this.vertical=e,this.moveFn=null,this.el=f("div","".concat(ot,"-scrollbar ").concat(e?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(t){var e=t.target,n=e.scrollTop,r=e.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,t)}))}return a()(t,[{key:"move",value:function(t){return this.el.scroll(t),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(t,e){var i=t-1;if(e>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(e,"px"))}else this.el.hide();return this}}]),t}(),Lt=10,Bt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,t),this.isreadonly=e,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ot,"-selector-corner")),this.areaEl=f("div","".concat(ot,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ot,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ot,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ot,"-selector-autofill")).hide(),this.el=f("div","".concat(ot,"-selector")).css("z-index","".concat(Lt)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),Lt+=1}return a()(t,[{key:"setOffset",value:function(t){return this.el.offset(t).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height,o={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:e-.8,top:i-.8};this.areaEl.offset(o).show()}},{key:"setClipboardOffset",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.clipboardEl.offset({left:e,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(t){var e=t.left,i=t.top,n=t.width,r=t.height;this.autofillEl.offset({width:n-3,height:r-3,left:e,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),t}();function zt(t){var e=this.data,i=t.left,n=t.top,r=t.width,o=t.height,a=t.scroll,s=t.l,l=t.t,c=e.freezeTotalWidth(),h=e.freezeTotalHeight(),u=e.displayRight2Left?0===c?i:i-(e.viewWidth()-e.cols.indexWidth-c):i-c,f=r;void 0!==a&&(e.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=a.x)):c>s&&(u-=a.x));var d=n-h;return void 0!==a&&h>l&&(d-=a.y),{left:u,top:d,width:f,height:o}}function Ht(t){var e=this.data,i=t.left,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=e.freezeTotalWidth(),c=e.displayRight2Left?0===l?i:i-(e.viewWidth()-e.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(e.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>o&&(c-=s.x)),{left:c,top:a,width:h,height:r}}function Nt(t){var e=this.data,i=t.top,n=t.width,r=t.height,o=t.l,a=t.t,s=t.scroll,l=t.left,c=e.freezeTotalHeight(),h=i-c;return c>a&&(h-=s.y),e.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:o,top:h,width:n,height:r}}function Wt(t){this.br.setAreaOffset(zt.call(this,t))}function Ut(t){this.tl.setAreaOffset(t)}function Xt(t){this.t.setAreaOffset(Ht.call(this,t))}function Yt(t){this.l.setAreaOffset(Nt.call(this,t))}function Vt(t){this.l.setClipboardOffset(Nt.call(this,t))}function Gt(t){this.br.setClipboardOffset(zt.call(this,t))}function qt(t){this.tl.setClipboardOffset(t)}function Kt(t){this.t.setClipboardOffset(Ht.call(this,t))}function Zt(t){Wt.call(this,t),Ut.call(this,t),Xt.call(this,t),Yt.call(this,t)}function Jt(t){Gt.call(this,t),qt.call(this,t),Kt.call(this,t),Vt.call(this,t)}var $t=function(){function t(e){var i=this;l()(this,t),this.inputChange=function(){},this.data=e;var n="edit"!==e.settings.mode;this.br=new Bt(n,!0),this.t=new Bt(n),this.l=new Bt(n),this.tl=new Bt(n),this.br.inputChange=function(t){i.inputChange(t)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ot,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,Lt+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return a()(t,[{key:"getObj",value:function(){if(null===this.objId)return null;var t=this.objId.split("_");return"s"===t[0]?this.data.shapes.filter((function(e){return Number(e.id)===Number(t[1])}))[0]:this.data.images.filter((function(e){return Number(e.id)===Number(t[1])}))[0]}},{key:"setObjId",value:function(t){this.objId=t}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(t){this.data=t,this.range=t.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var t=this.data,e=this.tl,i=this.t,n=this.l,r=this.br,o=t.freezeTotalHeight(),a=t.freezeTotalWidth();if(o>0||a>0)if(this.data.displayRight2Left){var s=t.viewWidth()-t.cols.indexWidth;e.setOffset({width:s-a,height:o}),i.setOffset({left:s-a,height:o}),n.setOffset({width:s-a,top:o}),r.setOffset({left:s-a,top:o})}else e.setOffset({width:a,height:o}),i.setOffset({left:a,height:o}),n.setOffset({width:a,top:o}),r.setOffset({left:a,top:o});else e.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Zt.call(this,t),Jt.call(this,e),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Wt.call(this,t):(Yt.call(this,t),Ut.call(this,t),Vt.call(this,e),qt.call(this,e)):(Wt.call(this,t),Xt.call(this,t),Gt.call(this,e),Kt.call(this,e)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var t=this.data.getSelectedRect(),e=this.data.getClipboardRect();Wt.call(this,t),Yt.call(this,t),Gt.call(this,e),Vt.call(this,e),this.resetOffset()}},{key:"set",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(t,e),o=r.sri,a=r.sci;if(i){var s=t,l=e;t<0&&(s=0),e<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[o,a],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,o=this.lastci;if(i){if(t===r&&e===o)return;this.lastri=t,this.lastci=e}this.moveIndexes=[t,e],this.range=n.calSelectedRangeByEnd(t,e),Zt.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(t,e){Zt.call(this,{width:this.mobilestartOffset.width+t,height:this.mobilestartOffset.height+e,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(t,e){var i=this.mobilestartRange,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=0,l=0,c=o,h=a;if(e>0){for(var u=o+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}}else{e=-e;for(u=o;u>=n;u--)if((s+=this.data.rows.getHeight(u))>e){c=u-1;break}c===n-1&&(c=n)}if(t>0){for(var f=a+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}}else{t=-t;for(f=a;f>=r;f--)if((l+=this.data.cols.getWidth(f))>t){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(t,e){var i=this.getMobileMultipleSelect(t,e),n=r()(i,2),o=n[0],a=n[1];this.setEnd(o,a,!1)}},{key:"setMobile",value:function(t,e,i,n){var r=this.range,o=r.eri,a=r.eci;this.set(t,e),this.lastri=this.lastci=0,this.setEnd(o,a);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Zt.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var t=this.data.selector.range,e=t.eri,i=t.eci;this.setEnd(e,i)}},{key:"showAutofill",value:function(t,e){if(-1!==t||-1!==e){var i=this.range,n=i.sri,r=i.sci,o=i.eri,a=i.eci,s=t,l=e,c=n-t,h=o-t,u=a-e;if(r-e>0)this.arange=new x(n,l,o,r-1);else if(c>0)this.arange=new x(s,r,n-1,a);else if(u<0)this.arange=new x(n,a+1,o,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(o+1,r,s,a)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,v=this.l,g=this.t,p=this.tl;d.showAutofill(zt.call(this,f)),v.showAutofill(Nt.call(this,f)),g.showAutofill(Ht.call(this,f)),p.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideAutofill()}))}},{key:"showClipboard",value:function(){var t=this,e=this.data.getClipboardRect();Jt.call(this,e),["br","l","t","tl"].forEach((function(e){t[e].showClipboard()}))}},{key:"hideClipboard",value:function(){var t=this;["br","l","t","tl"].forEach((function(e){t[e].hideClipboard()}))}}]),t}();function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var te=function(t){tt()(i,t);var e=Qt(i);function i(t){var n;return l()(this,i),(n=e.call(this,"dialog")).show(),n.setContent(t),n}return a()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(t){var e=f("p");e.child(t),this.child(e)}}],[{key:"findDialog",value:function(t){for(var e=[],i=0;i<t.children().length;i++)"dialog"===t.children()[i].localName&&e.push(i);return e}}]),i}(u);function ee(t){t.preventDefault(),t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=e.length-1),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ie(t){t.stopPropagation();var e=this.filterItems;e.length<=0||(this.itemIndex>=0&&(e[this.itemIndex].toggle(),e[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>e.length-1&&(this.itemIndex=0),e[this.itemIndex].toggle(),e[this.itemIndex].el.showHelp())}function ne(t){t.preventDefault();var e=this.filterItems;e.length<=0||(t.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),e[this.itemIndex].el.click(),this.hide())}function re(t,e){e.focusing=!0;var i=t.keyCode;switch(t.ctrlKey&&t.stopPropagation(),i){case 37:t.stopPropagation();break;case 38:ee.call(this,t);break;case 39:t.stopPropagation();break;case 40:ie.call(this,t);break;case 13:case 9:ne.call(this,t);break;default:t.stopPropagation()}}var oe=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,t),this.filterItems=[],this.items=e,this.el=f("div","".concat(ot,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return a()(t,[{key:"setOffset",value:function(t){this.el.cssRemoveKeys("top","bottom").offset(t)}},{key:"hide",value:function(){var t=this.el;this.filterItems=[],this.itemIndex=-1,t.hide();for(var e=te.findDialog(t.parent()),i=0;i<e.length;i++)t.parent().removeChild(t.parent().children()[e[i]]);Et(this.el.parent())}},{key:"setItems",value:function(t){this.items=t}},{key:"search",value:function(t){var e,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(t)||(r=r.filter((function(e){return(e.key||e).startsWith(t.toUpperCase())}))),r=r.map((function(t){var e=t.title;e?"function"==typeof e&&(e=e()):e=t;var r=f("div","".concat(ot,"-item")).child("f"===n?t.key:e).on("click.stop",(function(){i.itemClick(t),i.hide()}));return t.label&&r.child(f("div","label").html(t.label)),"f"===n&&(r.el.help=new te(t.title())),r.el.showHelp=function(){var t=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,e=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(t,"px"),left:"".concat(e,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Rt(r,(function(t){for(var e=te.findDialog(i.el.parent()),n=0;n<e.length;n++)i.el.parent().removeChild(i.el.parent().children()[e[n]]);Et(t)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Et(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var o=this.el;if((e=o.html("")).children.apply(e,v()(r)).show(),"f"===n){for(var a=te.findDialog(o.parent()),s=0;s<a.length;s++)o.parent().removeChild(o.parent().children()[a[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Rt(o.parent(),(function(){i.hide(),i.filterItems.forEach((function(t){return t.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(t,e){var i=this;t.on("keydown",(function(t){return re.call(i,t,e)}))}}]),t}();function ae(t,e){t.setMonth(t.getMonth()+e)}function se(t,e){var i=new Date(t);return i.setDate(e-t.getDay()+1),i}var le=function(){function t(e){var i,n=this;l()(this,t),this.value=e,this.cvalue=new Date(e),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new st("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new st("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,v()(W("calendar.weeks").map((function(t){return f("th","cell").child(t)}))))),this.bodyEl)),this.selectChange=function(){}}return a()(t,[{key:"setValue",value:function(t){this.value=t,this.cvalue=new Date(t),this.buildAll()}},{key:"prev",value:function(){ae(this.value,-1),this.buildAll()}},{key:"next",value:function(){ae(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var t=this.value;this.headerLeftEl.html("".concat(W("calendar.months")[t.getMonth()]," ").concat(t.getFullYear()))}},{key:"buildBody",value:function(){var t,e=this,i=this.value,n=this.cvalue,r=this.bodyEl,o=function(t,e,i){for(var n=new Date(t,e,1,23,59,59),r=[[],[],[],[],[],[]],o=0;o<6;o+=1)for(var a=0;a<7;a+=1){var s=se(n,7*o+a),l=s.getMonth()!==e,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[o][a]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(t){var i,n=t.map((function(t){var i="cell";return t.disabled&&(i+=" disabled"),t.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){e.selectChange(t.d)})).child(t.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,v()(n))}));(t=r.html("")).children.apply(t,v()(o))}}]),t}(),ce=function(){function t(){l()(this,t),this.calendar=new le(new Date),this.el=f("div","".concat(ot,"-datepicker")).child(this.calendar.el).hide()}return a()(t,[{key:"setValue",value:function(t){var e=this.calendar;return"string"==typeof t?/^\d{4}-\d{1,2}-\d{1,2}$/.test(t)&&e.setValue(new Date(t.replace(new RegExp("-","g"),"/"))):t instanceof Date&&e.setValue(t),this}},{key:"change",value:function(t){var e=this;this.calendar.selectChange=function(i){t(i),e.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),t}(),he=[{key:"SUM",title:U("formula.sum"),render:function(t){return t.reduce((function(t,e){return D("+",t,e)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:U("formula.average"),render:function(t){return t.reduce((function(t,e){return Number(t)+Number(e)}),0)/t.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:U("formula.max"),render:function(t){return Math.max.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:U("formula.min"),render:function(t){return Math.min.apply(Math,v()(t.map((function(t){return Number(t)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:U("formula._if"),render:function(t){var e=r()(t,3),i=e[0],n=e[1],o=e[2];return i?n:o},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:U("formula.and"),render:function(t){return t.every((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:U("formula.or"),render:function(t){return t.some((function(t){return t}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:U("formula.concat"),render:function(t){return t.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}}],ue=he,fe={};function de(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return ve(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ve(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}he.forEach((function(t){fe[t.key]=t}));var ge=function(){function t(){l()(this,t),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return a()(t,[{key:"tipContent",value:function(t,e){if(void 0===t)return"";var i=t.tipInfo.args.slice(),n="";t.tipInfo.repeat&&(n=i[i.length-1].name,i.pop());var r=[];if(""!==n){for(var o=1;i.length!==e+2;){var a=n+o;o++,i.push({name:a,required:!1})}i.push({name:"...",required:!0})}for(var s=0;s<i.length;s++){var l=i[s].required||0===s?i[s].name:"[".concat(i[s].name,"]");r.push(l)}return r[e]="<strong>".concat(r[e],"</strong>"),"".concat(t.key.toUpperCase(),"(").concat(r.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(t){if(-1!==t.startsWith("=")){var e,i="",n=[],r=[],o=de(t.substring(1));try{for(o.s();!(e=o.n()).done;){var a=e.value;switch(a){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=a}}}catch(t){o.e(t)}finally{o.f()}var s=he.find((function(t){return void 0!==n[0]&&t.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Rt(this.el)}}}]),t}(),pe=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],me=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function ye(t){for(var e=0;e<me.length;e+=1){var i=me[e];if(i.pt===t)return i.px}return t}var be=function(t){for(var e=[],i=[],n=[],o=0,a="",s=1,l="",c=0;c<t.length;c+=1){var h=t.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==t.charAt(c);)n.push(t.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=e.pop();if(2===o)try{for(var f=y(i.pop()),d=r()(f,2),v=d[0],g=d[1],p=y(i.pop()),m=r()(p,2),w=m[0],x=m[1],C=0,k=w;k<=v;k+=1)for(var _=x;_<=g;_+=1)i.push(b(k,_)),C+=1;i.push([u,C])}catch(t){}else if(1===o||3===o)3===o&&i.push(a),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(e.length<=0));)u=e.pop();o=0}else if("="===h||">"===h||"<"===h){var S=t.charAt(c+1);a=h,"="!==S&&"-"!==S||(a+=S,c+=1),o=3}else if(":"===h)o=2;else if(","===h)3===o&&i.push(a),o=1,s+=1;else if("("===h&&n.length>0)e.push(n.join(""));else{if(e.length>0&&("+"===h||"-"===h)){var T=e[e.length-1];if("("!==T&&i.push(e.pop()),"*"===T||"/"===T)for(;e.length>0&&"("!==(T=e[e.length-1]);)i.push(e.pop())}e.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));e.length>0;)i.push(e.pop());return i},we=function(t,e){var i=r()(t,1)[0],n=t;if('"'===i)return t.substring(1);var o=1;if("-"===i&&(n=t.substring(1),o=-1),n[0]>="0"&&n[0]<="9")return o*Number(n);var a=y(n),s=r()(a,2);return o*e(s[0],s[1])},xe=function(t,e,i,n){for(var o=[],a=0;a<t.length;a+=1){var s=t[a],l=s[0];if("+"===s){var c=o.pop();o.push(D("+",o.pop(),c))}else if("-"===s)if(1===o.length){var h=o.pop();o.push(D("*",h,-1))}else{var u=o.pop();o.push(D("-",o.pop(),u))}else if("*"===s)o.push(D("*",o.pop(),o.pop()));else if("/"===s){var f=o.pop();o.push(D("/",o.pop(),f))}else if("="===l||">"===l||"<"===l){var d=o.pop();Number.isNaN(d)||(d=Number(d));var v=o.pop();Number.isNaN(v)||(v=Number(v));var g=!1;"="===l?g=v===d:">"===s?g=v>d:">="===s?g=v>=d:"<"===s?g=v<d:"<="===s&&(g=v<=d),o.push(g)}else if(Array.isArray(s)){for(var p=r()(s,2),m=p[0],y=p[1],b=[],w=0;w<y;w+=1)b.push(o.pop());o.push(e[m].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),o.push(we(s,i)),n.pop()}}return o[0]},Ce=function t(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===e[0]){var o=be(e.substring(1));return o.length<=0?e:xe(o,i,(function(e,o){return t(n(e,o),i,n,r)}),r)}return e},ke=function(t){return t},_e=function(t){if(/^(-?\d*.?\d*)$/.test(t)){var e=Number(t).toFixed(2).toString().split("\\."),i=h()(e),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(v()(r))}return t},Se=[{key:"normal",title:U("format.normal"),type:"string",render:ke},{key:"text",title:U("format.text"),type:"string",render:ke},{key:"number",title:U("format.number"),type:"number",label:"1,000.12",render:_e},{key:"percent",title:U("format.percent"),type:"number",label:"10.12%",render:function(t){return"".concat(t,"%")}},{key:"rmb",title:U("format.rmb"),type:"number",label:"¥10.00",render:function(t){return"¥".concat(_e(t))}},{key:"usd",title:U("format.usd"),type:"number",label:"$10.00",render:function(t){return"$".concat(_e(t))}},{key:"eur",title:U("format.eur"),type:"number",label:"€10.00",render:function(t){return"€".concat(_e(t))}},{key:"date",title:U("format.date"),type:"date",label:"26/09/2008",render:ke},{key:"time",title:U("format.time"),type:"date",label:"15:59:00",render:ke},{key:"datetime",title:U("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:ke},{key:"duration",title:U("format.duration"),type:"date",label:"24:01:00",render:ke}],Te={};function Oe(){return window.devicePixelRatio||1}function Ee(){return Oe()-.5}function Re(t){return parseInt(t*Oe(),10)}function Ae(t){var e=Math.ceil(t/Oe());return Re(e)===t?e:e-1}function Ie(t){var e=Re(t);return e>0?e-.5:.5}Se.forEach((function(t){Te[t.key]=t}));var Pe=function(){function t(e,i,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,t),this.x=e,this.y=i,this.width=n,this.height=r,this.padding=o,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return a()(t,[{key:"setBorders",value:function(t){var e=t.top,i=t.bottom,n=t.left,r=t.right;e&&(this.borderTop=e),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPading",value:function(t,e){this.lpading=t,this.rpading=e}},{key:"setPattern",value:function(t){t&&(this.pattern=t)}},{key:"resize",value:function(t,e){this.width=t,this.height=e}},{key:"innerWidth",value:function(){return this.lpading||this.rpading?this.width-(this.lpading+this.rpading)-2:this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(t){var e=this.width,i=this.padding,n=this.lpading,r=this.rpading,o=this.x;return"left"===t?o+=n||i:"center"===t?o+=e/2:"right"===t&&(o+=e-(r||i)),o}},{key:"texty",value:function(t,e){var i=this.height,n=this.padding,r=this.y;return"top"===t?r+=n:"middle"===t?r+=i/2-e/2:"bottom"===t&&(r+=i-n-e),r}},{key:"topxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t+this.width,e]]}},{key:"rightxys",value:function(){var t=this.x,e=this.y,i=this.width;return[[t+i,e],[t+i,e+this.height]]}},{key:"bottomxys",value:function(){var t=this.x,e=this.y,i=this.width,n=this.height;return[[t,e+n],[t+i,e+n]]}},{key:"leftxys",value:function(){var t=this.x,e=this.y;return[[t,e],[t,e+this.height]]}}]),t}();function De(t,e,i,n,r,o,a){var s={x:0,y:0};"underline"===t?s.y="bottom"===r?0:"top"===r?-(o+2):-o/2:"strike"===t&&("bottom"===r?s.y=o/2:"top"===r&&(s.y=-(o/2+2))),"center"===n?s.x=a/2:"right"===n&&(s.x=a),this.line([e-s.x,i-s.y],[e-s.x+a,i-s.y])}function Fe(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}function Me(t,e,i,n,r,o){for(var a=e;a<n;a+=o)t.moveTo(a,i),t.lineTo(a,r)}function je(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(s,r),t.lineTo(a,i),a+=o}function Le(t,e,i,n,r,o){for(var a=e,s=a+o;s<=n;s+=o)t.moveTo(a,r),t.lineTo(s,i),a+=o}function Be(t,e,i,n,r,o){for(var a=i;a<r;a+=o)t.moveTo(e,a),t.lineTo(n,a)}var ze=function(){function t(e,i,n){l()(this,t),this.width=i,this.height=n,this.ctx=e,this.ctx.scale(Oe(),Oe())}return a()(t,[{key:"setel",value:function(t){var e=this.width,i=this.height;this.el=t,this.ctx=t.getContext("2d"),this.resize(e,i),this.ctx.scale(Oe(),Oe())}},{key:"resize",value:function(t,e){this.width=t,this.height=e,this.el.style.width="".concat(t,"px"),this.el.style.height="".concat(e,"px"),this.el.width=Re(t),this.el.height=Re(e)}},{key:"clear",value:function(){var t=this.width,e=this.height;return this.ctx.clearRect(0,0,Re(t),Re(e)),this}},{key:"attr",value:function(t){return Object.assign(this.ctx,t),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(t,e){return this.ctx.translate(Re(t),Re(e)),this}},{key:"scale",value:function(t,e){return this.ctx.scale(t,e),this}},{key:"scaledpr",value:function(t){this.scale(t,t)}},{key:"clearRect",value:function(t,e,i,n){return this.ctx.clearRect(t,e,i,n),this}},{key:"fillRectWithColor",value:function(t,e,i,n,r){var o=this.ctx;this.save(),void 0!==t&&(o.fillStyle=t),this.fillRect(e,i,n,r),this.restore()}},{key:"fillRect",value:function(t,e,i,n){return this.ctx.fillRect(Re(t)-.5,Re(e)-.5,Re(i),Re(n)),this}},{key:"fillText",value:function(t,e,i){return this.ctx.fillText(t,Re(e),Re(i)),this}},{key:"richtext",value:function(t,e,i,n){var r=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=t.bigfontsize,c=t.rtxt,h=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth();if(!(h<=0)){var u=e.textx(i);s.save(),s.beginPath();var f=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var d=[],v=[],g=c.length;if(o)for(var p=function(t){var e=c[t],i=[],n=0,r=0,o=0;e.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name)});var e=s.measureText(t.txt).width;if(r=n,(n+=e)>Re(h)){for(var a={w:r,len:0,start:0},l=0;l<t.txt.length;)if(a.w+=s.measureText(t.txt[l]).width+1,a.w>=Re(h)){if(a.len===a.start&&0===i.length&&(a.len+=1,l++),a.len>a.start){var c={};c.font=t.font,c.txt=t.txt.substring(a.start,a.len),i.push(c),t.font.size>o&&(o=t.font.size)}d.push(i),v.push(o),a={w:0,len:l,start:l},n=0,i=[],o=0}else a.len+=1,l++;if(a.len>a.start){var u={};u.font=t.font,u.txt=t.txt.substring(a.start,a.len),i.push(u),t.font.size>o&&(o=t.font.size),n=a.w}}else i.push(t),t.font.size>o&&(o=t.font.size)})),d.push(i),v.push(o)},m=0;m<g;m++)p(m);else d=c,v=l;for(var y=v.length,b=0,w=0;w<y;w++)b+=v[w]+8;var x=[],C=[];if("center"===i||"right"===i)for(var k=0;k<y;k++){var _=d[k],S=0;_.forEach((function(t){f.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Re(t.font.size),"pt ").concat(t.font.name),fillStyle:t.font.color,strokeStyle:t.font.color}),S+=Ae(s.measureText(t.txt).width)})),C.push(S)}if(0==a.length&&a.push(null),a.forEach((function(t){for(var o=e.texty(n,b),a=0,l=!1,c=!1,h=function(e){var n=d[e],h=0,g=u,p=g,m=g,y=v[e]+8,b=C.length>0?C[e]:0;"center"===i?p=g-b/2:"right"===i&&(p=g-b);var w=p;o+=y,n.forEach((function(e){f.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Re(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color});var n=Ae(s.measureText(e.txt).width);if(m=w+n,null!==t){if(a<=t.start&&t.start<a+e.txt.length){l=!0;var u=e.txt.substr(0,t.start-a),d=Ae(s.measureText(u).width);p=w+d}if(a<t.end&&t.end<=a+e.txt.length){var v=e.txt.substr(0,t.end-a),C=Ae(s.measureText(v).width);m=w+C,l=!1,x.push({x:p,y:o-y,w:m-p,h:y})}}h+=n;var k=0;"center"===i?k=b/2-h:"right"===i&&(k=b-h),c||r.fillText(e.txt,g-k,o),"center"===i&&(k+=n/2),!c&&e.font.strike&&De.call(r,"strike",g-k,o,i,"bottom",e.font.size,n),!c&&e.font.underline&&De.call(r,"underline",g-k,o,i,"bottom",e.font.size,n),"left"===i&&(g+=n),w+=n,a+=e.txt.length})),null!==t&&l&&x.push({x:p,y:o-y,w:m-p,h:y}),a++},g=0;g<y;g++)h(g);c||(c=!0)})),s.restore(),null!=a[0]){s.save(),this.attr({fillStyle:a[0].color});for(var T=0,O=x.length;T<O;T++){var E=x[T];this.fillRect(E.x,E.y,E.w,E.h)}s.restore()}return this}}},{key:"text",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,a=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=e.textx(s);a.save(),a.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Re(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var v="".concat(t).split("\n"),g=e.exttxtwidth?e.exttxtwidth+e.innerWidth():e.innerWidth(),p=[];v.forEach((function(t){var e=a.measureText(t).width;if(r&&e>Re(g)){for(var i={w:0,len:0,start:0},n=0;n<t.length;n+=1)i.w>=Re(g)&&(p.push(t.substring(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=a.measureText(t[n]).width+1;i.len>0&&p.push(t.substring(i.start,i.len))}else p.push(t)}));var m=(p.length-1)*(c.size+2),y=!1,b=[];if(0==o.length&&o.push(null),o.forEach((function(t){var n=e.texty(l,m),r=0,o=!1;p.forEach((function(e){var h=a.measureText(e).width,v=d,g=d+Ae(h);if(null!==t){if(r<=t.start&&t.start<r+e.length){o=!0;var p=e.substr(0,t.start-r),m=Ae(a.measureText(p).width);v+=m,Ae(h)-m}if(r<t.end&&t.end<r+e.length){var w=e.substr(0,t.end-r),x=Ae(a.measureText(w).width);g=d+x}if(r>t.end&&(o=!1),o){var C={x:0,y:0};C.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?C.x=Ae(h/2):"right"===s&&(C.x=Ae(h)),b.push({x:v-C.x,y:n-C.y,w:g-v,h:c.size+2})}}y||(i.fillText(e,d,n),u&&De.call(i,"strike",d,n,s,l,c.size,Ae(h)),f&&De.call(i,"underline",d,n,s,l,c.size,Ae(h))),n+=c.size+2,r+=e.length+1})),y||(y=!0)})),a.restore(),null!==o[0]){a.save(),this.attr({fillStyle:o[0].color});for(var w=0,x=b.length;w<x;w++){var C=b[w];this.fillRect(C.x,C.y,C.w,C.h)}a.restore()}return this}},{key:"border",value:function(t,e){var i=this.ctx;return i.lineWidth=Ee,i.strokeStyle=e,"medium"===t?i.lineWidth=Re(2)-.5:"thick"===t?i.lineWidth=Re(3):"dashed"===t?i.setLineDash([Re(3),Re(2)]):"dotted"===t?i.setLineDash([Re(1),Re(1)]):"double"===t&&i.setLineDash([Re(2),0]),this}},{key:"line",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(Ie(n),Ie(o));for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(Ie(c),Ie(h))}t.stroke()}return this}},{key:"strokeBorders",value:function(t){var e=this.ctx;e.save();var i=t.borderTop,n=t.borderRight,r=t.borderBottom,o=t.borderLeft;i&&(this.border.apply(this,v()(i)),this.line.apply(this,v()(t.topxys()))),n&&(this.border.apply(this,v()(n)),this.line.apply(this,v()(t.rightxys()))),r&&(this.border.apply(this,v()(r)),this.line.apply(this,v()(t.bottomxys()))),o&&(this.border.apply(this,v()(o)),this.line.apply(this,v()(t.leftxys()))),e.restore()}},{key:"strokePattern",value:function(t){var e=this.ctx;e.save();var i=t.x,n=t.y,r=t.width,o=t.height,a=t.pattern;if(a){e.beginPath();var s=Ie(i),l=s+Re(r),c=Ie(n),h=c+Re(o);switch(a){case"None":case"Solid":break;case"HorizontalStripe":e.lineWidth=2,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"ThinHorizontalStripe":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4);break;case"Gray75":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3);break;case"VerticalStripe":e.lineWidth=2,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"ThinVerticalStripe":e.lineWidth=1,e.setLineDash([]),Me(e,s,c,l,h,4);break;case"Gray50":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4);break;case"Gray25":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4);break;case"DiagonalStripe":e.lineWidth=2,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"ThinDiagonalStripe":e.lineWidth=1,e.setLineDash([]),Le(e,s,c,l,h,4);break;case"Gray12":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,4.5);break;case"DiagonalCrosshatch":e.lineWidth=1.5,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":e.lineWidth=1,e.setLineDash([]),Fe(e,s,c,l,h,4),Me(e,s,c,l,h,4);break;case"Gray6":e.lineWidth=2,e.setLineDash([2]),Be(e,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":e.lineWidth=2,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":e.lineWidth=1,e.setLineDash([]),je(e,s,c,l,h,4),Le(e,s,c,l,h,4)}e.closePath(),e.stroke()}e.restore()}},{key:"dropdown",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-15,o=n+t.height-15;e.save(),e.beginPath(),e.moveTo(Re(r),Re(o)),e.lineTo(Re(r+8),Re(o)),e.lineTo(Re(r+4),Re(o+6)),e.closePath(),e.fillStyle="rgba(0, 0, 0, .45)",e.fill(),e.restore()}},{key:"error",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=n+o-1;i.save(),i.beginPath(),e?(i.moveTo(Re(a-o+8),Re(r-1)),i.lineTo(Re(a-o),Re(r-1)),i.lineTo(Re(a-o),Re(r+8))):(i.moveTo(Re(a-8),Re(r-1)),i.lineTo(Re(a),Re(r-1)),i.lineTo(Re(a),Re(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=i+t.width-1;e.save(),e.beginPath(),e.moveTo(Re(r-8),Re(n-1)),e.lineTo(Re(r),Re(n-1)),e.lineTo(Re(r),Re(n+8)),e.closePath(),e.fillStyle="rgba(0, 255, 0, .85)",e.fill(),e.restore()}},{key:"line2",value:function(){var t=this.ctx;if(arguments.length>1){t.beginPath();var e=arguments.length<=0?void 0:arguments[0],i=r()(e,2),n=i[0],o=i[1];t.moveTo(n,o);for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=r()(s,2),c=l[0],h=l[1];t.lineTo(c,h)}t.stroke()}return this}},{key:"rect3",value:function(t){var e=this.ctx,i=t.x,n=t.y,r=t.width,o=t.height;e.save(),e.beginPath(),e.rect(Re(i)-.5,Re(n)-.5,Re(r),Re(o)),e.closePath(),e.strokeStyle="black",e.stroke(),e.restore()}},{key:"rect2",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,o-2,a-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,o+u+f-2,a-2),i.clip(),e(),i.restore()}else e(),i.restore()}},{key:"rect",value:function(t,e){var i=this.ctx,n=t.x,r=t.y,o=t.width,a=t.height,s=t.bgcolor,l=t.pbgcolor,c=t.exttxtwidthR,h=t.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(Ie(n+1),Ie(r+1),Re(o-2),Re(a-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(Ie(n+1-f),Ie(r+1),Re(o+u+f-2),Re(a-2)),i.clip(),e(),i.restore()}else e(),i.restore()}}]),t}();function He(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Ne(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ne(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var We={fillStyle:"#f4f5f8"},Ue={fillStyle:"#fff",lineWidth:Ee,strokeStyle:"#e6e6e6"};function Xe(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.cellRect(e,i),o=r.left,a=r.top,s=r.width,l=r.height;return new Pe(o,a+n,s,l,3)}function Ye(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.cellRect(e.sri,e.sci),r=n.left,o=n.top,a=t.cols.sumWidth(e.sci,e.eci+1),s=t.rows.sumHeight(e.sri,e.eri+1);return new Pe(r,o+i,a,s,3)}function Ve(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Ye(t,e,i);return n.width+=3,n.height+=3,n}function Ge(t,e,i,n,r,o,a){var s=t.cols,l=t.viewRangeCache;if(!a.textwrap&&o.text&&o.text.length>0){var c=0,h=0;if(void 0===a.align||"center"===a.align||"left"===a.align)for(var u=r+1;u<=l.eci;u++){var f=t.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(a.align&&("center"===a.align||"right"===a.align))for(var d=r-1;d>=l.sci;d--){var v=t.getCell(i,d);if(null!==v&&void 0!==v.text&&v.text.length>0)break;h+=s.getWidth(d)}c>0&&(e.exttxtwidthR=c),h>0&&(e.exttxtwidthL=h)}}function qe(t){if(void 0!==t.rtxt&&void 0===t.bigfontsize){for(var e=[],i=[],n=[],r=0,o=t.rtxt.length,a=0;a<o;a++){var s=t.rtxt[a].txt.split("\n"),l=s.length,c=t.rtxt[a].font.size;if(1===l)n.push(t.rtxt[a]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=t.rtxt[a].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),e.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=t.rtxt[a].font,f.txt=s[u],n.push(f),e.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=t.rtxt[a].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),e.push(n)),t.rtxt=e,t.bigfontsize=i}}function Ke(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=e.sortedRowMap,s=e.rows,l=e.cols;e.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;a.has(i)&&(c=a.get(i));var h=e.getCell(c,n);if(null!==h&&(!h.merge||o)){qe(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=e.getCellStyleOrDefault(c,n),d=Xe(e,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var v=d,g=!1,p=!1;f.hasbgcolor&&!o&&((e.bgcolor||void 0===f.border||void 0===f.border.right)&&(v.width+=3,g=!0),(e.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(v.height+=3,p=!0)),Ge(e,d,c,0,n,h,f);var m=e.getHighlightCellTxt(i,n);t.rect(v,(function(){var i="";i=e.settings.evalPaused||"server"===e.settings.updateMode?h.text||"":Ce(h.text||"",fe,(function(t,i){return e.getCellTextOrDefault(i,t)})),f.format&&"server"!==e.settings.updateMode&&(i=Te[f.format].render(i));var r=Object.assign({},f.font);r.size=ye(r.size),void 0===h.rtxt?""!==i&&t.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,m):t.richtext(h,d,f.align,f.valign,f.textwrap,m),e.validations.getError(c,n)&&t.error(d),u&&t.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),t.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),p&&(d.height-=3),d.setBorders(f.border),t.strokeBorders(d))}}}function Ze(t){var e=this.data,i=this.draw;if(t){var n=e.autoFilter,r=e.TableAutoFilters;Je(e,t,i,n),r.forEach((function(n){Je(e,t,i,n)}))}}function Je(t,e,i,n){if(n.active()){var r=n.hrange();e.intersects(r)&&r.each((function(e,n){var r=Xe(t,e,n);i.dropdown(r)}))}}function $e(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r),a.comments.forEach((function(e){if(t.sri<=e.row&&t.eri>=e.row&&t.sci<=e.col&&t.eci>=e.col){var i=Xe(a,e.row,e.col);o.error(i,a.displayRight2Left)}})),o.restore()}function Qe(t,e,i,n,r){var o=this.draw,a=this.data;o.save(),a.displayRight2Left?o.translate(-e,i).translate(n,r):o.translate(e,i).translate(n,r);var s=a.exceptRowSet;o.save(),o.translate(0,-0),t.emptyFirst((function(t,e){Ke(o,a,t,e)}),(function(t){return function(t){return!s.has(t)}(t)}),(function(t,e){return a.isEmpty(t,e)})),o.restore();var l=new Set;o.save(),o.translate(0,-0),a.eachMergesInView(t,(function(t){var e=t.sri,i=t.sci,n=t.eri;if(s.has(e)){if(!l.has(e)){l.add(e);var r=a.rows.sumHeight(e,n+1);o.translate(0,-r)}}else Ke(o,a,e,i,0,!0)})),o.restore(),Ze.call(this,t),o.restore()}function ti(t,e,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(t,e,i,n),r.restore()}function ei(t,e,i,n,r,o){var a=this,s=this.draw,l=this.data,c=e.h,h=e.w,u=o+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,v=l.displayRight2Left?d-i:0;if(s.save(),s.attr(We),"all"!==t&&"left"!==t||s.fillRect(v,u,i,c),"all"===t||"top"===t)if(l.displayRight2Left){var g=e.lineStartx?e.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var m=l.selector.range,y=m.sri,b=m.sci,w=m.eri,x=m.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Re(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Ee(),strokeStyle:"#e6e6e6"}),"all"===t||"left"===t){var C=v;l.rowEach(e.sri,e.eri,(function(t,e,n){var r=u+e,o=t;s.line([C,r],[C+i,r]),y<=o&&o<w+1&&ti.call(a,C,r,i,n),s.fillText(o+1,C+i/2,r+n/2),t>0&&l.rows.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([C+5,r+5],[C+i-5,r+5]),s.restore())})),s.line([C,c+u],[C+i,c+u]),s.line([C+i,u],[C+i,c+u])}"all"!==t&&"top"!==t||(l.colEach(e.sci,e.eci,(function(t,e,i){var r=l.displayRight2Left?d-(f+e+i):f+e,o=t;s.line([r,0],[r,n]),b<=o&&o<x+1&&ti.call(a,r,0,i,n),s.fillText(p(o),r+i/2,n/2),t>0&&l.cols.isHide(t-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function ii(t,e){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,t,e),i.restore()}function ni(t,e,i,n,o){var a=t.sri,s=t.sci,l=t.eri,c=t.eci,h=t.w,u=t.h,f=t.clearStartx,d=void 0===f?0:f,v=t.lineStartx,g=void 0===v?0:v,p=this.draw,m=this.data,y=(m.settings,m.displayRight2Left),b=m.scroll;if(p.save(),y?p.attr(Ue).translate(-(e+n),i+o):p.attr(Ue).translate(e+n,i+o),p.clearRect(d,0,h,u),m.bgcolor&&p.fillRectWithColor(m.bgcolor,d,0,h,u),m.showGrid&&!m.bgcolor){if(y){h+=e+n;var w=r()(m.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=m.viewWidth()),m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([g,e],[g+h,e]),t===l&&p.line([g,e+i],[g+h,e+i])}))}else m.rowEach(a,l,(function(t,e,i){t!==a&&p.line([0,e],[h,e]),t===l&&p.line([0,e+i],[h,e+i])}));if(y){var C=m.viewWidth();m.colEach(s,c,(function(t,e,i){p.line([C-e-i,0],[C-e-i,u]),t===s&&p.line([C-e,0],[C-e,u])}))}else m.colEach(s,c,(function(t,e,i){t!==s&&p.line([e,0],[e,u]),t===c&&p.line([e+i,0],[e+i,u])}));p.restore()}else p.restore()}function ri(t,e,i,n){var r=this.draw,o=this.data,a=o.viewWidth(),s=(a-t)/this.zoomlevel,l=(o.viewHeight()-e)/this.zoomlevel;o.displayRight2Left?r.save().translate(-t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(t,e).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),o.displayRight2Left?(r.line([0,n],[a,n]),r.line([a-i,0],[a-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var oi=function(){function t(e,i){l()(this,t),this.el=e,this.draw=new ze(e.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(e),this.data=i,this.zoomlevel=1}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.render()}},{key:"clearSelectRender",value:function(){var t=this.data,e=this.draw,i=this.zoomlevel,n=t.selector,r=n.ri,o=n.ci,a=r;t.sortedRowMap.has(r)&&(a=sortedRowMap.get(r));var s=t.getCell(a,o);if(null!==s){var l=t.getCellStyleOrDefault(a,o),c=Xe(t,r,o,0);Ge(t,c,a,0,o,s,l);var h=t.cols.indexWidth,u=t.settings.row.height,f=t.freezeTotalWidth(),d=t.scroll,v=d.x,g=d.y;e.save(),e.scaledpr(i),t.displayRight2Left?e.attr(Ue).translate(-(h+f),u+0):e.attr(Ue).translate(h+f,u+0);var p=void 0===c.exttxtwidthR?0:c.exttxtwidthR,m=void 0===c.exttxtwidthL?0:c.exttxtwidthL;e.fillRect(c.x+1-m-v,c.y+1-g,c.width+p+m-2,c.height-2),e.restore()}}},{key:"render",value:function(){var t=this.data,e=this.zoomlevel;if(!t.isupdating){var i=t.rows,n=t.cols;if(0!==Object.keys(i._).length){var o=n.indexWidth,a=t.settings.row.height;this.draw.resize(t.viewWidth(),t.viewHeight()),this.draw.scaledpr(e),this.clear();var s=t.viewRange(),l=t.freezeTotalWidth(),c=t.freezeTotalHeight(),h=t.scroll,u=h.x,f=h.y;ni.call(this,s,o,a,l,c),Qe.call(this,s,o,a,-u,-f),$e.call(this,s,o,a,-u,-f),ei.call(this,"all",s,o,a,l,c),ii.call(this,o,a);var d=r()(t.freeze,2),v=d[0],g=d[1];if(v>0||g>0){if(v>0){var p=s.clone();p.sri=0,p.eri=v-1,p.h=c,ni.call(this,p,o,a,l,0),Qe.call(this,p,o,a,-u,0),$e.call(this,p,o,a,-u,0),ei.call(this,"top",p,o,a,l,0),this.highlightRanges(p,o,a,u,0)}if(g>0){var m=s.clone();m.sci=0,m.eci=g-1,m.w=l,m.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,m.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,ni.call(this,m,o,a,0,c),ei.call(this,"left",m,o,a,0,c),Qe.call(this,m,o,a,0,-f),$e.call(this,m,o,a,0,-f),this.highlightRanges(m,o,a,0,f)}var y=t.freezeViewRange();y.clearStartx=t.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=t.displayRight2Left?t.viewWidth()-l:0,ni.call(this,y,o,a,0,0),ei.call(this,"all",y,o,a,0,0),Qe.call(this,y,o,a,0,0),$e.call(this,y,o,a,0,0),ri.call(this,o,a,l,c),this.highlightRanges(y,o,a,0,0)}this.highlightRanges(s,o,a,u,f)}}}},{key:"highlightRanges",value:function(t,e,i,n,r){var o=this.draw,a=this.data;if(a.showhighlight){if(o.save(),a.displayRight2Left?o.translate(-e,i).translate(-n,-r):o.translate(e,i).translate(-n,-r),a.highlightall){var s=Ve(a,t);s.bgcolor=a.highlightstyle.color,o.rect(s,(function(){}))}else if(a.highlightIR){var l,c=He(t.difference(a.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=Ve(a,l.value);h.bgcolor=a.highlightstyle.color,o.rect(h,(function(){}))}}catch(t){c.e(t)}finally{c.f()}}else{var u,f=He(a.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(t.intersects(d)){var v=d.clone();v.sri<t.sri&&(v.sri=t.sri),v.eri>t.eri&&(v.eri=t.eri),v.sci<t.sci&&(v.sci=t.sci),v.eci>t.eci&&(v.eci=t.eci);var g=Ve(a,v);g.bgcolor=a.highlightstyle.color,o.rect(g,(function(){}))}}}catch(t){f.e(t)}finally{f.f()}}o.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),t}();function ai(){var t=this.inputText;if(!/^\s*$/.test(t)){var e=this.textlineEl,i=this.textEl,n=this.areaOffset,r=t.split("\n"),o=Math.max.apply(Math,v()(r.map((function(t){return t.length})))),a=e.offset().width/t.length,s=(o+1)*a+5,l=this.viewFn().width-n.left-a,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function si(t){var e=t.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=e.innerText,this.inputHtml=e.innerHTML,ai.call(this)}}function li(t){var e=t.keyCode,i=t.altKey;13!==e&&9!==e&&t.stopPropagation(),13===e&&i&&(si.call(this,t),t.stopPropagation()),13!==e||i||t.preventDefault()}function ci(t){var e=t.target.innerText,i=t.target.innerHTML,n=this.suggest,r=this.textlineEl,o=this.validator,a=this.cell;if(this.textbox)return this.textbox.ischange=!0,void(this.inputHtml=i);if(null!==a)if("editable"in a&&!0===a.editable||void 0===a.editable){if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var s=e.lastIndexOf("=");-1!==s?(n.search(e.substring(s+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(i),ai.call(this),this.change("input",e)}else t.target.innerText="";else{if(this.inputText=e,this.inputHtml=i,o)"list"===o.type?n.search(e):n.hide();else{var l=e.lastIndexOf("=");-1!==l?(n.search(e.substring(l+1),"f"),"("===t.data&&n.hide(),this.formalaTip.show(e)):(n.hide(),this.formalaTip.hide())}r.html(e),ai.call(this),this.change("input",e)}}function hi(t,e){var i=this.textEl.el;setTimeout((function(){if(e){var t=window.getSelection(),n=document.createRange();t.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),t.addRange(n),i.focus()}}),1)}function ui(t,e,i,n){var r=this.textEl,o=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var a=!1;t.length>0?(a=!0,r.html(t)):r.html(e,!0,!0),a?o.html(t):o.html(e,!0,!0),hi.call(this,i,n)}function fi(t,e){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=t,r=this.inputText.length;else{var o=i.lastIndexOf("="),a=i.substring(0,o+1),s=i.substring(o+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(a+t.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}ui.call(this,this.inputText,r,e)}function di(){this.suggest.setItems(this.formulas)}var vi=function(){function t(e,i,n,r){var o=this;l()(this,t),this.viewFn=i,this.rowHeight=n,this.formulas=e,this.formalaTip=new ge,this.suggest=new oe(e,(function(t){fi.call(o,t,!0)})),this.datepicker=new ce,this.datepicker.change((function(t){o.setText(function(t){var e=t.getMonth()+1,i=t.getDate();return e<10&&(e="0".concat(e)),i<10&&(i="0".concat(i)),"".concat(t.getFullYear(),"-").concat(e,"-").concat(i)}(t)),o.clear()})),this.areaEl=f("div","".concat(ot,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(t){return ci.call(o,t)})).on("paste.stop",(function(){})).on("keydown",(function(t){return li.call(o,t)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ot,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.textbox=null,this.change=function(){},this.textboxChange=function(){}}return a()(t,[{key:"setFreezeLengths",value:function(t,e){this.freeze.w=t,this.freeze.h=e}},{key:"insertTextNewLine",value:function(t){si.call(this,t)}},{key:"clear",value:function(){this.textbox?(""!==this.inputHtml&&this.textboxChange(this.textbox,this.inputHtml),this.textbox.setVisible(!0)):""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.textbox=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textEl.cssRemoveKeys("width","height","padding-left","padding-right","text-align","border"),this.textlineEl.html(""),di.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,o=this.freeze,a=this.el;if(t){this.areaOffset=t;var s=t.left,l=t.top,c=t.width,h=t.height,u=t.l,f=t.t,d={left:0,top:0};o.w>u&&o.h>f||(o.w<u&&o.h<f?(d.left=o.w,d.top=o.h):o.w>u?d.top=o.h:o.h>f&&(d.left=o.w)),a.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var v={left:0};v[e]=h,r.setOffset(v),r.hide()}}},{key:"setForTextBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.el,n=this.textEl;n.attr("contenteditable","true"),i.show(),this.textbox=t,this.textbox.setVisible(!1),this.ishtml=!0,this.inputText=t.text,this.inputHtml=t.html,ui.call(this,t.html,t.text,t.text.length,e),n.css("width","".concat(t.width-9,"px")),n.css("height","".concat(t.height,"px")),n.css("padding-left","".concat(t.lp,"pt")),n.css("padding-right","".concat(t.rp,"pt")),n.css("text-align",t.align),n.css("border","black 1px solid")}},{key:"setCell",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,o=this.suggest,a=this.textEl;a.attr("contenteditable","true"),n.show(),this.cell=t;var s=t&&t.text||"",l=t&&t.html||"";if(t&&(t.f?s=t.f:t.ufv&&(s=t.ufv)),this.ishtml=t&&t.html,this.setTextAndHtml(l,s,i),this.validator=e,e){var c=e.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(o.setItems(e.values()),o.search(""))}}},{key:"setTextAndHtml",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=e,this.inputHtml=t,ui.call(this,t,e,e.length,i),ai.call(this)}},{key:"setText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=t,ui.call(this,"",t,t.length,e),ai.call(this)}}]),t}();function gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var pi=function(t){tt()(i,t);var e=gi(i);function i(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=e.call(this,"div","".concat(ot,"-button ").concat(r))).child(W("button.".concat(t))),n}return i}(u),mi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],yi=["landscape","portrait"];function bi(t){return parseInt(96*t,10)}function wi(t){"cancel"===t?this.el.hide():this.toPrint()}function xi(t){var e=this.paper,i=t.target.value,n=mi[i];e.w=bi(n[1]),e.h=bi(n[2]),this.preview()}function Ci(t){var e=this.paper,i=t.target.value,n=yi[i];e.orientation=n,this.preview()}var ki=function(){function t(e,i){var n,r;l()(this,t),this.paper={w:bi(mi[0][1]),h:bi(mi[0][2]),padding:50,orientation:yi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=e,this.imageCanvas=i,this.el=f("div","".concat(ot,"-print")).children(f("div","".concat(ot,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",wi.bind(this,"cancel")),new pi("next","primary").on("click",wi.bind(this,"next"))))),f("div","".concat(ot,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(W("print.size"))),(n=f("select","")).children.apply(n,v()(mi.map((function(t,e){return f("option","").attr("value",e).child("".concat(t[0]," ( ").concat(t[1],"''x").concat(t[2],"'' )"))})))).on("change",xi.bind(this))),f("fieldset","").children(f("label","").child("".concat(W("print.orientation"))),(r=f("select","")).children.apply(r,v()(yi.map((function(t,e){return f("option","").attr("value",e).child("".concat(W("print.orientations")[e]))})))).on("change",Ci.bind(this))))))).hide()}return a()(t,[{key:"resetData",value:function(t){this.data=t}},{key:"preview",value:function(){var t=this,e=this.data,i=this.paper,n=i.width,r=i.height,o=i.padding,a=n-2*o,s=r-2*o,l=e.contentRange(),c=parseInt(l.h/s,10)+1,h=a/l.w,u=o,d=o;h>1&&(u+=(a-l.w)/2);var v=0,g=0;this.contentEl.html(""),this.canvases=[];for(var p={sri:0,sci:0,eri:0,eci:0},m=function(i){var o=0,a=0,c=f("div","".concat(ot,"-canvas-card")),m=f("canvas","".concat(ot,"-canvas"));t.canvases.push(m.el);var y=new ze(m.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);v<=l.eri;v+=1){var b=e.rows.getHeight(v);if(!((o+=b)<s)){a=-(o-b);break}for(var w=0;w<=l.eci;w+=1)Ke(y,e,v,w,g),p.eci=w}p.eri=v,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;e.eachMergesInView(p,(function(t){var i=t.sri,n=t.sci;Ke(y,e,i,n,x)})),y.restore(),p.sri=p.eri,p.sci=p.eci,g+=a;var C=t.imageCanvas.el.getContext("2d");C.width=n,C.height=r,C.translate(u,d),h<1&&C.scale(h,h),m.el.getContext("2d").drawImage(t.imageCanvas.el,u-t.imageCanvas.tOffset.left,t.imageCanvas.tOffset.top),t.contentEl.child(f("div","".concat(ot,"-canvas-card-wraper")).child(c.child(m)))},y=0;y<c;y+=1)m()}},{key:"toPrint",value:function(){this.el.hide();var t=this.paper,e=f("iframe","").hide().el;window.document.body.appendChild(e);var i=e.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(t.width,"px ").concat(t.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(t){var e=t.cloneNode(!1);e.getContext("2d").drawImage(t,0,0),n.body.appendChild(e)})),i.print()}}]),t}(),_i=[{key:"copy",title:U("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:U("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:U("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:U("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:U("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:U("contextmenu.insertRow")},{key:"insert-column",title:U("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:U("contextmenu.deleteRow")},{key:"delete-column",title:U("contextmenu.deleteColumn")},{key:"delete-cell-text",title:U("contextmenu.deleteCellText")},{key:"hide",title:U("contextmenu.hide")},{key:"divider"},{key:"link",title:U("contextmenu.link")},{key:"openLink",title:U("contextmenu.openLink")},{key:"removeLink",title:U("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:U("contextmenu.validation")},{key:"cell-editable",title:U("contextmenu.celleditable")},{key:"cell-non-editable",title:U("contextmenu.cellnoneditable")}];function Si(t,e){var i=this,n=null;return(n="divider"===t.key?f("div","".concat(ot,"-item divider")):f("div","".concat(ot,"-item")).on("click",(function(){t.callback?t.callback(e,e.selector.getObj()):i.itemClick(t.key),i.hide()})).children(t.text?t.text:t.title(),f("div","label").child(t.label||"").attr("k",t.key))).key=t.key,n}function Ti(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_i,i=arguments.length>1?arguments[1]:void 0;return e.map((function(e){return Si.call(t,e,i)}))}function Oi(t,e){return t.find((function(t){return t.key===e}))}var Ei=function(){function t(e,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;if(l()(this,t),window.mobileAndTabletCheck()){var a={key:"merge",title:U("contextmenu.merge"),label:""},s={key:"unmerge",title:U("contextmenu.unmerge"),label:""},c={key:"edit",title:U("contextmenu.edit"),label:""};_i.forEach((function(t){t.label=void 0,"delete-cell-text"===t.key&&(t.title=U("contextmenu.clear"))})),_i.push(a),_i.push(s),_i.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:U("contextmenu.deleteImage"),label:"Del"}],this.customsetting=o&&!o.usedefault,this.customItems=this.customsetting?o.customItems:[],this.menuItems=this.customsetting?Ti.call(this,o.customItems,i):Ti.call(this),this.el=(n=f("div","".concat(ot,"-contextmenu"))).children.apply(n,v()(this.menuItems)).hide(),this.viewFn=e,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return a()(t,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t.key}));i>=0&&e.splice(i,1)})),e.push.apply(e,t)}},{key:"delImageContextMenuItems",value:function(t){var e=this.customMenuItemsForImage;t.forEach((function(t){var i=e.findIndex((function(e){return e.key===t}));i>=0&&e.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(t){this.addImageContextMenuItems([t])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var o=Ti.call(this,t,n);t.forEach((function(t,i){"divider"!==t.key&&Oi(e,t.key)||(e.push(t),r.push(o[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n&&("divider"===t.key||!Oi(i,t.key))){var a=Si.call(this,t,r);i.splice(e,0,t),o.splice(e,0,a),this.rebuildMenuItems(o)}}},{key:"updateCutomContextMenuItem",value:function(t,e){var i=this.customItems,n=this.customsetting,r=this.sheet,o=this.menuItems;if(n){var a=i.findIndex((function(e){return e.key==t}));if(-1!==a){e.text&&(i[a].text=e.text),e.callback&&(i[a].callback=e.callback);var s=Si.call(this,i[a],r);o[a]=s,this.rebuildMenuItems(o)}}}},{key:"rebuildMenuItems",value:function(t){var e,i=this.sheet;(i.el.removeChild(this.el.el),t.length>0)?this.el=(e=f("div","".concat(ot,"-contextmenu"))).children.apply(e,v()(t)).hide():this.el=f("div","".concat(ot,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(t){var e=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(t.forEach((function(t){var n=e.findIndex((function(e){return e.key===t}));n>=0&&(e.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(t){if(!this.customsetting){var e=this.menuItems[12];"row-col"===t?e.show():e.hide()}}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setPosition",value:function(t,e){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),o=r.width,a=r.height,s=this.viewFn(),l=t;s.width-t<=o&&(l-=o),i.css("left","".concat(l,"px"));var c=e;a+e>s.height&&(c-=a+e-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Rt(i)}}},{key:"showImageDeleteItem",value:function(t,e){var i=this,n=this.customMenuItemsForImage;n.forEach((function(e){t.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===e.key&&t.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=e.canvas.fabric.getActiveObject();null!=r&&("OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:U("contextmenu.download"),callback:function(){e.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]),Ti.call(this,n,e).forEach((function(t){return i.el.child(t,!0)})),e.selector.hide(),e.selector.setObjId(r.id))}}]),t}(),Ri=i(9),Ai=i.n(Ri);var Ii=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,t),this.tip=W("toolbar.".concat(e.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),this.activeTip=null===i?null:W("toolbar.".concat(i.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=e,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return a()(t,[{key:"element",value:function(){var t=this.tip,e=this.activeTip;return f("div","".concat(ot,"-toolbar-btn")).on("mouseenter",(function(i){""!==t&&function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.classList.contains("active")||null!==i){var n=e.getBoundingClientRect(),r=n.left,o=n.top,a=n.width,s=n.height,l=e.classList.contains("active")?i:t,c=f("div","".concat(ot,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+a/2-h.width/2,"px")).css("top","".concat(o+s+2,"px")),Tt(e,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Tt(e,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(t,i.target,e)})).attr("data-tooltip",t)}},{key:"setState",value:function(){}}]),t}();function Pi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Di=function(t){tt()(i,t);var e=Pi(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(t){return t}},{key:"element",value:function(){var t=this,e=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return t.change(e,t.getValue(i))},Ai()(rt()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(t){t&&(this.value=t,this.dd.setTitle(t))}}]),i}(Ii);function Fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mi=function(t){tt()(i,t);var e=Fi(i);function i(t,n,r,o){var a,s;l()(this,i),(s=e.call(this,"div","".concat(ot,"-dropdown ").concat(o))).title=t,s.change=function(){},s.headerClick=function(){},"string"==typeof t?s.title=f("div","".concat(ot,"-dropdown-title")).child(t):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ot,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(t){return t.tag})),(a=s).setContentChildren.apply(a,h),s.headerEl=f("div","".concat(ot,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var t=s.menuDiv.el,e=s.menuDiv.el.offsetParent;t.offsetParent&&"BODY"!==t.offsetParent.nodeName;)t=t.offsetParent;s.contentEl.el.clientWidth-t.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=e.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ot,"-icon arrow-right")).child(f("div","".concat(ot,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return a()(i,[{key:"setContentChildren",value:function(){var t;(this.contentEl.html(""),arguments.length>0)&&(t=this.contentEl).children.apply(t,arguments)}},{key:"showExplain",value:function(t){var e=this;if(this.contentEl.children().length===t.length)for(var i=function(i){Tt(e.contentEl.children()[i],"mouseover",(function(){var n=new te(t[i].title()),r=te.findDialog(e.contentEl),o={top:"".concat(e.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var a=0;a<r.length;a++)e.contentEl.removeChild(e.contentEl.children()[r[a]]);n.css(o),e.contentEl.child(n)})),Tt(e.contentEl.children()[i],"mouseout",(function(){var t=te.findDialog(e.contentEl);if(0!==t.length)for(var i=0;i<t.length;i++)e.contentEl.removeChild(e.contentEl.children()[t[i]])}))},n=0;n<t.length;n++)i(n)}},{key:"setTitle",value:function(t){this.title.html(t),this.hide()}},{key:"show",value:function(){var t=this;this.contentEl.show(),this.parent().active(),Rt(this.parent(),(function(){t.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Et(this.parent())}}]),i}(u);function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Li=function(t){tt()(i,t);var e=ji(i);function i(t,n){var r;l()(this,i);var o=new st("align-".concat(n)),a=t.map((function(t){return(e="align-".concat(t),f("div","".concat(ot,"-item")).child(new st(e))).on("click",(function(){r.setTitle(t),r.change(t)}));var e}));return r=e.call.apply(e,[this,o,"auto",!0,"bottom-left"].concat(v()(a)))}return a()(i,[{key:"setTitle",value:function(t){this.title.setName("align-".concat(t)),this.hide()}}]),i}(Mi);function Bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zi=function(t){tt()(i,t);var e=Bi(i);function i(t){return l()(this,i),e.call(this,"align",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new Li(["left","center","right"],t)}}]),i}(Di);function Hi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ni=function(t){tt()(i,t);var e=Hi(i);function i(t){return l()(this,i),e.call(this,"valign",null,"",t)}return a()(i,[{key:"dropdown",value:function(){var t=this.value;return new Li(["top","middle","bottom"],t)}}]),i}(Di);function Wi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ui=function(t){tt()(i,t);var e=Wi(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this,e=this.tag;return Ai()(rt()(i.prototype),"element",this).call(this).child(new st(e)).on("click",(function(){return t.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(t){this.el.active(t)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ii);function Xi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Yi=function(t){tt()(i,t);var e=Xi(i);function i(){return l()(this,i),e.call(this,"autofilter")}return a()(i,[{key:"setState",value:function(){}}]),i}(Ui);function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Gi=function(t){tt()(i,t);var e=Vi(i);function i(){return l()(this,i),e.call(this,"font-bold",null,"Ctrl+B")}return i}(Ui);function qi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ki=function(t){tt()(i,t);var e=qi(i);function i(){return l()(this,i),e.call(this,"font-italic",null,"Ctrl+I")}return i}(Ui);function Zi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ji=function(t){tt()(i,t);var e=Zi(i);function i(){return l()(this,i),e.call(this,"strike")}return i}(Ui);function $i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Qi=function(t){tt()(i,t);var e=$i(i);function i(){return l()(this,i),e.call(this,"underline",null,"Ctrl+U")}return i}(Ui),tn=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],en=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],nn=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function rn(t){var e=this;return f("td","").child(f("div","".concat(ot,"-color-palette-cell")).on("click.stop",(function(){return e.change(t)})).css("background-color",t))}var on=function t(){var e,i,n,r=this;l()(this,t),this.el=f("div","".concat(ot,"-color-palette")),this.change=function(){};var o=f("table","").children((e=f("tbody","")).children.apply(e,[(i=f("tr","".concat(ot,"-theme-color-placeholders"))).children.apply(i,v()(tn.map((function(t){return rn.call(r,t)}))))].concat(v()(en.map((function(t){var e;return(e=f("tr","".concat(ot,"-theme-colors"))).children.apply(e,v()(t.map((function(t){return rn.call(r,t)}))))}))),[(n=f("tr","".concat(ot,"-standard-colors"))).children.apply(n,v()(nn.map((function(t){return rn.call(r,t)}))))])));this.el.child(o)};function an(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var sn=function(t){tt()(i,t);var e=an(i);function i(t,n){var r;l()(this,i);var o=new st(t).css("height","16px").css("border-bottom","3px solid ".concat(n)),a=new on;return a.change=function(t){r.setTitle(t),r.change(t)},r=e.call(this,o,"max-content",!1,"bottom-left",a.el)}return a()(i,[{key:"setTitle",value:function(t){this.title.css("border-color",t),this.hide()}}]),i}(Mi);function ln(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var cn=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],hn=function(t){tt()(i,t);var e=ln(i);function i(t){var n;l()(this,i);var r=new st("line-type"),o=0,a=cn.map((function(e,i){return f("div","".concat(ot,"-item state ").concat(t===e[0]?"checked":"")).on("click",(function(){a[o].toggle("checked"),a[i].toggle("checked"),o=i,n.hide(),n.change(e)})).child(f("div","".concat(ot,"-line-type")).html(e[1]))}));return n=e.call.apply(e,[this,r,"max-content",!1,"bottom-left"].concat(v()(a)))}return i}(Mi);function un(){var t;return f("table","").child((t=f("tbody","")).children.apply(t,arguments))}function fn(t){var e=this;return f("td","").child(f("div","".concat(ot,"-border-palette-cell")).child(new st("border-".concat(t))).on("click",(function(){e.mode=t;var i=e.mode,n=e.style,r=e.color;e.change({mode:i,style:n,color:r})})))}var dn=function t(){var e,i,n=this;l()(this,t),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new sn("line-color",this.color),this.ddColor.change=function(t){n.color=t},this.ddType=new hn(this.style),this.ddType.change=function(t){var e=r()(t,1)[0];n.style=e},this.el=f("div","".concat(ot,"-border-palette"));var o=un(f("tr","").children(f("td","".concat(ot,"-border-palette-left")).child(un((e=f("tr","")).children.apply(e,v()(["all","inside","horizontal","vertical","outside"].map((function(t){return fn.call(n,t)})))),(i=f("tr","")).children.apply(i,v()(["left","top","right","bottom","none"].map((function(t){return fn.call(n,t)})))))),f("td","".concat(ot,"-border-palette-right")).children(f("div","".concat(ot,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ot,"-toolbar-btn")).child(this.ddType.el))));this.el.child(o)};function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var gn=function(t){tt()(i,t);var e=vn(i);function i(){var t;l()(this,i);var n=new st("border-all"),r=new dn;return r.change=function(e){t.change(e),t.hide()},t=e.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Mi);function pn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var mn=function(t){tt()(i,t);var e=pn(i);function i(){return l()(this,i),e.call(this,"border")}return a()(i,[{key:"dropdown",value:function(){return new gn}}]),i}(Di);function yn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var bn=function(t){tt()(i,t);var e=yn(i);function i(){return l()(this,i),e.apply(this,arguments)}return a()(i,[{key:"element",value:function(){var t=this;return this.icon=new st(this.tag),Ai()(rt()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return t.change(t.tag)}))}},{key:"setState",value:function(t){this.el.disabled(t)}},{key:"setIcon",value:function(t){this.icon.setName(t)}}]),i}(Ii);function wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var xn=function(t){tt()(i,t);var e=wn(i);function i(){return l()(this,i),e.call(this,"clearformat")}return i}(bn);function Cn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var kn=function(t){tt()(i,t);var e=Cn(i);function i(){return l()(this,i),e.call(this,"paintformat")}return a()(i,[{key:"setState",value:function(){}}]),i}(Ui);function _n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Sn=function(t){tt()(i,t);var e=_n(i);function i(t){return l()(this,i),e.call(this,"color",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new sn(t,e)}}]),i}(Di);function Tn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var On=function(t){tt()(i,t);var e=Tn(i);function i(t){return l()(this,i),e.call(this,"bgcolor",null,void 0,t)}return a()(i,[{key:"dropdown",value:function(){var t=this.tag,e=this.value;return new sn(t,e)}}]),i}(Di);function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Rn=function(t){tt()(i,t);var e=En(i);function i(){var t;l()(this,i);var n=me.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.pt)),t.change(e)})).child("".concat(e.pt))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function An(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var In=function(t){tt()(i,t);var e=An(i);function i(){return l()(this,i),e.call(this,"font-size")}return a()(i,[{key:"getValue",value:function(t){return t.pt}},{key:"dropdown",value:function(){return new Rn}}]),i}(Di);function Pn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Dn=function(t){tt()(i,t);var e=Pn(i);function i(){var t;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle("".concat(e.text)),t.change(e)})).child("".concat(e.text))}));return t=e.call.apply(e,[this,"10","60px",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function Fn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mn=function(t){tt()(i,t);var e=Fn(i);function i(){return l()(this,i),e.call(this,"zoom-size")}return a()(i,[{key:"getValue",value:function(t){return t}},{key:"setState",value:function(t){"string"!=typeof t&&(t=100*t+"%"),Ai()(rt()(i.prototype),"setState",this).call(this,t)}},{key:"dropdown",value:function(){return new Dn}}]),i}(Di);function jn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Ln=function(t){tt()(i,t);var e=jn(i);function i(){var t;l()(this,i);var n=pe.map((function(e){return f("div","".concat(ot,"-item")).on("click",(function(){t.setTitle(e.title),t.change(e)})).child(e.title)}));return t=e.call.apply(e,[this,pe[0].title,"max-content",!0,"bottom-left"].concat(v()(n)))}return i}(Mi);function Bn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zn=function(t){tt()(i,t);var e=Bn(i);function i(){return l()(this,i),e.call(this,"font-name")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Ln}}]),i}(Di);function Hn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Nn=function(t){tt()(i,t);var e=Hn(i);function i(){var t;l()(this,i);var n=Se.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(e){var i=f("div","".concat(ot,"-item"));return"divider"===e.key?i.addClass("divider"):(i.child(e.title()).on("click",(function(){t.setTitle(e.title()),t.change(e)})),e.label&&i.child(f("div","label").html(e.label))),i})),t=e.call.apply(e,[this,"Normal","220px",!0,"bottom-left"].concat(v()(n)))}return a()(i,[{key:"setTitle",value:function(t){for(var e=0;e<Se.length;e+=1)Se[e].key===t&&this.title.html(Se[e].title());this.hide()}}]),i}(Mi);function Wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Un=function(t){tt()(i,t);var e=Wn(i);function i(){return l()(this,i),e.call(this,"format")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Nn}}]),i}(Di),Xn=i(8),Yn=i.n(Xn);function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Gn=function(t){tt()(i,t);var e=Vn(i);function i(){var t,n;l()(this,i);var r=he.map((function(t){return f("div","".concat(ot,"-item")).on("click",(function(){n.hide(),n.change(t)})).child(t.key)}));return n=e.call.apply(e,[this,new st("formula"),"max-content",!0,"bottom-left"].concat(v()(r))),Ai()((t=Yn()(n),rt()(i.prototype)),"showExplain",t).call(t,he),n}return i}(Mi);function qn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Kn=function(t){tt()(i,t);var e=qn(i);function i(){return l()(this,i),e.call(this,"formula")}return a()(i,[{key:"getValue",value:function(t){return t.key}},{key:"dropdown",value:function(){return new Gn}}]),i}(Di);function Zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Jn=function(t){tt()(i,t);var e=Zn(i);function i(){return l()(this,i),e.call(this,"freeze")}return i}(Ui);function $n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Qn=function(t){tt()(i,t);var e=$n(i);function i(){return l()(this,i),e.call(this,"merge","unmerge")}return a()(i,[{key:"setState",value:function(t,e){this.el.active(t).disabled(e)}}]),i}(Ui);function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var er=function(t){tt()(i,t);var e=tr(i);function i(){return l()(this,i),e.call(this,"print","Ctrl+P")}return i}(bn);function ir(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var nr=function(t){tt()(i,t);var e=ir(i);function i(){return l()(this,i),e.call(this,"textwrap")}return i}(Ui);function rr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var or=function(t){tt()(i,t);var e=rr(i);function i(){var t;l()(this,i);var n=new st("ellipsis"),r=f("div","".concat(ot,"-toolbar-more"));return(t=e.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?t.contentEl.css("max-width","200px"):t.contentEl.css("max-width","420px"),t}return i}(Mi),ar=function(t){tt()(i,t);var e=rr(i);function i(){var t;return l()(this,i),(t=e.call(this,"more")).el.hide(),t}return a()(i,[{key:"dropdown",value:function(){return new or}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Di);function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var lr=function(t){tt()(i,t);var e=sr(i);function i(){return l()(this,i),e.call(this,"sort")}return i}(bn);function cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var hr=function(t){tt()(i,t);var e=cr(i);function i(){return l()(this,i),e.call(this,"search")}return i}(bn);function ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var fr=function(t){tt()(i,t);var e=ur(i);function i(){return l()(this,i),e.call(this,"commentEdit")}return i}(bn);function dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var vr=function(t){tt()(i,t);var e=dr(i);function i(){return l()(this,i),e.call(this,"commentRemove")}return i}(bn);function gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var pr=function(t){tt()(i,t);var e=gr(i);function i(){return l()(this,i),e.call(this,"commentPrevious")}return i}(bn);function mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var yr=function(t){tt()(i,t);var e=mr(i);function i(){return l()(this,i),e.call(this,"commentNext")}return i}(bn);function br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var wr=function(t){tt()(i,t);var e=br(i);function i(){var t;l()(this,i);var n=new st("".concat(ot,"-icon-img insert-image")),r=f("div","".concat(ot,"-item")),o=f("input");o.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var a=f("label");a.attr("for","upload-image"),a.child(new st("".concat(ot,"-icon-img insert-image-local"))),a.child(" "+W("menubar.".concat(r.tag))),r.child(o),r.child(a),r.on("click",(function(){t.change("local")}));var s,c=(s="".concat(ot,"-icon-img insert-image-url"),f("div","".concat(ot,"-item")).child(new st(s)));return c.tag="fromURL",c.child(" "+W("menubar.".concat(c.tag))),c.on("click",(function(){t.change("url")})),t=e.call.apply(e,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Mi);function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Cr=function(t){tt()(i,t);var e=xr(i);function i(t){return l()(this,i),e.call(this,"insert-image",null,"",t)}return a()(i,[{key:"dropdown",value:function(){return new wr}}]),i}(Di);function kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var _r=function(t){tt()(i,t);var e=kr(i);function i(){var t;return l()(this,i),(t=e.call(this,"menu-display-hide","")).state="up",t}return a()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(bn);function Sr(){return f("div","".concat(ot,"-toolbar-divider"))}function Tr(){var t=this;this.btns2=[],this.items.forEach((function(e){if(Array.isArray(e))e.forEach((function(e){var i=e.el,n=i.box(),r=i.computedStyle(),o=r.marginLeft,a=r.marginRight;t.btns2.push([i,n.width+parseInt(o,10)+parseInt(a,10)])}));else{var i=e.box(),n=e.computedStyle(),r=n.marginLeft,o=n.marginRight;t.btns2.push([e,i.width+parseInt(r,10)+parseInt(o,10)])}}))}function Or(){var t,e,i=this.el,n=this.btns,o=this.moreEl,a=this.btns2,s=o.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],v=[];a.forEach((function(t,e){var i=r()(t,2),n=i[0],o=i[1];u+=o,e===a.length-1||u<h.width?d.push(n):(f+=o,v.push(n))})),(t=n.html("")).children.apply(t,d),(e=l.html("")).children.apply(e,v),c.css("width","".concat(f,"px")),v.length>0?o.show():o.hide()}var Er=function(){function t(e,i,n,r){var o=this;l()(this,t),this.data=e,this.change=function(){},this.widthFn=i,this.isHide=n;var a=e.defaultStyle();this.items=[[new er,this.paintformatEl=new kn,this.clearformatEl=new xn],Sr(),[this.formatEl=new Un],Sr(),[this.fontEl=new zn,this.fontSizeEl=new In],Sr(),[this.zoomSizeEl=new Mn,this.boldEl=new Gi,this.italicEl=new Ki,this.underlineEl=new Qi,this.strikeEl=new Ji,this.textColorEl=new Sn(a.color)],Sr(),[this.fillColorEl=new On(a.bgcolor),this.borderEl=new mn,this.mergeEl=new Qn],Sr(),[this.alignEl=new zi(a.align),this.valignEl=new Ni(a.valign),this.textwrapEl=new nr],Sr(),[this.freezeEl=new Jn,this.autofilterEl=new Yi,this.formulaEl=new Kn,this.sortEl=new lr,this.insertImageEL=new Cr,this.searchEl=new hr],Sr(),[this.commentEditEl=new fr,this.commentRemoveEl=new vr,this.commentPreviousEl=new pr,this.commentNextEl=new yr],Sr(),[this.moreEl=new ar]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new er,this.moreEl=new ar,this.sortEl=new lr,this.searchEl=new hr]]),this.el=f("div","".concat(ot,"-toolbar")),this.btns=f("div","".concat(ot,"-toolbar-btns")),this.items.forEach((function(t){Array.isArray(t)?t.forEach((function(t){o.btns.child(t.el),t.change=function(){o.change.apply(o,arguments)}})):o.btns.child(t.el)}));var s=this.menuDisplay=new _r;s.change=function(){o.change.apply(o,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Tr.call(o),Or.call(o)}),0),Tt(window,"resize",(function(){Or.call(o)})))}return a()(t,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(t){this["".concat(t,"El")].click()}},{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var t=this.data,e=t.getSelectedCellStyle();this.mergeEl.setState(t.canUnmerge(),!1),this.autofilterEl.setState(!t.canAutofilter());var i=e.font,n=e.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(t.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(e.underline),this.strikeEl.setState(e.strike),this.textColorEl.setState(e.color),this.fillColorEl.setState(e.bgcolor),this.alignEl.setState(e.align),this.valignEl.setState(e.valign),this.textwrapEl.setState(e.textwrap),this.freezeEl.setState(t.freezeIsActive())}}}]),t}(),Rr=function(){function t(e,i){var n,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,t),this.moving=!1,this.drag=s,this.title=e;var c=parseInt(o);screen.width<500&&c>300&&(o="300px"),this.el=f("div","".concat(ot,"-modal")).css("width",o).css("position","absolute").children(f("div","".concat(ot,"-modal-header")).children(new st("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ot,"-modal-content"))).children.apply(n,v()(i))).hide(),this.showDimmer=a,this.drag&&this.el.on("mousedown.stop",(function(t){return r.mousedownHandler(t)}))}return a()(t,[{key:"show",value:function(){var t=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ot,"-dimmer active")),document.body.appendChild(this.dimmer.el));var e=this.el.show().box(),i=e.width,n=e.height,r=document.documentElement,o=r.clientHeight,a=r.clientWidth;this.el.offset({left:(a-i)/2,top:(o-n)/3}),window.xkeydownEsc=function(e){27===e.keyCode&&t.hide()},Tt(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Ot(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(t){var e=this,i=t;At(window,(function(t){if(e.moving=!0,null!==i){var n=e.el.offset(void 0);e.el.offset({left:n.left+t.movementX,top:n.top+t.movementY}),i=t}}),(function(){i=null,e.moving=!1}))}}]),t}(),Ar=function(){function t(e,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,t),this.vchange=function(){},this.el=f("div","".concat(ot,"-form-input")),this.input=f("input","").css("width",e).on("input",(function(t){return n.vchange(t)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return a()(t,[{key:"focus",value:function(){var t=this;setTimeout((function(){t.input.el.focus()}),10)}},{key:"hint",value:function(t){this.input.attr("placeholder",t)}},{key:"setReadonly",value:function(t){t?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(t){return this.input.val(t)}}]),t}();function Ir(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Pr(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Pr(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Dr=function(){function t(e,i,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(t){return t},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,t),this.key=e,this.getTitle=o,this.change=a,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ot,"-form-select")),this.suggest=new oe(i.map((function(t){return{key:t,title:r.getTitle(t)}})),(function(t){r.itemClick(t.key),a(t.key),r.vchange(t.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(e)),this.suggest.el).on("click",(function(){return r.show()}))}return a()(t,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(t){this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t))}},{key:"setItemsMap",value:function(t){var e=this;this.itemsmap=t;var i,n=[],o=Ir(t);try{for(o.s();!(i=o.n()).done;){var a=r()(i.value,2),s=a[0],l=a[1];n.push({key:s,title:l})}}catch(t){o.e(t)}finally{o.f()}this.suggest=new oe(n,(function(t){e.itemClick(t.key),e.change(t.key),e.vchange(t.key)}),this.width,this.el),t.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(t){return void 0!==t?(this.key=t,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(t)):this.itemEl.html(this.getTitle(t)),this):this.key}}]),t}(),Fr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Mr=function(){function t(e,i,n,r){var o=this;l()(this,t),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=e,this.input.vchange=function(){return o.validate()},this.el=f("div","".concat(ot,"-form-field")).children(this.label,e.el,this.tip)}return a()(t,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(t){return this.input.val(t)}},{key:"hint",value:function(t){this.input.hint(t)}},{key:"validate",value:function(){var t=this.input,e=this.rule,i=this.tip,n=this.el,r=t.val();if(e.required&&/^\s*$/.test(r))return i.html(W("validation.required")),n.addClass("error"),!1;if((e.type||e.pattern)&&!(e.pattern||Fr[e.type]).test(r))return i.html(W("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(t){var e=this.el,i=this.tip;e.addClass("error"),i.html(t),i.show()}},{key:"validateClear",value:function(){var t=this.el,e=this.tip;t.removeClass("error"),e.html(""),e.hide()}}]),t}();function jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Lr=function(t){tt()(i,t);var e=jr(i);function i(){var t;l()(this,i);var n=new Mr(new Dr("cell",["cell"],"100%",(function(t){return W("dataValidation.modeType.".concat(t))})),{required:!0},"".concat(W("dataValidation.range"),":"),100),r=new Mr(new Ar("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),o=new Mr(new Dr("list",["list","number","date","phone","email"],"100%",(function(t){return W("dataValidation.type.".concat(t))}),(function(e){return t.criteriaSelected(e)})),{required:!0},"".concat(W("dataValidation.criteria"),":"),100),a=new Mr(new Dr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(t){return W("dataValidation.operator.".concat(t))}),(function(e){return t.criteriaOperatorSelected(e)})),{required:!0}).hide(),s=new Mr(new Ar("70px","10"),{required:!0}).hide(),c=new Mr(new Ar("70px","100"),{required:!0,type:"number"}).hide(),h=new Mr(new Ar("120px","a,b,c"),{required:!0}),u=new Mr(new Ar("70px","10"),{required:!0,type:"number"}).hide();return(t=e.call(this,W("contextmenu.validation"),[f("div","".concat(ot,"-form-fields")).children(n.el,r.el),f("div","".concat(ot,"-form-fields")).children(o.el,a.el,s.el,c.el,u.el,h.el),f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",(function(){return t.btnClick("cancel")})),new pi("remove").on("click",(function(){return t.btnClick("remove")})),new pi("save","primary").on("click",(function(){return t.btnClick("save")})))])).mf=n,t.rf=r,t.cf=o,t.of=a,t.minvf=s,t.maxvf=c,t.vf=u,t.svf=h,t.change=function(){},t}return a()(i,[{key:"showVf",value:function(t){var e="date"===t?"2018-11-12":"10",i=this.vf;i.input.hint(e),i.show()}},{key:"criteriaSelected",value:function(t){var e=this.of,i=this.minvf,n=this.maxvf,r=this.vf,o=this.svf;"date"===t||"number"===t?(e.show(),i.rule.type=t,n.rule.type=t,"date"===t?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),o.hide()):("list"===t?o.show():o.hide(),r.hide(),e.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(t){if(t){var e=this.minvf,i=this.maxvf,n=this.vf;if("be"===t||"nbe"===t)e.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),e.hide(),i.hide()}}}},{key:"btnClick",value:function(t){if("cancel"===t)this.hide();else if("remove"===t)this.change("remove"),this.hide();else if("save"===t){for(var e=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<e.length;i+=1){var n=this[e[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),o=this.rf.val(),a=this.cf.val(),s="phone"===a||"email"===a?"":this.of.val(),l=this.svf.val();"number"!==a&&"date"!==a||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,o,{type:a,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(t){if(t){var e=this.mf,i=this.rf,n=this.cf,r=this.of,o=this.svf,a=this.vf,s=this.minvf,l=this.maxvf,c=t.mode,h=t.ref,u=t.validator||{type:"list"},f=u.type,d=u.operator,v=u.value;e.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(v)?(s.val(v[0]),l.val(v[1])):(o.val(v||""),a.val(v||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Rr),Br=function(){function t(e,i){l()(this,t),this.el=f("input","".concat(ot,"-form-checkbox")).css("width",e).attr("type","Checkbox")}return a()(t,[{key:"hint",value:function(t){this.el.attr("placeholder",t)}},{key:"val",value:function(t){if(void 0===t)return this.el.el.checked;this.el.el.checked=t}}]),t}();function zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Hr=function(t){tt()(i,t);var e=zr(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(W("dataSort.ci"),":"),60),r=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),o=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),a=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),s=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60),c=new Mr(new Dr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(W("dataSort.sortby"),":"),60),h=new Mr(new Dr("desc",["asc","desc"],"100%",(function(t){return W("dataSort.order.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new Br("60px","");u.el.on("click",(function(){return t.myHeaderClick()})),u.val(!0);var d=new pi("del","formbt").on("click",(function(){return t.btnClick("del",1)})),v=f("div","".concat(ot,"-form-fields")).children(a.el,s.el,f("div","".concat(ot,"-buttons")).children(new pi("add","formbt").on("click",(function(){return t.btnClick("add",2)})),d)),g=f("div","".concat(ot,"-form-fields")).children(c.el,h.el,new pi("del","formbt").on("click",(function(){return t.btnClick("del",2)})));return(t=e.call(this,W("contextmenu.sort"),[f("div","".concat(ot,"-form-fields")).children(n.el,new Mr(u,{required:!1},"".concat(W("dataSort.header"),":"),120).el),f("div","".concat(ot,"-form-fields")).children(r.el,o.el,new pi("add","formbt").on("click",(function(){return t.btnClick("add",1)}))),v,g,f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))])).cf=n,t.of1=o,t.sortby1=r,t.of2=s,t.sortby2=a,t.of3=h,t.sortby3=c,t.ci1=null,t.ci2=null,t.ci3=null,t.values=[],t.mcols=null,t.mcolsheader=null,t.cicount=1,t.div2=v,t.div3=g,t.but2=d,t.sc=1,t.myheader=u,v.hide(),g.hide(),t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t,e){if("ok"===t){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void lt("error","".concat(W("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===t?1===e?(this.div2.css("display",""),this.sc=2):2===e&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===t?1===e?(this.div2.hide(),this.sc=1):2===e&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===t&&this.hide()}},{key:"myHeaderClick",value:function(){var t=this.mcols,e=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,o=this.sortby3,a=i.val()?t:e;n.input.setItemsMap(a),n.val(0),r.input.setItemsMap(a),r.val(1),o.input.setItemsMap(a),o.val(2)}},{key:"setValue",value:function(t){if(null!=t){if(t){var e=this.cf,i=this.of1,n=this.sortby1,r=this.of2,o=this.sortby2,a=this.of3,s=this.sortby3,l=t.ref,c=t.sort,h=t.ci,u=t.m,f=t.mcols,d=t.mcolsheader,v=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,p=(c[2]||{order:"asc"}).order3;e.val(l),i.val(v),r.val(g),a.val(p),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var m=[],y=0;y<f.length;y++)m.push(y);n.input.setItemsMap(f),n.val(0),o.input.setItemsMap(f),o.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Rr);function Nr(t){return f("div","".concat(ot,"-item ").concat(t))}function Wr(t){var e=this;return Nr("state").child(W("sort.".concat(t))).on("click.stop",(function(){return e.itemClick(t)}))}function Ur(t){var e=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(t).forEach((function(r,o){var a=t[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ot,"-item state ").concat(s)).on("click.stop",(function(){return e.filterClick(o,r)})).children(""===r?W("filter.empty"):r,f("div","label").html("(".concat(a,")"))))}))}function Xr(){var t=this.filterhEl,e=this.filterValues,i=this.values;t.html("".concat(e.length," / ").concat(i.length)),t.checked(e.length===i.length)}var Yr=function(){function t(){var e=this;l()(this,t),this.filterbEl=f("div","".concat(ot,"-body")),this.filterhEl=f("div","".concat(ot,"-header state")).on("click.stop",(function(){return e.filterClick(0,"all")})),this.el=f("div","".concat(ot,"-sort-filter")).children(this.sortAscEl=Wr.call(this,"asc"),this.sortDescEl=Wr.call(this,"desc"),Nr("divider"),f("div","".concat(ot,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ot,"-buttons")).children(new pi("cancel").on("click",(function(){return e.btnClick("cancel")})),new pi("ok","primary").on("click",(function(){return e.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return a()(t,[{key:"btnClick",value:function(t){if("ok"===t){var e=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(e,i,"in",n)}this.hide()}},{key:"itemClick",value:function(t){this.sort=t;var e=this.sortAscEl,i=this.sortDescEl;e.checked("asc"===t),i.checked("desc"===t)}},{key:"filterClick",value:function(t,e){var i=this.filterbEl,n=this.filterValues,r=this.values,o=i.children();"all"===e?o.length===n.length?(this.filterValues=[],o.forEach((function(t){return f(t).checked(!1)}))):(this.filterValues=Array.from(r),o.forEach((function(t){return f(t).checked(!0)}))):f(o[t]).toggle("checked")?n.push(e):n.splice(n.findIndex((function(t){return t===e})),1);Xr.call(this)}},{key:"set",value:function(t,e,i,n){this.ci=t;var r=this.sortAscEl,o=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),o.checked(n.desc())):(this.sortDesc=null,r.checked(!1),o.checked(!1)),this.values=Object.keys(e),this.filterValues=i?Array.from(i.value):Object.keys(e),Ur.call(this,e,i),Xr.call(this)}},{key:"setOffset",value:function(t){var e=this;this.el.offset(t).show();var i=1;Rt(this.el,(function(){i<=0&&(e.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(t,e,i){var n=this;this.el.show();var r=this.el.offset(),o=r.width,a=r.height;t.top+a>i&&(t.top=i-a),t.left+o>e&&(t.left=e-o),this.el.offset(t);var s=1;Rt(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Et(this.el)}}]),t}(),Vr=function(){function t(){l()(this,t),xt()(this,"onEdit",!1),this.el=f("div","".concat(ot,"-comment-tip")).hide()}return a()(t,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(t,e,i){if(!0!==this.onEdit){var n=this.el,r=i?e.left-e.width-1:e.left+e.width,o=e.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(o,"px")),n.html(t).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),t}();function Gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qr=function(t){tt()(i,t);var e=Gr(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("80px",""),{required:!0},"".concat(W("dataSearch.label"),":"),100),r=new Mr(new Br("80px",""),{required:!1},"".concat(W("dataSort.casesense"),":"),100),o=new Mr(new Br("30px",""),{required:!1},"".concat(W("dataSearch.matchwhole"),":"),150),a=new Mr(new Dr("values",["values","formulas","comments"],"120px",(function(t){return W("dataSearch.lookin.".concat(t))}),(function(){})),{required:!0},"".concat(W("dataSearch.lkinlb"),":"),100);return(t=e.call(this,W("toolbar.search"),[f("div","".concat(ot,"-form-fields")).children(r.el,o.el),f("div","".concat(ot,"-form-fields")).child(n.el),f("div","".concat(ot,"-form-fields")).child(a.el),f("div","".concat(ot,"-buttons")).children(new pi("previous").on("click",(function(){return t.btnClick("previous")})),new pi("next").on("click",(function(){return t.btnClick("next")})),new pi("close","primary").on("click",(function(){return t.btnClick("close")})))],"500px",!1,!0)).formField=n,t.casesense=r,t.lookin=a,t.matchwhole=o,t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){if("close"!==t){if(!this.formField.validate())return;var e=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(t){case"previous":this.change("previous",r,e,i,n);break;case"next":this.change("next",r,e,i,n)}}else this.hide()}},{key:"show",value:function(){Ai()(rt()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Rr),Kr=function(){function t(e,i){var n=this;l()(this,t),this.data=e,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ot,"-formula-bar")),this.barLabel=f("div","".concat(ot,"-bar-label")),this.formulaInput=f("div","".concat(ot,"-formula-input")).on("input",(function(t){n.inputChange(n.ishtml?t.target.innerHTML:t.target.innerText)})).on("focus",(function(t){n.focuson()})).on("keydown",(function(t){var e=t.keyCode||t.which;13===e?(t.altKey||n.formulaInput.el.blur(),n.enter(t,n.ishtml)):9===e&&(n.formulaInput.el.blur(),n.tab(t))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return a()(t,[{key:"resetData",value:function(t){this.data=t,this.reset()}},{key:"reset",value:function(){var t=this.data,e=t.selector,i=p(e.ci)+""+(e.ri+1),n=t.getSelectedCell(),r="",o=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,o=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,o)}}]),t}();function Zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Jr=function(t){tt()(i,t);var e=Zr(i);function i(){var t;return l()(this,i),t=e.call(this),xt()(Yn()(t),"col",void 0),xt()(Yn()(t),"row",void 0),t.el.attr("contentEditable","true"),t.el.attr("placeholder","".concat(W("toolbar.commentDefault"))),t.el.attr("id","commentEdit"),t}return a()(i,[{key:"saveAndHide",value:function(t){var e=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<t.data.comments.length;n++)if(t.data.comments[n].col===this.col&&t.data.comments[n].row===this.row){i=n;break}-1===i?t.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):t.data.comments[i].note=this.el.html()}t.data.comments=t.data.comments.filter((function(t){return!e.checkEmptyContent(t.note)})),this.hide(),t.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(t){var e=document.createElement("div");return e.innerHTML=t,""===e.innerText}},{key:"setPosition",value:function(t,e,n){Ai()(rt()(i.prototype),"setPosition",this).call(this,t,e,n),this.el.focus()}}]),i}(Vr),$r=i(10),Qr=function(){function t(){l()(this,t),xt()(this,"name",void 0)}return a()(t,[{key:"execute",value:function(t){}}]),t}();function to(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function eo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function io(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function no(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function oo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ro(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ro(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var so=[function(t){tt()(i,t);var e=to(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Yn()(t),"name","delete"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas,i=t.data,n=e.fabric,r=n.getActiveObject(),o=e.findObjByData(r.id,i);if(o)if(o.op="del",i.canvasFreeze){var a=i.canvasFreeze;[a.br,a.bl,a.tr,a.tl].forEach((function(t){t.remove(e.findObjInCanvas(t,r.id)),e.saveCanvasData(i,t),t.renderAll()}))}else n.remove(r),n.renderAll(),e.saveCanvasData(i,n)}}]),i}(Qr),function(t){tt()(r,t);var e,i,n=no(r);function r(){var t;l()(this,r);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=n.call.apply(n,[this].concat(i)),xt()(Yn()(t),"name","paste"),xt()(Yn()(t),"canvas",void 0),xt()(Yn()(t),"sheet",void 0),xt()(Yn()(t),"inFreeze",void 0),t}return a()(r,[{key:"execute",value:(i=bt()(kt.a.mark((function t(e){var i,n,r,o,a;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:e.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:e,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:e.canvas.inFreeze,a=this,o){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,o.clonedObj.clone(function(){var t=bt()(kt.a.mark((function t(i){var n;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=fabric.util.object.clone(i),a.setImagePosition(n),e.canvas.setLoading(e,{left:n.left,top:n.top}),t.next=6,a.addImageToData(n);case 6:a.setImageEventAndLayout(n),a.addImageToCanvas(n)?a.reactiveObj(n):a.rollback(a.sheet,n),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),lt(t.t0);case 14:return t.prev=14,e.canvas.removeLoading(e),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,10,14,17]])})));return function(e){return t.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"rollback",value:function(t,e){var i=t.data,n=t.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(t){return t.id===e.id}))]),n.saveCanvasData(t.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(e.id),n.removeImageInData(i,e.id))}},{key:"setImagePosition",value:function(t){var e=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!t)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var o=this.canvas.getActiveObject();n=o.left+20,r=o.top+20}else{var a=e.getSelectedRect();if(!a)throw"get selected rect value is null";n=a.left+i.left,r=a.top+i.top}t.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(t)}},{key:"addImageToCanvas",value:function(t){var e=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(t),r=e.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else t.setCoords(),i.add(t);return!0}},{key:"addImageToData",value:(e=bt()(kt.a.mark((function t(e){var i,n,r,o,a,s,l,c,h,u;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,o=io({},r),a=this.sheet.getTableOffset(),s={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:o.id,srcname:i.canvas.clipboard.sheetName,isshape:"Picture"!==o.type},(l=new FormData).set("p",JSON.stringify(s)),l.set("uid",i.uniqueid),t.next=11,fetch(i.imageCopyUrl,{method:"POST",body:l});case 11:if((c=t.sent).ok){t.next=14;break}throw"upload copy image fail";case 14:return t.next=16,c.json();case 16:if(h=t.sent,h=JSON.parse(h)){t.next=20;break}throw"upload copy image return null ";case 20:if(!h.Error){t.next=22;break}throw h.Error;case 22:delete h.width,delete h.height,n.images||(n.images=[]),Object.assign(o,h),o.left=e-a.left,o.top=e-a.top,n.images.push(o),u=h.type,delete h.type,Object.assign(e,h),e.id=i.canvas.picId(h.id,h.tick),e.imgType=u,e.strid=h.strid,e.zorder=i.data.topOrder++,e.changed=!0;case 37:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(t){"Chart"===t.imgType&&t.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(t),this.sheet.canvas.eventsOn(t,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(t){var e=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,o=r.br,a=r.bl,s=r.tr,l=r.tl;[o,a,s,l].forEach((function(e){e.discardActiveObject(),e.setActiveObject(e.getObjects().find((function(e){return e.id===t.id}))),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else e.discardActiveObject(),e.setActiveObject(t),e.requestRenderAll(),i.canvas.saveCanvasData(n,e),i.canvas.saveOriginalAngleInfoOfImage(e)}}]),r}(Qr),function(t){tt()(i,t);var e=ao(i);function i(){var t;l()(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r)),xt()(Yn()(t),"name","copy"),t}return a()(i,[{key:"execute",value:function(t){var e=t.canvas.fabric;if(e.getActiveObject()){var i=e;t.data.canvasFreeze&&(i=t.data.canvasFreeze.tl),i.getActiveObject().clone((function(e){t.canvas.clipboard={clonedObj:e,newData:oo({},t.canvas.findObjByData(e.id,t.data)),sheetName:t.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}(Qr)],lo=function(){function t(e){var i=this;l()(this,t),xt()(this,"freezeXY",void 0),xt()(this,"imageCanvas",void 0),xt()(this,"freezeEvents",{"object:rotating":function(t){return function(e){i.imageCanvas.pubSub.publish("object:rotating",e,t)}},"object:moving":function(t){return function(e){i.imageCanvas.pubSub.publish("object:moving",e,t)}},"object:scaling":function(t){return function(e){i.imageCanvas.pubSub.publish("object:scaling",e,t)}},"selection:created":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:created",e,t)}},"selection:cleared":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:cleared",e,t)}},"selection:updated":function(t){return function(e){i.imageCanvas.pubSub.publish("selection:updated",e,t)}}}),this.imageCanvas=e;var n=e.sheet.getTableOffset(),r=e.sheet.data,o=e.sheet;if(!r.displayRight2Left){var a=r.freezeTotalWidth()+n.left/o.table.zoomlevel,s=r.freezeTotalHeight()+n.top/o.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=a,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){e.pubSub=e.initPubSub();var c=e.fabric;c.off("object:moving",e.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(o.overlayerEl,"bl",a,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(o.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(o.overlayerEl,"tl",a,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return a()(t,[{key:"getFreezeCanvasClipPath",value:function(t,e,i){var n=this.freezeXY,r=this.imageCanvas.sheet,o=this.imageCanvas.tOffset;o.left/=r.data.zoomlevel,o.top/=r.data.zoomlevel;var a=new $r.fabric.Rect({width:n.x,height:e.height-n.y,top:n.y,left:o.left}),s=new $r.fabric.Rect({width:n.x,height:n.y,left:o.left,top:o.top}),l=new $r.fabric.Rect({width:t.width-n.x,height:n.y,left:n.x,top:o.top}),c=new $r.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(t){var e;switch(t){case"tr":e=l;break;case"bl":e=a;break;case"tl":e=s;break;default:e=c}return e}}},{key:"getOffsetsBetweenCanvases",value:function(t,e){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y,a={offsetX:0,offsetY:0};switch(t+e){case"tlbl":case"trbr":a={offsetX:0,offsetY:-o};break;case"bltl":case"brtr":a={offsetX:0,offsetY:o};break;case"tltr":case"blbr":a={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":a={offsetX:r,offsetY:0};break;case"trbl":a={offsetX:r,offsetY:-o};break;case"tlbr":a={offsetX:-r,offsetY:-o};break;case"bltr":a={offsetX:-r,offsetY:o};break;case"brtl":a={offsetX:r,offsetY:o}}return a}},{key:"setIndividualCanvasesToMoveInSync",value:function(t,e,i,n){var r=this.imageCanvas.findObjInCanvas(t,e.target.id);if(r){var o=this.getOffsetsBetweenCanvases(n,t.canvasName);r.set({left:e.target.left-o.offsetX,top:e.target.top-o.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,t.canvasName),r.dirty=!0,t.renderAll()}}},{key:"setEventAndClipPath",value:function(t,e,i,n){var r=this;[t,e,i,n].forEach((function(t){var e=Object.keys(r.freezeEvents).map((function(e){return[e,r.freezeEvents[e](t.canvasName)]}));e=Object.fromEntries(e),r.imageCanvas.eventsOn(t,e)}));var o=this.getFreezeCanvasClipPath(e,i,t);this.freezeClipPath=o,[t,e,i,n].forEach((function(t){t.clipPath=o(t.canvasName),r.subscribeObjectEvent(t),r.subscribeSelectionEvent(t),r.subscribeCustomEvent(t,o)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(t,e){t.getObjects().forEach(e),t.renderAll()}},{key:"subscribeObjectEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===t.canvasName?{left:i.target.left,top:i.target.top}:{};e.setIndividualCanvasesToMoveInSync(t,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};e.setIndividualCanvasesToMoveInSync(t,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(t){var e,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,o=-n.y;switch(t){case"tr":e={x:r,y:0};break;case"bl":e={x:0,y:o};break;case"br":e={x:r,y:o};break;default:e={x:0,y:0}}return e}},{key:"subscribeCustomEvent",value:function(t,e){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var e=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);i.updateCanvasAllObjectAndRenderAll(t,(function(t){t.set({left:t.left-e.x,top:t.top-e.y}),t.setCoords(),t.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(e){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(t.canvasName);if(n){var o=JSON.parse(n);t.getObjects().forEach((function(t){var e=o.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+r.x,top:e.top+r.y}),t.setCoords()})),t.renderAll()}}))}},{key:"clearFreeze",value:function(t){if(t.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var e=t.canvasFreeze.tr,i=t.canvasFreeze.tl,n=t.canvasFreeze.bl;e.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new $r.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),t.canvasFreeze=void 0}}},{key:"setZoom",value:function(t){var e=this.imageCanvas,i=e.data,n=(e.fabric,e.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(e){e.setZoom(t),e.renderAll()})),this.foreachFreezeCanvas((function(e){e.setWidth(n[e.canvasName].width*t),e.setHeight(n[e.canvasName].height*t)}),"br")}},{key:"resize",value:function(){var t=this.imageCanvas,e=t.data,i=(t.fabric,e.canvasFreeze),n=(i.tl,i.bl),r=i.tr,o=i.br,a=this.getFreezeCanvasClipPath(r,n,o);this.foreachFreezeCanvas((function(t){t.clipPath=a(t.canvasName),t.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(t){var e=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==t.canvasName){e.imageCanvas.checkHyperlink(e.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&e.imageCanvas.openLink(e.imageCanvas.data);var r=e.imageCanvas.findObjInCanvas(t,i.target.id);t._setActiveObject(r),t.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(e,i){i!==t.canvasName&&(t._discardActiveObject(),t.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==t.canvasName){var o=e.imageCanvas.findObjInCanvas(t,i.target.id);(null===(r=t.getActiveObject())||void 0===r?void 0:r.id)!==o.id&&(t._setActiveObject(o),t.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(t,e){var i=this;++t.topOrder,Object.keys(t.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(t.canvasFreeze[n],e.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(t.canvasFreeze[n],r),e.zorder=r.zorder=t.topOrder,"TextBox"===e.imgType&&n!==e.canvas.canvasName&&(r.width=e.width,r.height=e.height,r.scaleX=1,r.scaleY=1),t.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(t){var e=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(e,t),this.imageCanvas.saveOriginalAngleInfoOfImage(e.canvasFreeze.br),this.imageCanvas.saveCanvasData(e,e.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var t=this.imageCanvas.data;if(t.canvasFreeze){var e=t.canvasFreeze,i=e.tl,n=e.bl,r=e.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(t,e,i,n,r){var o=document.createElement("canvas");o.width=i,o.height=n,o.setAttribute("id",e),t.children(o),window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1);var a=new $r.fabric.Canvas(e);return a.selection=!1,a.set("canvasName",e),this.imageCanvas.eventsOn(a,this.imageCanvas.canvasEvents),a}},{key:"removeImage",value:function(t){this.foreachFreezeCanvas((function(e){e.remove(e.getObjects()[e.getObjects().findIndex((function(e){return e.id===t}))])}),"br")}},{key:"setDirty",value:function(t){this.foreachFreezeCanvas((function(e){e.getObjects().find((function(e){return e.id===t})).dirty=!0,e.requestRenderAll()}))}},{key:"setVisible",value:function(t,e){this.foreachFreezeCanvas((function(i){i.getObjects().find((function(e){return e.id===t})).visible=e}))}},{key:"setFilter",value:function(t,e){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(e){return e.id===t}));n.filters[0]=e,n.applyFilters()}))}},{key:"setCustomHighlight",value:function(t,e,i){this.foreachFreezeCanvas((function(n){var r=n.getObjects().find((function(e){return e.id===t}));i(e,r)}))}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(t){null!=t&&t.getObjects().find((function(t){return!t.zorder}))||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}))}},{key:"saveCanvasData",value:function(){var t=this,e=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){t.imageCanvas.saveCanvasData(e,i)}))}},{key:"setCursor",value:function(t){this.foreachFreezeCanvas((function(e){e.defaultCursor=t}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(t){t.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var o=r.canvasFreeze,a=o.tl,s=o.bl,l=o.tr,c=o.br;[a,s,l,c].forEach((function(e){i.includes(e.canvasName)||t(e)}))}}}]),t}();function co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ho=function(){function t(){l()(this,t),this.subscribers=[]}return a()(t,[{key:"subscribe",value:function(t,e){var i=this.subscribers[t];i?i.push(e):this.subscribers[t]=[e]}},{key:"publish",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.subscribers[t]||[];r.forEach((function(t){return t.apply(void 0,i)}))}}]),t}(),uo=function(t,e){return"p_".concat(t,"_").concat(e)},fo=function(t,e){return"s_".concat(t,"_").concat(e)},vo=function(t){var e;this.visible=t,this.fabobj.visible=t;var i=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setVisible(i,t),this.setDirty()},go=function(){var t;this.fabobj.set("dirty",!0),this.fabobj.canvas.requestRenderAll();var e=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setDirty(e)},po=function(t){var e;this.fabobj.filters[0]=t,this.fabobj.applyFilters();var i=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setFilter(i,t)},mo=function(t,e){var i;e(t,this.fabobj);var n=this.getIdtick();null===(i=this.inFreeze)||void 0===i||i.setCustomHighlight(n,t,e)},yo=function(){return"Picture"===this.type?uo(this.id,this.tick):fo(this.id,this.tick)},bo=function(t,e){var i=this.width,n=this.height,r=this.shape;t.save(),t.translate(-i/2,-n/2);var o=new Pe(0,0,i,n,10);o.setPading(r.lp,r.rp);var a=new ze(t,i,n),s=1/Oe();a.scale(s,s),a.scale(s,s),a.rect3(o),a.richtext(r,o,r.align,r.valign,r.wrap,r.getHighlight()),t.restore()},wo=function(t){var e=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=e,this.height=i,this.shape.originWidth=e,this.shape.originHeight=i},xo=function(t){tt()(i,t);var e=co(i);function i(){var t;return l()(this,i),t=e.call(this,"canvas"),xt()(Yn()(t),"imgEvents",{mouseup:function(e){var i=Yn()(t).sheet,n=i.data,r=e.target;if(!window.mobileAndTabletCheck()){var o=r.canvas;o||(o=t.fabric),n.canvasFreeze?t.inFreeze.setOrderAndSaveData(r):(r.changed=!0,t.sendImageToFont(o,r),r.zorder=++n.topOrder,t.findObjInCanvas(o,r.id).zorder=r.zorder,t.saveOriginalAngleInfoOfImage(o),t.saveCanvasData(n,o)),i.selector.setObjId(r.id)}},mousedown:function(e){window.mobileAndTabletCheck()||(t.sheet.selector.hide(),t.sheet.editor.clear(),null==e||e.e.stopPropagation())},mousedblclick:function(e){if(!window.mobileAndTabletCheck()){var i=e.target,n=Yn()(t).sheet;if("OleObject"===i.imgType)n.getOle(i.strid);else if("TextBox"===i.imgType){var r=t.findShape(i.id,n.data);n.setEditForTextBox(r),t.fabric.discardActiveObject().requestRenderAll()}}},mousemove:function(e){t.findObjByData(e.target.id,t.sheet.data).hyperlink?t.fabric.hoverCursor="pointer":t.fabric.hoverCursor="move"}}),xt()(Yn()(t),"pausePanning",!1),xt()(Yn()(t),"canvasEvents",{"mouse:move:before":function(){t.sheet.data.canvasFreeze&&t.sheet.data.canvasFreeze.tl.getObjects().length!==t.sheet.data.canvasFreeze.br.getObjects().length&&t.inFreeze.loadFreezeImage()},"object:moving":function(e){t.edgeCollision(e.target,"canvas")},"selection:created":function(e){t.checkHyperlink(t.fabric)&&!e.e.ctrlKey&&t.openLink(t.data)}}),xt()(Yn()(t),"customEvents",{"object:scroll":function(){var e=t.data,i=e.scroll,n=e.displayRight2Left,r=e.canvasData,o=n?i.x:-i.x,a=-i.y;if(r){var s=JSON.parse(r);t.fabric.getObjects().forEach((function(t){var e=s.objects.find((function(e){return e.id===t.id}));t.set({left:e.left+o,top:e.top+a}),t.setCoords()})),t.fabric.renderAll()}}}),xt()(Yn()(t),"tOffset",void 0),xt()(Yn()(t),"data",void 0),xt()(Yn()(t),"fabric",void 0),xt()(Yn()(t),"freeze",void 0),xt()(Yn()(t),"freezeXY",{x:0,y:0}),xt()(Yn()(t),"pubSub",void 0),xt()(Yn()(t),"sheet",void 0),xt()(Yn()(t),"basicZorder",void 0),xt()(Yn()(t),"canvasId","canvas_".concat((new Date).getTime())),xt()(Yn()(t),"imageOperationList",{}),t.attr("id",t.canvasId),t.pubSub=t.initPubSub(),so.forEach((function(e){var i=new e;t.imageOperationList[i.name]=i})),Tt(window,"resize",(function(e){window.mobileAndTabletCheck()||t.resize(e)})),t}return a()(i,[{key:"publishEvent",value:function(t,e){this.pubSub.publish(t,e)}},{key:"initPubSub",value:function(){return new ho}},{key:"setCursor",value:function(t){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(t):this.fabric.defaultCursor=t}},{key:"doNewSheetPage",value:function(t){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doSwitchSheetPage",value:function(t){var e=this;this.sheet.selector.el.show();setTimeout((function t(){var i,n,r,o;e.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=e.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(o=e.sheet.data.shapes)||void 0===o?void 0:o.length)&&void 0!==r?r:0)?e.doEndSwitchSheetPage():setTimeout(t,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(t)}},{key:"doEndSwitchSheetPage",value:function(){var t;this.setOrder(this.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new lo(this)}},{key:"rerenderCanvasBySavedJson",value:function(t,e,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,o){o.set({left:r.left+e.x,top:r.top+e.y}),"Chart"===o.imgType&&o.setControlsVisibility({mtr:!1}),n.setSelectionLayout(o),n.eventsOn(o,n.imgEvents);var a,s,l=n.findObjByData(r.id,n.data);l&&(s=l,"TextBox"===(a=o).imgType&&(a.shape=s,a.drawObject=bo,a.on("modified",wo)),t.clipPath=i)}),t)}}},{key:"findObjInCanvas",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"recordCanvasData",value:function(t,e){var i,n,r=t.aCoords,o=this.tOffset,a=this.findObjByData(t.id,e);if(a){var s=r.tl.x+(r.tr.x-r.tl.x)/2-o.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-o.top;a.centerX||(a.centerX=s),a.centerY||(a.centerY=l),a.currentCenterX=s,a.currentCenterY=l;var c=e.getCellRectByXY(r.tl.x,r.tl.y);a.width=a.originWidth*t.scaleX,a.height=a.originHeight*t.scaleY,a.scaleX=t.scaleX,a.scaleY=t.scaleY,a.top=t.top-o.top/e.zoomlevel+e.scroll.y,a.left=t.left-o.left/e.zoomlevel+e.scroll.x,a.row=null==c?void 0:c.ri,a.col=null==c?void 0:c.ci,a.changed=null!==(i=t.changed)&&void 0!==i&&i,a.zorder=null!==(n=t.zorder)&&void 0!==n?n:e.topOrder}}},{key:"edgeCollision",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,o=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(e)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(e)&&(o-=i.scroll.x),t.setCoords();var a=t.getBoundingRect().top/i.zoomlevel,s=t.getBoundingRect().left/i.zoomlevel;(a<r||s<o)&&(t.top=Math.max(t.top,t.top-a+r),t.left=Math.max(t.left,t.left-s+o))}},{key:"init",value:function(t){var e=this;this.tOffset=t.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=t,window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1),this.fabric=new $r.fabric.Canvas(this.canvasId),this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel});var n=0,r=setInterval((function(){(t.data.isImageOk||50===n)&&(e.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var t;this.setOrder(this.sheet.canvas.fabric),null===(t=this.sheet.canvas.inFreeze)||void 0===t||t.setOrder()}},{key:"resetFreeze",value:function(t){var e=r()(t.freeze,2),i=e[0],n=e[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(t):this.initFreeze()}},{key:"reset",value:function(t){this.data=t,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(t){0===t&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(t){var e=this,i={};t.getObjects().forEach((function(t){i[t.id]=t.angle,e.rotateObject(t,0)})),t.renderAll(),t.getObjects().forEach((function(t){e.recordCanvasData(t,e.sheet.data),e.setDataAngle(t,i[t.id],e.sheet.data),e.rotateObject(t,i[t.id])})),t.renderAll()}},{key:"setDataAngle",value:function(t,e,i){var n=this.findObjByData(t.id,i);n&&(n.angle=e)}},{key:"clipPath",value:function(t){this.fabric.clipPath=new $r.fabric.Rect(t)}},{key:"eventsOn",value:function(t,e){for(var i in e)t.on(i,e[i])}},{key:"eventsOff",value:function(t,e){for(var i in e)t.off(i,e[i])}},{key:"saveCanvasData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(e){var n=e.toDatalessJSON(["id","tick","imgType","zorder","strid"]);n.objects.forEach((function(t){t.left+=i.data.scroll.x,t.top+=i.data.scroll.y})),t.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;t?n.loadFromJSON(t,(function(){i.setOrder(n),n.renderAll()}),e):n.clear()}},{key:"findObjByData",value:function(t,e){var i=this.findImage(t,e);return null!=i?i:this.findShape(t,e)}},{key:"setZoom",value:function(t){var e=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),e.canvasFreeze?this.inFreeze.setZoom(t):(this.fabric.clipPath=new $r.fabric.Rect({width:this.fabric.width/e.zoomlevel,height:this.fabric.height/e.zoomlevel,left:this.tOffset.left/e.zoomlevel,top:this.tOffset.top/e.zoomlevel}),this.fabric.setZoom(t),this.fabric.renderAll())}},{key:"findImage",value:function(t,e){var i;return null===(i=e.images)||void 0===i?void 0:i.find((function(e){return t===uo(e.id,e.tick)}))}},{key:"findShape",value:function(t,e){var i;return null===(i=e.shapes)||void 0===i?void 0:i.find((function(e){return t===fo(e.id,e.tick)}))}},{key:"resize",value:function(t){var e=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(t.target.outerWidth+n.left),i.setHeight(t.target.outerHeight+n.top),i.clipPath=new $r.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel}),i.renderAll(),e.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(t){t.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setTextBox",value:function(t,e,i){var n,r=t.canvas,o=new $r.fabric.Rect;i.width?i.fromOutside&&(delete i.width,delete i.height):(o.width=i.width,o.height=i.height),r.setSelectionLayout(o),r.eventsOn(o,r.imgEvents),r.eventsOn(r,this.canvasEvents),r.fabric.add(o),r.rotateObject(o,i.rotate),e.fabobj=o,o.shape=e,e.inFreeze=this.inFreeze,e.setVisible=vo,e.setDirty=go,e.setFilter=po,e.setCustomHighlight=mo,e.getIdtick=yo,i.id||(i.id=e.getIdtick()),o.set(i),t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),qe(e),o.drawObject=bo,o.on("modified",wo),e.updateTextBox=function(t,e){this.html=t,this.rtxt=e,delete this.bigfontsize,qe(this),this.setDirty()},e.getHighlight=function(){return this.showhighlight?v()(this.highlighttxts):[]},e.addHighlight=function(t,e){var i={start:t,end:e};this.highlighttxts.find((function(i){if(i.start===t&&i.end===e)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.setDirty())},e.removeHighlight=function(t,e){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===t&&i.end===e}));-1!==i&&(this.highlighttxts.splice(i,1),this.setDirty())}},e.setHighlight=function(t,e){this.showhighlight=t,this.highlighttxts||(this.highlighttxts=[]),e&&(this.hstyle=e),this.setDirty()},r.fabric.renderAll(),r.saveCanvasData(t.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"setImage",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=t.canvas,o=this;$r.fabric.Image.fromURL(n,(function(n){var a;if(e&&(e.fabobj=n,e.inFreeze=o.inFreeze,e.setVisible=vo,e.setDirty=go,e.setFilter=po,e.setCustomHighlight=mo,e.getIdtick=yo),i.id||(i.id=e.getIdtick()),i.id.includes("loading"))return n.set(i),r.fabric.add(n),e&&t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.fabric.requestRenderAll(),void(null===(a=o.inFreeze)||void 0===a||a.loadFreezeImage());try{var s,l=r.findObjByData(i.id,t.data);if(!l)return;var c=r.findObjInCanvas(r.fabric,i.id);c&&r.fabric.remove(c),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),l.fromOutside=!0,l.scaleX=n.scaleX,l.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,o.canvasEvents),r.fabric.add(n),e&&t.visibleFilter&&e.setVisible(t.visibleFilter(t,e)),r.rotateObject(n,i.rotate),r.fabric.renderAll(),r.saveCanvasData(t.data),null===(s=o.inFreeze)||void 0===s||s.loadFreezeImage()}catch(t){console.error(t),lt(t)}finally{r.removeLoading(t)}}))}},{key:"setLoading",value:function(t,e){var i=this.tOffset,n=t.data,r=n.displayRight2Left,o=n.cols,a=r?t.data.viewWidth()-o.indexWidth:0,s=r?a-e.left:e.left;e.top+=i.top,e.left=s+i.left,e.id="loading"+(new Date).getTime(),e.selectable=!1,this.setImage(t,null,e),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(e.id)}},{key:"removeLoading",value:function(t){var e=t.canvas;if(this.loadingStack){var i=this.loadingStack.shift();e.fabric.remove(e.fabric.getObjects()[e.fabric.getObjects().findIndex((function(t){return t.id===i}))]),e.saveCanvasData(t.data,e.fabric),e.inFreeze&&(e.inFreeze.removeImage(i),e.inFreeze.saveCanvasData(),e.inFreeze.renderAll(),e.fabric.renderAll())}}},{key:"rotateObject",value:function(t,e){t&&(t._setOriginToCenter(),t.set("angle",e).setCoords(),t._resetOrigin())}},{key:"doInsertURLImage",value:function(t,e){this.doInsertImage(t,e,!0)}},{key:"doInsertImage",value:function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.data.getSelectedRect(),a=this.tOffset,s=e.data,l=s.displayRight2Left,c=s.cols,h=l?e.data.viewWidth()-c.indexWidth:0,u=l?h-o.left/e.table.zoomlevel-t.width:o.left/e.table.zoomlevel,f=t.url,d={angle:0,col:this.data.selector.ci,height:t.height,id:t.id,left:o.left/e.table.zoomlevel,originAngle:0,originHeight:t.height,originLeft:o.left,originTop:o.top,originWidth:t.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:f,strid:t.strid,tick:t.tick,top:o.top/e.table.zoomlevel,type:t.type,width:t.width,zorder:null!==(i=e.data.topOrder)&&void 0!==i?i:0};this.findObjByData(d.id,e.data)||(e.data.images||(e.data.images=[]),e.data.images.push(d)),r?this.setImage(e,d,{id:uo(d.id,d.tick),tick:d.tick,scaleToWidth:t.width,scaleToHeight:t.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src):this.setImage(e,d,{id:uo(d.id,d.tick),tick:d.tick,scaleToWidth:d.width,scaleToHeight:d.height,top:d.top+a.top/e.table.zoomlevel,left:u+a.left/e.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src),this.fabric.renderAll(),this.saveCanvasData(e.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(t){var e=this.getActiveObjInData(this.data);e&&(e.hyperlink=t)}},{key:"getActiveObjInData",value:function(t){var e=this.fabric.getActiveObject();if(e)return this.findObjByData(e.id,t)}},{key:"link",value:function(t){var e,i=this.getActiveObjInData(t);i&&this.sheet.modalLink.setValue(xs.datas.map((function(t){return t.name})),null!==(e=i.hyperlink)&&void 0!==e?e:{})}},{key:"removeLink",value:function(t){var e=this.getActiveObjInData(t);e&&(e.hyperlink=null)}},{key:"openLink",value:function(t){var e=this.getActiveObjInData(t);e&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(e.hyperlink))}},{key:"sendImageToFont",value:function(t,e){t&&e&&t.bringToFront(e)}},{key:"doOperation",value:function(t){Object.keys(this.imageOperationList).includes(t)&&!window.mobileAndTabletCheck()&&this.imageOperationList[t].execute(this.sheet)}},{key:"removeImageInData",value:function(t,e){if(!e.includes("_")&&e.split("_").length-1!=2)throw new Error("not correct id");var i=e.split("_"),n=r()(i,3),o=n[0],a=n[1],s=n[2],l="s"===o?t.shapes:t.images;null==l||l.splice(l.findIndex((function(t){return t.id===a&&t.tick===s})),1)}},{key:"checkHyperlink",value:function(t){var e=t.getActiveObject();if(e)return!!this.findObjByData(e.id,this.data).hyperlink}},{key:"validType",value:function(t,e,i){var n=t.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[e]===i}},{key:"setOrder",value:function(t){null==t||t.getObjects().sort((function(t,e){return t.zorder<e.zorder?-1:1})).forEach((function(e){t.bringToFront(e)}))}}]),i}(u);function Co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var ko=function(t){tt()(i,t);var e=Co(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("100%",W("contextmenu.insertURL")),{required:!0},"",100);return(t=e.call(this,">",[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})))])).url=n,t.values=[],t.change=function(){},t}return a()(i,[{key:"btnClick",value:function(t){"ok"===t?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(t,e){"success"===e?(this.change("ok",t),this.hide()):this.url.validateFail(W("validation.downloadImageFail"))}},{key:"show",value:function(){Ai()(rt()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ai()(rt()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(t,e,i){var n,r=!1,o=this,a=new Image;a.onerror=a.onabort=function(){r||(clearTimeout(n),e.call(o,t,"error"))},a.onload=function(){r||(clearTimeout(n),e.call(o,t,"success"))},a.src=t,n=setTimeout((function(){r=!0,a.src="//!!!!/test.jpg",e.call(o,t,"timeout")}),i)}}]),i}(Rr);function _o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}function So(t){t.dd&&(t.dd.title.removeClass("arrow-left"),2===t.dd.headerEl.children().length&&t.dd.headerEl.removeChild(t.dd.headerEl.children()[1]))}function To(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+W("menubar.".concat(t.tag.replace(/-[a-z]/g,(function(t){return t[1].toUpperCase()}))));t.dd?t.dd.headerEl.child(i,e):t.el.child(i)}function Oo(t){var e=f("div","".concat(ot,"-item")).child(t.el);return t.dd&&(t.dd.contentEl.addClass("".concat(ot,"-menubar-dropdown-content")),e=f("div","".concat(ot,"-menubar-btn")).child(t.dd.el)),e}function Eo(t,e){t.el.addEventListener("click",(function(i){e.dd?e.dd.menuDiv=t:(e.click?e.click():e.change(e.tag),i.stopPropagation())}),!0),t.el.addEventListener("mouseenter",(function(t){t.stopPropagation()}),!0)}var Ro=function(t){tt()(i,t);var e=_o(i);function i(t,n){var r;l()(this,i);for(var o,a=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(o=n[c]).tip="",o.el.attr("style","margin:0"),o.el.attr("class",""),So(n[c]);var h=s.includes(n[c].tag);To(n[c],h);var u=Oo(n[c]);Eo(u,n[c]),a.push(u)}return(r=e.call.apply(e,[this,t,"max-content",!1,"bottom-left"].concat(a))).headerEl.on("mouseenter",(function(t){if(!window.mobileAndTabletCheck()){var e=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});t.target.dispatchEvent(e)}})),r}return i}(Mi);function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Io=function(t){tt()(i,t);var e=Ao(i);function i(t,n){return l()(this,i),e.call(this,t,null,"",n)}return a()(i,[{key:"dropdown",value:function(){return new Ro(this.tag,this.value)}}]),i}(Di);function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Do=function(t){tt()(i,t);var e=Po(i);function i(t){var n;l()(this,i);var r="download";return null!=t&&t&&(r+="_".concat(t)),n=e.call(this,r),"GOOGLE"===t||"DROPBOX"===t?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(bn);function Fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Mo=function(t){tt()(i,t);var e=Fo(i);function i(){return l()(this,i),e.call(this,"link")}return i}(bn);function jo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Lo=function(t){tt()(i,t);var e=jo(i);function i(){return l()(this,i),e.call(this,"insertColumn")}return i}(bn);function Bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var zo=function(t){tt()(i,t);var e=Bo(i);function i(){return l()(this,i),e.call(this,"insertRow")}return i}(bn);function Ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var No=function(t){tt()(i,t);var e=Ho(i);function i(){return l()(this,i),e.call(this,"insertSheet")}return i}(bn);var Wo=function(){function t(e,i,n,r,o){var a=this;l()(this,t),this.data=e;var s=e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=W("menubar.menuEdit"),h=W("menubar.menuComment"),u=W("menubar.menuInsert"),d=W("menubar.menuText"),v=W("menubar.menuFile");this.items={},this.items[v]=[new er,new Do("Original"),new Do("XLSX"),new Do("PDF"),new Do("HTML")],"ru"!==o&&"zh"!==o&&(this.items[v].push(new Do("GOOGLE")),this.items[v].push(new Do("DROPBOX"))),this.items[c]=[this.borderEl=new mn,this.mergeEl=new Qn,this.freezeEl=new Jn,this.autofilterEl=new Yi,this.sortEl=new lr,this.searchEl=new hr,this.paintformatEl=new kn,this.clearformatEl=new xn,this.fillColorEl=new On(s.bgcolor)],this.items[u]=[this.insertColumn=new Lo,this.insertRow=new zo,this.insertSheet=new No,this.insertImageEL=new Cr,this.formulaEl=new Kn,this.insertLink=new Mo,this.insetCommentEl=new fr],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new zn,this.fontSizeEl=new In,this.boldEl=new Gi,this.italicEl=new Ki,this.underlineEl=new Qi,this.strikeEl=new Ji,this.alignEl=new zi(s.align),this.valignEl=new Ni(s.valign),this.textwrapEl=new nr,this.textColorEl=new Sn(s.color)],this.items[h]=[this.commentEditEl=new fr,this.commentRemoveEl=new vr,this.commentPreviousEl=new pr,this.commentNextEl=new yr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ot,"-toolbar ").concat(ot,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(t){var e=new Io(t,a.items[t]);a.dropdowns.push(e),a.el.child(e.el),a.items[t].map((function(t){t.change=function(){a.change.apply(a,arguments)}}))})))}return a()(t,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(t){return t.dd.hide()}))}}]),t}(),Uo=function(){function t(){l()(this,t),xt()(this,"setActiveSheetBySheetName",(function(){})),xt()(this,"setActiveCell",(function(){})),xt()(this,"linkPositions",[])}return a()(t,[{key:"checkAndAccess",value:function(t,e,i){var n=this.find(t,e,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(t){var e=this,i=t.data;this.linkPositions=[];t.getTableOffset();i.hyperlinks.forEach((function(t){var n={},r=C.valueOf(t.area),o=i.scroll.ci,a=i.scroll.ri;o=o>0&&r.sci<o?0:o,a=a>0&&r.sri<a?0:a,n.x=[i.cols.sumWidth(o,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(o,r.eci+1)],n.y=[i.rows.sumHeight(a,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(a,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||e.linkPositions.push(n)}))}},{key:"find",value:function(t,e,i){var n=t.hyperlinks;if(0!==n.length)return n.find((function(t){return t.area?C.valueOf(t.area).includes(e,i):null}))}},{key:"findByArea",value:function(t,e){var i=t.hyperlinks;if(0!==i.length)return i.find((function(t){return t.area?C.valueOf(t.area).contains(C.valueOf(e)):null}))}},{key:"check",value:function(t,e,i){return!!this.find(t,e,i)}},{key:"remove",value:function(t,e){var i=e.hyperlinks.findIndex((function(e){return e.area===t.area}));e.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(t,e){var i=this.findByRange(t,e.data);this.remove(i,e.data),this.setHyperlinkStyleByArea(i.area,e,!1)}},{key:"findByRange",value:function(t,e){var i=this.getSelectArea(t);return this.findByArea(e,i)}},{key:"getSelectArea",value:function(t){var e=b(t.sci,t.sri),i=b(t.eci,t.eri);return"".concat(e,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(t,e,i){for(var n=C.valueOf(t),r=n.sri;r<=n.eri;r++)for(var o=n.sci;o<=n.eci;o++)e.data.setHyperlinkStyle(r,o,i);e.table.render()}},{key:"accessByRange",value:function(t,e){var i=this.getSelectArea(t),n=this.findByArea(e,i);this.access(n)}},{key:"access",value:function(t){if("number"==typeof t.type&&t.address){switch(t.type){case 0:case 2:window.open(t.address,"_blank");break;case 1:break;case 3:if(!t.address.includes("!"))break;var e=t.address.split("!"),i=r()(e,2),n=i[0],o=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var a=y(o),s=r()(a,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),t}();function Xo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Yo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Yo(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Vo=function(){function t(e){l()(this,t),this.sheet=e}return a()(t,[{key:"setCustomHighlightImgFunc",value:function(t){this.highlightImgFunc=t}},{key:"showHighlights",value:function(t){var e=this.sheet.data;e.showhighlight=!0,e.highlightstyle=t,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var t=this.sheet,e=t.data,i=t.canvas;if(e.highlightall){var n=i.fabric;this.highlightAllImg(e.showhighlight,n)}else this.showHighlightImageShapesAuto(e.showhighlight)}},{key:"hideHighlights",value:function(){var t=this.sheet,e=t.data,i=t.table;e.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(t,e,i,n){var r=this.sheet.data,o={row:t,col:e,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===t&&r.col===e&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(o)}},{key:"removeHighlightText",value:function(t,e,i,n){for(var r=this.sheet.data,o=0;o<r.highlighttxts.length;o++){var a=Number.isInteger(i)?i:r.highlighttxts[o].start,s=Number.isInteger(n)?n:r.highlighttxts[o].end;r.highlighttxts[o].row===t&&r.highlighttxts[o].col===e&&r.highlighttxts[o].start===a&&r.highlighttxts[o].end===s&&r.highlighttxts.splice(o,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)if(r.highlightrg[a].contains(o))return;r.highlightrg.push(o)}},{key:"removeHighlightRange",value:function(t,e,i,n){for(var r=this.sheet.data,o=new C(t,e,i,n),a=0;a<r.highlightrg.length;a++)r.highlightrg[a].equals(o)&&r.highlightrg.splice(a,1)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.sheet.data.highlightIR=new C(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(t,e){return t.getObjects().find((function(t){return t.id===e}))}},{key:"highlightAllImg",value:function(t,e){var i=this.sheet,n=i.data,r=(i.canvas,n.shapes),o=n.images;if(r){var a,s=Xo(r);try{for(s.s();!(a=s.n()).done;){var l=a.value;this.highlightImg(t,l,n.highlightstyle)}}catch(t){s.e(t)}finally{s.f()}}if(o){var c,h=Xo(o);try{for(h.s();!(c=h.n()).done;){var u=c.value;this.highlightImg(t,u,n.highlightstyle)}}catch(t){h.e(t)}finally{h.f()}}e.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(t){var e,i=this,n=this.sheet,r=n.data,o=n.canvas.fabric,a=Xo(r.highlighshapes);try{var s=function(){var n=e.value,o=r.shapes.find((function(t){return t.id===n}));o&&i.highlightImg(t,o,r.highlightstyle)};for(a.s();!(e=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}var l,c=Xo(r.highlighimgs);try{var h=function(){var e=l.value,n=r.images.find((function(t){return t.id===e}));n&&i.highlightImg(t,n,r.highlightstyle)};for(c.s();!(l=c.n()).done;)h()}catch(t){c.e(t)}finally{c.f()}o.requestRenderAll()}},{key:"highlightImg",value:function(t,e,i){var n=this.sheet;n.data,n.canvas;if(e)if("TextBox"!==e.type)if(this.highlightImgFunc)e.setCustomHighlight(t,this.highlightImgFunc);else{var r=!!t&&new fabric.Image.filters.Invert;e.setFilter(r)}else e.setHighlight(t,i)}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighshapes.indexOf(t)){var r=i.shapes.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighshapes.push(t),this.highlightImg(i.showhighlight,r,i.highlightstyle),i.showhighlight&&o.requestRenderAll()}}}},{key:"removeHighlightShape",value:function(t){var e=this.sheet,i=e.data,n=e.canvas.fabric,r=i.highlighshapes.indexOf(t);if(r>-1){i.highlighshapes.splice(r,1);var o=i.shapes.find((function(e){return e.id===t}));o&&(this.highlightImg(!1,o),n.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas;if(-1===i.highlighimgs.indexOf(t)){var r=i.images.find((function(e){return e.id===t}));if(r){var o=n.fabric;i.highlighimgs.push(t),i.showhighlight&&(this.highlightImg(!0,r),o.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(t){var e=this.sheet,i=e.data,n=e.canvas.fabric,r=i.highlighimgs.indexOf(t);if(r>-1){i.highlighimgs.splice(r,1);var o=i.images.find((function(e){return e.id===t}));o&&(this.highlightImg(!1,o),n.requestRenderAll())}}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,o=i.table;if(n.showhighlight){var a=r.fabric;n.highlightall=t,this.highlightAllImg(t,a),t||this.showHighlightImageShapesAuto(!0)}e&&o.render()}}]),t}();function Go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qo=function(t){tt()(i,t);var e=Go(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("400px",""),{required:!0},"".concat(W("download.fileName"),":"),100),r=new Mr(new Dr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(t){return W("download.saveTypes.".concat(t))}),(function(e){var i=t.fileNameField.val();t.fileNameField.val(t.setSuffix(i,e)),t.fileNameField.validate()})),{required:!0},"".concat(W("download.saveType"),":"),100);return t=e.call(this,W("contextmenu.download"),[f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Yn()(t),"defaultSuffix","xlsx"),t.fileNameField=n,t.saveTypeField=r,t.ci=null,t.values=[],t.change=function(){},t}return a()(i,[{key:"setSuffix",value:function(t,e){var i;return"Original"===e&&(e=this.originalType),t=(t=""===(null!==(i=t)&&void 0!==i?i:"")?this.originalFileName:t).includes(".")?t:t+"."+this.defaultSuffix,"".concat(t.substr(0,t.lastIndexOf(".")),".").concat(e.toLowerCase())}},{key:"btnClick",value:function(t){if("ok"===t){if(!this.fileNameField.validate())return;var e=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,e),this.change("ok",i,e)}this.hide()}},{key:"setValue",value:function(t){this.originalFileName=""===(null!=t?t:"")?"worksheet.xlsx":t,this.originalType=t.split(".").length>=2?t.substr(t.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Rr);function Ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var Zo=function(t){tt()(i,t);var e=Ko(i);function i(){var t;l()(this,i);var n=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.emailAddress"),":"),100),r=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.emailSubject"),":"),100),o=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(n.el),f("div","".concat(ot,"-form-fields")).children(r.el));o.hide();var a=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.sheetCell"),":"),100),s=new Mr(new Dr("",[""],"max-content",(function(t){return t}),(function(t){})),{required:!0},"".concat(W("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ot,"-form-fields")).children(f("div","".concat(ot,"-form-fields")).children(a.el),f("div","".concat(ot,"-form-fields")).children(s.el));c.hide();var h=new Mr(new Ar("100%",""),{required:!0},"".concat(W("link.webUrl"),":"),100),u=f("div","".concat(ot,"-form-fields")).children(h.el);u.hide();var d=new Mr(new Dr("web",["web","sheet","email"],"max-content",(function(t){return W("link.linkTypes.".concat(t))}),(function(e){switch(u.hide(),c.hide(),o.hide(),e){case"web":u.show(),t.active="web";break;case"sheet":c.show(),t.active="sheet";break;case"email":o.show(),t.active="email"}})),{required:!0},"".concat(W("link.linkType"),":"),100);return t=e.call(this,W("contextmenu.link"),[f("div","".concat(ot,"-form-fields")).children(d.el),f("div","".concat(ot,"-form-fields")).children(o.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ot,"-buttons")).children(new pi("ok","primary").on("click",(function(){return t.btnClick("ok")})),new pi("cancel").on("click",(function(){return t.btnClick("cancel")})))]),xt()(Yn()(t),"active",void 0),t.ci=null,t.values=[],t.sheetPageField=s,t.sheetField=c,t.webField=u,t.emailField=o,t.sheetCellField=a,t.webUrlField=h,t.emailAddressField=n,t.emailSubjectField=r,t.linkTypeField=d,t.change=function(){},t.el.on("click",(function(t){t.preventDefault()})),t}return a()(i,[{key:"btnClick",value:function(t){var e=this.link,i=this.type;if("ok"===t){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");e.type=0,e.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;e.type=3,e.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":e.type=2,e.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",e,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(t){var e;try{e=new URL(t)}catch(t){return!1}return"http:"===e.protocol||"https:"===e.protocol}},{key:"setValue",value:function(t,e,i){var n;if(this.type=i,this.sheets=t,this.link=e,this.clear(),this.sheetPageField.input.suggest.setItems(t.map((function(t){return{key:t,title:t}}))),""!==(null!==(n=null==e?void 0:e.type)&&void 0!==n?n:""))switch(e.type){case 1:case 0:this.webUrlField.input.val(e.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(e.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var o=e.address.split("!");if(2!==o.length)break;this.sheetPageField.val(o[0]),this.sheetCellField.val(o[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Rr),Jo=function(){function t(e){l()(this,t),this.el=f("div","".concat(ot,e?"-banner-icon-s":"-banner-icon"))}return a()(t,[{key:"setHomeIcon",value:function(t,e){this.el.css({"background-image":"url(".concat(t,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",e),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),t}(),$o=function(){function t(e){var i=this;l()(this,t),this.el=f("div","".concat(ot,"-banner-filename")),this.filename=f("div","".concat(ot,"-banner-filename-name")),this.filename.on("blur",(function(t){t.target.innerHTML=t.target.innerHTML.replace(/<[^>]+>/gi,"");var n=t.target.innerText;n=n.replace(/\r?\n|\r/g,""),e.filename=n+i.suffixStr,setTimeout((function(){e.selector.el.show()}),100)})),this.filename.on("focus",(function(t){window.mobileEditOnCell=!1,e.editor.el.hide()})),this.filename.on("keyup",(function(t){13===t.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return a()(t,[{key:"setValue",value:function(t){if(t.includes(".")){var e=t.substring(0,t.lastIndexOf(".")),i=this.suffixStr=t.substring(t.lastIndexOf("."));this.filename.html(e),this.suffix.html(i)}}}]),t}(),Qo=function(){function t(e,i,n,r,o,a,s){var c=this;l()(this,t),this.data=e;e.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new Jo(!o),this.filenamebar=new $o(a),this.menubar=new Wo(e,i,n,r,s),this.el=f("div");var h=f("div","".concat(ot,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ot,o?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),o||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return a()(t,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(t){this.filenamebar.setValue(t)}}]),t}();function ta(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ea(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ta(Object(i),!0).forEach((function(e){xt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ta(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ia(t,e){var i,n=this;return function(){for(var r=n,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=a;i||(i=setTimeout((function(){i=null,t.apply(r,l)}),e))}}function na(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRect(),r=n.l,o=n.t,a=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(a)+l>h.width)i.move({left:r+l-h.width});else{var u=t.freezeTotalWidth();a<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)e.move({top:o+c-h.height-1});else{var f=t.freezeTotalHeight();s<f&&e.move({top:o-1-f})}}function ra(){var t=this.data,e=this.verticalScrollbar,i=this.horizontalScrollbar,n=t.getSelectedRectBySearch(),r=n.l,o=n.t;i.move({left:r-1}),e.move({top:o-1})}function oa(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==e||-1!==i){var o=this.table,a=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===e||-1===i?"row-col":"range"),c.canSelected(e,i)){var u=c.getCell(e,i);t?(a.setEnd(e,i,r),this.trigger("cells-selected",u,a.range)):(a.set(e,i,n),this.trigger("cell-selected",u,e,i)),this.focusing=!0,a.setObjId(null),s.reset(),l.reset(),o.render()}}}function aa(t,e){var i=this.selector,n=this.data,o=n.rows,a=n.cols,s=r()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(t){var d=r()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===e?c>0&&(c-=1):"right"===e?(f!==c&&(c=f),c<a.len-1&&(c+=1)):"up"===e?l>0&&(l-=1):"down"===e?(u!==l&&(l=u),l<o.len-1&&(l+=1)):"row-first"===e?c=0:"row-last"===e?c=a.len-1:"col-first"===e?l=0:"col-last"===e&&(l=o.len-1),t&&(i.moveIndexes=[l,c]),oa.call(this,t,l,c),na.call(this)}function sa(t){if(0===t.buttons&&t.target.className!=="".concat(ot,"-resizer-hover")){var e=t.offsetX,i=t.offsetY,n=this.rowResizer,r=this.colResizer,o=this.tableEl,a=this.data,s=a.rows,l=a.cols,c=a.displayRight2Left,h=a.settings.row.height;if(e>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=o.box(),f=a.getCellRectByXY(t.offsetX/a.zoomlevel,t.offsetY/a.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*a.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*a.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function la(t){var e=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=e.scroll().top,o=i.scroll().left,a=n.rows,s=n.cols,l=t.deltaY,c=t.deltaX,h=function(t,e){var i=t,n=0;do{n=e(i),i+=1}while(n<=0);return n},u=function(t){if(t>0){var i=n.scroll.ri+1;if(i<a.len){var o=h(i,(function(t){return a.getHeight(t)}));e.move({top:r+o-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(t){return a.getHeight(t)}));e.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),v=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&ia(u(t.detail),50),v===d&&ia(function(t){if(t>0){var e=n.scroll.ci+1;if(e<s.len){var r=h(e,(function(t){return s.getWidth(t)}));i.move({left:o+r-1})}}else{var a=n.scroll.ci-1;if(a>=0){var l=h(a,(function(t){return s.getWidth(t)}));i.move({left:0===a?0:o-l})}}}(c),50),v===f&&ia(u(l),50)}function ca(){var t=this.data,e=this.verticalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=t.exceptRowTotalHeight(0,-1);e.set(i,(t.rows.totalHeight()-n)*t.zoomlevel)}function ha(){var t=this.data,e=this.horizontalScrollbar,i=(1!==t.zoomlevel?this.originTableOffset:this.getTableOffset()).width;t&&e.set(i,t.cols.totalWidth()*t.zoomlevel),t.displayRight2Left?e.el.attr("dir","rtl"):e.el.removeAttr("dir")}function ua(){var t=this.selector,e=this.data,i=this.editor,n=this.canvas,o=r()(e.freeze,2),a=o[0],s=o[1];if(a>0||s>0){var l=e.freezeTotalWidth(),c=e.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(e),t.resetAreaOffset()}function fa(){var t=this.tableEl,e=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,o=this.formulaBar,a=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(a.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();t.attr(h),e.offset(h);var u=this.data.zoomlevel;i.offset(ea(ea({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),ca.call(this),ha.call(this),ua.call(this),n.render(),r.reset(),o.reset(),a.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(a.br.useHideInput=!0)}function da(){var t=this.data,e=this.selector;t.clearClipboard(),e.hideClipboard()}function va(){var t=this.data,e=this.selector,i=this.canvas;t.copy(),e.showClipboard(),i.clipboard=null}function ga(){var t=this.data,e=this.selector;t.cut(),e.showClipboard()}function pa(t,e){var i=this.data;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(t,(function(t){return lt("Tip",t)})))fa.call(this);else if(e&&null==i.clipboard.range){var n=e.clipboardData.getData("text/plain");n.length>0&&(this.data.pasteFromText(n),fa.call(this))}}function ma(){this.data.hideRowsOrCols(),fa.call(this)}function ya(t,e){this.data.unhideRowsOrCols(t,e),fa.call(this)}function ba(){this.data.autofilter(),fa.call(this)}function wa(){var t=document.createElement("div");t.id="aspose_mask_bg",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="#777",t.style.opacity=.6,t.style.zIndex=10001,document.body.appendChild(t);var e=document.createElement("div");e.style.position="absolute",e.style.top="33%",e.style.left="40%",e.style.backgroundColor="white",e.style.border="#336699 1px solid",e.style.textAlign="center",e.style.fontSize="medium",e.style.padding="1.5em 4em 1.5em 4em",e.innerText="updating , please wait...",t.appendChild(e)}function xa(){var t=document.getElementById("aspose_mask_bg");null!=t&&t.parentNode.removeChild(t)}function Ca(t,e){return ka.apply(this,arguments)}function ka(){return(ka=bt()(kt.a.mark((function t(e,i){var n,r,o,a,s,l;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},o={p:JSON.stringify(r),uid:this.uniqueid,file:e,outputType:i},a=this.fileDownloadUrl,s=new FormData,Object.keys(o).forEach((function(t){return s.set(t,o[t])})),wa(),t.next=9,fetch(a,{method:"POST",body:s});case 9:if((l=t.sent).ok){t.next=15;break}xa(),alert("Download failed, please try again"),t.next=22;break;case 15:return t.t0=Wa,t.next=18,l.json();case 18:t.t1=t.sent,t.t2=e,(0,t.t0)(t.t1,t.t2),xa();case 22:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function _a(){var t=this.toolbar;t.paintformatActive()&&(pa.call(this,"format"),da.call(this),t.paintformatToggle())}function Sa(){var t=this.editor,e=this.contextMenu,i=this.commentTip,n=this.commentEditable;t.clear(),e.hide(),i.hide(),n.saveAndHide(this)}function Ta(t){var e=this,i=this.selector,n=this.data,o=this.table,a=this.sortFilter,s=this.hyperlink,l=t.offsetX,c=t.offsetY,h=t.target.className==="".concat(ot,"-selector-corner"),u=o.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,v=f.top,g=f.width,p=f.height,m=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,C=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var k=x.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,k,x.getFilter(w),x.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=x)}for(var _=0,S=C.length;_<S;_++){var T=C[_];if(T.includes(b,w)&&d+g-20*u<l&&v+p-20*u<c){var O=T.items(w,(function(t,e){return n.rows.getCell(t,e)}));return a.set(w,O,T.getFilter(w),T.getSort(w)),a.setOffsetAdjustView({left:d,top:v+p+2},y,m),void(n.currentAutoFilter=T)}}if(!t.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(oa.call(this,!1,b,w),!t.ctrlKey&&2!==t.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],A=r()(R,2);w=A[0],b=A[1]}window.mobileAndTabletCheck()||At(window,(function(t){var r=n.getCellRectByXY(t.offsetX/u,t.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==t.buttons||t.shiftKey||oa.call(e,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(t){return lt("Tip",t)}))&&o.render(),i.hideAutofill(),_a.call(e))}))}h||1!==t.buttons||t.shiftKey&&oa.call(this,!0,b,w)}}function Oa(){var t=this.data.getSelectedRect();Ea.call(this,t)}function Ea(t){var e=this.editor,i=this.getTableOffset(),n="top";t.top>i.height/2&&(n="bottom"),e.setOffset(t,n)}function Ra(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(Oa.call(this),e.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),t),da.call(this)))}function Aa(t){this.table;var e=this.editor,i=this.data;if("read"!==i.settings.mode&&!i.getLocked()){var n=i.getRectForTextbox(t);Ea.call(this,n),e.setForTextBox(t),da.call(this)}}function Ia(){var t=this.formulaBar,e=this.data;t.resetData(e)}function Pa(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrolly(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),Oa.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Da(t){var e=this,i=this.data,n=this.table,r=this.selector,o=this.hyperlink;i.scrollx(t,(function(){1!==e.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),Oa.call(e),n.render(),o.loadLinkPosition(e),i.scrollImagesShapes(),1!==e.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Fa(t,e){var i=t.ri,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.rows.getHeight(i);o.rows.setHeight(i,e),o.updateRowsHeight.add(i),o.updateConditionImagePositionForRow(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ca.call(this),Oa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Ma(t,e){var i=t.ci,n=this.table,r=this.selector,o=this.data,a=this.hyperlink,s=o.cols.getWidth(i);o.cols.setWidth(i,e),o.updateCols.add(i),o.updateConditionImagePositionForCol(i,e-s,e),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),a.loadLinkPosition(this),ha.call(this),Oa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function ja(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(t,e);var r=i.selector,o=r.ri,a=r.ci;if("finished"===e){if("server"===i.settings.updateMode)return;n.render()}else this.trigger("cell-edited",t,o,a)}}function La(t){var e=this.data;"insert-row"===t?e.insert("row"):"delete-row"===t?e.delete("row"):"insert-column"===t?e.insert("column"):"delete-column"===t?e.delete("column"):"delete-cell"===t?e.deleteCell():"delete-cell-format"===t?e.deleteCell("format"):"delete-cell-text"===t?e.deleteCell("text"):"cell-printable"===t?e.setSelectedCellAttr("printable",!0):"cell-non-printable"===t?e.setSelectedCellAttr("printable",!1):"cell-editable"===t?e.setSelectedCellAttr("editable",!0):"cell-non-editable"===t&&e.setSelectedCellAttr("editable",!1),da.call(this),fa.call(this)}function Ba(t){for(var e=t,i=0,n=0;null!==e;)i+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return{top:i,left:n}}function za(t,e,i){var n=this.data,r=this.modalSort,o=this.modalDownload,a=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==t&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(t.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?Ca.call(this,i,t):this.fileDownloadCallFunc(i,t,e)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===t)this.undo();else if("redo"===t)this.redo();else if("print"===t)this.print.preview(),this.print.toPrint();else if("paintformat"===t)!0===e?va.call(this):da.call(this);else if("clearformat"===t)La.call(this,"delete-cell-format");else if("chart"===t);else if("autofilter"===t)ba.call(this);else if("freeze"===t)if(e){var d=n.selector,v=d.ri,g=d.ci;this.freeze(v,g)}else this.freeze(0,0);else if("sort"===t)r.setValue(n.getSelectedSort());else if("download"===t)o.setValue(h);else if("download_HTML"===t)f.call(this,"HTML");else if("download_Original"===t)f.call(this,"Original");else if("download_XLSX"===t)f.call(this,"XLSX");else if("download_PDF"===t)f.call(this,"PDF");else if("download_GOOGLE"===t)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===t)f.call(this,"Original","Dropbox");else if("search"===t)s.show();else if("menu-display-hide"===t)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===t&&"commentEdit"===e||"insertComment"===t||"commentEdit"===t){var p=n.selector,m=p.ri,y=p.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===m&&x.col===y&&(b=x.note)}var C=n.cellRectWithOutTransfer(m,y);l.col=y,l.row=m,l.setPosition(b,C,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===t&&"commentRemove"===e||"commentRemove"===t){var k=n.selector,_=k.ri,S=k.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===S&&n.comments[T].row===_&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===t&&"commentPrevious"===e||"commentPrevious"===t)Ha(this,n,"previous");else if("insertComment"===t&&"commentNext"===e||"commentNext"===t)Ha(this,n,"next");else if("insert-image"===t)"url"===e&&c.show();else if("zoom-size"===t)this.setzoom(e.number);else if("insertSheet"===t)this.addSheet();else if("insertRow"===t)La.call(this,"insert-row");else if("insertColumn"===t)La.call(this,"insert-column");else if("link"===t){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),A="edit";if(!R){(R={}).area=E;var I=this.data.getCell(O.sri,O.sci);R.text=I?I.text:"",A="add"}a.setValue(xs.datas.map((function(t){return t.name})),R,A)}else n.setSelectedCellAttr(t,e),"formula"!==t||n.selector.multiple()||Ra.call(this),fa.call(this);i&&i()}function Ha(t,e,i){var n=t.selector,r=t.commentEditable,o=e.selector,a=o.ri,s=o.ci,l=a,c=s,h="";if(void 0!==e.comments){e.comments.sort((function(t,e){return t.row>e.row||t.row===e.row&&t.col>e.col?1:-1}));for(var u=0;u<e.comments.length;u++){var f=e.comments[u];if("previous"===i)(f.row<a||f.row===a&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>a||f.row===a&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=e.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function Na(t,e,i,n){this.data.setAutoFilter(t,e,i,n),fa.call(this),this.data.updateConditionImageVisible()}function Wa(t,e){var i=new XMLHttpRequest;i.open("get",t,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var t=this.response;Ua.call(this,t,e)}else alert("Download failed, please try again")},i.send()}function Ua(t,e){var i=document.createElement("a"),n=t;"string"==typeof t?i.target="_blank":n=window.URL.createObjectURL(t),i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof t&&window.URL.revokeObjectURL(n)}function Xa(t){var e=Ba(t.target);return[t.changedTouches[0].pageX-e.left,t.changedTouches[0].pageY-e.top]}function Ya(){var t=this,e=this.selector,i=this.overlayerEl,n=this.rowResizer,o=this.colResizer,a=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,v=this.menubar,g=this.formulaBar,p=this.modalValidation,m=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,k=this.sortFilter,_=this.canvas,S=this.el;function T(t,e){Sa.call(t),Ta.call(t,e)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(e){sa.call(t,e)})).on("mousedown",(function(e){Sa.call(t),2===e.buttons?(t.data.xyInSelectedRect(e.offsetX,e.offsetY)||Ta.call(t,e),c.setPosition(e.offsetX,e.offsetY),e.stopPropagation()):2===e.detail?Ra.call(t):Ta.call(t,e)})).on("mousewheel.stop",(function(e){la.call(t,e)})).on("mouseout",(function(t){var e=t.offsetX;t.offsetY<=0&&o.hide(),e<=0&&n.hide()})),u.el.on("input",(function(e){if(1===t.commentEditable.el.el.childNodes.length&&"#text"===t.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(t.commentEditable.el.el.textContent)),t.commentEditable.el.el.replaceChild(i.el,t.commentEditable.el.el.firstChild),e.target.focus();var n=window.getSelection();n.selectAllChildren(e.target),n.collapseToEnd()}})),e.inputChange=function(e){ja.call(t,e,"input"),Ra.call(t),Ia.call(t)},g.inputChange=function(e){ja.call(t,e,"input"),Ra.call(t,!1)},g.enter=function(e,i){if(e.altKey){l.insertTextNewLine(e);var n=i?e.target.innerHTML:e.target.innerText;ja.call(t,n,"input"),Ra.call(t,!1)}else l.clear(),aa.call(t,!1,e.shiftKey?"up":"down"),t.focusing=!0;e.preventDefault()},g.tab=function(e){l.clear(),aa.call(t,!1,e.shiftKey?"left":"right"),t.focusing=!0,e.preventDefault()},g.focuson=function(){t.focusing=!1},Tt(S.el,"mousemove",(function(e){h.hide();var i=e.offsetX,n=e.offsetY,r=t.data,o=t.table,a=t.hyperlink,s=t.canvas,l=r.comments,c=o.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=a.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});a.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(t){u.ri===t.row&&u.ci===t.col&&h.setPosition(t.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,A=!1,I=function(){return R&&A},P=this.getTableOffset(),D="",F=[0,0],M=[0,0],j=[0,0],L=[0,0],B=!1;E.table.zoomlevel;new AlloyFinger(this.el.el,{tap:function(t){},touchStart:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){!function(t,e){t.target.className.includes("item")||e.contextMenu.hide()}(t,E);var e=function(t,e){var i,n=t.target.className.includes("".concat(ot,"-selector-corner")),r=t.target.className.includes("tl")?"tl":"br",o=[],a=[],s=!1;return n&&(i=Ba(t.target.offsetParent.offsetParent),o[0]=t.changedTouches[0].pageX,o[1]=t.changedTouches[0].pageY,a[0]=e.data.scroll.x,a[1]=e.data.scroll.y,s=!0),[r,i,o,a,s]}(t,E),i=r()(e,5);D=i[0],O=i[1],F=i[2],j=i[3],(R=i[4])&&(B=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+j[0]),j[0]=E.data.scroll.x,j[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&I()){var i=M[0]-F[0]+E.data.scroll.x-j[0],n=M[1]-F[1]+E.data.scroll.y-j[1];e.setMobileMultipleSelect(i,n),function(t,e,i,n){if(e&&i){var r=t.br.areaEl.el.getBoundingClientRect(),o=r.right>window.screen.width?window.screen.width:r.right,a=r.top-i.top+n.top;a=a>window.screen.height?window.screen.height:a,c.setPosition(o,a)}}(e,!0,O,P);var o=(Pt(),[!1,!1,!1]),a=r()(o,3);R=a[0],A=a[1],B=a[2],E.table.render()}},doubleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)&&"CANVAS"===t.target.nodeName){var e=Xa(t),i=r()(e,2);t.offsetX=i[0],t.offsetY=i[1],window.mobileEditOnCell=!0,T(E,t),Ra.call(E)}},longTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=Xa(t),i=r()(e,2),n=i[0],o=i[1];c.setPosition(n,o)}},singleTap:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable||"CANVAS"!==t.target.nodeName||function(t){return t.target.className.includes("item")}(t))){var i=Xa(t),n=r()(i,2);t.offsetX=n[0],t.offsetY=n[1],window.mobileEditOnCell=!0,T(E,t),e.br.useHideInput=!1,window.keyboardShow?(e.br.useHideInput=!0,Ra.call(E)):function(t,e){var i=Xa(t),n=r()(i,2),o=n[0],a=n[1];if(t.target.className.includes("".concat(ot,"-selector-corner"))){var s=Ba(t.target);o=s.left,a=s.top}var l=o<=e.left&&a>=e.top,h=o>=e.left&&a<=e.top;if(l||h){var u=l?e.left:o,f=h?e.top:a;c.setPosition(u,f)}}(t,P)}},rotate:function(t){},pinch:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){E.editor.el.hide();var e=t.zoom;e>2&&(e=2),e<.5&&(e=.5),E.setzoom(e)}},pressMove:function(t){if(!(t.target.parentElement&&"true"===t.target.parentElement.contentEditable||"true"===t.target.contentEditable)){var e=E.selector;E.data;if(A=!0,I()){switch(function(t,e,i,n,r){t[0]=n.changedTouches[0].pageX,t[1]=n.changedTouches[0].pageY,e[0]=i.data.scroll.x,e[1]=i.data.scroll.y}(M,L,E,t),D){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];e.setEndMobile(i,n);var o=e.getMobileMultipleSelect(i,n),a=r()(o,2),s=a[0],l=a[1];s>=E.data.viewRange().eri-4&&!B&&(B=!0,e.setEnd(s,l),function(t,e){""!==t?Dt(e):Pt()}("down",E))}}else Math.abs(t.deltaX)>Math.abs(t.deltaY)?Math.abs(t.deltaX)>18&&(E.scrollH(t.deltaX),E.table.render()):Math.abs(t.deltaY)>18&&(E.scrollV(t.deltaY),E.table.render())}},swipe:function(t){}})}d.change=function(e,i){return za.call(t,e,i)},v.change=function(e,i){return za.call(t,e,i,(function(){return v.hideDropdown()}))},k.ok=function(e,i,n,r){return Na.call(t,e,i,n,r)},n.finishedFn=function(e,i){Fa.call(t,e,i)},o.finishedFn=function(e,i){Ma.call(t,e,i)},n.unhideFn=function(e){ya.call(t,"row",e)},o.unhideFn=function(e){ya.call(t,"col",e)},a.moveFn=function(e,i){Pa.call(t,e,i)},s.moveFn=function(e,i){Da.call(t,e,i)},l.change=function(e,i){ja.call(t,i,e),Ia.call(t)},l.textboxChange=function(e,i){var n=t.data;t.table;n.updateTextbox(e,i)},p.change=function(e){if("save"===e){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=t.data).addValidation.apply(i,r)}else t.data.removeValidation()},m.change=function(e,i,n,r){"ok"===e&&t.data.doSort(i,n,r)},y.change=function(e,i,n){"ok"===e&&Ca.call(t,i,n)},b.change=function(e,i,n){"ok"===e&&(t.canvas.isImageOnSelected()?t.canvas.setHyperlink(i):"add"===n&&(t.data.hyperlinks=t.data.hyperlinks.filter((function(t){return!C.valueOf(i.area).contains(C.valueOf(t.area))})),t.data.hyperlinks.push(i),t.hyperlink.setHyperlinkStyleByArea(i.area,t,!0),t.hyperlink.loadLinkPosition(t)))},w.change=function(e,i){var n=t.canvas,r=t;if("ok"===e){var o=r.data.getSelectedRect();n.setLoading(r,{top:o.top,left:o.left});var a={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name},s={p:JSON.stringify(a),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(t,e,i){(t=JSON.parse(t)).Error?lt("error",t.Error):n.doInsertURLImage(t,r)}})}},$("#upload-image").on("change",(function(e){var i=t.canvas,n=t,r=new FormData;r.append("uid",n.uniqueid);var o={ri:t.data.selector.ri,ci:t.data.selector.ci,name:t.data.name};r.append("p",JSON.stringify(o)),r.append("image",e.target.files[0]);var a=n.data.getSelectedRect();i.setLoading(n,{top:a.top,left:a.left}),$.ajax({url:n.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:r,success:function(t,r,o){(t=JSON.parse(t)).Error?lt("error",t.Error):i.doInsertImage(t,n),e.target.value=null}})})),x.change=function(i,n,r,o,a){if("close"!==i){r||(n=n.toUpperCase());var s=t.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===o&&l.matchwhole===a)d=l.result;else{var v=c.len>0?c._:{},g=null;if("comments"===o){for(var p=document.createElement("c"),m=0,y=h.length;m<y;m++)if(p.innerHTML=h[m].note,g=r?p.innerText:p.innerText.toUpperCase(),!a&&-1!==g.indexOf(n)||a&&g===n){var b={ri:h[m].row,ci:h[m].col};b.cmt=h[m],d.push(b)}}else for(var w in v){var x=v[w].cells;for(var C in x)if("values"===o?g=r?x[C].text:x[C].text.toUpperCase():"formulas"===o&&(g=void 0!==x[C].f?r?x[C].f:x[C].f.toUpperCase():null),null!=g&&(a&&g===n||!a&&-1!==g.indexOf(n))){var k={ri:w,ci:C};d.push(k)}}l.keywords=n,l.lookin=o,l.matchwhole=a,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var _=-1,S=Number(e.indexes[0]),T=Number(e.indexes[1]),O=d.length-1;if(1===d.length)_=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===S&&Number(d[E].ci)>T){_=E;break}if(Number(d[E].ri)>S){_=E;break}}-1===_&&(_=0)}else{for(var A=O;A>=0;A--){if(Number(d[A].ri)===S&&Number(d[A].ci)<T){_=A;break}if(Number(d[A].ri)<S){_=A;break}}-1===_&&(_=O)}l.current=_;var I=d[_];if(e.set(I.ri,I.ci),d[_].cmt){var P=I.cmt.note;if(""!==P){var D=s.cellRectWithOutTransfer(I.ri,I.ci);u.col=I.ci,u.row=I.ri,u.onEdit=!1,u.setPosition(P,D)}}ra.call(t)}},c.showMenuBefore=function(e){var i=r()(t.selector.indexes,2),n=i[0],o=i[1],a=!1;if(e.forEach((function(t){return t.show()})),t.canvas.isImageOnSelected()){if(e.forEach((function(t){-1===["copy","cut","paste","link"].indexOf(t.key)&&t.hide()})),t.canvas.checkHyperlink(t.canvas.fabric))return;t.canvas.validType(t.canvas.fabric,"type","Chart")&&(a=!0)}if(!t.hyperlink.check(t.data,n,o)){var s=null;if(e.forEach((function(t){a&&"link"===t.key&&(s.hide(),t.hide()),"openLink"===t.key&&t.hide(),"removeLink"===t.key&&t.hide(),s=t})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(t){return W("contextmenu.".concat(t))}));e.forEach((function(e){l.includes(e.el.innerText)||e.hide(),e.el.className.includes("divider")&&e.hide(),t.data.merges.equals(t.selector.range)&&e.el.innerText===W("contextmenu.merge")&&e.hide(),t.data.merges.equals(t.selector.range)||e.el.innerText!==W("contextmenu.unmerge")||e.hide()}))}}},c.itemClick=function(e){if("validation"===e)p.setValue(t.data.getSelectedValidation());else if("sort"===e)m.setValue(t.data.getSelectedSort());else if("download"===e)y.setValue(t.filename);else if("link"===e){if(t.canvas.isImageOnSelected())return void t.canvas.link(t.data);var i=t.selector.range,n=t.hyperlink.getSelectArea(i),r=t.hyperlink.findByArea(t.data,n),o="edit";if(!r){(r={}).area=n;var a=t.data.getCell(i.sri,i.sci);r.text=a?a.text:"",o="add"}b.setValue(xs.datas.map((function(t){return t.name})),r,o)}else"removeLink"===e?t.canvas.isImageOnSelected()?t.canvas.removeLink(t.data):t.hyperlink.removeByRange(t.selector.range,t):"openLink"===e?t.canvas.isImageOnSelected()?t.canvas.openLink(t.data):t.hyperlink.accessByRange(t.selector.range,t.data):"copy"===e?(va.call(t),t.canvas.doOperation("copy")):"cut"===e?(ga.call(t),t.canvas.doOperation("copy"),t.canvas.doOperation("delete")):"paste"===e?_.clipboard?t.canvas.doOperation("paste"):pa.call(t,"all"):"paste-value"===e?pa.call(t,"text"):"paste-format"===e?pa.call(t,"format"):"hide"===e?ma.call(t):"delete-image"===e?t.canvas.doOperation("delete"):"merge"===e?(t.data.setSelectedCellAttr(e,!0),t.table.render()):"unmerge"===e?(t.data.setSelectedCellAttr("merge",!1),t.table.render()):"edit"===e?Ra.call(t):La.call(t,e)},Tt(window,"resize",(function(){window.mobileAndTabletCheck()||t.reload()})),Tt(window,"click",(function(t){})),Tt(window,"paste",(function(e){t.focusing&&"commentEdit"!==e.target.parentElement.id&&(e.target.parentElement.parentElement&&"commentEdit"===e.target.parentElement.parentElement.id||(pa.call(t,"all",e),e.preventDefault()))})),Tt(window,"keydown",(function(e){if(t.focusing&&"commentEdit"!==e.target.id){var i=e.keyCode||e.which,n=e.key,r=e.ctrlKey,o=e.shiftKey,a=e.metaKey;if(r||a)switch(i){case 90:t.undo(),e.preventDefault();break;case 89:t.redo(),e.preventDefault();break;case 67:va.call(t),_.doOperation("copy"),e.preventDefault();break;case 88:ga.call(t),e.preventDefault();break;case 85:d.trigger("underline"),e.preventDefault();break;case 86:_.clipboard?_.doOperation("paste"):pa.call(t,"all"),e.preventDefault();break;case 37:aa.call(t,o,"row-first"),e.preventDefault();break;case 38:aa.call(t,o,"col-first"),e.preventDefault();break;case 39:aa.call(t,o,"row-last"),e.preventDefault();break;case 40:aa.call(t,o,"col-last"),e.preventDefault();break;case 32:oa.call(t,!1,-1,t.data.selector.ci,!1),e.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:o&&oa.call(t,!1,t.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),da.call(t);break;case 37:aa.call(t,o,"left"),e.preventDefault();break;case 38:aa.call(t,o,"up"),e.preventDefault();break;case 39:aa.call(t,o,"right"),e.preventDefault();break;case 40:aa.call(t,o,"down"),e.preventDefault();break;case 9:l.clear(),aa.call(t,!1,o?"left":"right"),e.preventDefault();break;case 13:l.clear(),aa.call(t,!1,o?"up":"down"),e.preventDefault();break;case 8:La.call(t,"delete-cell-text"),e.preventDefault()}"Delete"===n?(La.call(t,"delete-cell-text"),_.doOperation("delete"),e.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===e.key?(ja.call(t,e.key,"input"),Ra.call(t),Ia.call(t)):113===i&&Ra.call(t)}}}))}var Va=function(){function t(e,i){var n=this;l()(this,t),this.eventMap=new Map;var r=i.settings,o=r.view,a=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,v=r.local;this.el=f("div","".concat(ot,"-sheet")),this.menubar=new Qo(i,o.width,!a,u,s,this,v),this.toolbar=new Er(i,o.width,!a,u),this.formulaBar=new Kr(i,h),this.canvas=new xo,this.print=new ki(i,this.canvas),this.hyperlink=new Uo,e.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ot,"-table"));var g=i.settings.row.height;this.rowResizer=new Mt(!1,g,this),this.colResizer=new Mt(!0,i.cols.minWidth,this),this.verticalScrollbar=new jt(!0),this.horizontalScrollbar=new jt(!1),this.editor=new vi(ue,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new Lr,this.modalSort=new Hr,this.modalDownload=new qo,this.modalLink=new Zo,this.modalSearch=new qr,this.modalInsertURLImage=new ko,this.contextMenu=new Ei((function(){return n.getRect()}),this,!c,d),this.commentTip=new Vr,this.commentEditable=new Jr,this.selector=new $t(i),this.highlight=new Vo(this),this.overlayerCEl=f("div","".concat(ot,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ot,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new Yr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new oi(this.tableEl.el,i),Ya.call(this),fa.call(this),oa.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var e;return a()(t,[{key:"setReloadUrl",value:function(t){this.reloadUrl=t}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(t,e){return this.eventMap.set(t,e),this}},{key:"preMousedown",value:function(){Sa.call(this)}},{key:"trigger",value:function(t){var e=this.eventMap;if(e.has(t)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(i=e.get(t)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(t){this.editor.clear(),this.data=t,ca.call(this),ha.call(this);var e=this.getTableOffset();this.overlayerCEl.offset(e),t.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(t),this.formulaBar.resetData(t),this.print.resetData(t),this.selector.resetData(t),this.table.resetData(t),this.canvas.reset(t),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(t){return this.data.setData(t),fa.call(this),this}},{key:"scrollV",value:function(t){var e=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:e-t})}},{key:"scrollToRow",value:function(t){var e=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=t>i?-this.data.rows.sumHeight(i,t):this.data.rows.sumHeight(t,i);this.verticalScrollbar.move({top:e-n})}},{key:"scrollH",value:function(t){var e=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:e-t})}},{key:"selectMoveDown",value:function(){aa.call(this,!0,"down")}},{key:"freeze",value:function(t,e){var i=this.data;return this.canvas.doResetPosition(t,e),i.setFreeze(t,e),fa.call(this),this}},{key:"setActiveCell",value:function(t,e){return oa.call(this,!1,t,e),this.focusing=!0,this}},{key:"setEditForTextBox",value:function(t){return Aa.call(this,t),this}},{key:"undo",value:function(){this.data.undo(),fa.call(this)}},{key:"redo",value:function(){this.data.redo(),fa.call(this)}},{key:"reload",value:function(){return fa.call(this),this}},{key:"setzoom",value:function(t){var e=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=t,e.zoomlevel=t;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/t,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/t,"px")),n.setZoom(t),fa.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),e.updateConditionImageZoom()}},{key:"showHighlights",value:function(t){this.highlight.showHighlights(t)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(t,e,i,n){this.highlight.addHighlightText(t,e,i,n)}},{key:"removeHighlightText",value:function(t,e,i,n){this.highlight.removeHighlightText(t,e,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(t,e,i,n){this.highlight.addHighlightRange(t,e,i,n)}},{key:"removeHighlightRange",value:function(t,e,i,n){this.highlight.removeHighlightRange(t,e,i,n)}},{key:"setHighlightInverseRange",value:function(t,e,i,n){this.highlight.setHighlightInverseRange(t,e,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(t){this.highlight.addHighlightShape(t)}},{key:"removeHighlightShape",value:function(t){this.highlight.removeHighlightShape(t)}},{key:"addHighlightTextBox",value:function(t,e,i){var n=this.data,r=(this.table,this.highlight,n.shapes.find((function(e){return e.id===t})));r?"TextBox"===r.type?(this.addHighlightShape(t),r.addHighlight(e,i)):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"removeHighlightTextBox",value:function(t,e,i){var n=this.data,r=(this.table,n.shapes.find((function(e){return e.id===t})));r?"TextBox"===r.type?-1!==n.highlighshapes.indexOf(t)&&r.removeHighlight(e,i):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(t){this.highlight.addHighlightImage(t)}},{key:"removeHighlightImage",value:function(t){this.highlight.removeHighlightImage(t)}},{key:"setHighlightAll",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(t,e)}},{key:"setCustomHighlightImgFunc",value:function(t){this.highlight.setCustomHighlightImgFunc(t)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(t){this.contextMenu.addImageContextMenuItems(t)}},{key:"delImageContextMenuItems",value:function(t){this.contextMenu.delImageContextMenuItems(t)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(t){this.contextMenu.addCutomContextMenuItems(t)}},{key:"insertCustomContextMenuItem",value:function(t,e){this.contextMenu.insertCutomContextMenuItem(t,e)}},{key:"updateCustomContextMenuItem",value:function(t,e){this.contextMenu.updateCutomContextMenuItem(t,e)}},{key:"delCustomContextMenuItems",value:function(t){this.contextMenu.delCutomContextMenuItems(t)}},{key:"getOle",value:(e=bt()(kt.a.mark((function t(e){var i;return kt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.oleDownloadUrl+"?id="+e+"&uid="+this.uniqueid+"&sheet="+this.data.name,Ua.call(this,i);case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"getRect",value:function(){var t=this.data;return{width:t.viewWidth(),height:t.viewHeight()}}},{key:"getTableOffset",value:function(){var t=this.data,e=t.rows,i=t.cols,n=t.displayRight2Left,r=this.table.zoomlevel,o=this.data.settings.row.height,a=this.getRect(),s=a.width,l=a.height;return{width:(s-i.indexWidth)*r,height:(l-e.height)*r,left:n?0:i.indexWidth*r,top:o*r}}}]),t}();function Ga(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=rt()(t);if(e){var r=rt()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return it()(this,i)}}var qa=function(t){tt()(i,t);var e=Ga(i);function i(t){var n;l()(this,i);var r=new st("ellipsis");return(n=e.call(this,r,"auto",!1,"top-left")).contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}},{key:"setTitle",value:function(){}}]),i}(Mi),Ka=function(t){tt()(i,t);var e=Ga(i);function i(t){var n;l()(this,i);var r=new st("pagination");return(n=e.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=t,n}return a()(i,[{key:"reset",value:function(t){var e=this,i=t.map((function(t,i){return f("div","".concat(ot,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){e.contentClick(i),e.hide()})).child(t)}));this.setContentChildren.apply(this,v()(i))}}]),i}(Mi),Za=[{key:"delete",title:U("contextmenu.deleteSheet")}];function Ja(t){var e=this;return f("div","".concat(ot,"-item")).child(t.title()).on("click",(function(){e.itemClick(t.key),e.hide()}))}function $a(){var t=this;return Za.map((function(e){return Ja.call(t,e)}))}var Qa=function(){function t(){var e;l()(this,t),this.el=(e=f("div","".concat(ot,"-contextmenu")).css("width","160px")).children.apply(e,v()($a.call(this))).hide(),this.itemClick=function(){}}return a()(t,[{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"setOffset",value:function(t){var e=this.el;e.offset(t),e.show(),Rt(e)}}]),t}(),ts=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,t),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=o,this.scrollFunc=a,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new qa((function(t){e.clickSwap2(e.items[t])})),this.paginationEl=new Ka((function(t){e.scrollFunc(t)})),this.contextMenu=new Qa,this.contextMenu.itemClick=r,this.el=f("div","".concat(ot,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return a()(t,[{key:"setMenuEl",value:function(){var t=this;return"edit"===this.settings.mode?f("ul","".concat(ot,"-menu")).child(f("li","").children(new st("add").on("click",(function(){t.dataNames.length<10?t.addFunc():lt("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ot,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(t,e,i,n){this.dataNames.push(t);var r=f("li",e?"active":"").child(t);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),e&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(t){for(var e=[],i=1;i<=t;i++){var n=i+"";e.push(n)}this.paginationEl.reset(e)}},{key:"setItemEvent",value:function(t){var e=this;"edit"===this.settings.mode?t.on("click",(function(){e.clickSwap2(t)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,o=n.offsetHeight;e.contextMenu.setOffset({left:r,bottom:o+1}),e.deleteEl=t})).on("dblclick",(function(){if(!(t.el.children.length>0)){var i=t.html(),n=new Ar("auto","",31);n.val(i),n.input.on("blur",(function(t){var r=t.target.value,o=e.dataNames.findIndex((function(t){return t===i}));e.renameItem(o,r,n)})),t.html("").child(n.el),n.focus()}})):t.on("click",(function(){e.clickSwap2(t)}))}},{key:"renameItem",value:function(t,e,i){if(this.dataNames[t]!==e&&0!==e.length)if(e.length>31)lt("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(e)>=0)lt("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<e.length;n++)switch(e[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void lt("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(t,1,e),this.moreEl.reset(this.dataNames),this.items[t].html("").child(e),this.updateFunc(t,e)}else this.items[t].html("").child(e)}},{key:"clear",value:function(){var t=this;this.items.forEach((function(e){t.menuEl.removeChild(e.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var t=this.el;t.hide(),Et(t)}},{key:"deleteItem",value:function(){var t=this.activeEl,e=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(t){return t===e}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(e.el),this.moreEl.reset(this.dataNames),t===e){var n=r()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(t){var e=this.items.findIndex((function(e){return e===t}));this.clickSwap(t),this.activeEl.toggle(),this.swapFunc(e)}},{key:"clickSwap",value:function(t){null!==this.activeEl&&this.activeEl.toggle(),this.activeEl=t}},{key:"setDirection",value:function(t){t?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),t}();i(35),i(36);function es(t){var e=[],i=0;this.run=function(t){var n=this;this.startHandler(t,(function(){i--,t.timestm,t.isfinish,e.length>0&&n.run(e.shift())}))},this.startHandler=function(n,r){var o=this;n.isfinish?e.length>0&&this.run(e.shift()):0!==i?setTimeout((function(){return o.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,t(n,r))},this.append=function(t){e.push(t),e.length,t.timestm,1===e.length&&this.run(t)},this.isFinish=function(){return 0===e.length&&0===i}}var is=function t(e,i,n,r){l()(this,t),this.item=e,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function ns(t,e){var i=$.ajax({url:t.url,type:"post",dataType:"json",data:t.item});t.timestm,t.isfinish,i.done((function(i){t.timestm,t.callback&&(t.callback(i),t.isfinish=!0),e()})),i.fail((function(i,n,r){t.timestm,t.callbackerror&&(t.callbackerror(i,n,r),t.isfinish=!0),e()}))}function rs(t){t.scaleX=1,t.scaleY=1,t.originAngle=t.angle;var e=t.originAngle;e<0&&(e+=360),e>90&&e<180?e=180-e:e>=180&&e<270?e-=180:e>=270&&(e=360-e),e>=45&&(e=90-e);Math.sin(.017453293*e),Math.cos(.017453293*e);t.originWidth=t.width,t.originHeight=t.height,t.originLeft=t.left,t.originTop=t.top}function os(t,e,i,n,r){var o,a,s;return{tick:t.tick,width:t.width,height:t.height,top:t.top+n.top/r,left:i+n.left/r,"z-index":e+t.zorder,originAngle:t.originAngle,rotate:t.angle,imgType:t.type,strid:t.strid,text:t.text,html:t.html,hyperlink:t.hyperlink,zorder:t.zorder,fromOutside:null!==(o=t.fromOutside)&&void 0!==o&&o,scaleX:null!==(a=t.scaleX)&&void 0!==a?a:1,scaleY:null!==(s=t.scaleY)&&void 0!==s?s:1}}var as=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t);var r=e;this.options=n,n.local&&Y(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new es(ns),"string"==typeof e&&(r=document.querySelector(e)),window.mobileAndTabletCheck=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(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|xda|xiino|android|ipad|playbook|silk/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),e},window.mobileEditOnCell=!1,Ft((function(t){var e=i.sheet;e.data,e.selector,e.canvas,e.editor,e.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(t){window.keyboardShow=!0;var e=i.sheet,n=e.data;e.selector,e.editor,e.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new ts((function(){if(i.uniqueid.endsWith(".csv"))lt("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))lt("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var t=i.addSheet();t.showGrid=!0,i.sheet.resetData(t)}}),(function(t){var e=i.datas[t];e.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(e),i.bottombar.setDirection(e.displayRight2Left),i.resetPagination(e),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(e.zoomlevel)}),(function(){i.deleteSheet()}),(function(t,e){i.renameSheet(t,e)}),(function(t){var e=t*i.data.settings.row.len,n=i.data.rows.sumHeight(0,e);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var o=f("div","".concat(ot)).on("contextmenu",(function(t){return t.preventDefault()}));r.appendChild(o.el),this.sheet=new Va(o,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(t){i.setActiveSheetByName(t)},this.sheet.hyperlink.setActiveCell=function(t,e){i.setActiveCell(t,e)},this.sheet.addSheet=this.bottombar.addFunc,o.child(this.bottombar.el)}return a()(t,[{key:"setUniqueId",value:function(t){this.uniqueid=t,this.sheet.uniqueid=t}},{key:"setFileDownloadInfo",value:function(t){this.sheet.fileDownloadUrl=t}},{key:"setOleDownloadInfo",value:function(t){this.sheet.oleDownloadUrl=t}},{key:"setFileName",value:function(t){this.filename=t,this.sheet.filename=t,this.sheet.menubar.setFileName(t)}},{key:"setZoomLevel",value:function(t){this.sheet.setzoom(t)}},{key:"setReloadUrl",value:function(t){this.sheet.setReloadUrl(t)}},{key:"setVisibleFilter",value:function(t){this.sheet.visibleFilter=t}},{key:"setFileDownloadCallFunction",value:function(t){this.sheet.fileDownloadCallFunc=t}},{key:"setImageInfo",value:function(t,e,i,n,r,o,a){return this.imageDiv=t,this.imageUrl=e,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=o,this.updating=a,this}},{key:"setImageForTest",value:function(t,e,i){return this.imageDiv=t,this.imageUrl=e,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(t){var e=this.sheet,i=this.bottombar,n=e.data;if(n.displayRight2Left!==t){n.displayRight2Left=t;var r=e.getTableOffset();e.overlayerCEl.offset(r),e.resetData(n),i.setDirection(t)}}},{key:"getUpdateDatas",value:function(){for(var t=[],e=0,i=this.datas.length;e<i;e++){var n=this.datas[e].getDataForSave();null!=n&&t.push(n)}return t}},{key:"addSheet",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t||"sheet".concat(this.sheetIndex),a=new mt(o,this.options);return a.rows.setCellText(0,0,""),a.change=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["change"].concat(n))},a.updateCellsData=function(t){var i=e.sheet.data,n=i.updateCellError,r=i.updateMyCells,o=e.uniqueid,a=e.imageUrl;if(t.Error)t.cell&&(r.call(e.sheet.data,[t.cell]),e.reRender()),t.cells&&(r.call(e.sheet.data,t.cells),e.reRender()),t.p&&(e.sheet.data.updateRevertOpr(t.p),e.reRender()),n(t.Error);else if("update"===t.op)t.data.forEach((function(t,i,n){for(var r=0,s=new Array;r<e.datas.length;r++)if(e.datas[r].name===t.name){e.datas[r].updateMyCells(t.cells),e.datas[r].updateShapes(t.shapes,s),e.datas[r].updateMyConditionImages(t.conditionimg);break}e.sheet.data.updateShapeSrcToRefresh(o,a,t.pickey,s)})),e.reRender();else if("sort"===t.op)t.rowids&&t.rowids.length>0&&(e.sheet.data.sortByRowIdArray(t.r,t.rowids),e.reRender());else if("updateTextBox"===t.op){for(var s=0;s<e.sheet.data.shapes.length;s++)if(e.sheet.data.shapes[s].strid===t.id){e.sheet.data.shapes[s].updateTextBox(t.html,t.rtxt);break}e.reRender()}},a.updateServerError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateServerError"].concat(n))},a.updateCellError=function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(t=e.sheet).trigger.apply(t,["updateCellError"].concat(n))},a.updateCellServer=function(t){var i=e.sheet.data,n=i.settings,r=i.updateServerError,o=i.updateCellsData,a=e.uniqueid,s=e.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(t),uid:a,folderName:n.folderName,fileName:n.fileName};s.append(new is(l,n.updateUrl,(function(t){o(t)}),(function(t,e,i){r(t,e,i)})))}},a.menubarStatus=function(){return!e.sheet||"up"===e.sheet.toolbar.menuDisplay.state},a.loadImages=function(){var t=e.sheet.data,i=t.images,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=os(t,a,e,c,s.table.zoomlevel);t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.loadShapes=function(){var t=e.sheet.data,i=t.shapes,n=t.displayRight2Left,r=t.cols,o=n?e.sheet.data.viewWidth()-r.indexWidth:0,a=(e.uniqueid,e.imageDiv,e.imageUrl,e.basicZorder),s=e.sheet,l=e.updating;s.canvas.basicZorder=null!=a?a:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(t){if("del"!==t.op){var e=n?o-t.left-t.width:t.left;s.data.topOrder=s.data.topOrder<t.zorder?t.zorder:s.data.topOrder;var i=os(t,a,e,c,s.table.zoomlevel);"TextBox"===t.type?s.canvas.setTextBox(s,t,i):t.src?s.canvas.setImage(s,t,i,t.src):s.canvas.setImage(s,t,i,l)}}))},a.fillImageSrc=function(){var t=e.sheet.data,i=t.images,n=t.shapes,r=t.sheetid,o=t.isImageOk,a=e.uniqueid,s=(e.imageDiv,e.imageUrl);e.basicZorder;if(!o&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=e,c=e.istestforimage?s+"/"+a+"."+r+"_batch.zip":s+"?uid="+a+"&id="+r+"_batch.zip";e.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(t){l.sheet.data.generatePicItems(i,n,t)}))}},a.fillImageOnebyOne=function(t,i){var n=new XMLHttpRequest,r=e.sheet,o=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(o))}),200);n.onreadystatechange=function(){if(4==n.readyState){var t=n.response,e=new Uint8Array(t);JSZip.loadAsync(e).then((function(t){i.forEach((function(e,i,n){t.file(e.name).async("blob").then((function(t){var i=URL.createObjectURL(t),n=r.canvas.fabric.getObjects().find((function(t){return t.id===e.id}));n&&"TextBox"!==n.imgType&&(n.setSrc(i,(function(t){var e;r.canvas.fabric.requestRenderAll(),r.canvas.saveCanvasData(r.data),null===(e=r.canvas.inFreeze)||void 0===e||e.loadFreezeImage()})),e.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",t,!0),n.responseType="arraybuffer",n.send()},a.loadConditionImage=function(){var t=e.sheet.data.conditionimg,i=e.imageDiv,n=e.basicZorder;t&&t.forEach((function(t){if(t.data){var e=a.createConditionImage(t,n);t.data=void 0,t.image=e,i.append(e)}else i.append(t.image)}))},a.insertConditionImage=function(t){var i=e.sheet.data.conditionimg,n=e.imageDiv,r=e.basicZorder;if(i)if(t.data){var o=a.createConditionImage(t,r);t.data=void 0,t.image=o,n.append(o),i.push(t)}else n.append(t.image)},a.reloadImagesShapes=function(){var t=e.imageDiv;null!=t&&(t.empty(),t.css("left",0),t.css("top",0),a.loadImages(),a.loadShapes(),a.loadConditionImage(),a.fillImageSrc())},a.scrollImagesShapes=function(){var t=e.imageDiv,i=e.sheet.canvas,n=e.sheet.data,r=n.scroll,o=n.displayRight2Left,a=n.zoomlevel;i.publishEvent("object:scroll",e.sheet.data),i.initFreeze(),null!=t&&(t.css("left",o?r.x*a:-r.x*a),t.css("top",-r.y*a))},this.datas.push(a),this.bottombar.addItem(o,i,n,r),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(o),a}},{key:"resetPagination",value:function(t){var e=t.rows.len,i=t.settings.row.len,n=e%i==0?e/i:Math.ceil(e/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var t=this.bottombar.deleteItem(),e=r()(t,2),i=e[0],n=e[1];if(i>=0){var o=this.datas[i].name;this.sheet.data.delSheetOpr(o),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(t,e){var i=this.datas[t].name;this.datas[t].name=e,this.sheet.data.renameSheetOpr(i,e)}},{key:"loadData",value:function(t){this.isloading=!0;var e=Array.isArray(t)?t:[t];if(this.bottombar.clear(),this.datas=[],e.length>0)for(var i=0;i<e.length;i+=1){var n,o,a=e[i],s=this.addSheet(a.name,0===i,a.tabcolor,a.fontcolor);if(void 0!==a.merges)for(var l=0,c=a.merges.length;l<c;l++){var h=a.merges[l].split(":"),u=y(h[0]),f=r()(u,2),d=f[0],v=f[1],g=y(h[1]),p=r()(g,2),m=p[0],b=p[1];a.rows[v]&&a.rows[v].cells[d]&&(a.rows[v].cells[d].merge=[b-v,m-d])}null===(n=a.images)||void 0===n||n.forEach((function(t){rs(t)})),null===(o=a.shapes)||void 0===o||o.forEach((function(t){rs(t)})),s.setData(a)}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(t){return t.getData()}))}},{key:"cellText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(t,e,i,"finished"),this}},{key:"setActiveCell",value:function(t,e){return this.sheet.setActiveCell(t,e),this}},{key:"setActiveSheet",value:function(t){return this.bottombar.clickSwap2(this.bottombar.items[t]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(t){for(var e=0;e<this.bottombar.dataNames.length;e++)if(this.bottombar.dataNames[e]===t){this.bottombar.clickSwap2(this.bottombar.items[e]);break}return this}},{key:"cell",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(t,e)}},{key:"cellStyle",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(t,e)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(t){this.sheet.showHighlights(t)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(t,e){return this.sheet.on(t,e),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(t){return this.sheet.on("change",t),this}},{key:"updateServerError",value:function(t){return this.sheet.on("updateServerError",t),this}},{key:"updateCellError",value:function(t){return this.sheet.on("updateCellError",t),this}}],[{key:"locale",value:function(t,e){X(t,e)}}]),t}(),ss=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new as(t,e)};window&&(window.x_spreadsheet=ss,window.x_spreadsheet.locale=function(t,e){return X(t,e)});e.default=as}]);
|